/* Sahi landing page. World: the app itself, grown to page scale.
   Black ground, soft rounded surfaces, one flat blue accent, Inter, handwriting only for signatures.
   Tokens mirror design/design-tokens.json so the page and the app screens re-theme together. */

:root, :root[data-theme="dark"] {
  --page: #000000; --bg: #0b0b0c; --sheet: #151516;
  --surface: rgba(255,255,255,.06); --fill: rgba(255,255,255,.08); --fill-strong: rgba(255,255,255,.14);
  --line: rgba(255,255,255,.08); --line-strong: rgba(255,255,255,.3);
  --text: #f5f6fa; --text-2: #9da4b8;
  --accent: #3b5bff; --accent-text: #a9b8ff; --accent-soft: rgba(59,91,255,.18); --accent-line: rgba(59,91,255,.4); --on-accent: #ffffff;
  --paper: #f3f5fa; --chip: #dde2f0; --chip-text: #232838; --sig: #1d3fd8; --paper-ink: #232838; --paper-sub: #5f6578; --paper-skel: #e3e6ef;
  --shadow: 0 16px 40px rgba(0,0,0,.35); --device-shadow: 0 40px 90px rgba(0,0,0,.55);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --page: #e9ecf3; --bg: #f4f5f9; --sheet: #ffffff;
  --surface: #ffffff; --fill: rgba(18,22,40,.06); --fill-strong: rgba(18,22,40,.12);
  --line: rgba(18,22,40,.08); --line-strong: rgba(18,22,40,.22);
  --text: #11131c; --text-2: #5b6173;
  --accent: #3b5bff; --accent-text: #2a45d6; --accent-soft: rgba(59,91,255,.10); --accent-line: rgba(59,91,255,.35); --on-accent: #ffffff;
  --paper: #ffffff; --chip: #e8ecf8; --chip-text: #232838; --sig: #1d3fd8; --paper-ink: #232838; --paper-sub: #5f6578; --paper-skel: #e3e6ef;
  --shadow: 0 12px 32px rgba(18,22,40,.08), 0 1px 2px rgba(18,22,40,.06); --device-shadow: 0 40px 90px rgba(18,22,40,.25);
  color-scheme: light;
}
:root[data-theme="noir"] {
  --page: #151516; --bg: #0b0b0c; --sheet: #171718;
  --surface: rgba(255,248,240,.05); --fill: rgba(244,232,220,.07); --fill-strong: rgba(244,232,220,.14);
  --line: rgba(244,232,220,.08); --line-strong: rgba(244,232,220,.3);
  --text: #fff8f0; --text-2: #b3a99f;
  --accent: #f4e8dc; --accent-text: #f4e8dc; --accent-soft: rgba(244,232,220,.12); --accent-line: rgba(244,232,220,.35); --on-accent: #0b0b0c;
  --paper: #f4e8dc; --chip: #e6d9cb; --chip-text: #1a1a1c; --sig: #1a1a1d; --paper-ink: #1a1a1c; --paper-sub: #6e6358; --paper-skel: #e3d5c6;
  --shadow: 0 16px 40px rgba(0,0,0,.5); --device-shadow: 0 40px 90px rgba(0,0,0,.7);
  color-scheme: dark;
}

:root {
  --ease: cubic-bezier(.32, .72, 0, 1);
  --head-h: 76px;
  --f-body: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --f-sig: "Allura", cursive;
  --r-card: 32px; --r-tile: 22px; --r-field: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 12px); -webkit-text-size-adjust: 100%; scrollbar-color: var(--fill-strong) transparent; }
body { margin: 0; background: var(--page); color: var(--text); font-family: var(--f-body); font-size: 1.0625rem; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: clip; transition: background-color .5s ease, color .5s ease; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: var(--on-accent); }
input, textarea { caret-color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; border-radius: 10px; }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--fill-strong); border: 3px solid var(--page); border-radius: 99px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 12px 18px; border-radius: 99px; font-weight: 600; }
.skip:focus { top: 12px; }
.sheet { position: relative; }
.lab { font-weight: 600; font-size: .875rem; color: var(--text-2); line-height: 1.2; }

