/* Lexo landing: tokens from the Lexo Design System (claude.ai/artifact/1rMFdk9V3VNP8eWZ27A6HW).
   Rules kept: one black (ink), purple marks what matters, cream only behind explanatory
   drawings (it is a fixed color in both themes), no gradients / glows / shadows,
   Sora for everything scanned, Newsreader only for complete sentences.
   Light and dark values are the design system's own. */

@font-face {
  font-family: "Sora";
  src: url("/fonts/Sora-variable.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/Newsreader-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  size-adjust: 113%; /* x-height match to Sora, as in lexo-react-app */
}

/* ---------- Tokens ----------
   The <meta name="color-scheme"> is the source of truth: "light dark" follows the system,
   "light" / "dark" pin an override (theme.js). CSS maps the meta back to color-scheme, and
   every themed token resolves through light-dark(), so the page follows the system with no JS.
   Browsers without light-dark() fall back to prefers-color-scheme (system only, no override). */
:root {
  color-scheme: light dark;
  &:has(> head > meta[name="color-scheme"][content="dark"]) { color-scheme: dark; }
  &:has(> head > meta[name="color-scheme"][content="light"]) { color-scheme: light; }

  /* Raw light / dark values (design system tokens) */
  --bg-l: #F8F8FA; --bg-d: #0E0D12;
  --surface-l: #FFFFFF; --surface-d: #16151C;
  --raised-l: #F1F1F4; --raised-d: #1E1D26;
  --border-l: #E3E3E9; --border-d: #2E2D38;
  --ink-l: #0A0A0A; --ink-d: #F1F1F4;
  --ink-2-l: #555564; --ink-2-d: #B4B4C2;
  --ink-3-l: #737383; --ink-3-d: #8E8E9E;
  --purple-l: #5B21B6; --purple-d: #7545D7;
  --purple-hover-l: #6D28D9; --purple-hover-d: #8458E0;
  --purple-press-l: #4C1D95; --purple-press-d: #5B21B6;
  --accent-text-l: #5B21B6; --accent-text-d: #A98FFE;
  --purple-tint-l: #EDE9FE; --purple-tint-d: #2A1F4A;
  --slate-l: #4E6E8E; --slate-d: #93AECB;
  --bronze-l: #8F6A2C; --bronze-d: #DDB873;
  --control-l: #737383; --control-d: #8E8E9E;
  --status-success-l: #0F766E; --status-success-d: #2DBFAE;
  --status-success-bg-l: #E6F4F1; --status-success-bg-d: #0F2A27;
  --status-error-l: #B42318; --status-error-d: #FF7A7A;
  --status-error-bg-l: #FDECEA; --status-error-bg-d: #3A1518;

  /* Fallback: light, or dark by system preference */
  --bg: var(--bg-l);
  --surface: var(--surface-l);
  --raised: var(--raised-l);
  --border: var(--border-l);
  --ink: var(--ink-l);
  --ink-2: var(--ink-2-l);
  --ink-3: var(--ink-3-l);
  --purple: var(--purple-l);
  --purple-hover: var(--purple-hover-l);
  --purple-press: var(--purple-press-l);
  --accent-text: var(--accent-text-l);
  --purple-tint: var(--purple-tint-l);
  --slate: var(--slate-l);
  --bronze: var(--bronze-l);
  --control: var(--control-l);
  --status-success: var(--status-success-l);
  --status-success-bg: var(--status-success-bg-l);
  --status-error: var(--status-error-l);
  --status-error-bg: var(--status-error-bg-l);
  @media (prefers-color-scheme: dark) {
    --bg: var(--bg-d);
    --surface: var(--surface-d);
    --raised: var(--raised-d);
    --border: var(--border-d);
    --ink: var(--ink-d);
    --ink-2: var(--ink-2-d);
    --ink-3: var(--ink-3-d);
    --purple: var(--purple-d);
    --purple-hover: var(--purple-hover-d);
    --purple-press: var(--purple-press-d);
    --accent-text: var(--accent-text-d);
    --purple-tint: var(--purple-tint-d);
    --slate: var(--slate-d);
    --bronze: var(--bronze-d);
    --control: var(--control-d);
    --status-success: var(--status-success-d);
    --status-success-bg: var(--status-success-bg-d);
    --status-error: var(--status-error-d);
    --status-error-bg: var(--status-error-bg-d);
  }
  /* Preferred: follows color-scheme, so the toggle's override works */
  @supports (color: light-dark(#000, #fff)) {
    --bg: light-dark(var(--bg-l), var(--bg-d));
    --surface: light-dark(var(--surface-l), var(--surface-d));
    --raised: light-dark(var(--raised-l), var(--raised-d));
    --border: light-dark(var(--border-l), var(--border-d));
    --ink: light-dark(var(--ink-l), var(--ink-d));
    --ink-2: light-dark(var(--ink-2-l), var(--ink-2-d));
    --ink-3: light-dark(var(--ink-3-l), var(--ink-3-d));
    --purple: light-dark(var(--purple-l), var(--purple-d));
    --purple-hover: light-dark(var(--purple-hover-l), var(--purple-hover-d));
    --purple-press: light-dark(var(--purple-press-l), var(--purple-press-d));
    --accent-text: light-dark(var(--accent-text-l), var(--accent-text-d));
    --purple-tint: light-dark(var(--purple-tint-l), var(--purple-tint-d));
    --slate: light-dark(var(--slate-l), var(--slate-d));
    --bronze: light-dark(var(--bronze-l), var(--bronze-d));
    --control: light-dark(var(--control-l), var(--control-d));
    --status-success: light-dark(var(--status-success-l), var(--status-success-d));
    --status-success-bg: light-dark(var(--status-success-bg-l), var(--status-success-bg-d));
    --status-error: light-dark(var(--status-error-l), var(--status-error-d));
    --status-error-bg: light-dark(var(--status-error-bg-l), var(--status-error-bg-d));
  }

  /* Black surfaces: the masthead stays black in both themes. */
  --bar: #0A0A0A;
  --bar-line: #2E2D38;
  --on-bar: #FFFFFF;
  --on-bar-2: #E4E4EC;

  /* Illustration palette: drawings sit on cream in both themes, so these do not switch. */
  --cream: #F5F1E6;
  --il-ink: #3D3D4A;          /* legend-ink */
  --il-strong: #0A0A0A;
  --il-faint: rgba(61, 61, 74, 0.22);
  --il-rule: #CBCBD4;         /* grid-rule */
  --il-paper: #FFFFFF;
  --il-head: #E3E3E9;         /* table-head */
  --il-purple: #5B21B6;
  --il-tint: #EDE9FE;
  --il-gold: #B48A3C;         /* seal ring only */

  --sans: Sora, "Segoe UI", system-ui, sans-serif;
  --serif: Newsreader, Georgia, "Times New Roman", serif;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px;
  --measure: 68ch;
  --wrap: 1120px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  accent-color: var(--purple);
}

/* Non-color branching (logos, the toggle's icon and label): .when-dark / .when-light.
   Dark = meta pinned dark, or system dark while not pinned light. */
.when-dark { display: none !important; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  & .when-dark { display: revert !important; }
  & .when-light { display: none !important; }
}
@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) {
    & .when-dark { display: revert !important; }
    & .when-light { display: none !important; }
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; border-radius: 2px; }
.theme-switching, .theme-switching *:not(canvas) {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease, stroke .35s ease !important;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(20px, 5vw, 56px); }
.skip {
  position: absolute; left: 16px; top: -48px; z-index: 10;
  background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: var(--radius-sm);
}
.skip:focus { top: 12px; }

/* ---------- Type (web scale) ---------- */
.label {
  font-family: var(--sans);
  font-size: 12px; line-height: 16px; font-weight: 600;
  letter-spacing: 1.3px; text-transform: uppercase;
}
.headline {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(28px, 4.2vw, 36px); line-height: 1.17; letter-spacing: -0.3px;
  margin: 0; max-width: 22ch;
}
.lead {
  font-family: var(--serif);
  font-size: 18px; line-height: 30px;   /* renders ~20px: web lead 20/30 */
  max-width: var(--measure); margin: var(--space-4) 0 0;
}
.section {
  font-family: var(--sans); font-weight: 600;
  font-size: 24px; line-height: 30px;
  margin: 0; padding-top: var(--space-4);
}
.body {
  font-family: var(--serif);
  font-size: 16px; line-height: 28px;   /* renders ~18px: web body 18/28 */
  max-width: var(--measure); margin: var(--space-3) 0 0;
}
.caption { font-size: 13px; line-height: 18px; color: var(--ink-2); margin: 0; }
.eyebrow { color: var(--accent-text); margin: 0 0 var(--space-3); }

/* Hairline above section headings, drawn in. */
.rule-top { position: relative; }
.rule-top::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: var(--border);
  transform-origin: left; transition: transform 1s var(--ease);
}

