/* twoenvelopes.app · the category standard at Apple/Things finish, in the app's own colours.
 * Ground: security-ink paper; ink text; Manila only where you act and where the answer prints.
 * Display: General Sans 600 (the app's answer-line face); body: the system sans (SF Pro on Apple devices). */
@import url("./tokens.css");
@import url("./base.css");

@font-face { font-family: "General Sans"; src: url("./fonts/GeneralSans-Semibold.otf") format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("./fonts/GeneralSans-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }

:root {
  --container: 1120px;
  --tile: oklch(0.993 0.003 245);
  --tile-rule: oklch(0.55 0.015 245 / 0.16);
  --shadow-tile: 0 1px 2px oklch(0.24 0.025 245 / 0.05), 0 12px 32px -18px oklch(0.24 0.025 245 / 0.22);
  --shadow-device: 0 50px 90px -46px oklch(0.2 0.03 245 / 0.6), 0 22px 40px -28px oklch(0.2 0.03 245 / 0.45);
  --bezel: oklch(0.17 0.012 245);
  --text-hero: clamp(2.875rem, 5.4vw + 0.5rem, 5.5rem);
  --text-h2: clamp(2.125rem, 3.4vw + 0.75rem, 4rem);
  --text-lede: clamp(1.1875rem, 0.4vw + 1.05rem, 1.375rem);
  --radius-tile: 28px;
}
@media (prefers-color-scheme: dark) {
  .night { box-shadow: inset 0 1px 0 oklch(0.66 0.015 245 / 0.18), inset 0 -1px 0 oklch(0.66 0.015 245 / 0.18); }
  :root { --color-night: oklch(0.15 0.02 245); --tile: oklch(0.255 0.024 245); --tile-rule: oklch(0.66 0.015 245 / 0.18); --shadow-tile: 0 0 0 1px oklch(0.66 0.015 245 / 0.12); --bezel: oklch(0.12 0.01 245); }
}

body { font-size: 1.0625rem; letter-spacing: -0.003em; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; color: var(--color-ink); }
.center { text-align: center; margin-inline: auto; }

/* Header: system chrome, the one translucent surface */
.site-header { position: sticky; top: 0; z-index: var(--z-sticky-nav); background: color-mix(in oklab, var(--color-paper) 78%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px); box-shadow: 0 1px 0 transparent; transition: box-shadow var(--dur-short) var(--ease-out); view-transition-name: site-header; }
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--color-rule); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); min-height: 60px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.wordmark img { width: 30px; height: 30px; border-radius: 7px; }
.nav ul { display: flex; align-items: center; gap: var(--space-lg); list-style: none; margin: 0; padding: 0; }
.nav a:not(.button):not(.wordmark) { color: var(--color-ink-2); text-decoration: none; font-size: var(--text-sm); transition: color var(--dur-micro) var(--ease-out); }
.nav a:not(.button):not(.wordmark):hover { color: var(--color-ink); }
.nav .button { min-height: 34px; padding-inline: 16px; font-size: var(--text-sm); white-space: nowrap; }

/* Actions */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-ink); font-weight: 600; text-decoration: none; transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
.button:hover { background: color-mix(in oklab, var(--color-accent) 88%, var(--color-accent-ink)); }
.button:active { transform: scale(0.97); }
.button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.button--large { min-height: 56px; padding-inline: 32px; font-size: 1.125rem; }
/* Before launch: not an action, so not Manila (DESIGN.md, the Manila Rule). Same shape, quiet surface. */
.button--soon, .button--soon:hover { background: var(--color-paper-2); color: var(--color-ink-2); box-shadow: inset 0 0 0 1px var(--tile-rule); cursor: default; }
.button--soon:active { transform: none; }
.textlink { color: var(--color-accent-text); font-weight: 500; text-decoration: none; }
.textlink:hover { text-decoration: underline; }
.chev { display: inline-block; width: 0.5em; height: 0.85em; margin-left: 0.35em; vertical-align: -0.05em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-short) var(--ease-out); }
.textlink:hover .chev, .tile--rounds:hover .chev { transform: translateX(3px); }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-lg); }
.note { font-size: var(--text-sm); color: var(--color-muted); text-wrap: balance; }
.center, .way-caption, .plans-invite, .small { text-wrap: balance; }

