/* Matchwright — ledger / registry. See docs/design-brief.md. */

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #EEF3F7;
  --sheet: #FFFFFF;
  --ink: #1C3D6E;
  --ink-deep: #14305A;
  --ink-tint: #DCE5EF;
  --night: #10213D;
  --marker: #F2C230;
  --correction: #B8392A;
  --graphite: #4A5D75;
  --dim: #71859D;
  --rule: #C5D2DE;
  --rule-soft: #D8E1EA;
  --field-border: #6E819A;
  --on-night: #FFFFFF;
  --on-night-2: #B9C8DA;
  --night-rule: rgba(185, 200, 218, 0.22);

  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --header-h: 3.75rem;
  --gutter: clamp(1rem, 0.4rem + 2.4vw, 2.5rem);
  --section: clamp(5rem, 3rem + 7vw, 9rem);
  --how-h: 220vh;
  --vh-full: 100vh;

  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  interpolate-size: allow-keywords;
}
@supports (height: 100svh) {
  :root { --vh-full: 100svh; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  scrollbar-color: var(--ink) var(--paper);
  scrollbar-width: thin;
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--ink); border: 3px solid var(--paper); }
::selection { background: var(--ink); color: var(--sheet); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}
/* Paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.24 0 0 0 0 0.43 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 {
  font-size: clamp(2rem, 1.2rem + 2.8vw, 3.5rem);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 18ch;
}
h3 { font-size: 1.3125rem; font-weight: 620; line-height: 1.2; letter-spacing: -0.015em; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--ink); }
code { font-family: var(--mono); font-size: 0.9em; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 70;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--sheet);
}
.skip-link:focus { top: 0.75rem; }

/* Shared mono details */
.entry-no,
.fig-cap,
.step-no,
.r-num {
  font-family: var(--mono);
  font-feature-settings: "zero" 1;
}
.entry-no {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
  color: var(--graphite);
}
.entry-no::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
  transform-origin: left center;
  transition: transform 900ms var(--ease-expo);
}
.fig-cap { font-size: 0.8125rem; color: var(--graphite); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 100%;
  padding-inline: var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.025em;
  text-decoration: none;
}
/* Logo: a zigzag and a wave meet and leave as one line; the marker sits under the shared line.
   Lines are strokes (round caps), the name is Schibsted Grotesk Bold in outlines. */