/* ---------- Masthead ---------- */
.masthead { background: var(--bar); color: var(--on-bar); border-bottom: 1px solid var(--bar-line); }
.masthead__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); min-height: 88px; }
.masthead__logo img { width: 200px; height: auto; }
.masthead__meta { display: flex; align-items: center; gap: var(--space-4); }
.masthead__nav {
  color: var(--on-bar-2); text-decoration: none; position: relative; padding: 6px 0;
}
.masthead__nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--on-bar);
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease);
}
.masthead__nav:hover::after { transform: scaleX(1); transform-origin: left; }
.masthead__link {
  color: var(--on-bar); text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--bar-line); border-radius: var(--radius-sm);
  transition: border-color .2s;
}
.masthead__link:hover { border-color: var(--on-bar-2); }
.masthead :focus-visible { outline-color: var(--on-bar); }

.theme-toggle {
  display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  background: transparent; color: var(--on-bar);
  border: 1px solid var(--bar-line); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--on-bar-2); }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; overflow: visible; }
.theme-toggle .icon-swap { display: grid; place-items: center; }
@media (prefers-reduced-motion: no-preference) {
  .theme-toggle .icon-swap svg { animation: spin-in .45s var(--ease) both; }
}
@keyframes spin-in { from { opacity: 0; transform: rotate(-60deg) scale(.6); } }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(56px, 10vw, 112px); padding-bottom: clamp(32px, 5vw, 56px); }
.hero__products { margin: 0 0 var(--space-4); display: flex; gap: var(--space-2); }
.t-research { color: var(--slate); }
.t-trading { color: var(--bronze); }
.dot { color: var(--ink-3); }

