/* Marketing page. Colours and faces are ALIASES onto the generated
   /brand/tokens.css — no brand hex is typed here. Change lib/brand.js and run
   `npm run gen:brand` instead.

   The page's one idea: a number on this site is shown with its math, like a
   receipt. So numbers get the mono face and tabular figures, formulas sit
   under the figure they produced, and gold is spent on the actions only. */
:root {
  --ink-2: color-mix(in srgb, var(--ink) 84%, var(--bg));   /* secondary text, AAA on every surface below */
  --surface-2: color-mix(in srgb, var(--surface) 88%, var(--ink) 12%);
  --hair: color-mix(in srgb, var(--ink) 12%, transparent);
  --wash: color-mix(in srgb, var(--accent) 10%, transparent);
  --gold-line: color-mix(in srgb, var(--accent) 38%, transparent);

  --fs-xs: 0.8125rem;   /* 13 */
  --fs-sm: 0.9375rem;   /* 15 */
  --fs-md: 1.0625rem;   /* 17 — body */
  --fs-lg: 1.25rem;     /* 20 */
  --fs-xl: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  --fs-h2: clamp(2.5rem, 1.6rem + 3.4vw, 4.25rem);
  --fs-h1: clamp(3.25rem, 2rem + 5vw, 6.25rem);

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 72px; --sp-9: 112px;
  --wrap: 1200px;
  --ease-out: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--fs-md); line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p { margin: 0; text-wrap: pretty; }
h1, h2 { text-wrap: balance; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--sp-5); }

.skip-link { position: absolute; left: var(--sp-3); top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--r-md); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: var(--sp-3); }

/* ── buttons & links ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 48px; padding: 0 22px; border-radius: var(--r-md);
  font: 600 var(--fs-md)/1 var(--font-body); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color 160ms ease, border-color 160ms ease, transform 120ms ease;
}
.btn--sm { min-height: 40px; padding: 0 16px; font-size: var(--fs-sm); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--hair); }
.btn:active { transform: translateY(1px); }
.btn[aria-busy="true"] { cursor: progress; opacity: .75; }
@media (hover: hover) and (pointer: fine) {
  .btn--accent:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
  .btn--ghost:hover { border-color: var(--gold-line); background: var(--wash); }
  .site-nav a:hover, .link-quiet:hover, .site-foot__links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
}
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.link-quiet { color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
* { scroll-margin-top: 84px; }  /* clear the sticky header for anchors and focus scrolling */

/* ── header ──────────────────────────────────────────────────────────── */
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--hair); }
@supports (backdrop-filter: blur(8px)) { .site-head { backdrop-filter: blur(8px); } }
.site-head__row { display: flex; align-items: center; gap: var(--sp-5); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark { width: 32px; height: 32px; }
.brand__name { font-family: var(--font-display); font-size: 1.625rem; letter-spacing: .5px; line-height: 1; padding-top: 3px; }
.site-nav { display: flex; gap: var(--sp-5); margin-left: var(--sp-4); }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.site-head__cta { margin-left: auto; display: flex; align-items: center; gap: var(--sp-4); }
@media (max-width: 960px) { .site-nav { display: none; } }
.btn { white-space: nowrap; }
.brand__name { white-space: nowrap; }
.cta-short { display: none; }
@media (max-width: 520px) { .cta-full { display: none; } .cta-short { display: inline; } .site-head__cta { gap: var(--sp-3); } }
@media (max-width: 400px) { .site-head__cta .link-quiet { display: none; } }

/* ── hero ────────────────────────────────────────────────────────────── */
.hero { padding: var(--sp-8) 0 var(--sp-9); border-bottom: 1px solid var(--hair); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-8); align-items: start; }
.hero__copy { padding-top: var(--sp-6); }
.hero__title { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h1); line-height: .92; letter-spacing: .5px; }
.hero__lede { margin-top: var(--sp-5); font-size: var(--fs-lg); line-height: 1.55; color: var(--ink-2); max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
.hero__fine { margin-top: var(--sp-4); font-size: var(--fs-sm); color: var(--ink-2); max-width: 34em; }
@media (max-width: 1023px) {
  .hero { padding-top: var(--sp-7); }
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-7); }
  .hero__copy { padding-top: 0; }
}