/* Devices: the real screenshots in a drawn iPhone */
.device { --w: 300px; position: relative; margin: 0; width: var(--w); max-width: 100%; padding: calc(var(--w) * 0.034); border-radius: calc(var(--w) * 0.168); background: var(--bezel); box-shadow: inset 0 0 0 1.5px oklch(0.42 0.015 245), var(--shadow-device); }
.device picture { display: block; }
.device img { width: 100%; border-radius: calc(var(--w) * 0.135); }
.device::after { content: ""; position: absolute; top: calc(var(--w) * 0.06); left: 50%; width: 27%; height: calc(var(--w) * 0.082); translate: -50% 0; border-radius: var(--radius-pill); background: #05070a; }

/* Hero: centred, then three phones; the two seal screens converge on the answer as you scroll */
.hero { padding-top: clamp(2.5rem, 6vh, 4.5rem); overflow: clip; }
.hero-copy { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-icon { width: 92px; height: 92px; border-radius: 21px; box-shadow: 0 18px 36px -18px oklch(0.2 0.03 245 / 0.55); }
.hero h1 { margin-top: var(--space-lg); font-size: var(--text-hero); line-height: 0.98; letter-spacing: -0.04em; max-width: 15ch; }
.hero-sub { margin-top: var(--space-lg); font-size: var(--text-lede); color: var(--color-ink-2); max-width: 46ch; text-wrap: balance; }
.hero .actions { margin-top: var(--space-xl); }
.hero .note { margin-top: var(--space-md); }
.hero-stage { --cw: clamp(210px, 23vw, 316px); position: relative; display: grid; place-items: start center; margin-top: calc(clamp(2.5rem, 6vh, 4rem) - 32px); padding-top: 32px; height: calc(var(--cw) * 1.75 + 32px); -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent); mask-image: linear-gradient(to bottom, #000 62%, transparent); }
.hero-phone { grid-area: 1 / 1; }
.hero-phone .device { --w: var(--cw); }
.hero-phone--center { z-index: 2; }
.hero-phone--left, .hero-phone--right { z-index: 1; margin-top: calc(var(--cw) * 0.16); }
.hero-phone--left .device, .hero-phone--right .device { --w: calc(var(--cw) * 0.88); filter: saturate(0.92); }
.hero-phone--left { transform: translateX(-80%); }
.hero-phone--right { transform: translateX(80%); }
@keyframes settle { from { opacity: 0; transform: translateY(14px); } }
@keyframes icon-in { from { opacity: 0; transform: scale(0.86); } }
@keyframes stage-in { from { opacity: 0; transform: translateY(60px); } }
.hero-icon { animation: icon-in 800ms var(--ease-out) both; }
.hero h1 { animation: settle 800ms var(--ease-out) 80ms both; }
.hero-sub { animation: settle 800ms var(--ease-out) 160ms both; }
.hero .actions { animation: settle 800ms var(--ease-out) 230ms both; }
.hero .note { animation: settle 800ms var(--ease-out) 290ms both; }
.hero-stage { animation: stage-in 1100ms var(--ease-out) 260ms both; }
@supports (animation-timeline: scroll()) {
  @keyframes meet-l { from { translate: -16% 0; } to { translate: 6% 0; } }
  @keyframes meet-r { from { translate: 16% 0; } to { translate: -6% 0; } }
  .hero-phone--left { animation: meet-l linear both; animation-timeline: scroll(root); animation-range: 0 80vh; }
  .hero-phone--right { animation: meet-r linear both; animation-timeline: scroll(root); animation-range: 0 80vh; }
}
/* The answer prints: a strip of the screenshot's own background covers its answer line (rows 372-436 of 1100) and
   wipes away left to right once the phones have landed, the way the app draws its seam and then the answer. */
.answer-cover { position: absolute; left: calc(var(--w) * 0.034); right: calc(var(--w) * 0.034); top: calc(var(--w) * (0.034 + 0.932 * 372 / 506)); height: calc(var(--w) * 0.932 * 64 / 506); background: var(--shot-bg, rgb(239 244 248)); clip-path: inset(0 0 0 100%); pointer-events: none; }
@keyframes answer-print { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 0 100%); } }
.answer-cover { animation: answer-print 760ms cubic-bezier(0.65, 0, 0.35, 1) 1250ms both; }
/* Idle float: a few pixels, slow, each phone on its own phase; paused when the hero is off screen */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.hero-phone .device { animation: float 7.5s ease-in-out infinite; animation-delay: 2s; }
.hero-phone--left .device { animation-duration: 8.5s; animation-delay: -1.2s; }
.hero-phone--right .device { animation-duration: 9s; animation-delay: -4.4s; }
.hero.is-offscreen .hero-phone .device { animation-play-state: paused; }
/* Depth: on a fine pointer the phones follow it a little, the front one most (set by the script as --px/--py, -1..1) */
.hero-phone .device { translate: calc(var(--px, 0) * 5px) calc(var(--py, 0) * 4px); transition: translate 900ms var(--ease-out); }
.hero-phone--center .device { translate: calc(var(--px, 0) * 12px) calc(var(--py, 0) * 8px); }

/* Sections */
.section { padding-block: var(--section-gap-s); }
.section h2 { font-size: var(--text-h2); line-height: 1.04; letter-spacing: -0.04em; max-width: 18ch; }
.section .lede { font-size: var(--text-lede); color: var(--color-ink-2); margin-top: var(--space-lg); max-width: 40ch; line-height: 1.45; }
.section .center.lede { max-width: 44ch; }

/* Highlights: one grid of tiles, sized by what they carry */
.highlights { padding-top: var(--space-xl); }
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-top: var(--space-2xl); }
.tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 236px; padding: 28px; border-radius: var(--radius-tile); background: var(--tile); box-shadow: var(--shadow-tile); color: inherit; text-decoration: none; overflow: hidden; }
.tile h3 { font-size: var(--text-title); letter-spacing: -0.02em; line-height: 1.15; }
.tile p { margin-top: var(--space-xs); color: var(--color-muted); font-size: 1rem; max-width: 34ch; }
.tile--scene { grid-column: span 4; grid-row: span 2; justify-content: space-between; gap: var(--space-xl); }
.tile-text { display: block; }
.tile--rounds, .tile--invite { grid-column: span 2; }
.tile--reveal, .tile--table, .tile--receipt { grid-column: span 2; }
.tile-figure { margin-bottom: auto; font-family: var(--font-display); font-weight: 600; font-size: clamp(2.5rem, 3vw + 1rem, 3.5rem); letter-spacing: -0.04em; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.tile-figure b { color: var(--color-ink); font-weight: 600; }
.tile--invite .tile-figure { color: var(--color-ink); }
.tile--rounds .chev { color: var(--color-accent-text); }
.tile-list { display: grid; gap: 8px; margin: 0 0 auto; padding: 0; list-style: none; }
.tile-list li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--color-paper-2); font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); }
.tile-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--color-muted); flex: none; }
.tile--reveal .tile-list { margin-bottom: var(--space-lg); }
.tile-icon { width: 72px; margin-bottom: auto; fill: none; stroke: var(--color-ink-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile-code { margin-bottom: auto; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: clamp(1.125rem, 1vw + 0.75rem, 1.5rem); letter-spacing: 0.04em; color: var(--color-ink); padding: 10px 14px; border: 1.5px dashed var(--tile-rule); border-radius: 12px; align-self: flex-start; }
/* The app's table, drawn: two sealed envelopes and the line where the answer prints */
.scene { display: grid; gap: 18px; padding-top: var(--space-sm); }
.scene-env { position: relative; display: grid; gap: 2px; padding: 46px 22px 18px; border-radius: 14px; background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in oklab, var(--color-ink) 4.5%, transparent) 7px 8px), var(--color-paper-2); }
.scene-env::before { content: ""; position: absolute; inset: 0 0 auto; height: 40px; background: linear-gradient(to bottom left, transparent calc(50% - 1px), var(--color-rule) 50%, transparent calc(50% + 1px)) left / 50.1% 100% no-repeat, linear-gradient(to bottom right, transparent calc(50% - 1px), var(--color-rule) 50%, transparent calc(50% + 1px)) right / 50.1% 100% no-repeat; }
.scene-env b { font-weight: 500; }
.scene-env span { color: var(--color-muted); font-size: var(--text-sm); }
.tile .scene-line { display: flex; max-width: none; margin: 0; color: var(--color-ink); align-items: center; gap: 18px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.75rem, 2.4vw + 0.75rem, 2.75rem); letter-spacing: -0.03em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.scene-line::before, .scene-line::after { content: ""; flex: 1; height: 2px; background: var(--color-accent); transform-origin: var(--o, left); }
.scene-line::after { --o: right; }
.scene-line span { min-width: 0; }