.headline .w { display: inline-block; white-space: pre; }

.keyrow {
  position: relative;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
  margin: clamp(32px, 5vw, 48px) 0 0;
  padding-top: var(--space-4);
  max-width: 820px;
}
.rule-draw::before { /* the 2pt purple rule above the key row */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--purple);
  transform-origin: left; transition: transform 1.1s var(--ease) .2s;
}
.keyrow dt { color: var(--ink-2); }
.keyrow dd { margin: var(--space-1) 0 0; font-size: 16px; line-height: 24px; font-weight: 600; }

/* ---------- Hero illustration (canvas) ---------- */
.figure { padding-bottom: clamp(64px, 9vw, 112px); }
.flow { margin: 0; }
.flow__stage {
  position: relative; background: var(--cream);
  border-radius: var(--radius-lg);
  aspect-ratio: 16 / 7; min-height: 260px; overflow: hidden;
  cursor: crosshair; touch-action: pan-y;
}
#flow { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.flow__tag {
  position: absolute; top: 20px; color: var(--il-ink);
  font-size: 11px; letter-spacing: 1.2px; white-space: nowrap; pointer-events: none;
}
.flow__tag--src { left: 4%; }
.flow__tag--ai { left: 34%; }
.flow__tag--gate { left: 62%; transform: translateX(-50%); color: var(--il-strong); }
.flow__tag--end { right: 4%; color: var(--il-purple); }
.flow__hint {
  position: absolute; left: 4%; bottom: 30px; color: var(--il-ink); font-size: 12px;
  opacity: .0; transition: opacity .4s ease; pointer-events: none;
}
.flow__stage:hover .flow__hint { opacity: .8; }
.flow figcaption { margin-top: var(--space-3); }

