/* MathIDE landing. Native CSS, no build step.
   Type: self-hosted Geist + Geist Mono (SIL OFL, fonts/LICENSE.txt). Icons: Phosphor Light subset (MIT, icons/LICENSE.txt).
   Theme: light only, set once on :root. No dark sections, no black surfaces.
   Colour: one accent, pine #1d6b58 (hsl 165 57% 27%), used for every accent on the page. Neutrals are tinted
     toward the same pine hue; text is a deep pine ink. The only other hue is the semantic error red.
   Shape system (followed everywhere):
     pill   every action and chip: buttons, nav pill, nav links, badges, eyebrow, inline code
     28px   bezel shells (outer tray of a double-bezel container, 6px padding)
     22px   bezel cores (inner plate, concentric with the shell)
     14px   anything nested inside a core: code blocks, inputs, map nodes, detail panel, form panel, icon tiles
   Motion: custom cubic-beziers only. Everything collapses under prefers-reduced-motion.
   Z-index scale: nav 40, grain 60, skip link 70. */

@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;

  --bg: #f4f8f6;
  --surface: #fcfdfc;
  --mint: #e6f1ec;
  --code-bg: #eef5f1;
  --ink: #0f2a23;
  --ink-2: #284139;
  --muted: #4b6159;
  --field: #7a8f88;
  --pine: #1d6b58;
  --pine-hover: #175a4a;
  --pine-ink: #f4faf7;
  --pine-wash: rgba(29, 107, 88, 0.08);
  --glow: rgba(126, 201, 171, 0.3);
  --ring: rgba(15, 42, 35, 0.07);
  --ring-strong: rgba(15, 42, 35, 0.12);
  --error: #a3392b;

  --r-shell: 28px;
  --r-core: 22px;
  --r-inner: 14px;
  --r-pill: 999px;

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-soft: 0 1px 1px rgba(15, 42, 35, 0.03), 0 12px 32px -14px rgba(20, 74, 60, 0.16), 0 40px 80px -40px rgba(20, 74, 60, 0.2);
  --shadow-lift: 0 0 0 1px var(--ring-strong), 0 10px 24px -12px rgba(20, 74, 60, 0.32);

  --gutter: clamp(16px, 4vw, 40px);
  --z-nav: 40;
  --z-grain: 60;
  --z-skip: 70;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6.5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: clip;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(58rem 38rem at 92% -4%, var(--glow), transparent 62%),
    radial-gradient(46rem 34rem at -10% 14%, rgba(29, 107, 88, 0.07), transparent 64%);
  background-repeat: no-repeat;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Grain: fixed, pointer-events-none, never on a scrolling container */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .06 0 0 0 0 .16 0 0 0 0 .14 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

img { max-width: 100%; }
a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: rgba(29, 107, 88, 0.2); color: var(--ink); }
:focus-visible { outline: 2px solid var(--pine); outline-offset: 3px; }

h1, h2, h3 { text-wrap: balance; color: var(--ink); }
p { text-wrap: pretty; }

.wrap { width: 100%; max-width: calc(1200px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: var(--gutter); top: 0.75rem; z-index: var(--z-skip);
  padding: 0.7rem 1.15rem; border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font-weight: 550; text-decoration: none;
  box-shadow: var(--shadow-lift);
  transform: translateY(-180%);
  transition: transform 400ms var(--ease);
}
.skip:focus { transform: none; }

/* ---------- Double-bezel (outer tray + inner plate) ---------- */
.bezel {
  padding: 6px;
  border-radius: var(--r-shell);
  background: rgba(29, 107, 88, 0.05);
  box-shadow: inset 0 0 0 1px rgba(15, 42, 35, 0.06), var(--shadow-soft);
}
.core {
  border-radius: var(--r-core);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--ring), inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(15, 42, 35, 0.04);
}
.tile {
  flex: none;
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: var(--r-inner);
  background: var(--pine-wash);
  color: var(--pine);
  font-size: 1.45rem;
  box-shadow: inset 0 0 0 1px rgba(29, 107, 88, 0.12);
}

