/* Table For landing pages. Tokens from design-system/tokens.json; brand rules in design-system/README.md.
   The ledger (ruled lines, red margin, handwritten fill) is the hero only; the rest of the page is plain
   paper with the 48px line kept as the spacing unit. */

:root {
  --surface: #F3EEE3; --surface-raised: #FBF8F1; --surface-sunken: #E9E2D3;
  --rule: #C9BFAE; --margin: #B9413A; --on-margin: #FFFFFF;
  --ink: #26231E; --ink-field: #1B2A6B; --ink-hand: #1B2A6B; --ink-muted: #6F6A5E;
  --fit-wrong: #8C2F2A; --focus: var(--margin);
  --font-field: "Archivo Narrow", "Arial Narrow", sans-serif;
  --font-hand: "Caveat", "Bradley Hand", cursive;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --line: 48px;
  --rule-y: 36px;            /* where the rule sits inside each 48px hero line, just under the baseline */
  --mcol: 72px;              /* margin column */
  --gut: 24px;
  --indent: calc(var(--mcol) + var(--gut));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #141C3F; --surface-raised: #1C2650; --surface-sunken: #0D1330;
    --rule: #33407A; --margin: #E2574A; --on-margin: #F3EEE3;
    --ink: #F3EEE3; --ink-field: #F3EEE3; --ink-hand: #F6D26B; --ink-muted: #A9ADC4;
    --fit-wrong: #EC8F80;
    color-scheme: dark;
  }
}
@media (max-width: 640px) {
  :root { --mcol: 40px; --gut: 16px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 400 17px/28px var(--font-body); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--margin); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
p, h2, h3 { margin: 0; text-wrap: pretty; }

/* Type roles */
.fld { font: 600 13px/18px var(--font-field); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-field); }
.hand { font-family: var(--font-hand); font-weight: 600; color: var(--ink-hand); }
.cap { font: 500 12px/16px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.name { font: 600 24px/28px var(--font-field); letter-spacing: .02em; color: var(--ink-field); }
.name-lg { font: 600 32px/36px var(--font-field); letter-spacing: .01em; color: var(--ink-field); }

/* Page column: its left edge lines up with the hero's writing, just past the margin. */
.col { padding: 0 var(--gut) 0 var(--indent); max-width: calc(1040px + var(--indent)); }
section.col { margin-top: calc(2 * var(--line)); }

/* ---------- Hero: the ledger ---------- */
.ledger {
  position: relative;
  background-image: repeating-linear-gradient(to bottom,
    transparent 0 calc(var(--rule-y) - 1px), var(--rule) calc(var(--rule-y) - 1px) var(--rule-y),
    transparent var(--rule-y) var(--line));
  padding: 0 var(--gut) var(--line) var(--indent);
}
.ledger::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--mcol);
  border-left: 2px solid var(--margin); pointer-events: none;
}
/* In a 48px line the baseline falls at about 24px + 0.34em; shifting each text element by
   (rule - 26px - 0.34em) sits it on its rule at any size. */
.ledger .on { position: relative; top: calc(var(--rule-y) - 26px - var(--k, .34) * 1em); }
.ledger .fld, .ledger .fld-lg { --k: .36; }
.run { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; height: var(--line); }
.run > * { font: 500 12px/var(--line) var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.fld-lg { font: 600 22px/var(--line) var(--font-field); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-field); white-space: nowrap; }
.ln { display: flex; align-items: flex-start; gap: 20px; height: var(--line); }
.ln .fld { line-height: var(--line); white-space: nowrap; }
.ln.big { margin-top: var(--line); }
.slot { display: inline-grid; align-items: start; justify-items: start; }
.slot > span { grid-area: 1 / 1; white-space: nowrap; line-height: var(--line); }
.slot .ghost { visibility: hidden; }
.big .slot > span, .big .slot > .on { font-size: clamp(44px, 12vw, 88px); }
.seat .slot > span { font-size: clamp(26px, 6.6vw, 44px); }

/* The write-in: revealed left to right, held, lifted; the last word stays.
   Negative insets so the clip never trims ascenders and descenders outside the line box. */