.brand-logo { display: block; width: 180px; height: 28px; overflow: visible; }
.mw-line { fill: none; stroke: var(--ink); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.mw-out { stroke-width: 13; }
.mw-band { fill: var(--marker); }
.mw-text { fill: var(--ink); }

/* One-shot intro on the home page, 1.2 s. Lengths: zigzag 78.92, wave 71.66, shared line 27. */
@keyframes mw-zig-in { from { stroke-dashoffset: 79.92; } to { stroke-dashoffset: 0; } }
@keyframes mw-wave-in { from { stroke-dashoffset: 72.66; } to { stroke-dashoffset: 0; } }
@keyframes mw-out-in { from { stroke-dashoffset: 28; } to { stroke-dashoffset: 0; } }
@keyframes mw-band-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes mw-text-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.brand-logo.is-intro .mw-zig { stroke-dasharray: 78.92 80.92; animation: mw-zig-in 680ms cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.brand-logo.is-intro .mw-wave { stroke-dasharray: 71.66 73.66; animation: mw-wave-in 600ms cubic-bezier(0.22, 0.61, 0.36, 1) 80ms both; }
.brand-logo.is-intro .mw-out { stroke-dasharray: 27 29; animation: mw-out-in 320ms cubic-bezier(0.22, 0.61, 0.36, 1) 600ms both; }
.brand-logo.is-intro .mw-band { transform-box: fill-box; transform-origin: 0 50%; animation: mw-band-in 340ms cubic-bezier(0.65, 0, 0.35, 1) 820ms both; }
.brand-logo.is-intro .mw-text { animation: mw-text-in 420ms cubic-bezier(0.22, 0.61, 0.36, 1) 760ms both; }

/* Loader: the same mark drawn on a loop (2.6 s), used while a form request is in flight.
   It sits on ink buttons, so the lines take the button's text colour and the shared line is marker. */
.mw-loader { display: none; flex: none; width: 31px; height: 22px; overflow: visible; }
.mw-loader .mw-line { stroke: currentColor; }
.mw-loader .mw-out { stroke: var(--marker); }
[aria-busy="true"] > .mw-loader { display: block; }
@keyframes mw-zig-loop {
  0% { stroke-dashoffset: 79.92; opacity: 1; animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
  26.15%, 82.69% { stroke-dashoffset: 0; opacity: 1; }
  94.23% { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 79.92; opacity: 0; }
}
@keyframes mw-wave-loop {
  0% { stroke-dashoffset: 72.66; opacity: 0; }
  3.08% { stroke-dashoffset: 72.66; opacity: 1; animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
  26.15%, 82.69% { stroke-dashoffset: 0; opacity: 1; }
  94.23% { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 72.66; opacity: 0; }
}
@keyframes mw-out-loop {
  0% { stroke-dashoffset: 28; opacity: 0; }
  23.08% { stroke-dashoffset: 28; opacity: 1; animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
  35.38%, 82.69% { stroke-dashoffset: 0; opacity: 1; }
  94.23% { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 28; opacity: 0; }
}
.mw-loader .mw-zig { stroke-dasharray: 78.92 80.92; animation: mw-zig-loop 2600ms linear infinite; }
.mw-loader .mw-wave { stroke-dasharray: 71.66 73.66; animation: mw-wave-loop 2600ms linear infinite; }
.mw-loader .mw-out { stroke-dasharray: 27 29; animation: mw-out-loop 2600ms linear infinite; }
.btn-square[aria-busy="true"] { gap: 0.75rem; cursor: progress; }
.btn-header { margin-left: auto; }
.label-short { display: none; }

.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
}
.read-progress span {
  display: block;
  height: 100%;
  background: var(--ink);
  transform-origin: left center;
  transform: scaleX(var(--scroll, 0));
}

/* ---------- Ledger margin index (wide screens) ---------- */

.rail {
  position: fixed;
  top: 50%;
  left: var(--gutter);
  z-index: 30;
  display: none;
  translate: 0 -50%;
}
.rail ol { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.rail a {
  display: grid;
  grid-template-columns: 2.6rem auto;
  row-gap: 0.3rem;
  padding: 0.35rem 0;
  font-size: 0.8125rem;
  color: var(--graphite);
  text-decoration: none;
}
.r-num { justify-self: start; padding-inline: 0.2rem; color: var(--graphite); transition: background-color 200ms ease, color 200ms ease; }
.r-bar { grid-column: 2; display: block; width: 4.5rem; height: 1px; background: var(--rule); }
.r-bar i {
  display: block;
  height: 100%;
  background: var(--ink);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
}
.rail a:hover .r-name,
.rail a[aria-current="true"] .r-name { color: var(--ink); }
.rail a[aria-current="true"] .r-num { background: var(--ink); color: var(--sheet); }
.rail li.on-night a { color: var(--on-night-2); }
.rail li.on-night .r-num,
.rail li.on-night a:hover .r-name,
.rail li.on-night a[aria-current="true"] .r-name { color: var(--on-night); }
.rail li.on-night a[aria-current="true"] .r-num { background: var(--on-night); color: var(--night); }
.rail li.on-night .r-bar { background: var(--night-rule); }
.rail li.on-night .r-bar i { background: var(--on-night); }

@media (min-width: 1440px) {
  .rail { display: block; }
}

/* ---------- Buttons and links ---------- */

.btn-square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.4rem;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 620;
  letter-spacing: -0.005em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
.btn-square:hover { background: var(--ink-tint); }
.btn-square:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--sheet); }
.btn-primary:hover { background: var(--ink-deep); border-color: var(--ink-deep); color: var(--sheet); }
.btn-header { min-height: 44px; padding: 0.5rem 1rem; font-size: 0.9375rem; }

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
  transition: text-decoration-thickness 160ms ease;
}
.text-link:hover { text-decoration-thickness: 3px; }

/* ---------- Highlight: the marker means "matched" ---------- */

.stage-match mark,
.rn-good mark,
.done-mark,
.c-good span {
  color: var(--ink);
  padding: 0.05em 0.3em;
  margin-inline: -0.3em;
  background-color: transparent;
  background-image: linear-gradient(var(--marker), var(--marker));
  background-repeat: no-repeat;
  background-position: 0 60%;
  background-size: 100% 88%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.diff {
  color: var(--correction);
  font-weight: 600;
  text-decoration: underline wavy;
  text-decoration-color: var(--correction);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
}
.missing { color: var(--correction); font-weight: 600; }
@keyframes marker-in { from { background-size: 0% 88%; } to { background-size: 100% 88%; } }
.done-mark { margin-inline: 0; animation: marker-in 700ms var(--ease-expo) 150ms both; }

/* ---------- Entries and reveals ---------- */

.entry { position: relative; }
.problem,
.model,
.early-access { padding-block: var(--section); }

html.js h2.reveal { transition: clip-path 1000ms var(--ease-expo); }
html.js h2.reveal:not(.is-revealed) { clip-path: inset(0 100% 0 0); }
html.js .entry-no:not(.is-revealed)::after { transform: scaleX(0); }

/* ---------- 001 Overview ---------- */

.hero { overflow-x: clip; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(1.5rem, 4vw, 4rem);
  padding-block: clamp(1.5rem, 5vh, 3.5rem) 0;
}
.hero-copy { display: contents; }
.hero-copy .entry-no { grid-column: 1 / -1; }
.hero h1 {
  grid-column: 1 / -1;
  font-size: clamp(2.75rem, 0.9rem + 6.3vw, 6.5rem);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.048em;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hero h1 .line > span { display: inline-block; }
.hero h1 .line-strong { font-weight: 720; }
.hero-body { grid-column: 1; grid-row: 3; align-self: start; padding-top: clamp(1.75rem, 4vh, 2.75rem); }
.lede { max-width: 34rem; font-size: 1.1875rem; line-height: 1.6; color: var(--graphite); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 2rem; }

@keyframes line-rise { from { translate: 0 105%; } to { translate: 0 0; } }
@keyframes clip-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
html.js .hero h1 .line > span { animation: line-rise 1000ms var(--ease-expo) both; }
html.js .hero h1 .line:nth-child(2) > span { animation-delay: 90ms; }
html.js .hero h1 .line:nth-child(3) > span { animation-delay: 180ms; }
html.js .hero .lede { animation: clip-in 900ms var(--ease-expo) 420ms both; }
html.js .hero .actions { animation: fade-in 700ms ease 620ms both; }
html.js .hero .entry-no { animation: fade-in 600ms ease both; }
html.js .stack-fig .fig-cap { animation: fade-in 700ms ease 1500ms both; }

/* Report stack in CSS 3D: the sheets cascade so each provider's header shows. */
.stack-fig { grid-column: 2; grid-row: 3; position: relative; margin: clamp(-2rem, -3vw, 0rem) 0 0; min-width: 0; }
.stack {
  position: relative;
  height: clamp(20rem, 30vw, 27rem);
  perspective: 1800px;
  perspective-origin: 50% 30%;
  --sp: 0;
}
.stack::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 12%;
  bottom: 4%;
  height: 18%;
  background: radial-gradient(closest-side, rgba(16, 33, 61, 0.14), transparent);
  opacity: calc(1 - var(--sp) * 0.8);
}
.stack-tilt { position: absolute; inset: 0; display: grid; place-items: center; transform-style: preserve-3d; }
.stack-body {
  position: relative;
  width: clamp(15rem, 23vw, 21rem);
  aspect-ratio: 1.55;
  transform-style: preserve-3d;
  transform: rotateX(57deg) rotateZ(-38deg) translate3d(0, var(--body-y, 4.5rem), calc(var(--sp) * -2rem));
}
.sheet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-bottom: 3px solid #B7C6D6;
  --gap: calc(1.1rem + var(--sp) * 3.2rem);
  transform: translate3d(calc(var(--dx, 0) * var(--sp) * 1rem), calc(var(--oy, 0rem) + var(--dy, 0) * var(--sp) * 1rem), calc(var(--n) * var(--gap)));
  opacity: clamp(0, calc(1.6 - var(--sp) * 1.6), 1);
}
.sheet:nth-child(1) { --n: 3; --oy: 0rem; --dx: -2.2; --dy: -1; border-top: 3px solid var(--ink); }
.sheet:nth-child(2) { --n: 2; --oy: -3.2rem; --dx: 1.6; --dy: -2.2; }
.sheet:nth-child(3) { --n: 1; --oy: -6.4rem; --dx: -1; --dy: 2.4; }
.sheet:nth-child(4) { --n: 0; --oy: -9.6rem; --dx: 2.6; --dy: 1.4; }
.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.8125rem;
  font-weight: 650;
}
.sheet-head span:last-child { font-family: var(--mono); font-weight: 400; font-size: 0.6875rem; color: var(--graphite); }
.sheet-lines { display: grid; gap: 0.25rem; }
.sheet-lines span { overflow: hidden; font-family: var(--mono); font-size: 0.6875rem; line-height: 1.35; color: var(--graphite); white-space: nowrap; text-overflow: ellipsis; }
@keyframes sheet-drop { from { translate: 0 0 9rem; opacity: 0; } to { translate: 0 0 0; opacity: 1; } }
html.js .sheet { animation: sheet-drop 900ms var(--ease-expo) both; }
html.js .sheet:nth-child(4) { animation-delay: 450ms; }
html.js .sheet:nth-child(3) { animation-delay: 600ms; }
html.js .sheet:nth-child(2) { animation-delay: 750ms; }
html.js .sheet:nth-child(1) { animation-delay: 900ms; }
html.js .sheet.landed { animation: none; }
.stack-fig .fig-cap { margin-top: 0.25rem; text-align: right; }

/* Planned connectors */
.ticker {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: clamp(2.5rem, 6vh, 4rem);
  padding: 0.6rem max(var(--gutter), calc((100% - 72rem) / 2 + var(--gutter)));
  border-block: 1px solid var(--rule);
  overflow: hidden;
}
.ticker-label { flex: none; font-family: var(--mono); font-size: 0.8125rem; color: var(--graphite); }
.ticker-track {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker-list {
  display: flex;
  flex: none;
  gap: 3rem;
  margin: 0;
  padding: 0.35rem 3rem 0.35rem 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.875rem;
  white-space: nowrap;
  animation: ticker 48s linear infinite;
}
.ticker:hover .ticker-list,
.ticker:focus-within .ticker-list,
.ticker.is-paused .ticker-list { animation-play-state: paused; }
@keyframes ticker { to { translate: -100% 0; } }
.ticker-toggle {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8125rem;
  cursor: pointer;
}
.ticker-toggle:hover { background: var(--sheet); }

/* Normalization demo */
.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 2rem clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  padding-block: clamp(3.5rem, 8vh, 6rem) 0;
}
.ledger-intro-title { font-size: 1.5rem; font-weight: 650; line-height: 1.2; letter-spacing: -0.02em; }
.ledger-intro-text { margin-top: 0.6rem; max-width: 22rem; color: var(--graphite); }

.convert { margin: 0; padding: 0 1.5rem 1.25rem; background: var(--sheet); border: 1px solid var(--rule); }
.convert-tabs { position: relative; display: flex; margin: 0 -1.5rem 1.25rem; border-bottom: 1px solid var(--rule); }
.convert-tab {
  flex: 1;
  min-height: 48px;
  padding: 0.6rem 1rem;
  border: 0;
  border-right: 1px solid var(--rule-soft);
  background: transparent;
  color: var(--graphite);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}
.convert-tab:last-of-type { border-right: 0; }
.convert-tab:hover { color: var(--ink); background: var(--paper); }
.convert-tab[aria-selected="true"] { color: var(--ink); font-weight: 500; }
.convert-tab:focus-visible { outline-offset: -3px; }
.tab-ink {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 3px;
  width: var(--tw, 33.333%);
  background: var(--ink);
  transform: translateX(var(--tl, 0px));
  transition: transform 420ms var(--ease-expo), width 420ms var(--ease-expo);
}
.convert-panel { transition: opacity 140ms ease; }
.convert-panel.is-switching { opacity: 0; }
.convert-file { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; padding-bottom: 0.9rem; }
.cf-name { font-family: var(--mono); font-size: 0.875rem; font-weight: 500; }
.cf-format { font-size: 0.875rem; color: var(--graphite); }
.convert-views { position: relative; }
.raw {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--ink);
}
.records { width: 100%; border-collapse: collapse; }
.records th,
.records td { padding: 0.7rem 0.25rem; border-top: 1px solid var(--rule-soft); text-align: left; vertical-align: baseline; }
.records thead th { border-top: 0; padding-block: 0 0.5rem; font-family: var(--mono); font-size: 0.75rem; font-weight: 400; color: var(--graphite); }
.records tbody tr:last-child td { border-bottom: 1px solid var(--rule); }
.records td { font-family: var(--mono); font-size: 0.9375rem; }
.records .num { text-align: right; white-space: nowrap; }
.kind { display: inline-block; min-width: 4.8rem; padding: 0.05rem 0.45rem; border: 1px solid var(--rule); font-size: 0.8125rem; }
html.js .convert:not(.is-normalized) .records { display: none; }
html.js .convert.is-normalized .raw { display: none; }
html:not(.js) .records { margin-top: 1.25rem; }
@keyframes row-in { from { opacity: 0; translate: -0.75rem 0; } to { opacity: 1; translate: 0 0; } }
html.js .convert.is-normalized .records tbody tr { animation: row-in 420ms var(--ease-expo) both; }
html.js .convert.is-normalized .records tbody tr:nth-child(2) { animation-delay: 70ms; }
html.js .convert.is-normalized .records tbody tr:nth-child(3) { animation-delay: 140ms; }
html.js .convert.is-normalized .records tbody tr:nth-child(4) { animation-delay: 210ms; }
.convert-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; margin-top: 1rem; font-size: 0.9375rem; color: var(--graphite); }
.convert-foot > span { display: flex; align-items: center; flex: 1 1 auto; min-height: 3em; }
.convert-toggle { flex: none; }