/* Rounds panel */
.panel { padding: clamp(28px, 5vw, 64px); border-radius: 36px; background: var(--tile); box-shadow: var(--shadow-tile); }
.panel h2 { max-width: 16ch; }
.rounds { display: grid; grid-template-columns: minmax(0, 5rem) minmax(0, 1fr) minmax(0, 1fr); margin-top: var(--space-xl); border-top: var(--rule-hair) solid var(--tile-rule); font-variant-numeric: tabular-nums; }
.rounds > .row { display: contents; }
.rounds .row > * { padding: var(--space-md) var(--space-sm); border-bottom: var(--rule-hair) solid var(--tile-rule); }
.rounds .head { font-size: var(--text-sm); color: var(--color-muted); }
.rounds .amount { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.02em; }
.rounds .meet { background: color-mix(in oklab, var(--color-accent) 30%, transparent); }
.rounds [data-round] { transition: opacity var(--dur-long) var(--ease-out), background-color var(--dur-long) var(--ease-out); }
.rounds-answer { margin-top: var(--space-lg); font-family: var(--font-display); font-weight: 600; font-size: var(--text-2xl); letter-spacing: -0.03em; }
.rounds-answer b { font-weight: inherit; transition: opacity var(--dur-short) var(--ease-out); }
.rounds-answer span { display: block; margin-top: var(--space-2xs); color: var(--color-muted); font-family: var(--font-body); font-weight: 400; font-size: var(--text-md); letter-spacing: 0; }
/* While an example plays, rounds not reached yet wait in grey and the answer waits for the last round. */
.rounds [data-round][data-pending] { opacity: 0.3; }
.rounds .meet[data-pending] { background-color: transparent; }
.rounds-answer b[data-pending] { opacity: 0; }