.w { clip-path: inset(-.6em 100% -.6em -.2em); animation: write 1.3s ease-in-out 1 backwards; }
/* Longhands, so the .d5 delay isn't reset by a shorthand; fill both so the word stays hidden until its turn. */
.w.last { animation-name: write-last; animation-duration: 1.1s; animation-timing-function: ease-out; animation-fill-mode: both; }
@keyframes write { 0% { clip-path: inset(-.6em 100% -.6em -.2em); } 45%, 82% { clip-path: inset(-.6em -.2em -.6em -.2em); opacity: 1; } 100% { clip-path: inset(-.6em -.2em -.6em -.2em); opacity: 0; } }
@keyframes write-last { from { clip-path: inset(-.6em 100% -.6em -.2em); } to { clip-path: inset(-.6em -.2em -.6em -.2em); } }
.d0 { animation-delay: 0s; } .d1 { animation-delay: 1.6s; } .d2 { animation-delay: 3.2s; } .d3 { animation-delay: 4.8s; }
.d4 { animation-delay: 6.4s; } .d5 { animation-delay: 8s; }
.seat .d0 { animation-delay: .35s; } .seat .d1 { animation-delay: 1.95s; } .seat .d2 { animation-delay: 3.55s; }
.seat .d3 { animation-delay: 5.15s; } .seat .d4 { animation-delay: 6.75s; } .seat .d5 { animation-delay: 8.35s; }
@media (prefers-reduced-motion: reduce) {
  .w { display: none; }
  .w.last { display: inline; animation: none; clip-path: none; }
}

/* ---------- Below the hero: plain paper ---------- */
.lede { margin-top: var(--line); font-size: 26px; line-height: 36px; max-width: 26em; }

.steps-head { margin-bottom: 24px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; margin: 0; padding: 0; }
.steps li { padding: 0 32px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; }
.steps li:first-child { padding-left: 0; border-left: 0; }
.steps .num { color: var(--margin); margin-right: .5em; }
.steps .hand { font-size: 30px; line-height: 34px; }

.claims { display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px; max-width: 880px; }
.claims div { display: flex; flex-direction: column; gap: 8px; }

/* Signup panel */
.panel { background: var(--surface-raised); border: 1px solid var(--rule); padding: 48px; max-width: 880px; }
.panel .name-lg { margin-bottom: 8px; }
.panel form { margin-top: 32px; display: flex; flex-direction: column; gap: 24px; }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 32px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field .lbl { display: flex; justify-content: space-between; align-items: baseline; }
.field input {
  height: 44px; width: 100%; min-width: 0;
  font: 400 18px var(--font-body); color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--ink-field); border-radius: 0; padding: 0;
}
.field input::placeholder { font: 600 26px var(--font-hand); color: var(--ink-muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.submit { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.btn {
  font: 600 13px/1 var(--font-field); letter-spacing: .14em; text-transform: uppercase;
  min-height: 48px; padding: 0 28px; border-radius: 2px; border: 0; cursor: pointer;
  background: var(--margin); color: var(--on-margin);
}
.btn[disabled] { opacity: .6; cursor: progress; }
.err { color: var(--fit-wrong); }
.err:empty { display: none; }
.done[hidden], form[hidden] { display: none; }
.done { margin-top: 24px; display: flex; flex-direction: column; gap: 8px; }
.done .write { display: flex; align-items: baseline; gap: 16px; }
.done .write .fld { font-size: 22px; letter-spacing: .18em; }
.done .write .hand { font-size: 56px; line-height: 64px; }

footer { margin: calc(2 * var(--line)) var(--gut) 0 var(--indent); padding: 24px 0 48px; max-width: 1040px;
  border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: 32px; }
  .steps li, .steps li:first-child { padding: 0 0 0 16px; border-left: 2px solid var(--rule); }
  .claims, .fields { grid-template-columns: 1fr; gap: 32px; }
  .panel { padding: 32px 20px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; line-height: 26px; }
  .lede { font-size: 21px; line-height: 30px; }
  .ln.big { flex-wrap: wrap; height: auto; column-gap: 12px; }
  .ln.big { margin-top: 0; }
  .ln.big .fld-lg { flex-basis: 100%; }
  .run { flex-direction: column; gap: 0; height: auto; }
  .col { padding-left: var(--gut); }
  footer { margin-left: var(--gut); }
}

/* Long-form pages (privacy). */
.prose h2 { margin: var(--line) 0 8px; }
.prose p, .prose ul { max-width: 40em; margin: 0 0 16px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 8px; }
.prose strong { font-weight: 500; }
.run a { text-decoration: none; }