/* ---------- 002 The problem ---------- */

.problem h2 { margin-bottom: clamp(2.5rem, 6vh, 4rem); }
.story { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2rem clamp(2rem, 5vw, 5rem); }
.story-step {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  column-gap: 1rem;
  align-content: center;
  padding-block: 2rem;
  border-top: 1px solid var(--rule);
  transition: opacity 320ms ease;
}
.story-step:last-child { border-bottom: 1px solid var(--rule); }
html.js .story-step { min-height: 55vh; }
html.js .story-step:not(.is-active) { opacity: 0.75; }
.step-no { grid-row: span 2; font-size: 1.75rem; line-height: 1.1; color: var(--graphite); }
.story-step.is-active .step-no { color: var(--ink); }
.story-step h3 { margin-bottom: 0.9rem; font-size: clamp(1.35rem, 1.05rem + 0.9vw, 1.75rem); line-height: 1.2; }
.story-step > p:last-of-type { max-width: 30rem; font-size: 1.0625rem; color: var(--graphite); }
.fix-label { padding: 0.05em 0.3em; margin-right: 0.1em; background: var(--marker); color: var(--ink); font-weight: 600; }
.step-scene { display: none; }

.story-stage { align-self: start; }
html.js .story-stage {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  display: flex;
  align-items: center;
  height: calc(var(--vh-full) - var(--header-h) - 3rem);
}
.stage-card { position: relative; width: 100%; padding: 1.5rem; background: var(--sheet); border: 1px solid var(--rule); overflow: hidden; }
html.js .stage-card { height: 24rem; max-height: 100%; }
.story-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.8125rem;
}
.sp-segs { display: flex; gap: 0.3rem; }
.sp-seg { width: 1.75rem; height: 3px; background: var(--rule); transition: background-color 260ms ease; }
.sp-seg.on { background: var(--ink); }
.sp-label { margin-left: auto; font-family: var(--mono); color: var(--graphite); }
.sp-label b { font-weight: 500; color: var(--ink); }
html:not(.js) .story-progress { display: none; }