/* ---------- Buttons: pill with button-in-button trailing icon ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.9rem;
  min-height: 3.25rem;
  padding: 0.375rem 0.375rem 0.375rem 1.4rem;
  border: 0; border-radius: var(--r-pill);
  background: var(--pine); color: var(--pine-ink);
  font: inherit; font-size: 1rem; font-weight: 550; line-height: 1; letter-spacing: -0.01em;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(15, 42, 35, 0.08), 0 12px 26px -12px rgba(29, 107, 88, 0.6);
  transition: transform 500ms var(--ease), background-color 400ms var(--ease), box-shadow 500ms var(--ease);
}
.btn:hover { background: var(--pine-hover); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(15, 42, 35, 0.08), 0 18px 34px -14px rgba(29, 107, 88, 0.7); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-ico {
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; border-radius: var(--r-pill);
  background: rgba(244, 250, 247, 0.14);
  box-shadow: inset 0 0 0 1px rgba(244, 250, 247, 0.16);
  font-size: 1.125rem;
  transition: transform 500ms var(--ease), background-color 400ms var(--ease);
}
.btn:hover .btn-ico { transform: translate(3px, -1px) scale(1.05); background: rgba(244, 250, 247, 0.22); }
.btn-sm { min-height: 2.75rem; padding-left: 1.1rem; gap: 0.65rem; font-size: 0.9375rem; }
.btn-sm .btn-ico { width: 2rem; height: 2rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: space-between; }
.btn[disabled] { cursor: progress; opacity: 0.72; transform: none; }

/* ---------- Notice + floating pill nav ---------- */
.notice {
  margin: 0;
  padding: 0.6rem var(--gutter);
  text-align: center; text-wrap: balance;
  font-size: 0.8125rem; line-height: 1.45; color: var(--ink-2);
  background: rgba(29, 107, 88, 0.07);
  box-shadow: inset 0 -1px 0 var(--ring);
}

.nav { position: sticky; top: 0; z-index: var(--z-nav); padding: 0.875rem var(--gutter) 0; pointer-events: none; }
.nav-pill {
  position: relative; z-index: 2; pointer-events: auto;
  display: flex; align-items: center; gap: 0.5rem;
  width: max-content; max-width: 100%;
  margin-inline: auto;
  padding: 6px 6px 6px 12px;
  border-radius: var(--r-pill);
  background: rgba(252, 253, 252, 0.74);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 0 0 1px var(--ring-strong), inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 14px 34px -18px rgba(20, 74, 60, 0.35);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding-right: 0.4rem; border-radius: var(--r-pill);
  color: var(--ink); text-decoration: none;
  font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.025em;
}
.brand:hover { text-decoration: none; }
.brand-mark { display: block; width: 28px; height: 28px; border-radius: 9px; }
.nav-links { display: flex; align-items: center; gap: 0.15rem; margin-inline: 0.6rem; }
.nav-links a {
  padding: 0.55rem 0.85rem; border-radius: var(--r-pill);
  color: var(--muted); text-decoration: none; font-size: 0.9375rem; font-weight: 500;
  transition: color 300ms var(--ease), background-color 300ms var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); background: var(--pine-wash); }

.menu-toggle {
  display: none; position: relative; flex: none;
  width: 2.75rem; height: 2.75rem; padding: 0;
  border: 0; border-radius: var(--r-pill);
  background: var(--pine-wash); cursor: pointer;
}
.menu-toggle span {
  position: absolute; left: 50%; top: 50%;
  width: 1.05rem; height: 1.5px; margin: -0.75px 0 0 -0.525rem;
  border-radius: 2px; background: var(--ink);
  transition: transform 500ms var(--ease);
}
.menu-toggle span:first-child { transform: translateY(-3.5px); }
.menu-toggle span:last-child { transform: translateY(3.5px); }
.menu-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column; justify-content: center; gap: 0.2rem;
  padding: 6rem calc(var(--gutter) + 0.5rem) 3rem;
  background: rgba(244, 248, 246, 0.86);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  backdrop-filter: blur(28px) saturate(1.4);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 500ms var(--ease), visibility 0s var(--ease) 500ms;
}
.menu a {
  align-self: flex-start;
  margin-left: -0.6rem; padding: 0.3rem 0.6rem; border-radius: var(--r-pill);
  color: var(--ink); text-decoration: none;
  font-size: clamp(2rem, 9vw, 2.75rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1.15;
  opacity: 0; transform: translateY(2.5rem);
  transition: transform 700ms var(--ease-out), opacity 700ms var(--ease-out);
}
.menu-open { overflow: hidden; }
.menu-open .menu { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 500ms var(--ease), visibility 0s var(--ease); }
.menu-open .menu a { opacity: 1; transform: none; }
.menu-open .menu a:nth-child(2) { transition-delay: 60ms; }
.menu-open .menu a:nth-child(3) { transition-delay: 120ms; }
.menu-open .menu a:nth-child(4) { transition-delay: 180ms; }

/* ---------- Type ---------- */
h1 {
  margin: 0;
  font-size: clamp(2.5rem, 4vw, 3.2rem);
  line-height: 1.02; letter-spacing: -0.045em; font-weight: 600;
}
h1 .line { display: block; }
.accent { color: var(--pine); }
h2 {
  margin: 0 0 1.25rem; max-width: 18ch;
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  line-height: 1.04; letter-spacing: -0.04em; font-weight: 600;
}
h3 { margin: 0; font-size: 1.1875rem; line-height: 1.3; letter-spacing: -0.02em; font-weight: 600; }
.section-body { margin: 0 0 1rem; max-width: 58ch; color: var(--muted); font-size: 1.125rem; line-height: 1.65; }
.eyebrow {
  display: inline-flex; margin: 0 0 1.25rem; padding: 0.38rem 0.85rem;
  border-radius: var(--r-pill);
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--pine); background: var(--pine-wash); box-shadow: inset 0 0 0 1px rgba(29, 107, 88, 0.14);
}
code {
  font-family: var(--mono); font-size: 0.86em;
  padding: 0.1em 0.5em; border-radius: var(--r-pill);
  background: var(--pine-wash); color: var(--pine);
}

