/* BuildPenny — buildpenny.com
   ------------------------------------------------------------------
   Palette, surfaces and ink come straight from the app
   (Core/Extensions/Color+Theme.swift), light and dark. Headlines use the
   system serif (New York on Apple devices), body the system sans, figures
   the system mono with tabular numerals — the same pairing the app uses for
   money. No web fonts, no scripts, no third-party requests. */

:root {
  --navy: #102f46;
  --blue: #176487;
  --teal: #2d7c78;
  --gold: #d58a22;
  --gold-ink: #95600f; /* gold as text on paper: 4.7:1 */
  --green: #247a55;
  --red: #b43d3d;

  --paper: #f3f6f7;
  --paper-2: #eaf0f2;
  --card: #ffffff;
  --line: #d7e1e5;
  --line-strong: #b9c8cf;

  --ink: #162833;
  --ink-2: #4a5f6b;
  --ink-3: #5d717c;

  --band: #102f46;
  --band-ink: #eef4f6;
  --band-ink-2: #b5cad3;
  --band-link: #9ed2ea;

  --phone-bezel: #0e1a22;
  --shadow: 0 1px 2px rgb(16 47 70 / 6%), 0 24px 48px -24px rgb(16 47 70 / 28%);

  --serif: "New York", ui-serif, "Iowan Old Style", "Apple Garamond", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --measure: 60ch;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #75c7eb;
    --teal: #73d4cc;
    --gold: #f2b95d;
    --gold-ink: #f2b95d;
    --green: #6ed2a0;
    --red: #ff8d86;

    --paper: #09141d;
    --paper-2: #0f1d27;
    --card: #111f29;
    --line: #22343f;
    --line-strong: #2f4552;

    --ink: #f4f8fa;
    --ink-2: #b6c4cc;
    --ink-3: #93a5b0;

    --band: #0f2433;
    --phone-bezel: #02070b;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 24px 48px -24px rgb(0 0 0 / 70%);
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -48px;
  background: var(--ink); color: var(--paper);
  padding: 8px 14px; border-radius: 8px; z-index: 20;
}
.skip-link:focus { top: 12px; }

.kicker {
  font: 600 13px/1.3 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin: 0 0 14px;
}

/* ---------- masthead ---------- */

.masthead {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font: 700 19px/1 var(--sans); letter-spacing: -0.02em; }

.m-plate { fill: var(--card); stroke: var(--ink); stroke-width: 3; }
.m-ink { fill: var(--ink); }
.m-gold { fill: var(--gold); }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--ink-2); text-decoration: none;
  font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: 999px;
}
.site-nav a:hover { color: var(--ink); background: var(--paper-2); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }

@media (max-width: 560px) {
  .brand-name { font-size: 17px; }
  .site-nav a { padding: 8px 8px; font-size: 14px; }
  .site-nav a[href="/#features"] { display: none; }
}

/* ---------- phone frame ---------- */

.phone {
  position: relative;
  width: 100%;
  max-width: 330px;
  aspect-ratio: 660 / 1434;
  padding: 9px;
  border-radius: 48px;
  background: var(--phone-bezel);
  box-shadow: var(--shadow);
}
.phone img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 40px;
  background: var(--paper-2);
}

/* ---------- hero ---------- */

.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(48px, 7vw, 88px); overflow: hidden; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(38px, 5.4vw, 64px);
  margin-bottom: 22px;
}

.lede { font-size: clamp(18px, 1.6vw, 20px); color: var(--ink-2); max-width: 36em; }

.hero-actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 14px 22px; margin: 30px 0 34px;
}

.store-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px 12px 16px;
  border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 16px;
}
.store-pill svg { width: 20px; height: 20px; fill: currentColor; }

.text-link { font-weight: 600; text-decoration: none; }
.text-link::after { content: " \2193"; }
.text-link:hover { text-decoration: underline; }

.hero-facts {
  list-style: none; margin: 0; padding: 22px 0 0;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  color: var(--ink-2); font-size: 15px;
}
.hero-facts strong { color: var(--ink); font-weight: 600; }