.scene { font-size: 0.9375rem; }
html.js .story-stage .scene {
  position: absolute;
  inset: 4.4rem 1.5rem 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 320ms;
}
html.js .story-stage .scene.is-active { opacity: 1; visibility: visible; }
html:not(.js) .scene + .scene { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--rule); }

.net-deposit { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 1rem; border: 1.5px solid var(--ink); font-weight: 600; }
.net-deposit strong,
.net-part span:last-child,
.late-item > span:nth-child(2),
.tz-row strong { font-family: var(--mono); font-weight: 500; }
.net-parts { display: grid; gap: 0.6rem; margin: 0.9rem 0 0 1.25rem; padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.net-part { position: relative; display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 1rem; background: var(--paper); transition: opacity 320ms ease, translate 520ms var(--ease-expo); }
.net-part::before { content: ""; position: absolute; left: -1.25rem; top: 50%; width: 1.25rem; border-top: 1px solid var(--rule); }
.net-part span:last-child { white-space: nowrap; }
.net-fee { background: var(--sheet); border: 1.5px dashed var(--correction); }
.net-fee span:last-child { color: var(--correction); }
html.js .scene-net:not(.is-active) .net-part { opacity: 0; translate: 0 -1.25rem; }
html.js .scene-net.is-active .net-part:nth-child(1) { transition-delay: 100ms; }
html.js .scene-net.is-active .net-part:nth-child(2) { transition-delay: 220ms; }
html.js .scene-net.is-active .net-part:nth-child(3) { transition-delay: 340ms; }

.late-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding-bottom: 0.5rem; border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: 0.75rem; color: var(--graphite); }
.late-track { position: relative; height: 13rem; }
.late-item { position: absolute; top: 7rem; display: grid; gap: 0.15rem; transition: opacity 320ms ease, translate 520ms var(--ease-expo); }
.late-item small { font-family: var(--mono); font-size: 0.6875rem; color: var(--graphite); }
.late-pay { left: 1%; }
.late-refund { left: 61%; }
.late-item .dot { width: 12px; height: 12px; margin-bottom: 0.35rem; background: var(--ink); }
.late-refund .dot { background: var(--sheet); outline: 1.5px solid var(--ink); }
.late-link {
  position: absolute;
  top: 2.4rem;
  left: calc(1% + 6px);
  width: 60%;
  height: 4.6rem;
  overflow: visible;
  clip-path: inset(-10% -10% -10% 0);
  transition: clip-path 700ms var(--ease-expo) 250ms;
}
.late-link path { fill: none; stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
html.js .scene-late:not(.is-active) .late-refund { opacity: 0; translate: 0 -2rem; }
html.js .scene-late.is-active .late-refund { transition-delay: 80ms; }
html.js .scene-late:not(.is-active) .late-link { clip-path: inset(-10% -10% -10% 100%); transition-delay: 0ms; }

.tz-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
.tz-row span { color: var(--graphite); font-size: 0.875rem; }
.tz-row strong { white-space: nowrap; }
.tz-utc strong {
  padding: 0.05em 0.3em;
  margin-inline: -0.3em;
  background-image: linear-gradient(var(--marker), var(--marker));
  background-repeat: no-repeat;
  background-position: 0 60%;
  background-size: 100% 88%;
  transition: background-size 420ms var(--ease-expo) 500ms;
}
.tz-days { position: relative; display: grid; grid-template-columns: 1fr 1fr; height: 7rem; margin: 1.4rem 0 1rem; }
.tz-day { display: flex; align-items: flex-end; padding: 0.5rem 0.7rem; background: var(--paper); border: 1px solid var(--rule); font-family: var(--mono); font-size: 0.75rem; color: var(--graphite); }
.tz-day:nth-child(2) { border-left: 0; }
.tz-midnight { position: absolute; top: -0.6rem; bottom: -0.6rem; left: 50%; border-left: 1.5px dashed var(--ink); }
.tz-midnight span { position: absolute; top: -1.2rem; left: 0; translate: -50% 0; font-family: var(--mono); font-size: 0.6875rem; }
.tz-dot { position: absolute; top: 2.4rem; left: calc(50% - 1.4rem - 16px); width: 16px; height: 16px; background: var(--ink); box-shadow: 0 0 0 4px var(--paper); transition: left 600ms var(--ease-expo) 120ms; }
html.js .scene-tz:not(.is-active) .tz-dot { left: calc(50% + 1.4rem); transition-delay: 0ms; }
html.js .scene-tz:not(.is-active) .tz-utc strong { background-size: 0% 88%; transition-delay: 0ms; }

.rn-file { padding: 0.8rem 1rem; background: var(--paper); border: 1px solid var(--rule); }
.rn-name { font-family: var(--mono); font-size: 0.75rem; color: var(--graphite); }
.rn-head { margin-top: 0.3rem; font-family: var(--mono); font-size: 0.9375rem; white-space: nowrap; }
.rn-old { text-decoration: line-through; text-decoration-color: var(--correction); text-decoration-thickness: 2px; color: var(--graphite); transition: text-decoration-color 250ms ease 100ms; }
.rn-new { display: inline-block; max-width: 9em; margin-left: 0.4em; overflow: hidden; vertical-align: bottom; font-weight: 500; transition: max-width 450ms steps(12, end) 200ms; }
.rn-status { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; padding: 0.85rem 1rem; border: 1px solid var(--rule); transition: opacity 300ms ease, translate 380ms var(--ease-expo); }
.rn-status span { color: var(--graphite); }
.rn-bad strong { color: var(--correction); font-weight: 600; }
.rn-good strong { font-weight: 600; }
.rn-good mark { transition: background-size 380ms var(--ease-expo) 600ms; }
html.js .scene-rename.is-active .rn-bad { transition-delay: 380ms; }
html.js .scene-rename.is-active .rn-good { transition-delay: 520ms; }
html.js .scene-rename:not(.is-active) .rn-old { text-decoration-color: transparent; transition-delay: 0ms; }
html.js .scene-rename:not(.is-active) .rn-new { max-width: 0; transition-delay: 0ms; }
html.js .scene-rename:not(.is-active) .rn-status { opacity: 0; translate: 0 0.6rem; }
html.js .scene-rename:not(.is-active) .rn-good mark { background-size: 0% 88%; transition-delay: 0ms; }

.closing {
  max-width: 24ch;
  margin-top: clamp(4rem, 10vh, 7rem);
  font-size: clamp(1.75rem, 1rem + 2.6vw, 3.25rem);
  font-weight: 550;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.closing .w { transition: color 220ms ease; }
html.js .closing .w:not(.on) { color: var(--dim); }

/* ---------- 003 How it works ---------- */

.how-frame { position: relative; padding-block: var(--section); background: var(--night); color: var(--on-night); }
.how-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--night-rule) 1px, transparent 1px), linear-gradient(90deg, var(--night-rule) 1px, transparent 1px);
  background-size: 6rem 6rem;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 80%);
  opacity: 0.6;
}
.how-inner { position: relative; }
.how-frame h2,
.how-frame h3 { color: var(--on-night); }
.how-frame .entry-no { color: var(--on-night-2); }
.how-frame .entry-no::after { border-color: var(--night-rule); }
.how-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.25rem 2rem; margin-bottom: 2.5rem; }
.how-head > div:first-child { flex: 1 1 22rem; }
.how-progress { display: flex; gap: 0.5rem; }
.hw-seg { display: grid; gap: 0.45rem; width: 7.5rem; }
.hw-seg i { position: relative; display: block; height: 2px; overflow: hidden; background: var(--night-rule); }
.hw-seg i::after { content: ""; position: absolute; inset: 0; background: var(--on-night); transform-origin: left center; transform: scaleX(var(--fill, 1)); }
.hw-seg b { font-family: var(--mono); font-size: 0.75rem; font-weight: 400; color: var(--on-night-2); transition: color 200ms ease; }
.hw-seg.is-current b { color: var(--on-night); }
.fig-cap-night { margin-top: 2rem; color: var(--on-night-2); }