/* ---------- How it works ---------- */
.how, .trust { padding-bottom: clamp(72px, 10vw, 120px); }
.intro { margin-bottom: clamp(28px, 4vw, 44px); max-width: 760px; }

.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6);
}
.step {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-3) var(--space-6);
  transition: border-color .25s ease, transform .35s var(--ease);
}
.step:hover { border-color: var(--ink-3); }
.steps__note { margin-top: var(--space-4); }
.step__num { color: var(--accent-text); margin: var(--space-4) var(--space-3) 0; }
.step__title {
  font-family: var(--sans); font-weight: 600; font-size: 18px; line-height: 24px;
  margin: var(--space-2) var(--space-3) 0;
}
.step__body {
  font-family: var(--serif); font-size: 15px; line-height: 25px; color: var(--ink);
  margin: var(--space-2) var(--space-3) 0;
}

/* The illustration panel shared by the steps. */
.ill {
  position: relative; background: var(--cream);
  border-radius: calc(var(--radius-lg) - 6px);
  aspect-ratio: 16 / 10; overflow: hidden;
}
.ill svg { display: block; width: 100%; height: 100%; }
.ill__hint {
  position: absolute; right: 12px; bottom: 8px; font-size: 11px; color: var(--il-ink);
  opacity: 0; transform: translateY(4px); transition: opacity .3s ease, transform .3s ease;
}
.step:hover .ill__hint, .ill:focus-visible .ill__hint { opacity: .85; transform: none; }
.ill:focus-visible { outline-offset: 2px; }

.ill text { font-family: var(--sans); }
.il-label { font-size: 9px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; fill: var(--il-ink); }