/* The rail: the same example as two sealed envelopes on a price scale, ticked every $500 like the app's dial */
.rail { position: relative; margin-top: var(--space-2xl); }
.rail-scene { overflow: clip;  padding-inline: clamp(3.5rem, 8vw, 6rem); }
.rail-track { position: relative; height: 128px; }
.rail-track::before { content: ""; position: absolute; inset-inline: 0; top: calc(50% - 6px); height: 12px; background:
  linear-gradient(var(--color-rule), var(--color-rule)) center / 100% 1px no-repeat,
  repeating-linear-gradient(to right, var(--color-rule) 0 1px, transparent 1px calc(100% / 6)) center / calc(100% + 1px) 12px no-repeat,
  repeating-linear-gradient(to right, var(--color-rule) 0 1px, transparent 1px calc(100% / 12)) center / calc(100% + 1px) 6px no-repeat; }
.rail-mark, .rail-band, .rail-seal { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.rail-mark { transition: transform 760ms var(--ease-in-out); }
.rail-mark--seller { transform: translateX(var(--s)); }
.rail-mark--buyer { transform: translateX(var(--b)); }
.rail-mark > * { position: absolute; left: 0; translate: -50% 0; }
.rail-mark .env { top: calc(50% - 13px); }
.rail-mark--seller .rail-label { top: 0; }
.rail-mark--buyer .rail-label { bottom: 0; }
.rail-label { white-space: nowrap; font-size: var(--text-sm); color: var(--color-muted); }
.rail-label b { font-family: var(--font-display); font-weight: 600; font-size: var(--text-md); color: var(--color-ink); font-variant-numeric: tabular-nums; }
.env { display: block; width: 36px; height: 26px; border-radius: 4px; border: 1px solid var(--color-rule); background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in oklab, var(--color-ink) 4%, transparent) 4px 5px), var(--color-paper-2); box-shadow: 0 4px 10px -6px oklch(0.24 0.025 245 / 0.4); }
.env svg { width: 100%; height: 100%; fill: none; stroke: var(--color-seam); stroke-width: 1.5; stroke-linejoin: round; }
.rail-mark--buyer .env { background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in oklab, var(--color-ink) 4%, transparent) 4px 5px), var(--color-paper-3); }
/* The stretch between the two limits: a grey gap while apart, Manila once they overlap */
.rail-band::before { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - 2px); height: 4px; border-radius: 2px; transform-origin: left; transform: translateX(var(--lo)) scaleX(var(--w)); background: var(--color-accent); transition: transform 760ms var(--ease-in-out), background-color var(--dur-short) var(--ease-out); }
.rail[data-phase="playing"] .rail-band::before, .rail[data-deal="no"] .rail-band::before { background: color-mix(in oklab, var(--color-muted) 30%, transparent); }
/* The seal presses onto the overlap: 1.15 → 1, no bounce (paper doesn't bounce) */
.rail-seal::before { content: ""; position: absolute; top: calc(50% - 9px); left: calc(var(--lo) + var(--w) * 50% - 9px); width: 18px; height: 18px; border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 0 3px var(--tile), 0 3px 8px -2px oklch(0.24 0.025 245 / 0.45); }
.rail-seal::before { transition: opacity 180ms var(--ease-out), scale 180ms var(--ease-out); }
.rail[data-phase="playing"] .rail-seal::before, .rail[data-deal="no"] .rail-seal::before { opacity: 0; scale: 1.15; transition-duration: 0ms; }
.rail-status { margin-top: var(--space-sm); text-align: center; font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); font-variant-numeric: tabular-nums; min-height: 1.6em; transition: opacity var(--dur-short) var(--ease-out); }
.rail-status.is-swapping { opacity: 0; }
.rail-replay { display: flex; margin: var(--space-2xs) auto 0; visibility: hidden; opacity: 0; align-items: center; gap: var(--space-xs); min-height: 40px; padding: 0 var(--space-sm); border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--color-accent-text); font-size: var(--text-sm); font-weight: 500; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), opacity var(--dur-short) var(--ease-out); }
.rail-replay.is-shown { visibility: visible; opacity: 1; }
.rail-replay:hover { background: color-mix(in oklab, var(--color-accent) 14%, transparent); }
.rail-replay svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: rotate var(--dur-long) var(--ease-out); }
.rail-replay:hover svg { rotate: -40deg; }

/* Feature rows: copy beside one phone */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3xl); align-items: center; }
.feature .device { justify-self: center; }
.feature--flip .feature-copy { order: 2; }

/* Three ways: an iOS segmented control over one phone */
.segmented { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 34rem); margin: var(--space-xl) auto 0; padding: 4px; border-radius: var(--radius-pill); background: var(--color-paper-2); }
.segmented button { position: relative; z-index: 1; min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--radius-pill); background: none; color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 500; cursor: pointer; white-space: nowrap; transition: color var(--dur-short) var(--ease-out); }
.segmented button[aria-selected="true"] { color: var(--color-ink); font-weight: 600; }
.segmented button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.segmented-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: var(--radius-pill); background: var(--tile); box-shadow: 0 1px 2px oklch(0.24 0.025 245 / 0.12), 0 3px 10px -4px oklch(0.24 0.025 245 / 0.25); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform 380ms var(--ease-out); }
.ways-stage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-columns); margin-top: var(--space-2xl); }
.ways-stage.is-tabbed { grid-template-columns: minmax(0, 1fr); }
.ways-stage.is-tabbed .way { grid-area: 1 / 1; }
.way { display: flex; flex-direction: column; align-items: center; transition: opacity 420ms var(--ease-out), transform 520ms var(--ease-out), visibility 0s; }
.way[data-inactive] { opacity: 0; transform: translateY(12px) scale(0.985); visibility: hidden; transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out), visibility 0s 220ms; }
.way .device { --w: 280px; }
.ways-stage:not(.is-tabbed) .device { --w: 240px; }
.way-caption { margin-top: var(--space-xl); max-width: 36ch; text-align: center; font-size: var(--text-lede); color: var(--color-ink-2); }
.way-caption b { color: var(--color-ink); font-weight: 600; }