.how.is-pinned { height: var(--how-h); }
.how.is-pinned .how-pin {
  position: sticky;
  top: var(--header-h);
  display: flex;
  height: calc(var(--vh-full) - var(--header-h));
}
.how.is-pinned .how-frame {
  flex: 1;
  display: flex;
  align-items: center;
  padding-block: 2rem;
  clip-path: inset(calc((1 - var(--enter, 1)) * min(6%, 1.5rem)) calc((1 - var(--enter, 1)) * min(8%, var(--gutter) - 0.5rem)));
}

.pipeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem minmax(0, 1fr) 4.5rem minmax(0, 1fr);
  align-items: start;
  --f1: 1;
  --f2: 1;
}
.stage h3 { margin: 1.4rem 0 0.5rem; font-size: 1.1875rem; }
.stage > p { max-width: 32ch; font-size: 0.9375rem; color: var(--on-night-2); }
.pic {
  position: relative;
  height: 17.5rem;
  padding: 1.1rem;
  overflow: hidden;
  color: var(--ink);
  background: var(--sheet);
  outline: 2px solid transparent;
  outline-offset: 4px;
  transition: outline-color 260ms ease;
}
.stage.is-active .pic { outline-color: var(--on-night); }

.flow { position: relative; height: 17.5rem; }
.flow::before {
  content: "";
  position: absolute;
  left: 0.6rem;
  right: 0.9rem;
  top: calc(50% - 1px);
  height: 1.5px;
  background-image: linear-gradient(90deg, var(--on-night-2) 55%, transparent 0);
  background-size: 10px 1.5px;
}
.flow-1::before { background-position: calc(var(--f1) * 60px) 0; }
.flow-2::before { background-position: calc(var(--f2) * 60px) 0; }
.flow::after { content: ""; position: absolute; right: 0.6rem; top: calc(50% - 5px); width: 9px; height: 9px; border-top: 1.5px solid var(--on-night-2); border-right: 1.5px solid var(--on-night-2); transform: rotate(45deg); }
.packet { position: absolute; left: 0.4rem; top: calc(50% - 7px); width: 22px; height: 14px; border: 1.5px solid var(--on-night); background: var(--night); }
.flow-1 .packet { transform: translateX(calc(var(--f1) * 2.6rem)); opacity: min(calc(var(--f1) * 8), calc((1 - var(--f1)) * 8), 1); }
.flow-2 .packet { transform: translateX(calc(var(--f2) * 2.6rem)); opacity: min(calc(var(--f2) * 8), calc((1 - var(--f2)) * 8), 1); }