section { padding-block: clamp(4.5rem, 8vw, 7rem) clamp(5rem, 9vw, 7.75rem); }

/* ---------- Hero: asymmetric split, copy left, framed product shot right ---------- */
.hero { padding-block: clamp(2.5rem, 5.5vw, 4.25rem) clamp(4.5rem, 9vw, 7rem); }
.hero-grid { display: grid; grid-template-columns: minmax(min(26rem, 100%), 6fr) minmax(0, 10fr); gap: clamp(2.5rem, 4.5vw, 3.5rem); align-items: center; }
.lede {
  margin: 1.5rem 0 2.25rem; max-width: 27ch;
  font-size: clamp(1.125rem, 1.5vw, 1.3125rem); line-height: 1.5; letter-spacing: -0.012em;
  color: var(--muted); text-wrap: balance;
}
.hero-shot { margin: 0; }
.shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 1.5rem; text-align: center;
  background:
    radial-gradient(70% 90% at 12% 0%, rgba(126, 201, 171, 0.34), transparent 62%),
    radial-gradient(60% 80% at 100% 100%, rgba(29, 107, 88, 0.13), transparent 66%),
    linear-gradient(180deg, #f9fbfa, #eaf3ee);
}
.shot-empty::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(15, 42, 35, 0.13) 1px, transparent 1.4px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(closest-side, #fff 30%, transparent);
  mask-image: radial-gradient(closest-side, #fff 30%, transparent);
}
.shot-empty > * { position: relative; }
.shot-ico {
  display: grid; place-items: center;
  width: 3.5rem; height: 3.5rem; margin-bottom: 0.6rem;
  border-radius: var(--r-inner);
  background: var(--surface); color: var(--pine); font-size: 1.6rem;
  box-shadow: var(--shadow-lift);
}
.shot-title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.shot-sub { max-width: 34ch; font-size: 0.875rem; color: var(--muted); text-wrap: balance; }

/* ---------- Approach: sticky statement + live proof loop, rules tray ---------- */
.approach-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(3rem, 6vw, 5.5rem); align-items: start; }
.approach-lead { position: sticky; top: 6.5rem; }