/* Night band: privacy, with a working Hold to seal */
.night { background: var(--color-night); color: var(--color-night-ink); }
.night h2 { color: var(--color-night-ink); }
.night .lede { color: var(--color-night-muted); }
.night .textlink { color: var(--color-night-link); }
.night :focus-visible { outline-color: var(--color-night-link); }
.night-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--space-3xl); align-items: center; padding-block: var(--section-gap); }
.night-copy > p:last-child { margin-top: var(--space-xl); }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: var(--space-xl) 0 0; padding: 0; list-style: none; }
.facts li { padding: 8px 16px; border-radius: var(--radius-pill); background: oklch(0.95 0.008 245 / 0.08); color: var(--color-night-ink); font-size: var(--text-sm); font-weight: 500; }
/* Hold to seal, working: 0.6 s linear fill, release early and it drains back in 180 ms */
.seal-demo { --env: oklch(0.27 0.024 245); --env-rule: oklch(0.66 0.015 245 / 0.35); width: 100%; max-width: 24rem; justify-self: end; }
.envelope { position: relative; overflow: hidden; --flap: 72px; padding: calc(var(--flap) + var(--space-md)) var(--space-lg) var(--space-lg); border-radius: var(--radius-card); background: var(--env); box-shadow: 0 0 0 1px var(--env-rule), 0 30px 60px -30px oklch(0.1 0.02 245 / 0.8); }
.envelope::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom left, transparent calc(50% - 1px), var(--env-rule) 50%, transparent calc(50% + 1px)) left top / 50.2% var(--flap) no-repeat, linear-gradient(to bottom right, transparent calc(50% - 1px), var(--env-rule) 50%, transparent calc(50% + 1px)) right top / 50.2% var(--flap) no-repeat; pointer-events: none; }
.envelope::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 7px, oklch(0.95 0.008 245 / 0.05) 7px 8px); opacity: 0; transition: opacity 250ms var(--ease-out); pointer-events: none; }
.envelope-who { position: relative; display: block; font-weight: 500; color: var(--color-night-ink); }
.envelope-who span { font-weight: 400; color: var(--color-night-muted); font-size: var(--text-sm); margin-left: var(--space-2xs); }
.envelope-amount { position: relative; display: flex; align-items: baseline; margin-top: var(--space-xs); font-family: var(--font-display); font-weight: 600; font-size: var(--text-3xl); letter-spacing: var(--tracking-display); color: var(--color-night-ink); transition: opacity 250ms var(--ease-out), filter 250ms var(--ease-out); }
.envelope-amount input { width: 100%; min-width: 0; padding: 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; font-variant-numeric: tabular-nums; caret-color: var(--color-accent); transition: border-color var(--dur-micro) var(--ease-out); }
.envelope-amount input:focus { outline: none; border-bottom-color: var(--color-night-link); }
.envelope-sealed { position: absolute; left: var(--space-lg); bottom: var(--space-lg); color: var(--color-night-muted); font-weight: 500; opacity: 0; transform: translateY(6px); transition: opacity 250ms var(--ease-out) 120ms, transform 250ms var(--ease-out) 120ms; }
.envelope-seal { position: absolute; top: calc(var(--flap) - 20px); left: calc(50% - 20px); width: 40px; height: 40px; border-radius: 50%; background: var(--color-accent); box-shadow: 0 6px 14px -6px oklch(0.1 0.02 245 / 0.8); opacity: 0; scale: 1.15; transition: opacity 180ms var(--ease-out), scale 180ms var(--ease-out); }
.seal-demo.is-sealed .envelope::after { opacity: 1; }
.seal-demo.is-sealed .envelope-amount { opacity: 0; filter: blur(8px); }
.seal-demo.is-sealed .envelope-sealed { opacity: 1; transform: none; }
.seal-demo.is-sealed .envelope-seal { opacity: 1; scale: 1; transition-delay: 160ms; }
.hold { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; margin-top: var(--space-md); padding: 0 var(--space-lg); border: 0; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-ink); font-weight: 600; cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.hold:focus-visible { outline: 2px solid var(--color-night-link); outline-offset: 3px; }
.hold-fill { position: absolute; inset: 0; background: color-mix(in oklab, var(--color-accent) 72%, var(--color-accent-ink)); transform: scaleX(0); transform-origin: left; }
.hold-label { position: relative; }
.hold.is-holding { transform: scale(0.98); }
.hold:hover .hold-fill { transform: scaleX(0.04); }
.hold[aria-disabled="true"] { cursor: not-allowed; opacity: 0.5; }
.again { display: flex; align-items: center; min-height: 52px; margin-top: var(--space-md); padding: 0; border: 0; background: none; font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 0.16em; }
.demo-help { margin-top: var(--space-sm); font-size: var(--text-sm); color: var(--color-night-muted); }