.file { position: absolute; padding: 0.55rem 0.7rem; background: var(--paper); border: 1px solid var(--rule); font-size: 0.75rem; line-height: 1.45; transition: opacity 300ms ease; }
.file-name { margin-bottom: 0.2rem; overflow: hidden; font-family: var(--mono); font-weight: 500; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; }
.file-body { overflow: hidden; font-family: var(--mono); color: var(--graphite); white-space: nowrap; text-overflow: ellipsis; }
.file-csv { top: 1.1rem; left: 1.1rem; right: 1.9rem; transform: rotate(-1.5deg); }
.file-json { top: 6.2rem; left: 1.9rem; right: 1.1rem; transform: rotate(1.2deg); background: var(--sheet); }
.file-xlsx { top: 11.3rem; left: 1.3rem; right: 1.5rem; transform: rotate(-0.6deg); }

.rec { display: grid; grid-template-columns: 4.4rem minmax(0, 1fr) 3rem; gap: 0.5rem; align-items: center; padding: 0.62rem 0.15rem; border-top: 1px solid var(--rule-soft); font-family: var(--mono); font-size: 0.8125rem; transition: opacity 300ms ease; }
.rec .num { text-align: right; white-space: nowrap; }
.rec-head { border-top: 0; padding-top: 0; font-size: 0.6875rem; color: var(--graphite); }
.rec-head .src-head { text-align: right; }
.src { justify-self: end; padding: 0.05rem 0.4rem; border: 1px solid var(--rule); font-size: 0.6875rem; color: var(--graphite); }

.pair { display: grid; grid-template-columns: minmax(0, 1fr) 2.2rem minmax(0, 1fr); align-items: center; padding: 0.62rem 0.15rem; border-top: 1px solid var(--rule-soft); font-family: var(--mono); font-size: 0.875rem; white-space: nowrap; transition: opacity 260ms ease; }
.pair > span:first-child { text-align: right; }
.pair-head { border-top: 0; padding-top: 0; font-family: var(--font); font-size: 0.75rem; color: var(--graphite); }
.tie { height: 1.5px; margin-inline: 0.4rem; background: var(--ink); transform-origin: left center; transition: transform 260ms var(--ease-expo) 150ms; }
.pair.is-off .tie { background: none; background-image: linear-gradient(90deg, var(--correction) 50%, transparent 0); background-size: 6px 1.5px; }
.match-foot { margin-top: 0.9rem; font-family: var(--mono); font-size: 0.75rem; color: var(--graphite); transition: opacity 300ms ease; }
.stage-match mark { transition: background-size 380ms var(--ease-expo); }
.pair > span:last-child mark { transition-delay: 280ms; }
.stage-match .diff { transition: color 300ms ease, text-decoration-color 300ms ease; }
.stage-match .missing { transition: color 300ms ease 200ms; }