.loop-fig { margin: 2.5rem 0 0; }
.loop { overflow: hidden; background: var(--code-bg); font-family: var(--mono); font-size: 0.8125rem; }
.loop-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 0.5rem 0.5rem 1.15rem;
  color: var(--muted); background: rgba(252, 253, 252, 0.7);
  box-shadow: inset 0 -1px 0 var(--ring);
}
.loop-bar button {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.8rem; border: 0; border-radius: var(--r-pill);
  font: inherit; color: var(--pine); background: var(--pine-wash); cursor: pointer;
  transition: background-color 300ms var(--ease);
}
.loop-bar button:hover { background: rgba(29, 107, 88, 0.14); }
.loop-code { margin: 0; padding: 1.25rem 1.3rem; overflow-x: auto; font-family: var(--mono); font-size: 0.9375rem; line-height: 1.8; color: var(--ink); }
.loop-code .k { color: var(--pine); font-weight: 600; }
.caret { display: inline-block; width: 0.55ch; height: 1.1em; margin-left: 1px; vertical-align: -0.18em; border-radius: 1px; background: var(--pine); }
.loop-out {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 3.25rem; padding: 0.6rem 0.6rem 0.6rem 1.3rem;
  background: rgba(252, 253, 252, 0.7); box-shadow: inset 0 1px 0 var(--ring);
}
.loop-msg { color: var(--muted); }
.loop-msg.err { color: var(--error); }
.loop-msg.ok { color: var(--pine); }
.badge {
  flex: none; padding: 0.35rem 0.8rem; border-radius: var(--r-pill);
  font-family: var(--sans); font-size: 0.75rem; font-weight: 600;
  color: var(--muted); box-shadow: inset 0 0 0 1px var(--ring-strong);
  transition: background-color 400ms var(--ease), color 400ms var(--ease);
}
.badge.err { color: var(--error); background: rgba(163, 57, 43, 0.06); box-shadow: inset 0 0 0 1px rgba(163, 57, 43, 0.3); }
.badge.ok { color: var(--pine-ink); background: var(--pine); box-shadow: none; }
.loop-fig figcaption { margin-top: 0.9rem; max-width: 52ch; font-size: 0.875rem; color: var(--muted); }

.rules { list-style: none; margin: 0; padding: 0.4rem clamp(1.25rem, 2.6vw, 2.1rem); }
.rules li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.15rem; padding: 1.65rem 0; }
.rules li + li { box-shadow: inset 0 1px 0 var(--ring-strong); }
.rules p { margin: 0.45rem 0 0; color: var(--muted); font-size: 1rem; }

/* ---------- Proof map: full-width interactive canvas with a detail panel ---------- */
.mapsec { background: radial-gradient(52rem 30rem at 50% 62%, rgba(126, 201, 171, 0.16), transparent 70%); }
.sec-head { max-width: 48rem; }
.map-shell { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.map-core {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem);
  overflow: hidden;
  background-color: var(--code-bg);
  background-image:
    radial-gradient(rgba(15, 42, 35, 0.11) 1px, transparent 1.3px),
    radial-gradient(80% 100% at 30% 0%, rgba(126, 201, 171, 0.26), transparent 70%);
  background-size: 22px 22px, 100% 100%;
}
.map-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.map { position: relative; min-width: 640px; height: 26rem; margin-inline: clamp(1rem, 2.5vw, 2rem); }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map line {
  stroke: rgba(29, 107, 88, 0.38); stroke-width: 1.5; stroke-dasharray: 4 5;
  vector-effect: non-scaling-stroke;
  transition: stroke 400ms var(--ease);
}
.map line.active { stroke: var(--pine); stroke-width: 2; stroke-dasharray: none; }
.node {
  position: absolute; transform: translate(-50%, -50%);
  max-width: 12rem; padding: 0.7rem 1rem;
  font: inherit; font-size: 0.9rem; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; text-align: center;
  color: var(--ink); background: var(--surface);
  border: 0; border-radius: var(--r-inner); cursor: pointer;
  box-shadow: var(--shadow-lift);
  transition: transform 500ms var(--ease), background-color 400ms var(--ease), color 400ms var(--ease), box-shadow 400ms var(--ease);
}
.node:hover { transform: translate(-50%, calc(-50% - 3px)); box-shadow: 0 0 0 1px rgba(29, 107, 88, 0.45), 0 16px 30px -14px rgba(20, 74, 60, 0.4); }
.node:active { transform: translate(-50%, -50%) scale(0.98); }
.node[aria-pressed="true"] { color: var(--pine-ink); background: var(--pine); box-shadow: 0 0 0 4px rgba(29, 107, 88, 0.16), 0 16px 30px -14px rgba(29, 107, 88, 0.65); }
.map-detail {
  margin: 8px; padding: clamp(1.5rem, 2.5vw, 2rem);
  border-radius: var(--r-inner);
  background: rgba(252, 253, 252, 0.94);
  box-shadow: 0 0 0 1px var(--ring), 0 12px 30px -20px rgba(20, 74, 60, 0.4);
}
.md-kicker { margin: 0 0 1rem; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.map-detail h3 { margin-bottom: 0.65rem; font-size: 1.25rem; }
.map-detail #md-text { margin: 0; color: var(--muted); }
.map-note { margin: 1rem 0 0; font-size: 0.875rem; color: var(--muted); }

/* ---------- Features: asymmetric bento, three cells, three surfaces ---------- */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.cell { display: flex; }
.cell > .core { flex: 1; display: flex; flex-direction: column; gap: 1.25rem; padding: clamp(1.75rem, 3vw, 2.5rem); }
.cell p { margin: 0.6rem 0 0; color: var(--muted); max-width: 46ch; }
.cell-lead { grid-column: 1 / span 7; }
.cell-paper { grid-column: 8 / span 5; grid-row: 1 / span 2; }
.cell-editor { grid-column: 1 / span 7; }
.cell-lead > .core {
  min-height: 17rem; justify-content: space-between;
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(150, 215, 190, 0.2), transparent 55%),
    linear-gradient(160deg, #1f705c, #1a6352);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(15, 42, 35, 0.1);
}
.cell-lead h3 { color: var(--pine-ink); font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -0.03em; }
.cell-lead p { color: rgba(244, 250, 247, 0.9); }
.cell-lead .tile { color: var(--pine-ink); background: rgba(244, 250, 247, 0.12); box-shadow: inset 0 0 0 1px rgba(244, 250, 247, 0.2); }
.tex {
  margin: auto 0 0; padding: 1.25rem 1.35rem; overflow-x: auto;
  border-radius: var(--r-inner);
  font-family: var(--mono); font-size: 0.875rem; line-height: 1.85; color: var(--ink);
  background: var(--code-bg); box-shadow: inset 0 0 0 1px var(--ring);
}
.tex .k { color: var(--pine); font-weight: 600; }
.tex .c { color: var(--muted); }
.cell-editor > .core {
  justify-content: space-between;
  background:
    radial-gradient(90% 130% at 0% 100%, rgba(126, 201, 171, 0.34), transparent 60%),
    var(--mint);
}

/* ---------- Questions: side-by-side list, every answer visible ---------- */
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(2.5rem, 6vw, 5rem); margin-top: clamp(2.25rem, 4.5vw, 3.25rem); }
.qa { padding: 1.75rem 0 2.1rem; box-shadow: inset 0 1px 0 var(--ring-strong); }
.qa p { margin: 0.65rem 0 0; max-width: 54ch; color: var(--muted); }