/* ---------- Header: floating capsule ---------- */
.formhead { position: sticky; top: 0; z-index: 60; padding: 12px clamp(12px, 3vw, 28px) 0; pointer-events: none; height: var(--head-h); }
.navbar { pointer-events: auto; max-width: 1240px; margin: 0 auto; height: 56px; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 22px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); transition: background-color .5s ease; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.375rem; letter-spacing: -.035em; text-decoration: none; margin-right: auto; }
.brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transition: transform .5s var(--ease); }
.brand:hover i { transform: scale(1.6); }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; flex: none; box-shadow: inset 0 0 0 1px var(--line); transition: transform .5s var(--ease); }
.brand:hover .mark { transform: rotate(-6deg) scale(1.06); }
.tabs { display: none; align-items: center; gap: 2px; }
.tabs a { position: relative; padding: 9px 16px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .9375rem; color: var(--text-2); transition: background-color .25s ease, color .25s ease; }
.tabs a:hover { color: var(--text); background: var(--fill); }
.tabs a[aria-current="true"] { color: var(--text); background: var(--fill-strong); }
.headcta { display: flex; align-items: center; }

/* ---------- Buttons: flat accent capsules, as in the app ---------- */
.submit { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; padding: 0 30px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 1.0625rem; letter-spacing: -.01em; text-decoration: none; border: 0; border-radius: 999px; cursor: pointer; transition: transform .4s var(--ease), background-color .25s ease, box-shadow .35s var(--ease); -webkit-tap-highlight-color: transparent; }
.submit svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .45s var(--ease); }
.submit:hover { box-shadow: 0 12px 28px -12px rgba(0,0,0,.6); transform: translateY(-2px); }
.submit:hover svg { transform: translateY(3px); }
.submit:active { transform: scale(.96); transition-duration: .12s; }
.submit.sm { min-height: 44px; padding: 0 20px; font-size: .9375rem; }
.submit.ghost { background: var(--fill); color: var(--text); box-shadow: none; }
.submit.ghost:hover { background: var(--fill-strong); box-shadow: none; }
.pen { display: inline-block; font-weight: 600; padding: 14px 6px; color: var(--accent-text); text-decoration: none; }
.pen:hover { text-decoration: underline; }