/* While scrubbing, content that hasn't been reached yet is dimmed, never hidden. */
.pipeline.is-scrub .file:not(.on),
.pipeline.is-scrub .rec:not(.on),
.pipeline.is-scrub .pair:not(.pair-head):not(.on),
.pipeline.is-scrub .match-foot:not(.on) { opacity: 0.32; }
.pipeline.is-scrub .pair:not(.match) mark { background-size: 0% 88%; }
.pipeline.is-scrub .pair:not(.match) .tie { transform: scaleX(0); }
.pipeline.is-scrub .pair.is-off:not(.match) .diff { color: var(--ink); text-decoration-color: transparent; }
.pipeline.is-scrub .pair.is-off:not(.match) .missing { color: var(--graphite); }

/* ---------- CTA band and inline CTA ---------- */

.cta-band { border-bottom: 1px solid var(--rule); }
.cta-band-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-block: 2rem; }
.cta-band p { max-width: 34rem; font-size: 1.1875rem; font-weight: 550; letter-spacing: -0.01em; }
.cta-inline { margin-top: 2.5rem; }

/* ---------- 004 Support ---------- */

.model h2 { margin-bottom: clamp(2.5rem, 6vh, 4rem); }
.model-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem clamp(2rem, 5vw, 5rem); }
.model-col h3 { padding-bottom: 0.9rem; border-bottom: 1.5px solid var(--ink); font-size: 1.125rem; }
.model-col ul { margin: 0; padding: 0; list-style: none; counter-reset: item; }
.model-col li { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); padding: 0.85rem 0; border-bottom: 1px solid var(--rule); color: var(--graphite); counter-increment: item; }
.model-col li::before { content: counter(item, decimal-leading-zero); font-family: var(--mono); font-size: 0.8125rem; line-height: 1.9; color: var(--ink); }

.compare { margin: clamp(4rem, 10vh, 6.5rem) 0 0; }
.compare-cap { margin-bottom: 1.25rem; font-size: 1.125rem; font-weight: 600; }
.compare-cap code { padding: 0.05em 0.35em; background: var(--sheet); border: 1px solid var(--rule); font-size: 0.85em; font-weight: 400; }
.compare-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--sheet); border: 1px solid var(--rule); }
.compare-table th,
.compare-table td { padding: 1.05rem 1.25rem; text-align: left; vertical-align: top; border-top: 1px solid var(--rule-soft); }
.compare-table thead th { border-top: 0; border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: 0.8125rem; font-weight: 400; color: var(--graphite); }
.compare-table td + td { border-left: 1px solid var(--rule-soft); }
.compare-table .c-step { width: 3.5rem; font-family: var(--mono); font-weight: 400; font-size: 0.875rem; color: var(--graphite); }
.compare-table tbody tr { transition: opacity 320ms ease; }
.compare-table .c-bad { color: var(--correction); }
.c-good span { transition: background-size 520ms var(--ease-expo) 150ms; }
html.js .compare-table tbody tr:not(.on) { opacity: 0.7; }
html.js .compare-table tbody tr:not(.on) .c-good span { background-size: 0% 88%; }

/* ---------- 005 Register ---------- */

.ea-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem clamp(2rem, 5vw, 5rem); align-items: start; }
.ea-intro h2 { max-width: 13ch; }
.ea-intro > p:last-child { margin-top: 1.25rem; max-width: 24rem; font-size: 1.125rem; color: var(--graphite); }
html.js .ea-intro { position: sticky; top: calc(var(--header-h) + 2rem); }

.register { padding: clamp(1.5rem, 3vw, 2.5rem); background: var(--sheet); border: 1px solid var(--rule); }
.register-done h3 { margin: 0 0 0.6rem; }
.register-done p { color: var(--graphite); }
.register-done strong { color: var(--ink); font-weight: 600; word-break: break-all; }

.reg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
.field-wide { grid-column: 1 / -1; }
.field { margin: 0 0 1.6rem; padding: 0; border: 0; min-width: 0; }
.field > label,
.field > legend,
.sub-label {
  display: block;
  margin-bottom: 0.3rem;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--graphite);
}
.field > legend { margin-bottom: 0.6rem; }
.sub-label { margin-top: 1rem; }
.optional { margin-left: 0.35rem; text-transform: none; letter-spacing: 0; }

input[type="text"],
input[type="email"],
textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0;
  border: 0;
  border-bottom: 1.5px solid var(--field-border);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.125rem;
  transition: border-color 160ms ease;
}
textarea { resize: vertical; min-height: 5.5rem; line-height: 1.5; }
input:hover, textarea:hover { border-bottom-color: var(--ink); }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-bottom-color: var(--ink); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-bottom-color: var(--correction); }

@keyframes nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.is-nudged { animation: nudge 260ms ease 1; }
.field-error { margin-top: 0.5rem; font-size: 0.9375rem; font-weight: 500; color: var(--correction); }
.field-error:empty { display: none; }

.provider-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0.75rem; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.providers[aria-invalid="true"] .provider-grid { border-color: var(--correction); }
.provider {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 180ms ease;
}
.provider:hover { background-color: var(--paper); }
.provider input {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--ink);
  background: var(--sheet);
  cursor: pointer;
}
.provider input::after { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--sheet); border-bottom: 2px solid var(--sheet); transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform 160ms var(--ease-expo); }
.provider input:checked { background: var(--ink); }
.provider input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.provider:has(input:checked) { background-color: var(--ink-tint); }
.provider:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: -2px; }
.provider input:focus-visible { outline: none; }
.provider-count { margin-bottom: 0.5rem; font-family: var(--mono); font-size: 0.8125rem; color: var(--graphite); }
.provider-count:empty { display: none; }

.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.what-you-get { margin-bottom: 0.75rem; font-weight: 550; }
.privacy { margin-bottom: 1.25rem; font-size: 0.9375rem; color: var(--graphite); }
.privacy a { color: var(--ink); text-underline-offset: 0.2em; }
.btn-submit { width: 100%; min-height: 56px; font-size: 1.0625rem; }
.btn-submit[aria-busy="true"] { cursor: progress; }
.form-status { margin-top: 0.9rem; font-size: 0.9375rem; font-weight: 500; color: var(--correction); }
.form-status:empty { display: none; }
.form-status.is-ok { color: var(--ink); }