/* ---------- Request: tinted tray, copy left, form panel right ---------- */
.request { padding-top: clamp(3rem, 6vw, 5rem); }
.request-core {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2.5rem, 5vw, 4.5rem); align-items: start;
  padding: clamp(1.5rem, 5vw, 4.5rem);
  background:
    radial-gradient(70% 110% at 0% 0%, rgba(126, 201, 171, 0.34), transparent 60%),
    radial-gradient(60% 90% at 100% 100%, rgba(29, 107, 88, 0.12), transparent 65%),
    var(--mint);
}
.request-copy h2 { max-width: 12ch; }

#demo-form {
  display: grid; gap: 1.35rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: var(--r-inner);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--ring), 0 24px 50px -28px rgba(20, 74, 60, 0.4);
}
.field { display: grid; gap: 0.5rem; }
label { font-size: 0.9375rem; font-weight: 550; color: var(--ink); }
.help { margin: 0; font-size: 0.875rem; color: var(--muted); }
input[type="email"], select, textarea {
  width: 100%; padding: 0.8rem 1rem;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field); border-radius: var(--r-inner);
  transition: border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}
input[type="email"]:hover, select:hover, textarea:hover { border-color: var(--muted); }
input[type="email"]:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--pine);
  box-shadow: 0 0 0 1px var(--pine), 0 0 0 5px rgba(29, 107, 88, 0.18);
}
textarea { min-height: 7rem; resize: vertical; }
.select { position: relative; }
.select select { -webkit-appearance: none; appearance: none; padding-right: 2.75rem; cursor: pointer; }
.select .ph-light { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 1.1rem; color: var(--muted); }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.75rem; align-items: start; font-weight: 400; color: var(--ink-2); }
.check input { width: 1.15rem; height: 1.15rem; margin: 0.22rem 0 0; accent-color: var(--pine); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { margin: 0; font-size: 0.9375rem; }
.status:empty { margin-top: -1.35rem; } /* stays in the accessibility tree, takes no space */
.status.ok { color: var(--pine); font-weight: 600; }
.status.err { color: var(--error); font-weight: 550; }
#demo-form.done > :not(.status) { display: none; }

/* ---------- Footer ---------- */
.foot { padding: 0 0 3rem; font-size: 0.9375rem; color: var(--muted); }
.foot-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-top: 2rem;
  background: linear-gradient(var(--ring-strong), var(--ring-strong)) 50% 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}