/* Pricing */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: var(--space-2xl); }
.plan { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-xl); min-height: 180px; padding: 26px; border-radius: 24px; background: var(--tile); box-shadow: var(--shadow-tile); }
.plan h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--color-ink-2); }
.plan-price { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.75rem, 1.4vw + 1rem, 2.25rem); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.plan-price span { display: block; margin-top: 2px; font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400; letter-spacing: 0; color: var(--color-muted); }
.plan--free { box-shadow: inset 0 0 0 2px var(--color-ink), var(--shadow-tile); }
.plan--free h3 { color: var(--color-ink); font-weight: 600; }
.plans-invite { margin-top: var(--space-xl); text-align: center; font-size: var(--text-lede); color: var(--color-ink-2); }
.plans-invite b { color: var(--color-ink); font-weight: 600; }
.small { font-size: var(--text-sm); color: var(--color-muted); margin-top: var(--space-md); }

/* The close */
.end { display: flex; flex-direction: column; align-items: center; text-align: center; padding-bottom: var(--section-gap); }
.end img { width: 88px; height: 88px; border-radius: 20px; box-shadow: 0 18px 36px -18px oklch(0.2 0.03 245 / 0.55); }
.end h2 { margin-top: var(--space-xl); max-width: 16ch; }
.end .actions { margin-top: var(--space-xl); }
.end .note { margin-top: var(--space-md); }

/* Footer */
.footer { background: var(--color-paper-2); padding-block: var(--space-xl); font-size: var(--text-sm); }
.footer nav ul { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); list-style: none; margin: 0; padding: 0; }
.footer a { color: var(--color-ink-2); text-decoration: none; }
.footer a:hover { color: var(--color-ink); text-decoration: underline; }
.footer .legal { margin-top: var(--space-md); padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-rule); color: var(--color-muted); }

/* Document pages: support, privacy, terms */
.doc { max-width: 44rem; margin-inline: auto; padding-block: var(--space-2xl) var(--space-3xl); }
.doc--wide { max-width: 52rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--space-xl); padding: 0; list-style: none; font-size: var(--text-sm); color: var(--color-muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--color-rule); }
.doc .crumbs a { color: var(--color-ink-2); text-decoration: none; }
.doc .crumbs a:hover { color: var(--color-ink); text-decoration: underline; }
.doc .doc-lede { font-size: var(--text-lede); color: var(--color-ink-2); margin-top: var(--space-lg); line-height: 1.45; text-wrap: pretty; }
.doc .doc-note { font-size: var(--text-sm); color: var(--color-muted); }
.doc-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-lg); margin-top: var(--space-2xl); padding-top: var(--space-xl); border-top: var(--rule-hair) solid var(--tile-rule); }
.doc .doc-cta .textlink, .doc .doc-more .textlink, .panel-link .textlink { color: var(--color-accent-text); text-decoration: none; }
.panel-link { margin-top: var(--space-lg); }
.doc-more { margin-top: var(--space-xl); }
/* A worked example inside an article: the rounds panel, smaller */
.doc-example { margin-top: var(--space-lg); padding: clamp(20px, 4vw, 40px); border-radius: var(--radius-tile); background: var(--tile); box-shadow: var(--shadow-tile); }
.doc-example .rail { margin-top: 0; }
.doc .doc-example p { margin-top: 0; }
.doc .doc-example .rounds-answer { margin-top: var(--space-lg); color: var(--color-ink); }
.doc .doc-example .rail-status { margin-top: var(--space-sm); color: var(--color-ink); }
/* What each answer tells */
.learns { display: grid; gap: 10px; margin: var(--space-lg) 0 0; }
.learns > div { padding: 18px 20px; border-radius: 16px; background: var(--tile); box-shadow: var(--shadow-tile); }
.learns dt { font-weight: 600; color: var(--color-ink); }
.learns dd { margin: 4px 0 0; color: var(--color-ink-2); line-height: 1.55; }
/* Scenario index */
.case-list { display: grid; gap: 12px; margin: var(--space-xl) 0 0; padding: 0; list-style: none; }
.doc .case-card { position: relative; display: grid; gap: 4px; padding: 22px 56px 22px 24px; border-radius: 20px; background: var(--tile); box-shadow: var(--shadow-tile); color: var(--color-ink); text-decoration: none; transition: box-shadow var(--dur-short) var(--ease-out); }
.case-card:hover { box-shadow: inset 0 0 0 1px var(--tile-rule), var(--shadow-tile); }
.case-title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-title); letter-spacing: -0.02em; line-height: 1.2; }
.case-card .chev { position: absolute; right: 24px; top: 50%; margin: 0; translate: 0 -50%; color: var(--color-accent-text); }
.case-card:hover .chev { transform: translateX(3px); }
.doc h1 { font-size: var(--text-display-s); line-height: 1.02; letter-spacing: -0.04em; }
.doc .meta { color: var(--color-muted); font-size: var(--text-sm); margin-top: var(--space-md); }
.doc h2 { font-size: var(--text-title); margin-top: var(--space-xl); letter-spacing: -0.02em; }
.doc p { color: var(--color-ink-2); margin-top: var(--space-sm); line-height: 1.6; }
.doc a { color: var(--color-accent-text); }
.doc .contact { margin-top: var(--space-xl); padding: var(--space-lg); border-radius: 20px; background: var(--tile); box-shadow: var(--shadow-tile); }
.doc .contact h2 { margin-top: 0; }
.doc .contact p { margin-top: var(--space-xs); }