.hero-shots {
  position: relative;
  display: flex; justify-content: center;
  min-height: 0;
}
.hero-shots .phone:first-child { z-index: 2; transform: rotate(-2deg); }
.hero-shots .phone:last-child {
  position: absolute;
  width: 78%; max-width: 270px;
  right: -2%; top: 14%;
  z-index: 1; transform: rotate(4deg);
  opacity: 0.96;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-shots { padding-right: 14%; }
  .hero-shots .phone:first-child { max-width: 300px; }
  .hero-shots .phone:last-child { max-width: 230px; right: 4%; }
}

@media (max-width: 480px) {
  .hero-shots .phone:last-child { display: none; }
  .hero-shots { padding-right: 0; }
  .hero-shots .phone:first-child { transform: none; max-width: 280px; }
}

/* ---------- questions strip ---------- */

.questions {
  border-block: 1px solid var(--line);
  background: var(--paper-2);
  padding: 36px 0;
}
.question-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 32px;
  font: italic 500 clamp(19px, 1.8vw, 22px)/1.35 var(--serif);
  color: var(--ink);
}
.questions-answer { margin: 22px 0 0; color: var(--ink-2); font-weight: 600; }

@media (max-width: 800px) {
  .question-list { grid-template-columns: 1fr; }
}

/* ---------- section heads ---------- */

.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head h2 { font-size: clamp(30px, 3.6vw, 44px); }

/* ---------- feature chapters ---------- */

.features { padding: clamp(64px, 9vw, 120px) 0 clamp(32px, 4vw, 48px); }

.chapter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  padding: clamp(40px, 6vw, 72px) 0;
  border-top: 1px solid var(--line);
}
.section-head + .chapter { border-top: 0; padding-top: 0; }
.chapter.flip .chapter-copy { order: 2; }
.chapter-shot { display: flex; justify-content: center; }
.chapter-shot .phone { max-width: 300px; }

.chapter h3 { font-size: clamp(26px, 2.8vw, 34px); margin-bottom: 16px; }
.chapter-copy > p { color: var(--ink-2); max-width: var(--measure); }

.ticks { list-style: none; margin: 20px 0 0; padding: 0; max-width: var(--measure); }
.ticks li {
  position: relative; padding: 10px 0 10px 30px;
  border-top: 1px solid var(--line);
}
.ticks li:last-child { border-bottom: 1px solid var(--line); }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 17px;
  width: 12px; height: 7px;
  border-left: 2px solid var(--green); border-bottom: 2px solid var(--green);
  transform: rotate(-45deg);
}

@media (max-width: 820px) {
  .chapter { grid-template-columns: 1fr; }
  .chapter.flip .chapter-copy { order: 0; }
  .chapter-shot .phone { max-width: 270px; }
}

/* ---------- worked examples ---------- */

.calc {
  width: 100%; max-width: 420px;
  margin-top: 24px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  box-shadow: 0 1px 2px rgb(16 47 70 / 5%);
}
.calc caption {
  caption-side: top; text-align: left; background: var(--paper);
  font: 600 12px/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); padding: 0 0 8px;
}
.calc th, .calc td { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.calc th { text-align: left; font-weight: 500; color: var(--ink-2); }
.calc td {
  text-align: right; white-space: nowrap;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.calc tr.sub th, .calc tr.sub td { color: var(--ink); font-weight: 600; }
.calc tr.void th, .calc tr.void td { color: var(--red); }
.calc tfoot th, .calc tfoot td {
  border-bottom: 0; border-top: 2px solid var(--ink);
  color: var(--ink); font-weight: 700; font-size: 16px;
}
.calc-note { font-size: 14px; color: var(--ink-3); margin-top: 10px; max-width: 420px; }

/* ---------- extras ---------- */

.extras { padding: clamp(40px, 6vw, 72px) 0 clamp(72px, 9vw, 112px); }
.extras-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; margin: 0;
  border-top: 1px solid var(--line-strong);
}
.extras-grid > div {
  padding: 24px 28px 26px 0;
  border-bottom: 1px solid var(--line);
}
.extras-grid dt { font: 600 19px/1.3 var(--serif); margin-bottom: 8px; }
.extras-grid dd { margin: 0; color: var(--ink-2); font-size: 16px; }

@media (max-width: 900px) { .extras-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .extras-grid { grid-template-columns: 1fr; } }

/* ---------- privacy band ---------- */

.privacy-band {
  background: var(--band); color: var(--band-ink);
  padding: clamp(56px, 8vw, 104px) 0;
}
.privacy-band .kicker { color: var(--gold); }
.privacy-band h2 { font-size: clamp(30px, 3.6vw, 44px); }
.privacy-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 80px); align-items: start;
}
.privacy-points p { color: var(--band-ink-2); font-size: 18px; }
.privacy-points a { color: var(--band-link); }
@media (max-width: 820px) { .privacy-grid { grid-template-columns: 1fr; } }