.foot-brand { display: inline-flex; align-items: center; gap: 0.65rem; }
.foot-brand .brand-mark { width: 22px; height: 22px; border-radius: 7px; }
.foot a { color: var(--ink-2); font-weight: 500; text-decoration: none; }
.foot a:hover { color: var(--pine); text-decoration: underline; }

/* ---------- Privacy page ---------- */
.prose { max-width: 68ch; padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(4rem, 9vw, 6.5rem); }
.prose h1 { margin-bottom: 1.25rem; font-size: clamp(2.25rem, 5vw, 3.25rem); }
.prose h2 { max-width: none; margin: 2.5rem 0 0.6rem; font-size: 1.375rem; letter-spacing: -0.02em; }
.prose p, .prose li { color: var(--muted); }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.4rem; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0; transform: translateY(2.5rem); filter: blur(8px);
    transition: opacity 1000ms var(--ease-out), transform 1100ms var(--ease-out), filter 1000ms var(--ease-out);
  }
  .js [data-reveal="2"] { transition-delay: 90ms; }
  .js [data-reveal="3"] { transition-delay: 180ms; }
  .js [data-reveal].in { opacity: 1; transform: none; filter: none; }

  .hero h1, .hero .lede, .hero-copy .btn, .hero-shot { animation: rise 1100ms var(--ease-out) backwards; }
  .hero .lede { animation-delay: 90ms; }
  .hero-copy .btn { animation-delay: 170ms; }
  .hero-shot { animation-delay: 260ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(1.75rem); filter: blur(8px); } }

  .caret { animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }

  .map-detail.swap > * { animation: swap 600ms var(--ease-out) backwards; }
  .map-detail.swap > :nth-child(3) { animation-delay: 60ms; }
  @keyframes swap { from { opacity: 0; transform: translateY(0.5rem); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
}

/* ---------- Responsive ---------- */
@media (min-width: 900px) {
  .menu { display: none; }
}
@media (min-width: 1024px) {
  h1 .line { white-space: nowrap; } /* each sentence holds one line beside the product frame */
}
@media (max-width: 1023px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .lede { max-width: 36ch; }
  .approach-grid { grid-template-columns: minmax(0, 1fr); }
  .approach-lead { position: static; }
  .map-core { grid-template-columns: minmax(0, 1fr); }
  .request-core { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .nav-links { display: none; }
  .menu-toggle { display: block; }
  .nav-pill { width: 100%; }
  .nav-pill .btn-sm { margin-left: auto; }
}
@media (max-width: 767px) {
  :root { --gutter: 16px; }
  section { padding-block: 4.5rem 5rem; }
  .hero { padding-block: 2.25rem 4rem; }
  .bento { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .cell-lead, .cell-paper, .cell-editor { grid-column: auto; grid-row: auto; }
  .cell-lead > .core { min-height: 0; }
  .faq { grid-template-columns: minmax(0, 1fr); }
  /* Proof map becomes an indented tree: no clipped canvas, no sideways scroll */
  .map-scroll { overflow: visible; }
  .map { min-width: 0; height: auto; margin: 0; padding: 1.25rem 1rem 1rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.55rem; }
  .map svg { display: none; }
  .node { --indent: 0rem; position: relative; left: auto !important; top: auto !important; transform: none; max-width: calc(100% - var(--indent)); margin-left: var(--indent); font-size: 0.875rem; text-align: left; }
  .node[data-depth="1"] { --indent: 1.4rem; }
  .node[data-depth="2"] { --indent: 2.8rem; }
  .node[data-depth="1"]::before, .node[data-depth="2"]::before { content: ""; position: absolute; right: 100%; top: 50%; width: 0.9rem; height: 1px; margin-right: 0.3rem; background: rgba(29, 107, 88, 0.45); }
  .node:hover { transform: translateY(-2px); }
  .node:active { transform: scale(0.98); }
  .request-core { padding: 1.5rem 0.625rem 0.625rem; }
  .request-copy { padding-inline: 0.75rem; }
  #demo-form { padding: 1.25rem; }
  .loop-code { font-size: 0.875rem; padding-inline: 1rem; }
}
@media (max-width: 480px) {
  .nav-pill { padding-left: 10px; }
  .nav-pill .btn-sm { padding-right: 1rem; }
  .nav-pill .btn-sm .btn-ico { display: none; }
}