/* Tiles arrive as a list the first time they come into view (the script sets this only below the fold) */
.bento.is-waiting > * { opacity: 0; transform: translateY(28px); }
.bento > * { transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); }
.bento > :nth-child(2) { transition-delay: 60ms; } .bento > :nth-child(3) { transition-delay: 120ms; }
.bento > :nth-child(4) { transition-delay: 180ms; } .bento > :nth-child(5) { transition-delay: 240ms; } .bento > :nth-child(6) { transition-delay: 300ms; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; }
}
@media (prefers-reduced-motion: reduce) {
  .hero *, .hero-stage, .hero-phone, .hero-phone .device { animation: none !important; }
  .answer-cover { display: none; }
  .bento.is-waiting > * { opacity: 1; transform: none; }
}

@media (max-width: 60rem) {
  .nav ul li.hide-s { display: none; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile--scene { grid-column: span 2; grid-row: auto; }
  .tile--rounds, .tile--invite, .tile--reveal, .tile--table, .tile--receipt { grid-column: span 1; }
  .feature, .night-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xl); }
  .feature--flip .feature-copy { order: 0; }
  .seal-demo { justify-self: start; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
  .nav { gap: var(--space-sm); }
  .nav ul { gap: var(--space-md); }
  .nav ul li.hide-xs { display: none; }
  .hero-stage { --cw: min(58vw, 236px); }
  .hero-phone--left { transform: translateX(-62%); }
  .hero-phone--right { transform: translateX(62%); }
  .bento { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tile--scene, .tile--rounds, .tile--invite, .tile--reveal, .tile--table, .tile--receipt { grid-column: auto; }
  .tile { min-height: 200px; padding: 24px; }
  .rail-track { height: 112px; }
  .rail-mark .env { width: 28px; height: 20px; top: calc(50% - 10px); }
  .panel { padding: 24px 20px; }
  .rail-scene { padding-inline: 2.75rem; }
  .rail-status { font-size: var(--text-md); }
  .rounds .amount { font-size: var(--text-lg); }
  .segmented button { font-size: var(--text-xs); padding: 4px 6px; white-space: normal; line-height: 1.15; min-height: 44px; }
  .way .device { --w: 240px; }
  .ways-stage:not(.is-tabbed) { grid-template-columns: minmax(0, 1fr); }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan { min-height: 0; flex-direction: row; align-items: center; }
  .plan-price { text-align: right; }
}

/* FAQ: native disclosure, one tile per question */
.faq { display: grid; gap: 10px; max-width: 48rem; margin: var(--space-2xl) auto 0; }
.doc .faq { margin-top: var(--space-lg); }
.faq-item { border-radius: 20px; background: var(--tile); box-shadow: var(--shadow-tile); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); min-height: 60px; padding: 16px 22px; cursor: pointer; list-style: none; font-weight: 600; color: var(--color-ink); border-radius: 20px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.faq-icon { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--color-accent-text); stroke-width: 1.8; stroke-linecap: round; transition: rotate var(--dur-short) var(--ease-out); }
.faq-item[open] .faq-icon { rotate: 45deg; }
.faq-item p, .doc .faq-item p { margin: 0; padding: 0 22px 20px; color: var(--color-ink-2); line-height: 1.6; max-width: 62ch; }