/* ---------- spec ---------- */

.spec-section { padding: clamp(64px, 8vw, 104px) 0; }
.spec-grid {
  display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(28px, 6vw, 80px);
}
.spec-grid h2 { font-size: clamp(30px, 3.6vw, 44px); }
.spec { width: 100%; border-collapse: collapse; border-top: 1px solid var(--line-strong); }
.spec th, .spec td { padding: 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.spec th { width: 34%; font-weight: 600; padding-right: 20px; }
.spec td { color: var(--ink-2); }
@media (max-width: 820px) {
  .spec-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .spec th, .spec td { display: block; width: auto; padding: 0; border: 0; }
  .spec th { padding-top: 14px; }
  .spec td { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
}

/* ---------- contact band ---------- */

.contact-band {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: clamp(56px, 7vw, 88px) 0;
  text-align: center;
}
.contact-band h2 { font-size: clamp(28px, 3.2vw, 40px); margin-bottom: 14px; }
.contact-band p { color: var(--ink-2); font-size: 18px; }
.contact-links { font-size: 16px !important; margin: 0; }

/* ---------- documents (support / privacy / terms / 404) ---------- */

.doc-head { padding: clamp(48px, 7vw, 88px) 0 clamp(28px, 4vw, 40px); border-bottom: 1px solid var(--line); }
.doc-head h1 { font-size: clamp(38px, 5vw, 56px); margin-bottom: 16px; }
.doc-head .lede { margin-bottom: 0; }
.doc-head .meta { margin: 18px 0 0; font-size: 14px; color: var(--ink-3); }

.doc {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(28px, 6vw, 80px);
  padding: clamp(36px, 5vw, 56px) 0 clamp(72px, 9vw, 112px);
}

.doc-index { position: sticky; top: 96px; align-self: start; font-size: 15px; }
.doc-index .label {
  font: 600 12px/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}
.doc-index ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.doc-index a {
  display: block; padding: 6px 0 6px 16px; margin-left: -1px;
  color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent;
}
.doc-index a:hover { color: var(--ink); border-left-color: var(--gold); }

.doc-body { max-width: 68ch; }
.doc-body section { padding-bottom: 12px; }
.doc-body section + section { border-top: 1px solid var(--line); padding-top: 32px; }
.doc-body h2 { font-size: 27px; margin-bottom: 14px; }
.doc-body h3 { font: 600 17px/1.4 var(--sans); letter-spacing: 0; margin: 22px 0 6px; }
.doc-body ul, .doc-body ol { padding-left: 1.2em; margin: 0 0 1em; }
.doc-body li { margin-bottom: 0.55em; }
.doc-body li::marker { color: var(--ink-3); }

.callout {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 10px; padding: 16px 20px; margin: 0 0 1.2em;
}
.callout p:last-child { margin: 0; }

@media (max-width: 820px) {
  .doc { grid-template-columns: 1fr; }
  .doc-index { position: static; }
  .doc-index ol { columns: 2; column-gap: 24px; }
}

/* ---------- footer ---------- */

.colophon { border-top: 1px solid var(--line); padding: 56px 0 32px; font-size: 15px; }
.colophon-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px;
}
.colophon-brand p { color: var(--ink-3); margin-top: 14px; }
.colophon-col { display: flex; flex-direction: column; gap: 8px; }
.colophon-head {
  font: 600 12px/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin: 4px 0 6px;
}
.colophon-col a { color: var(--ink-2); text-decoration: none; overflow-wrap: anywhere; }
.colophon-col a:hover { color: var(--ink); text-decoration: underline; }
.colophon-legal {
  margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  color: var(--ink-3); font-size: 13px;
}
.colophon-legal p { margin: 0; }

@media (max-width: 820px) { .colophon-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .colophon-grid { grid-template-columns: 1fr; } }

@media print {
  .masthead, .colophon, .skip-link, .doc-index { display: none; }
  body { background: #fff; color: #000; }
  .doc { display: block; }
}