/* Draw-on paths: pathLength="1" lets one dash cover any path. */
.wire, .trace, .sig, .ring, .check, .icon path {
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
/* Replays jump to the start without animating backwards. */
.ill.reset *, .ill.reset *::before { transition: none !important; }

/* Step 1 · Read */
.ill-read .doc rect { fill: var(--il-paper); stroke: var(--il-ink); stroke-width: 1; }
.ill-read .doc path { stroke: var(--il-faint); stroke-width: 3; }
.ill-read .doc { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .8s var(--ease); }
.ill-read .doc-1 { transform: translate(-3px, 3px); }
.ill-read .doc-2 { transform: translate(0, 0); }
.ill-read .doc-3 { transform: translate(3px, -3px); }
.is-on .ill-read .doc-1 { transform: translate(-10px, -2px) rotate(-10deg); }
.is-on .ill-read .doc-2 { transform: translate(6px, -8px) rotate(-1deg); }
.is-on .ill-read .doc-3 { transform: translate(22px, 0) rotate(9deg); }
.ill-read .wire { fill: none; stroke: var(--il-ink); stroke-width: 1; transition: stroke-dashoffset .8s var(--ease); }
.is-on .ill-read .wire { stroke-dashoffset: 0; }
.is-on .ill-read .w1 { transition-delay: .5s; }
.is-on .ill-read .w2 { transition-delay: .7s; }
.is-on .ill-read .w3 { transition-delay: .9s; }
.ill-read .row > rect:first-child { fill: var(--il-paper); stroke: var(--il-rule); }
.ill-read .row .fill { fill: var(--il-faint); transform-box: fill-box; transform-origin: left; transform: scaleX(0); transition: transform .6s var(--ease); }
.ill-read .row .tag { fill: var(--il-tint); stroke: var(--il-purple); stroke-width: 1; }
.ill-read .row .tag, .ill-read .row text { opacity: 0; transition: opacity .4s ease; }
.ill-read .row text { font-size: 8px; font-weight: 700; fill: var(--il-purple); text-anchor: middle; }
.is-on .ill-read .row .fill { transform: scaleX(1); }
.is-on .ill-read .row .tag, .is-on .ill-read .row text { opacity: 1; }
.is-on .ill-read .r1 .fill, .is-on .ill-read .r1 .tag, .is-on .ill-read .r1 text { transition-delay: 1.1s; }
.is-on .ill-read .r2 .fill, .is-on .ill-read .r2 .tag, .is-on .ill-read .r2 text { transition-delay: 1.3s; }
.is-on .ill-read .r3 .fill, .is-on .ill-read .r3 .tag, .is-on .ill-read .r3 text { transition-delay: 1.5s; }

/* Step 2 · Analyze (a table is measured, so it sits on white paper) */
.ill-analyze .t-bg { fill: var(--il-paper); }
.ill-analyze .t-head { fill: var(--il-head); }
.ill-analyze .t-key { fill: var(--il-tint); }
.ill-analyze .t-rule { stroke: var(--il-rule); stroke-width: 1; fill: none; }
.ill-analyze text { font-size: 9px; fill: var(--il-strong); font-variant-numeric: tabular-nums; }
.ill-analyze text.b { font-weight: 700; }
.ill-analyze .cell { cursor: pointer; outline: none; }
.ill-analyze .cell .hit { fill: transparent; stroke: transparent; stroke-width: 1.5; transition: fill .25s, stroke .25s; }
.ill-analyze .cell.on .hit { fill: rgba(91, 33, 182, .08); stroke: var(--il-purple); }
.ill-analyze .cell:focus-visible .hit { stroke: var(--il-purple); stroke-dasharray: 3 2; }
.ill-analyze .trace { fill: none; stroke: var(--il-purple); stroke-width: 1.5; transition: stroke-dashoffset .55s var(--ease); }
.ill-analyze .trace.on { stroke-dashoffset: 0; }
.ill-analyze .src { opacity: .45; transition: opacity .3s ease, transform .4s var(--ease); transform-box: fill-box; transform-origin: left center; }
.ill-analyze .src.on { opacity: 1; transform: translateX(-3px); }
.ill-analyze .src rect { fill: var(--il-paper); stroke: var(--il-rule); transition: stroke .3s; }
.ill-analyze .src.on rect { stroke: var(--il-purple); }
.ill-analyze .src .s1 { font-weight: 600; }
.ill-analyze .src .s2 { font-size: 8px; fill: var(--il-ink); }
@media (prefers-reduced-motion: no-preference) {
  .js .ill-analyze .t-wrap { opacity: 0; transform: translateY(6px); transition: opacity .6s ease, transform .6s var(--ease); }
  .js .is-on .ill-analyze .t-wrap { opacity: 1; transform: none; }
}

/* Step 3 · Judge */
.ill-judge .memo rect { fill: var(--il-paper); stroke: var(--il-ink); stroke-width: 1; }
.ill-judge .memo path { stroke: var(--il-faint); stroke-width: 3; fill: none; }
.ill-judge .memo .key { stroke: var(--il-purple); stroke-width: 2; }
.ill-judge .memo .sig { stroke: var(--il-strong); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke-dashoffset 1s ease .2s; }
.ill-judge .ring { fill: none; stroke: var(--il-gold); stroke-width: 3; transform-box: fill-box; transform-origin: center; transform: rotate(-90deg); transition: stroke-dashoffset .9s var(--ease) 1.1s; }
.ill-judge .disc { fill: var(--il-purple); transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .55s var(--ease) 1s; }
.ill-judge .check { fill: none; stroke: #FFFFFF; stroke-width: 4; stroke-linecap: square; transition: stroke-dashoffset .45s ease 1.5s; }
.ill-judge .who { font-size: 9px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; transition: opacity .4s ease; }
.ill-judge .who-ai { fill: var(--il-ink); }
.ill-judge .who-hj { fill: var(--il-purple); opacity: 0; }
.is-on .ill-judge .sig, .is-on .ill-judge .ring, .is-on .ill-judge .check { stroke-dashoffset: 0; }
.is-on .ill-judge .disc { transform: scale(1); }
.is-on .ill-judge .who-ai { opacity: 0; transition-delay: 1.6s; }
.is-on .ill-judge .who-hj { opacity: 1; transition-delay: 1.8s; }

/* ---------- Principles ---------- */
.principles {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6);
}
.principle { padding-top: var(--space-4); border-top: 1px solid var(--border); }
.icon {
  width: 48px; height: 48px; fill: none;
  stroke: var(--ink-2); stroke-width: 1.5; stroke-linecap: square;
  transition: transform .35s var(--ease);
}
.icon path { transition: stroke-dashoffset 1.1s var(--ease); }
.icon path:nth-child(2) { transition-delay: .25s; }
.icon path:nth-child(3) { transition-delay: .5s; }
.icon path:nth-child(4) { transition-delay: .75s; stroke: var(--accent-text); }
.principle:hover .icon { transform: translateY(-3px); }
.principle__title { font-family: var(--sans); font-weight: 600; font-size: 18px; line-height: 24px; margin: var(--space-3) 0 0; }
.principle__body { font-family: var(--serif); font-size: 16px; line-height: 26px; margin: var(--space-2) 0 0; max-width: 34ch; }

/* ---------- Contact ---------- */
.contact {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 80px);
  padding-bottom: clamp(72px, 10vw, 120px);
}
.form {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 32px);
}
.field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field .label { color: var(--ink-2); transition: color .2s; }
.field:focus-within .label { color: var(--accent-text); }
.opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-3); margin-left: var(--space-1); }
input, textarea {
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--control); border-radius: var(--radius-md);
  padding: 11px 14px; width: 100%; min-height: 48px;
  transition: border-color .15s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 128px; line-height: 1.5; }