/* ---------- Footer, thanks, privacy ---------- */

.site-footer { padding-block: 1.5rem 2rem; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 0.8125rem; color: var(--graphite); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; flex-wrap: wrap; }
.footer-inner a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 0.25em; }
.thanks { padding-block: var(--section); max-width: 40rem; }
.thanks h1 { font-size: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); font-weight: 650; line-height: 1; letter-spacing: -0.04em; }
.thanks p { margin-top: 1rem; font-size: 1.125rem; color: var(--graphite); }
.thanks .actions { margin-top: 2rem; }

.doc { max-width: 46rem; padding-block: clamp(3rem, 8vh, 5rem) var(--section); }
.doc h1 { font-size: clamp(2.25rem, 1.4rem + 3vw, 3.75rem); font-weight: 650; line-height: 1.02; letter-spacing: -0.04em; }
.doc-updated { margin-top: 0.75rem; font-family: var(--mono); font-size: 0.8125rem; color: var(--graphite); }
.doc section { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.doc h2 { margin-bottom: 0.75rem; font-size: 1.375rem; letter-spacing: -0.02em; max-width: none; }
.doc section p { max-width: 40rem; color: var(--graphite); }
.doc section p + p { margin-top: 0.75rem; }
.doc-delete .register { margin-top: 1rem; }

/* ---------- Breakpoints ---------- */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-body, .stack-fig { grid-column: 1; grid-row: auto; }
  .stack-fig { margin-top: 2rem; }
  .stack { height: clamp(17rem, 72vw, 23rem); }
  .stack-body { width: clamp(13rem, 56vw, 19rem); }
  .ledger-row { grid-template-columns: minmax(0, 1fr); }
  .ea-grid { grid-template-columns: minmax(0, 1fr); }
  html.js .ea-intro { position: static; }

  /* Story: each line carries its own scene; no sticky card. */
  .story { grid-template-columns: minmax(0, 1fr); gap: 0; }
  html.js .story-stage { display: none; }
  html.js .step-scene {
    display: block;
    grid-column: 1 / -1;
    margin-top: 1.25rem;
    padding: 1.1rem;
    background: var(--sheet);
    border: 1px solid var(--rule);
    overflow: hidden;
  }
  html.js .story-step { min-height: 0; padding-block: 2rem; align-content: start; }
  html.js .story-step:not(.is-active) { opacity: 1; }
  .story-step { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .step-no { font-size: 1.25rem; }
  .step-scene .scene { font-size: 0.875rem; }
  .late-track { height: 11rem; }
  .late-item { top: 6rem; }
  .late-link { top: 1.6rem; height: 4.4rem; }
  .tz-days { height: 5rem; margin-top: 1.2rem; }
  .tz-dot { top: 1.5rem; }

  .how-head { margin-bottom: 1.5rem; }
  .how-progress { display: none; }
  .pipeline { grid-template-columns: minmax(0, 1fr); max-width: 30rem; }
  .stage > p { max-width: none; }
  .flow { height: 4.5rem; }
  .flow::before {
    left: calc(50% - 1px);
    right: auto;
    top: 0.6rem;
    bottom: 0.9rem;
    width: 1.5px;
    height: auto;
    background-image: linear-gradient(180deg, var(--on-night-2) 55%, transparent 0);
    background-size: 1.5px 10px;
  }
  .flow::after { right: auto; left: calc(50% - 5px); top: auto; bottom: 0.6rem; transform: rotate(135deg); }
  .packet { display: none; }
}

@media (max-width: 640px) {
  .model-cols { grid-template-columns: minmax(0, 1fr); }
  .reg-grid { grid-template-columns: minmax(0, 1fr); }
  .provider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .convert { padding: 0 1rem 1rem; }
  .convert-tabs { margin-inline: -1rem; }
  .convert-tab { padding-inline: 0.7rem; font-size: 0.75rem; }
  .raw { font-size: 0.8125rem; }
  .records td { font-size: 0.875rem; }
  .kind { min-width: 0; }
  .convert-foot { flex-wrap: wrap; }
  .convert-foot > span { flex-basis: 100%; min-height: 4.6em; }
  .compare-table th,
  .compare-table td { padding: 0.85rem 0.7rem; font-size: 0.9375rem; }
  .compare-table .c-step { width: 2.2rem; }

  /* Two sheets read better than four on a phone. */
  .sheet:nth-child(3),
  .sheet:nth-child(4) { display: none; }
  .stack-body { --body-y: 1.8rem; }
  .sheet:nth-child(1) { --n: 1; --oy: 0rem; }
  .sheet:nth-child(2) { --n: 0; --oy: -3.2rem; }
  .sheet-lines span { font-size: 0.75rem; }

  /* Planned connectors as a static list. */
  .ticker { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .ticker-track { flex-basis: 100%; -webkit-mask-image: none; mask-image: none; }
  .ticker-list { flex: 1; flex-wrap: wrap; gap: 0.35rem 1.25rem; padding: 0; white-space: normal; animation: none; }
  .ticker-copy,
  .ticker-toggle { display: none !important; }
}

@media (max-width: 420px) {
  .brand-logo { width: 154px; height: 24px; }
  .label-long { display: none; }
  .label-short { display: inline; }
  .btn-header { padding-inline: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .ticker-track { -webkit-mask-image: none; mask-image: none; }
  .ticker-list { flex-wrap: wrap; white-space: normal; row-gap: 0.5rem; }
  .ticker-copy,
  .ticker-toggle { display: none !important; }
}