/* ── the receipt ─────────────────────────────────────────────────────── */
.receipt { margin: 0; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .9); }
.receipt__head { padding-bottom: var(--sp-4); border-bottom: 1px dashed var(--hair); }
.receipt__title { font-weight: 700; font-size: var(--fs-lg); }
.receipt__meta { margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-2); }
.receipt__controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); padding: var(--sp-4) 0; border-bottom: 1px dashed var(--hair); }

.seg { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; border: 0; padding: 0; margin: 0; }
.seg legend { float: left; margin-right: var(--sp-3); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); line-height: 36px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label > span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--hair); border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 500; font-family: var(--font-mono); cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease; }
.seg input:checked + span { background: var(--wash); border-color: var(--accent); color: var(--ink); font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.check { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-sm); cursor: pointer; min-height: 36px; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }

.receipt__rows { list-style: none; margin: 0; padding: var(--sp-1) 0 0; min-height: 480px; }
.receipt__loading { padding: var(--sp-5) 0; color: var(--ink-2); font-size: var(--fs-sm); }
.rrow:last-child { border-bottom: 0; }
.rrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--sp-4); padding: 9px 0; border-bottom: 1px solid var(--hair); }
.rrow__label { font-size: var(--fs-sm); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.rrow__label .tag { margin-left: 6px; }
.rrow__amt { font-family: var(--font-mono); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rrow__amt--out::before { content: "− "; color: var(--ink-2); }
.rrow__f { grid-column: 1 / -1; margin-top: 2px; font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.rrow--missing .rrow__amt { color: var(--bad); }
.tag { display: inline-block; padding: 0 7px; border-radius: 999px; font-family: var(--font-mono); font-size: 0.6875rem; line-height: 1.6; vertical-align: 1px; border: 1px solid var(--hair); color: var(--ink-2); }
.tag--missing { border-color: color-mix(in srgb, var(--bad) 60%, transparent); color: color-mix(in srgb, var(--bad) 70%, var(--ink)); }

.receipt__total { padding: var(--sp-4) 0; border-bottom: 1px dashed var(--hair); }
.receipt__how { margin-top: var(--sp-4); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-2); }
.receipt__total-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-2); }
.receipt__total-value { font-family: var(--font-display); font-size: clamp(3rem, 2.2rem + 3vw, 4.5rem); line-height: 1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.receipt__total-value.is-neg { color: var(--bad); }
.receipt__formula { margin-top: 6px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2); overflow-wrap: anywhere; }
.receipt__missing { margin-top: var(--sp-3); padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.receipt__cap, .receipt__noscript { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px dashed var(--hair); font-size: var(--fs-xs); color: var(--ink-2); }
.flash { animation: flash 700ms var(--ease-out); }
@keyframes flash { from { background-color: var(--wash); } to { background-color: transparent; } }

/* ── sections ────────────────────────────────────────────────────────── */
.section { padding: var(--sp-9) 0; border-bottom: 1px solid var(--hair); }
.marker { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 1px; color: var(--accent); margin-bottom: var(--sp-4); }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h2); line-height: .95; letter-spacing: .4px; max-width: 16em; }
.h3 { font-size: var(--fs-xl); font-weight: 700; line-height: 1.2; letter-spacing: -.2px; }
.section__lede { margin-top: var(--sp-4); color: var(--ink-2); font-size: var(--fs-lg); max-width: 38em; }
.prose p + p { margin-top: var(--sp-4); }
.prose { font-size: var(--fs-lg); color: var(--ink-2); max-width: 36em; }
.prose p:first-child { color: var(--ink); }
@media (max-width: 767px) { .section { padding: var(--sp-8) 0; } }