/* Rounds calculator */
.calc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: var(--space-xl); }
.calc fieldset { margin: 0; padding: 18px 20px 20px; border: 0; border-radius: 20px; background: var(--tile); box-shadow: var(--shadow-tile); display: grid; gap: 12px; }
.calc legend:not(.visually-hidden) { float: left; width: 100%; padding: 0; margin-bottom: 2px; font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.02em; color: var(--color-ink); }
.calc-terms { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; }
.field-label { font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); }
.field-label span { font-weight: 400; color: var(--color-muted); }
.field-input { display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 0 14px; border-radius: 12px; background: var(--color-paper); box-shadow: inset 0 0 0 1px var(--tile-rule); font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; color: var(--color-muted); transition: box-shadow var(--dur-micro) var(--ease-out); }
.field-input:focus-within { box-shadow: inset 0 0 0 2px var(--color-focus); }
.field-input input { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--color-ink); font: inherit; font-variant-numeric: tabular-nums; caret-color: var(--color-accent); }
.field-input input:focus { outline: none; }
.field select { min-height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--color-paper); box-shadow: inset 0 0 0 1px var(--tile-rule); color: var(--color-ink); font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; }
.field select:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 0; }
.calc-out { margin-top: 12px; padding: clamp(20px, 4vw, 40px); border-radius: var(--radius-tile); background: var(--tile); box-shadow: var(--shadow-tile); }
.calc-out .rail { margin-top: 0; }
.doc .calc-out p { margin-top: 0; }
.doc .calc-out .rail-status { margin-top: var(--space-sm); color: var(--color-ink); }
.doc .calc-result { line-height: 1.25; margin-top: var(--space-lg); font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.02em; color: var(--color-ink); text-wrap: balance; }
.doc .calc-error { margin-top: var(--space-lg); padding: 12px 16px; border-radius: 12px; background: color-mix(in oklab, var(--color-error) 10%, transparent); color: var(--color-error); font-weight: 500; }
.calc-out.is-invalid .rail, .calc-out.is-invalid .rounds { opacity: 0.35; }
@media (prefers-color-scheme: dark) { .doc .calc-error { color: oklch(0.8 0.12 27); } }
@media (max-width: 40rem) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .calc-terms { grid-template-columns: minmax(0, 1fr); }
  .faq-item summary { padding: 14px 18px; }
  .faq-item p, .doc .faq-item p { padding: 0 18px 18px; }
}

/* Tools: what each answer reveals, split the difference */
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-row > *, .calc-side > *, .calc fieldset { min-width: 0; }
.field { grid-template-columns: minmax(0, 1fr); }
.calc .choice { padding: 0; border-radius: 0; background: none; box-shadow: none; gap: 6px; }
.calc .choice legend { float: none; width: auto; margin: 0 0 6px; font-family: inherit; font-size: var(--text-sm); font-weight: 500; letter-spacing: 0; color: var(--color-ink-2); }
.choice-set { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 4px; border-radius: 14px; background: var(--color-paper); box-shadow: inset 0 0 0 1px var(--tile-rule); }
.choice-set label { position: relative; display: block; }
.choice-set input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.choice-set span { display: grid; place-items: center; min-height: 40px; padding: 0 10px; border-radius: 10px; color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 500; text-align: center; transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out); }
.choice-set input:checked + span { background: var(--tile); color: var(--color-ink); font-weight: 600; box-shadow: 0 1px 2px oklch(0.24 0.025 245 / 0.12), 0 3px 10px -4px oklch(0.24 0.025 245 / 0.25); }
.choice-set input:focus-visible + span { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding-top: 4px; font-size: var(--text-sm); color: var(--color-ink-2); cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--color-accent); }
.doc .reveal-lead { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); line-height: 1.3; letter-spacing: -0.015em; color: var(--color-ink); text-wrap: pretty; }
.reveal-out .learns { gap: 0; margin-top: var(--space-md); }
.reveal-out .learns > div { padding: 16px 0; border-radius: 0; background: none; box-shadow: none; border-top: var(--rule-hair) solid var(--tile-rule); }
.reveal-out .learns > div:last-child { padding-bottom: 0; }
.reveal-out .learns > .is-warning { padding-left: 14px; box-shadow: inset 3px 0 0 var(--color-accent); }
.calc-out.is-invalid .reveal-rows, .calc-out.is-invalid .reveal-lead { opacity: 0.35; }
.doc .calc-out .split-more { margin-top: var(--space-md); color: var(--color-ink-2); line-height: 1.6; }
.case-desc { font-size: var(--text-sm); color: var(--color-ink-2); line-height: 1.5; }
@media (max-width: 40rem) { .field-row { grid-template-columns: minmax(0, 1fr); } }

/* Article rhythm */
.doc h1 + p { margin-top: var(--space-lg); }
.doc .faq { margin-left: 0; margin-right: 0; }
/* The calculator states its answer once, in its own result line */
.calc-out .rail-status { display: none; }

/* App icons on a dark page: the icon's own navy square is the page's colour, so it gets an edge, drawn over the image
   (outline, inset by 1px, follows the radius), and a deeper offset shadow that separates it from the ground.
   Placed last so it wins over the base icon rules above. */
@media (prefers-color-scheme: dark) {
  .hero-icon, .end img, .wordmark img { outline: 1px solid oklch(0.82 0.012 245 / 0.32); outline-offset: -1px; }
  .hero-icon, .end img { box-shadow: 0 1px 0 oklch(0.95 0.008 245 / 0.06), 0 22px 44px -18px oklch(0.05 0.01 245 / 0.9), 0 0 0 1px oklch(0.05 0.01 245 / 0.6); }
}

/* Dark mode: the phones show the app's dark screenshots (picture/source in the markup). Their answer line sits lower
   (rows 417-467 of 1100) on the dark background rgb(16 25 34), so the strip that prints it moves and darkens. */
@media (prefers-color-scheme: dark) {
  .answer-cover { --shot-bg: rgb(16 25 34); top: calc(var(--w) * (0.034 + 0.932 * 405 / 506)); height: calc(var(--w) * 0.932 * 80 / 506); }
}