/* ---------- Field rows ---------- */
.boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.box { position: relative; padding: 14px 18px 16px; border-radius: var(--r-tile); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); min-height: 78px; display: flex; flex-direction: column; gap: 6px; transition: background-color .35s ease, box-shadow .35s ease, transform .5s var(--ease); }
.box:hover { background: var(--fill); transform: translateY(-2px); }
.box dt { display: flex; gap: 8px; align-items: center; }
.box dt .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: .75rem; }
.box dd { font-weight: 600; font-size: 1.125rem; line-height: 1.25; letter-spacing: -.015em; min-height: 1.4em; }
.box.on, .box.filled { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s6 { grid-column: span 6; }
.box:has(.sigline) { background: var(--paper); box-shadow: var(--shadow); color: var(--paper-ink); }
.box:has(.sigline):hover { background: var(--paper); }
.box:has(.sigline) .lab { color: var(--paper-sub); }
.box:has(.sigline) dt .n { background: rgba(29,63,216,.12); color: #1d3fd8; }
.ck { display: inline-flex; align-items: center; gap: 8px; margin-right: 14px; }
.ck i { width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center; background: var(--fill-strong); flex: none; transition: background-color .3s ease; }
.ck i svg { width: 13px; height: 13px; stroke: var(--on-accent); fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .5s var(--ease); }
.ck.on i, .ck.always i { background: var(--accent); }
.ck.on i svg, .ck.always i svg { stroke-dashoffset: 0; }
.script { font-family: var(--f-sig); font-size: 3.1rem; line-height: 1.1; color: var(--sig); white-space: nowrap; }
.caret::after { content: ""; display: inline-block; width: 2px; height: 1.05em; background: var(--accent-text); margin-left: 2px; vertical-align: -.15em; animation: blink 1s steps(1) infinite; }
.done .caret::after { display: none; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Headings ---------- */
.strip { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.strip .part { display: inline-grid; place-items: center; height: 34px; padding: 0 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: .9375rem; flex: none; }
.strip h2 { font-weight: 800; font-size: clamp(2rem, 4.6vw, 3.5rem); line-height: 1.04; letter-spacing: -.04em; text-wrap: balance; }
.statement { font-weight: 800; font-size: clamp(2.2rem, 5.6vw, 4.25rem); line-height: 1; letter-spacing: -.04em; text-wrap: balance; max-width: 16ch; }
.body-copy { max-width: 52ch; font-size: 1.125rem; color: var(--text-2); }
.pad { padding: clamp(72px, 9vw, 128px) clamp(20px, 4vw, 48px) 0; max-width: 1240px; margin: 0 auto; }
section { position: relative; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 1240px; margin: 0 auto; padding: clamp(24px, 5vw, 64px) clamp(20px, 4vw, 48px) 0; gap: 32px; align-items: center; }
.hero-l { display: flex; flex-direction: column; gap: 26px; }
.hero h1 { font-weight: 800; font-size: clamp(3.4rem, 9.2vw, 6rem); line-height: .96; letter-spacing: -.04em; }
.hero h1 span { display: block; }
.hero .lede { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); max-width: 44ch; color: var(--text-2); }
.hero-r { position: relative; display: grid; place-items: center; padding: 8px 0 24px; min-height: 660px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.note { font-size: .9375rem; color: var(--text-2); font-weight: 500; }
.hero .boxes .box { min-height: 72px; }

.js .sigline .script { clip-path: inset(0 100% 0 0); }
.js .signed .sigline .script { animation: wipe 1.5s var(--ease) forwards; }
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }

/* ---------- Signed badge ---------- */
.stamp { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .9375rem; letter-spacing: -.01em; }
.stamp::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12l5 5 9-10'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12l5 5 9-10'/></svg>") center / contain no-repeat; }
.js .stamp { opacity: 0; transform: scale(.7); }
.js .stamp.in { animation: stampIn .6s var(--ease) forwards; }
@keyframes stampIn { to { opacity: 1; transform: none; } }
.hero-stamp { position: absolute; right: 14px; top: 14px; z-index: 8; }

/* ---------- Device frame ---------- */
.phone { position: relative; width: 300px; height: 620px; flex: none; padding: 8px; border-radius: 52px; background: #050506; box-shadow: inset 0 0 0 1.5px #7a7f8e, inset 0 0 0 5px #17181c, 0 0 0 1px rgba(0,0,0,.55), var(--device-shadow); transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--ease), box-shadow .5s ease; }
.phone::before { content: ""; position: absolute; left: -3px; top: 120px; width: 3px; height: 28px; border-radius: 2px 0 0 2px; background: #4a4e5a; box-shadow: 0 50px 0 #4a4e5a, 0 104px 0 #4a4e5a; }
.phone::after { content: ""; position: absolute; right: -3px; top: 180px; width: 3px; height: 82px; border-radius: 0 2px 2px 0; background: #4a4e5a; }
.island { position: absolute; left: 50%; top: 17px; width: 88px; height: 25px; margin-left: -44px; border-radius: 99px; background: #000; z-index: 9; }
.screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 44px; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif; font-size: 14px; line-height: 1.4; transition: background-color .5s ease; }
.screen::after { content: ""; position: absolute; bottom: 8px; left: 50%; width: 112px; height: 4px; margin-left: -56px; border-radius: 99px; background: var(--text); opacity: .4; z-index: 8; }
.scr { position: absolute; inset: 0; padding: 54px 14px 26px; display: flex; flex-direction: column; gap: 12px; }
.p-h { font-weight: 700; font-size: 26px; line-height: 1.05; letter-spacing: -.04em; }
.p-sub { font-size: 13px; color: var(--text-2); }
.p-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.p-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; background: var(--fill-strong); }
.p-av.a { background: var(--accent); color: var(--on-accent); }
.p-btn { display: flex; align-items: center; justify-content: center; min-height: 50px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 16px; flex: none; margin-top: auto; }
.p-seg { display: flex; padding: 3px; border-radius: 99px; background: var(--fill); }
.p-seg span { flex: 1; text-align: center; padding: 9px 0; border-radius: 99px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.p-seg span.on { background: var(--accent); color: var(--on-accent); }
.p-paper { background: var(--paper); border-radius: 22px; box-shadow: var(--shadow); color: var(--paper-ink); }
.p-tile { display: flex; flex-direction: column; justify-content: space-between; padding: 14px; border-radius: 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.p-ico { width: 36px; height: 36px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; flex: none; }
.p-ico svg, .p-check svg { width: 19px; height: 19px; fill: none; stroke: var(--accent-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.p-chip { min-height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--fill); font-weight: 600; font-size: 12px; box-shadow: inset 0 0 0 1px var(--line); transition: background-color .3s ease, box-shadow .3s ease; }
.p-chip.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.p-dots { display: flex; justify-content: center; gap: 12px; }
.p-dots i { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.p-dots i.on { outline: 2px solid var(--accent); outline-offset: 3px; }
.sig-p { font-family: var(--f-sig); color: var(--sig); white-space: nowrap; line-height: 1.25; }
.sig-p[data-cycle] { font-size: calc(50px * var(--k, 1)); }

.hero-r .phone { z-index: 2; }
.hero-r .phone-back { display: none; position: absolute; z-index: 1; left: 50%; top: 50%; margin: -310px 0 0 -40px; transform: translateX(150px) rotate(6deg) scale(.82); opacity: .9; }
@media (min-width: 1180px) { .hero-r .phone-back { display: block; } }

/* ---------- Story: pinned phone ---------- */
.story-grid { display: grid; grid-template-columns: minmax(0, 1fr); position: relative; max-width: 1240px; margin: clamp(64px, 8vw, 120px) auto 0; padding: 0 clamp(20px, 4vw, 48px); }
.parts { display: flex; flex-direction: column; }
.stage-wrap { position: sticky; top: var(--head-h); z-index: 20; height: 44svh; display: grid; place-items: start center; padding-top: 8px; background: var(--page); order: -1; overflow: hidden; transition: background-color .5s ease; }
.stage { width: 300px; height: 620px; transform-origin: top center; transform: scale(var(--fit, .8)); }
.stage .scr { opacity: 0; transform: translateY(26px) scale(.98); transition: opacity .55s ease, transform .7s var(--ease); pointer-events: none; }
.stage .scr.is-active { opacity: 1; transform: none; }
.stage .scr.is-past { opacity: 0; transform: translateY(-26px) scale(.98); }
.part-block { min-height: 92svh; display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 40px 0; }
.part-body { display: flex; flex-direction: column; gap: 24px; }
.specimen { border-radius: var(--r-card); background: var(--paper); box-shadow: var(--shadow); padding: 8px 28px; min-height: 132px; display: flex; align-items: center; overflow: hidden; }
.specimen .script { font-size: calc(clamp(3rem, 6vw, 4.6rem) * var(--k, 1)); transition: opacity .25s ease; }
.part-block .stamp { align-self: flex-start; }
.styles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.doc { position: relative; flex: 1; margin: 2px 0 0; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); color: var(--paper-ink); padding: 18px 16px; overflow: hidden; }
.doc b { display: block; font-size: 13px; letter-spacing: -.02em; }
.doc i { display: block; height: 6px; border-radius: 4px; background: var(--paper-skel); margin-top: 8px; }
.doc .line { position: absolute; left: 16px; right: 16px; bottom: 46px; border-top: 1.5px solid #8a90a3; padding-top: 4px; font-size: 11px; color: var(--paper-sub); }
.fly { position: absolute; left: 16px; bottom: 62px; padding: 3px 12px; border-radius: 10px; background: color-mix(in srgb, #3b5bff 22%, #fff); box-shadow: inset 0 0 0 1.5px #3b5bff, 0 0 0 3px #c9d3ff; font-size: 30px; transform: translate(calc((1 - var(--p1, 0)) * 90px), calc((1 - var(--p1, 0)) * 130px)) rotate(calc((1 - var(--p1, 0)) * 14deg)) scale(calc(.8 + var(--p1, 0) * .2)); opacity: calc(.15 + var(--p1, 0) * 1.2); }
.tray { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tray span { height: 44px; border-radius: 13px; background: var(--fill); display: grid; place-items: center; font-weight: 600; font-size: 11px; }
.tray span.on { background: var(--accent); color: var(--on-accent); }
.reveal-row { opacity: 0; transform: translateX(22px); transition: opacity .5s ease, transform .6s var(--ease); }
.reveal-row.on { opacity: 1; transform: none; }
.tl { display: flex; flex-direction: column; }
.tl li { display: flex; gap: 14px; padding-bottom: 18px; opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .6s var(--ease); }
.tl li.on { opacity: 1; transform: none; }
.tl i { width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: var(--accent); flex: none; }
.tl i.o { background: none; box-shadow: inset 0 0 0 2px var(--accent-text); }
.tl b { display: block; font-size: 15px; }
.bar { height: 6px; border-radius: 99px; background: var(--fill-strong); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(calc(.1 + var(--p3, 0) * .4)); border-radius: 99px; }
.swap-label { position: relative; display: grid; }
.swap-label span { grid-area: 1 / 1; transition: opacity .3s ease; }
.swap-label .b { opacity: 0; }
.swap-label.on .a { opacity: 0; } .swap-label.on .b { opacity: 1; }
.p-check { width: 84px; height: 84px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; }
.p-check svg { width: 42px; height: 42px; stroke: var(--on-accent); stroke-width: 2.6; stroke-dasharray: 24; stroke-dashoffset: calc(24 * (1 - min(1, var(--p4, 0) * 3))); }

/* ---------- Exhibits (horizontal scrub) ---------- */
.exhibits-intro { display: flex; flex-direction: column; gap: 20px; padding-bottom: 8px; }
.rail { position: relative; margin-top: 24px; }
.rail-pin { padding: 8px 0 40px; }
.track { transform-origin: 0 50%; display: flex; gap: 56px; padding: 36px clamp(20px, 4vw, 48px); width: max-content; will-change: transform; }
.ex { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.ex figcaption { display: flex; gap: 10px; align-items: baseline; font-weight: 600; }
.ex figcaption .lab { color: var(--accent-text); }
@media (max-width: 899px) { .rail-pin { overflow-x: auto; scroll-snap-type: x mandatory; } .ex { scroll-snap-align: center; } }
.rail.static { height: auto !important; }
.rail.static .rail-pin { position: static; height: auto; overflow-x: auto; padding: 8px 0 40px; display: block; }

/* ---------- Worksheet ---------- */
.lines { display: flex; flex-direction: column; gap: 10px; }
.line { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--r-tile); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .3s ease, transform .5s var(--ease); }
.line:hover { background: var(--fill); transform: translateX(4px); }
.line .ln { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.line .what { font-weight: 600; letter-spacing: -.01em; }
.line .what small { display: block; font-size: .875rem; color: var(--text-2); font-weight: 500; }
.line .val { min-width: 96px; text-align: right; font-weight: 800; font-size: 1.5rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.line.total { background: var(--accent); color: var(--on-accent); box-shadow: none; padding: 22px 24px; }
.line.total .ln { background: rgba(0,0,0,.22); color: var(--on-accent); }
.line.total .what small { color: var(--on-accent); }
.line.total .val { font-size: 2.5rem; }
.line.total:hover { background: var(--accent); }

/* ---------- Schedule table ---------- */
.sched { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.sched th { text-align: left; padding: 18px 24px 12px; font-weight: 600; font-size: .875rem; color: var(--text-2); }
.sched th:last-child { text-align: center; }
.sched td { padding: 18px 24px; vertical-align: top; box-shadow: 0 -1px 0 var(--fill); transition: background-color .3s ease; }
.sched tr:hover td { background: var(--fill); }
.sched td:first-child { font-weight: 700; letter-spacing: -.015em; width: 32%; }
.sched td:nth-child(2) { color: var(--text-2); }
.sched td:last-child { width: 80px; text-align: center; }
.sched .tick { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); }
.sched .tick svg { width: 16px; height: 16px; fill: none; stroke: var(--on-accent); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .6s var(--ease) calc(var(--i, 0) * 70ms + .2s); }
.js .sched tr.on .tick svg { stroke-dashoffset: 0; }
html:not(.js) .sched .tick svg { stroke-dashoffset: 0; }
@media (max-width: 640px) { .sched td:first-child { width: auto; } .sched td, .sched th { padding-inline: 16px; } }

/* ---------- Fees ---------- */
.fees { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: stretch; }
.fee { padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 18px; position: relative; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.fee.pick { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.fee h3 { font-weight: 700; font-size: 1.5rem; letter-spacing: -.03em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.price { font-weight: 800; font-size: clamp(2.8rem, 6vw, 4rem); letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.price small { font-size: 1.0625rem; font-weight: 600; letter-spacing: 0; color: var(--text-2); }
.tag { display: inline-block; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .8125rem; padding: 4px 11px; border-radius: 999px; }
.incl { display: flex; flex-direction: column; gap: 10px; font-weight: 500; }
.incl li { display: flex; gap: 12px; align-items: flex-start; }
.incl svg { width: 20px; height: 20px; flex: none; margin-top: 3px; fill: none; stroke: var(--accent-text); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { border-radius: var(--r-tile); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .3s ease; }
.faq details[open] { background: var(--fill); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 24px; font-weight: 600; font-size: 1.125rem; letter-spacing: -.02em; border-radius: var(--r-tile); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary i { width: 32px; height: 32px; flex: none; border-radius: 50%; position: relative; background: var(--fill-strong); transition: background-color .3s ease; }
.faq summary i::before, .faq summary i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; border-radius: 2px; background: var(--text); transition: transform .4s var(--ease), background-color .3s ease; }
.faq summary i::after { transform: rotate(90deg); }
.faq details[open] summary i { background: var(--accent); }
.faq details[open] summary i::before, .faq details[open] summary i::after { background: var(--on-accent); }
.faq details[open] summary i::after { transform: rotate(0deg); }
.faq details > div { padding: 0 24px 24px; max-width: 62ch; color: var(--text-2); }
.faq details[open] > div { animation: drop .5s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Signature block / final ---------- */
.signblock { display: grid; grid-template-columns: minmax(0, 1fr); border-radius: 40px; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.signline { padding: 28px 32px 24px; display: flex; flex-direction: column; gap: 10px; min-height: 230px; justify-content: flex-end; position: relative; background: var(--paper); color: var(--paper-ink); }
.signline .lab { color: var(--paper-sub); }
.signline svg { width: min(100%, 520px); height: auto; overflow: visible; }
.signline path { fill: none; stroke: var(--sig); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .signline path { stroke-dashoffset: calc(1 - min(1, var(--p, 0) * 1.6)); }
html:not(.js) .signline path { stroke-dashoffset: 0; }
.signline::after { content: ""; position: absolute; left: 32px; right: 32px; bottom: 48px; border-top: 1.5px dashed #8a90a3; }
.signmeta { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px; }
.signmeta .box { grid-column: auto; }
.final { display: flex; flex-direction: column; gap: 24px; padding: clamp(48px, 6vw, 88px) clamp(20px, 4vw, 48px) 0; max-width: 1240px; margin: 0 auto; align-items: flex-start; }
.final h2 { font-weight: 800; font-size: clamp(3rem, 8.4vw, 6rem); line-height: .96; letter-spacing: -.04em; }

/* ---------- Theme chooser (last, least important) ---------- */
.looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 640px; }
.look { display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: left; padding: 12px; border-radius: 26px; border: 0; cursor: pointer; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; transition: box-shadow .35s var(--ease), transform .45s var(--ease), background-color .3s ease; }
.look:hover { transform: translateY(-3px); background: var(--fill); }
.look[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.look .sw { height: 84px; border-radius: 16px; position: relative; overflow: hidden; background: var(--c-bg); box-shadow: inset 0 0 0 1px rgba(128,128,128,.35); }
.look .sw i { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 26px; border-radius: 9px; background: var(--c-paper); }
.look .sw b { position: absolute; left: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--c-acc); }
.look span.t { padding: 0 4px 4px; display: flex; justify-content: space-between; align-items: center; }
.look em { font-style: normal; font-size: .8125rem; color: var(--text-2); font-weight: 500; }

/* ---------- Footer ---------- */
.foot { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; max-width: 1240px; margin: clamp(72px, 8vw, 120px) auto 0; padding: 28px clamp(20px, 4vw, 48px) 40px; color: var(--text-2); font-size: .9375rem; box-shadow: 0 -1px 0 var(--line); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-left: auto; }
.foot a { padding: 10px 0; font-weight: 600; }

/* ---------- Scroll reveal: one grammar, text inks in ---------- */
.js .ink-in { clip-path: inset(0 0 100% 0); transform: translateY(12px); transition: clip-path 1s var(--ease), transform 1s var(--ease); }
.js .ink-in.on { clip-path: inset(-10% -2% -10% -2%); transform: none; }
.ink-wrap { display: block; }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .tabs { display: flex; }
  .hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); min-height: min(780px, calc(100svh - 20px)); padding-top: 28px; }
  .hero-r { min-height: 0; }
  .story-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; }
  .stage-wrap { order: 0; height: calc(100svh - var(--head-h)); place-items: center; padding-top: 0; background: transparent; }
  .stage { transform-origin: center; }
  .fees { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .signblock { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .signmeta { padding: 20px; align-content: center; }
  .faq-wrap { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 56px; align-items: start; }
  .faq-wrap > .statement, .faq-wrap > .ink-wrap { position: sticky; top: calc(var(--head-h) + 28px); }
  .rail { height: var(--rail-h, 320vh); }
  .rail-pin { position: sticky; top: var(--head-h); height: calc(100svh - var(--head-h)); overflow: hidden; padding: 0; display: flex; align-items: center; }
}
@media (max-width: 899px) { .stage-wrap { box-shadow: 0 1px 0 var(--line); } }
@media (max-width: 520px) { .boxes .s2, .boxes .s3, .boxes .s4 { grid-column: span 6; } .script { font-size: 2.5rem; } .line { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; padding: 14px; } .line .val { min-width: 0; font-size: 1.25rem; } .looks { grid-template-columns: 1fr; } .navbar { padding-left: 18px; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .js .ink-in { clip-path: none; transform: none; }
}

/* ================= LEGAL PAGES ================= */
.legal { max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vw, 72px) clamp(20px, 4vw, 48px) 0; }
.legal .eyebrow { color: var(--accent-text); font-weight: 700; font-size: .9375rem; letter-spacing: -.01em; }
.legal h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); line-height: 1.05; letter-spacing: -.045em; margin: 10px 0 14px; }
.legal .updated { color: var(--text-2); font-size: .9375rem; }
.legal .lede { font-size: 1.1875rem; margin-top: 24px; }
.legal .toc { margin: 36px 0 8px; padding: 22px 26px; border-radius: 24px; background: var(--sheet); box-shadow: inset 0 0 0 1px var(--line); }
.legal .toc b { display: block; font-size: .875rem; color: var(--text-2); margin-bottom: 8px; }
.legal .toc ol { padding-left: 1.3em; columns: 2 240px; column-gap: 32px; }
.legal .toc li { padding: 3px 0; break-inside: avoid; }
.legal .toc a { color: var(--text); font-weight: 600; text-decoration: none; }
.legal .toc a:hover { color: var(--accent-text); }
.legal section { padding-top: 44px; }
.legal h2 { font-size: 1.5rem; letter-spacing: -.03em; line-height: 1.2; margin-bottom: 14px; }
.legal h3 { font-size: 1.0625rem; letter-spacing: -.015em; margin: 22px 0 8px; }
.legal p + p, .legal p + ul, .legal ul + p { margin-top: 12px; }
.legal ul { padding-left: 1.25em; }
.legal li { padding: 4px 0; }
.legal li::marker { color: var(--accent-text); }
.legal a { color: var(--accent-text); font-weight: 600; }
.legal strong { color: var(--text); }
.legal p, .legal li { color: color-mix(in srgb, var(--text) 86%, var(--text-2)); }
.legal .note { margin-top: 16px; padding: 16px 20px; border-radius: 18px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.legal table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .9688rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; box-shadow: 0 1px 0 var(--line); }
.legal th { color: var(--text-2); font-weight: 600; font-size: .875rem; }
.legal td:first-child { font-weight: 600; color: var(--text); width: 34%; }
.navbar .back { pointer-events: auto; padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: .9375rem; color: var(--text-2); text-decoration: none; }
.navbar .back:hover { color: var(--text); background: var(--fill); }
@media (max-width: 520px) { .legal table, .legal thead, .legal tbody, .legal tr, .legal td { display: block; } .legal thead { display: none; } .legal td { padding: 2px 0; box-shadow: none; width: auto !important; } .legal tr { padding: 12px 0; box-shadow: 0 1px 0 var(--line); } }