.story__grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--sp-6); }
.story .h2 { margin-bottom: var(--sp-5); }
@media (max-width: 900px) { .story__grid { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* steps: alternate text and screenshot, the last two text-only side by side */
.steps { list-style: none; margin: var(--sp-7) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-8) var(--sp-7); }
.step--shot { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--sp-7); align-items: center; }
.step--shot:nth-child(2) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.step--shot:nth-child(2) .step__text { order: 2; }
.step__n { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--accent); margin-bottom: var(--sp-2); }
.step__text p:not(.step__n) { margin-top: var(--sp-3); color: var(--ink-2); }
.step:not(.step--shot) { border-top: 1px solid var(--hair); padding-top: var(--sp-5); }
.shot { border-radius: var(--r-md); border: 1px solid var(--hair); background: var(--surface); }
@media (max-width: 900px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: var(--sp-7); }
  .step--shot, .step--shot:nth-child(2) { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
  .step--shot:nth-child(2) .step__text { order: 0; }
}

.dash__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--sp-5) var(--sp-7); align-items: start; }
.dash .shot--wide { grid-column: 1 / -1; margin-top: var(--sp-5); }
@media (max-width: 900px) { .dash__grid { grid-template-columns: minmax(0, 1fr); } }

.rows { margin: var(--sp-7) 0 0; }
.rows__item { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--sp-5); padding: var(--sp-5) 0; border-top: 1px solid var(--hair); }
.rows__item:last-child { border-bottom: 1px solid var(--hair); }
.rows dt { font-size: var(--fs-xl); font-weight: 700; }
.rows dd { margin: 0; color: var(--ink-2); font-size: var(--fs-lg); max-width: 40em; }
@media (max-width: 767px) { .rows__item { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); } }

.note-strong { display: inline-block; margin-top: var(--sp-5); padding: 10px 14px; border: 1px solid var(--gold-line); border-radius: var(--r-sm); font-weight: 600; font-size: var(--fs-sm); }
.tax-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--sp-7); margin-top: var(--sp-6); }
.tax-item { padding: var(--sp-5) 0; border-top: 1px solid var(--hair); }
.tax-item p { margin-top: var(--sp-3); color: var(--ink-2); }
.shots-pair { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: var(--sp-5); margin-top: var(--sp-7); align-items: start; }
@media (max-width: 900px) { .tax-grid, .shots-pair { grid-template-columns: minmax(0, 1fr); } }