input:hover, textarea:hover { border-color: var(--ink-2); }
input:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-tint); /* a focus ring, not a shadow */
}
/* Errors show only after interaction (:user-invalid) or a failed submit (.is-invalid). */
:is(input, textarea):is(:user-invalid, .is-invalid) { border-color: var(--status-error); }
.error-msg { display: none; margin: 0; font-size: 13px; line-height: 18px; color: var(--status-error); }
.error-msg::before { content: "✖ "; } /* glyph + word: never color alone */
:is(input, textarea):is(:user-invalid, .is-invalid) ~ .error-msg { display: block; }
@keyframes nudge { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form__foot { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-2); }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: inherit; font-weight: 600; font-size: 15px;
  color: #fff; background: var(--purple);
  border: 0; border-radius: var(--radius-md);
  padding: 12px 20px 12px 22px; cursor: pointer;
  transition: background-color .15s;
}
.btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; transition: transform .3s var(--ease); }
.btn:hover { background: var(--purple-hover); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { background: var(--purple-press); }
.btn[disabled] { opacity: .6; cursor: progress; }
.form__status { margin: 0; font-size: 14px; line-height: 20px; }
.form__status[data-tone="ok"]  { color: var(--status-success); background: var(--status-success-bg); padding: 8px 12px; border-radius: var(--radius-sm); }
.form__status[data-tone="err"] { color: var(--status-error); background: var(--status-error-bg); padding: 8px 12px; border-radius: var(--radius-sm); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer__row { display: flex; align-items: center; gap: var(--space-6); padding-block: var(--space-6); }
.footer__row img { width: 83px; flex-shrink: 0; }
.footer__row { justify-content: space-between; }
.footer__meta { display: flex; align-items: center; gap: var(--space-6); }
.footer__meta a { color: var(--ink-2); text-decoration: none; }
.footer__meta a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Scroll motion ----------
   Opt-in: the hidden "before" states exist only with JS AND no reduced-motion preference, so
   without either everything is simply shown in its final state. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .js [data-reveal] {
    opacity: 0; transform: translateY(16px);
    transition: opacity .8s ease, transform .9s var(--ease);
    transition-delay: var(--d, 0ms);
  }
  .js [data-reveal].in { opacity: 1; transform: none; }
  .js .rule-draw::before, .js .rule-top::before { transform: scaleX(0); }
  .js .in.rule-draw::before, .js .in.rule-top::before { transform: scaleX(1); }
  .js .headline .w { opacity: 0; transform: translateY(.45em); transition: opacity .6s ease, transform .8s var(--ease); transition-delay: calc(var(--i) * 55ms + 80ms); }
  .js .headline.in .w { opacity: 1; transform: none; }
  .js .icon path { stroke-dashoffset: 1; }
  .js .in .icon path { stroke-dashoffset: 0; }
  .form__status:not(:empty) { animation: rise .4s var(--ease) both; }
  :is(:user-invalid, .is-invalid) { animation: nudge .35s ease; }
}
.icon path { stroke-dashoffset: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Reduced motion: the drawings still explain, so they jump straight to their end state;
   only movement is removed. Color transitions (links, buttons, focus) are kept. */
@media (prefers-reduced-motion: reduce) {
  .ill *, .icon, .icon path, .masthead__nav::after, .btn svg, .rule-draw::before, .rule-top::before { transition: none !important; }
  .principle:hover .icon, .btn:hover svg { transform: none; }
}


/* ---------- Utilities ---------- */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important; clip-path: inset(50%) !important; overflow: hidden !important;
  width: 1px !important; height: 1px !important; margin: -1px !important;
  padding: 0 !important; border: 0 !important; white-space: nowrap !important;
}

/* Pause / Play for the hero animation (WCAG 2.2.2: motion over 5s needs a stop control) */
.flow__pause, .ill__replay {
  position: absolute; z-index: 1;
  font: inherit; font-size: 12px; font-weight: 600; line-height: 16px;
  color: var(--il-ink); background: var(--il-paper);
  border: 1px solid var(--il-rule); border-radius: var(--radius-sm);
  padding: 6px 10px; min-height: 32px; cursor: pointer;
  transition: border-color .2s;
}
.flow__pause { right: 16px; bottom: 30px; }
.flow__pause:hover, .ill__replay:hover { border-color: var(--il-ink); }
.ill__replay { right: 10px; bottom: 10px; opacity: 0; transition: opacity .25s ease, border-color .2s; }
.step:hover .ill__replay, .ill__replay:focus-visible { opacity: 1; }
@media (hover: none) { .ill__replay { opacity: 1; } }

.form__note { margin: 0; }
.form__privacy a, .form__note a { color: var(--accent-text); }

/* ---------- Breadcrumbs ---------- */
.crumbs { padding-top: clamp(32px, 5vw, 48px); max-width: 820px; font-size: 13px; line-height: 18px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.crumbs li { display: flex; align-items: center; gap: var(--space-2); color: var(--ink-2); }
.crumbs li + li::before { content: "/"; color: var(--ink-3); }
.crumbs a { color: var(--accent-text); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current="page"] { color: var(--ink); }

/* ---------- Document pages (privacy, 404) ---------- */
.doc-page { padding-block: clamp(24px, 4vw, 40px) clamp(72px, 10vw, 120px); max-width: 820px; }
.doc-page h1 { margin-top: var(--space-4); }
.doc-page h2 { font-family: var(--sans); font-weight: 600; font-size: 20px; line-height: 28px; margin: 40px 0 0; padding-top: var(--space-4); border-top: 1px solid var(--border); }
.doc-page p, .doc-page li { font-family: var(--serif); font-size: 16px; line-height: 28px; max-width: var(--measure); }
.doc-page ul { padding-left: 1.2em; }
.doc-page a { color: var(--accent-text); }
.doc-page .updated { color: var(--ink-2); margin-top: var(--space-2); }

/* Font fallback stability (Sora). Serif text keeps Newsreader's own size-adjust. */
body { font-size-adjust: from-font; }
.lead, .body, .step__body, .principle__body, .doc-page p, .doc-page li { font-size-adjust: none; }

/* ---------- Narrow ---------- */
@media (max-width: 960px) {
  .steps { grid-template-columns: 1fr; max-width: 560px; }
  .masthead__nav { display: none; }
}
@media (max-width: 860px) {
  .contact { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .masthead__logo img { width: 180px; }
  .masthead__meta { gap: var(--space-2); }
  .keyrow { grid-template-columns: 1fr; gap: var(--space-3); }
  .form { grid-template-columns: 1fr; }
  .flow__stage { aspect-ratio: 4 / 3; }
  .flow__tag { font-size: 10px; letter-spacing: 1px; }
  .flow__tag--ai, .wide-only { display: none; }
  .footer__row { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
}
@media (max-width: 400px) {
  .masthead__logo img { width: 180px; }
  .masthead__link { padding: 6px 8px; }
}