/* ── pricing ─────────────────────────────────────────────────────────── */
.seg--bill { margin-top: var(--sp-6); }
.seg__save { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-xs); color: var(--good); margin-left: 6px; }
.seg__save:empty { display: none; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); margin-top: var(--sp-6); align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: var(--sp-6) var(--sp-5); }
.plan--rec { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--gold-line); }
.plan__tag { position: absolute; top: -12px; left: var(--sp-5); background: var(--accent); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.plan__name { font-size: var(--fs-xl); font-weight: 700; }
.plan__for { margin-top: 4px; color: var(--ink-2); font-size: var(--fs-sm); min-height: 3.4em; }
.plan__price { margin-top: var(--sp-5); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.plan__amount { font-family: var(--font-display); font-size: 3.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.plan__per { color: var(--ink-2); font-size: var(--fs-sm); }
.plan__sub { margin-top: 6px; font-size: var(--fs-sm); color: var(--ink-2); min-height: 3.2em; }
.plan__cta { margin-top: var(--sp-5); width: 100%; }
.plan__status { font-size: var(--fs-sm); margin-top: var(--sp-2); }
.plan__status:empty { display: none; }
.plan__status a { color: var(--accent); }
.plan__list { list-style: none; margin: var(--sp-5) 0 0; padding: var(--sp-5) 0 0; border-top: 1px dashed var(--hair); display: grid; gap: var(--sp-3); font-size: var(--fs-sm); }
.plan__list li { padding-left: 22px; position: relative; }
.plan__list li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 9px; height: 5px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg); }
.pricing__fine { margin-top: var(--sp-5); color: var(--ink-2); font-size: var(--fs-sm); max-width: 60em; }
@media (max-width: 960px) { .plans { grid-template-columns: minmax(0, 1fr); max-width: 520px; } .plan__for, .plan__sub { min-height: 0; } }

.compare { margin-top: var(--sp-7); overflow-x: auto; border: 1px solid var(--hair); border-radius: var(--r-md); }
.compare table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.compare caption { text-align: left; padding: var(--sp-4) var(--sp-4) var(--sp-2); font-weight: 700; font-size: var(--fs-md); }
.compare th, .compare td { padding: 12px var(--sp-4); border-top: 1px solid var(--hair); text-align: left; vertical-align: top; }
.compare thead th { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .6px; color: var(--ink-2); font-weight: 500; }
.compare tbody th { font-weight: 500; }
.compare td { width: 14%; white-space: nowrap; }
.yes::before, .no::before { display: inline-block; width: 1.1em; font-weight: 700; }
.yes::before { content: "✓"; color: var(--good); }
.no { color: var(--ink-2); }
.no::before { content: "–"; }
@media (max-width: 600px) {
  .compare th, .compare td { padding: 10px 8px; }
  .compare thead th { letter-spacing: 0; }
  .compare td { width: 1%; text-align: center; }
  .compare tbody th { width: auto; }
  .compare thead th { font-size: 0.6875rem; }
  /* the word stays for screen readers; the glyph carries it on screen */
  .compare .yes, .compare .no { font-size: 0; }
  .compare .yes::before, .compare .no::before { font-size: 1rem; width: auto; }
}

/* ── faq ─────────────────────────────────────────────────────────────── */
.faq__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--sp-7); }
.faq__list details { border-top: 1px solid var(--hair); }
.faq__list details:last-child { border-bottom: 1px solid var(--hair); }
.faq__list summary { cursor: pointer; list-style: none; padding: var(--sp-4) var(--sp-6) var(--sp-4) 0; position: relative; font-weight: 600; font-size: var(--fs-lg); min-height: 48px; }
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::after { content: "+"; position: absolute; right: 4px; top: var(--sp-4); font-family: var(--font-mono); color: var(--accent); font-size: 1.25rem; line-height: 1.4; }
.faq__list details[open] summary::after { content: "−"; }
.faq__list details p { padding: 0 var(--sp-6) var(--sp-5) 0; color: var(--ink-2); }
@media (max-width: 900px) { .faq__grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); } }

.close { border-bottom: 0; }
.close__box { text-align: left; }
.close .h2 { max-width: 18em; }

/* ── footer ──────────────────────────────────────────────────────────── */
.site-foot { border-top: 1px solid var(--hair); padding: var(--sp-7) 0 var(--sp-6); background: var(--surface); }
.site-foot__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-6); }
.site-foot__tag { margin-top: var(--sp-3); color: var(--ink-2); font-size: var(--fs-sm); }
.site-foot__links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.site-foot__links a { color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); display: inline-block; padding: 4px 0; }
.site-foot__legal { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--hair); font-size: var(--fs-xs); color: var(--ink-2); }
.site-foot__legal a { color: var(--ink-2); }
@media (max-width: 767px) { .site-foot__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .site-foot__grid > :first-child { grid-column: 1 / -1; } }

/* ── scroll progress: an orientation cue, compositor-only, no JS ────── */
@supports (animation-timeline: scroll()) {
  .site-head::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent);
    transform-origin: 0 50%; transform: scaleX(0);
    animation: progress linear both; animation-timeline: scroll(root);
  }
  @keyframes progress { to { transform: scaleX(1); } }
}

/* ── reveal: hidden state only when JS says motion is allowed ───────── */
.js-motion [data-reveal] { opacity: 0; transform: translateY(14px); }
.js-motion [data-reveal].is-in { opacity: 1; transform: none; transition: opacity 420ms ease-out, transform 420ms var(--ease-out); }

/* Reduced motion: fewer and gentler, not zero. Colour feedback stays (hover,
   the checked segment, the changed-figure flash); movement goes. The resting
   .btn transition drops `transform` too, or the release of a press would
   still move (the press/release trap in routines/animation-audit.md). */
@media (prefers-reduced-motion: reduce) {
  .btn { transition: background-color 160ms ease, border-color 160ms ease; }
  .btn:active { transform: none; background-image: linear-gradient(rgba(0, 0, 0, .12), rgba(0, 0, 0, .12)); }
  .site-head::after { display: none; }
}
