/* ==========================================================================
   Clean Lava — design system
   Layers: tokens → fonts → base → layout → header/footer → components →
           sections → docs → responsive (desktop-first) → motion
   ========================================================================== */

/* ----- 1. Tokens ----- */
:root {
  /* Color — white, black, lava red. Red is scarce on purpose. */
  --paper: #FAFAF8;
  --paper-2: #F2F0EB;
  --ink: #0A0A0A;
  --ink-2: #43403B;
  --ink-3: #716C64;
  --line: #E3E0D9;
  --lava: #E8402D;        /* accent: marks, rules, non-text */
  --lava-deep: #B81E0C;   /* text-safe red: links, button bg (AA on paper, white on it) */

  /* Dark-section palette */
  --coal: #0B0A09;
  --coal-2: #171512;
  --coal-text: #F4F2ED;
  --coal-muted: #A39E95;
  --coal-line: #292622;

  /* Type */
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-text: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* Rhythm */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 7rem;
  --container: 1240px;
  --radius: 6px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ----- 2. Fonts (self-hosted) ----- */
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/dm-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ----- 3. Base ----- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }

a { color: var(--lava-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--lava);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--lava); color: #fff; }

code, pre, kbd { font-family: var(--font-mono); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ----- 4. Layout ----- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.section { padding-block: var(--space-7); }

.section--dark {
  background: var(--coal);
  color: var(--coal-text);
}
.section--dark ::selection { background: var(--lava); color: #fff; }

.section--tint { background: var(--paper-2); }

/* Section header pattern: kicker + big serif headline + lede */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--space-3);
}
.kicker::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--lava);
}
.section--dark .kicker { color: var(--coal-muted); }

.headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 4.2vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.005em;
  max-width: 22ch;
}
.headline em {
  font-style: italic;
  color: var(--lava-deep);
}
.section--dark .headline em { color: var(--lava); }

.lede {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 62ch;
  margin-top: var(--space-3);
}
.section--dark .lede { color: var(--coal-muted); }

/* ----- 5. Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(10, 10, 10, 0.02);
}
.site-header__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 0 var(--space-4);
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
}
.wordmark:hover { text-decoration: none; }
.wordmark__mark {
  width: 22px; height: 22px;
  background: url("/assets/brand/logo.svg") center / contain no-repeat;
  align-self: center;
  flex: 0 0 auto;
}
/* Dark surfaces (footer): the black ribbon would vanish, so use the reverse mark. */
.site-footer .wordmark__mark {
  background-image: url("/assets/brand/logo-reverse-256.png");
}

.site-nav { display: flex; align-items: center; gap: var(--space-4); }
.site-nav a {
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--ink); }

.nav-toggle { display: none; }

/* ----- 6. Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-text);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease,
              color 0.2s ease, transform 0.2s var(--ease-out);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--lava { background: var(--lava-deep); color: #fff; }
.btn--lava:hover { background: #9E1806; color: #fff; }

.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }

.section--dark .btn--ghost,
.page-hero--dark .btn--ghost,
.hero .btn--ghost { border-color: var(--coal-line); color: var(--coal-text); }
.section--dark .btn--ghost:hover,
.page-hero--dark .btn--ghost:hover,
.hero .btn--ghost:hover { border-color: var(--coal-text); color: var(--coal-text); }

.btn--sm { padding: 0.55rem 1.1rem; font-size: 0.875rem; }

/* ----- 7. Hero ----- */
.hero {
  background: var(--coal);
  color: var(--coal-text);
  position: relative;
  overflow: hidden;
  padding-block: var(--space-7) var(--space-6);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-6);
  align-items: center;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 6vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.hero__title em { font-style: italic; color: var(--lava); }
.hero__lede {
  margin-top: var(--space-4);
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--coal-muted);
  max-width: 54ch;
}
.hero__actions {
  margin-top: var(--space-5);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--coal-muted);
  border: 1px solid var(--coal-line);
  border-radius: 100px;
  padding: 0.45rem 1rem;
  margin-bottom: var(--space-4);
}
.hero__eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lava);
}

/* Hero figure: the lava seam — an SVG line that draws itself */
.hero__figure svg { width: 100%; height: auto; }
.lava-seam {
  stroke: var(--lava);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
}
.js .lava-seam {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  transition: stroke-dashoffset 2.4s var(--ease-out) 0.3s;
}
.js .is-drawn .lava-seam { stroke-dashoffset: 0; }
.hero-node { fill: var(--coal-2); stroke: var(--coal-line); }
.hero-node-label { font-family: var(--font-mono); font-size: 11px; fill: var(--coal-muted); }
.hero-node-strong { fill: var(--coal-text); }

/* Compliance strip under hero */
.strip {
  border-top: 1px solid var(--coal-line);
  background: var(--coal);
  color: var(--coal-muted);
}
.strip__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.strip__item { display: inline-flex; align-items: center; gap: 0.55rem; }
.strip__item::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--lava);
  clip-path: polygon(50% 0, 100% 62%, 82% 100%, 18% 100%, 0 62%);
}

/* ----- 8. Cards ----- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color 0.25s ease, transform 0.3s var(--ease-out);
}
a.card { color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--ink); transform: translateY(-3px); }

.card__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.card h3 { font-size: 1.3125rem; }
.card p { color: var(--ink-2); font-size: 0.9688rem; }
.card__cta {
  margin-top: auto;
  padding-top: var(--space-2);
  font-weight: 600;
  font-size: 0.9063rem;
  color: var(--lava-deep);
}
a.card:hover .card__cta::after { transform: translateX(4px); }
.card__cta::after {
  content: "→";
  display: inline-block;
  margin-left: 0.4rem;
  transition: transform 0.25s var(--ease-out);
}

.badge {
  display: inline-block;
  font-size: 0.7188rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lava-deep);
  border: 1px solid currentColor;
  border-radius: 100px;
  padding: 0.15rem 0.6rem;
}

/* Dark cards */
.section--dark .card {
  background: var(--coal-2);
  border-color: var(--coal-line);
}
.section--dark .card p { color: var(--coal-muted); }
.section--dark a.card:hover { border-color: var(--coal-muted); }
.section--dark .card__meta { color: var(--coal-muted); }
.section--dark .card__cta { color: var(--lava); }

/* ----- 9. Persona explorer (tabs) ----- */
.personas { margin-top: var(--space-6); }
.personas__layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: var(--space-5);
  align-items: start;
}
.personas__list {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--coal-line);
}
.personas__tab {
  appearance: none;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  margin-left: -1.5px;
  text-align: left;
  font-family: var(--font-text);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--coal-muted);
  padding: 0.9rem 0 0.9rem 1.4rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.personas__tab:hover { color: var(--coal-text); }
.personas__tab[aria-selected="true"] {
  color: var(--coal-text);
  border-left-color: var(--lava);
}

.persona-panel h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.875rem;
  line-height: 1.15;
  max-width: 26ch;
}
.persona-panel__risk {
  margin-top: var(--space-2);
  color: var(--coal-muted);
  max-width: 60ch;
}
.persona-panel__list {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 0;
  display: grid;
  gap: var(--space-2);
}
.persona-panel__list li {
  border: 1px solid var(--coal-line);
  border-radius: var(--radius);
  background: var(--coal-2);
  padding: var(--space-2) var(--space-3);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2);
  align-items: baseline;
}
.persona-panel__list li::before {
  content: "→";
  color: var(--lava);
  font-family: var(--font-mono);
}
.persona-panel__list strong { color: var(--coal-text); font-weight: 600; }
.persona-panel__list span { color: var(--coal-muted); display: block; font-size: 0.9375rem; }
.persona-panel__product {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--coal-muted);
}
.persona-panel__product a { color: var(--lava); }

/* JS-gated panel visibility (no-JS shows all panels stacked) */
.js .persona-panel[hidden] { display: none; }
.no-js-label { display: block; margin-bottom: var(--space-2); }
.js .persona-panel .no-js-label { display: none; }

/* ----- 10. Steps / architecture ----- */
.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-6);
}
.step { border-top: 2px solid var(--line); padding-top: var(--space-3); }
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--lava-deep);
  display: block;
  margin-bottom: var(--space-2);
}
.step h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.step p { color: var(--ink-2); font-size: 0.9688rem; }

.diagram {
  margin-top: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: var(--space-4);
  overflow-x: auto;
}
.diagram svg { min-width: 640px; width: 100%; height: auto; }
.diagram--fit svg { min-width: 0; } /* tall/narrow diagrams inside split columns */
.diagram--dark { background: var(--coal-2); border-color: var(--coal-line); }

/* Diagram text styles (used inside inline SVG) */
.dg-label { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-3); }
.dg-strong { font-family: var(--font-text); font-size: 13px; font-weight: 600; fill: var(--ink); }
.dg-note { font-family: var(--font-text); font-size: 11px; fill: var(--ink-3); }
.dg-box { fill: var(--paper); stroke: var(--line); }
.dg-box--hot { stroke: var(--lava); }
.dg-flow { stroke: var(--ink-3); stroke-dasharray: 4 4; fill: none; }
.dg-flow--hot { stroke: var(--lava); }

/* ----- 11. Stats ----- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.stat { border-top: 2px solid var(--coal-line); padding-top: var(--space-3); }
.stat__value {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
  color: var(--coal-text);
}
.stat__value em { font-style: normal; color: var(--lava); }
.stat__label { margin-top: 0.6rem; color: var(--coal-muted); font-size: 0.9063rem; }

/* ----- 12. Code blocks ----- */
.codeblock {
  position: relative;
  background: var(--coal);
  color: var(--coal-text);
  border-radius: var(--radius);
  border: 1px solid var(--coal-line);
  margin-top: var(--space-3);
}
.codeblock pre {
  padding: var(--space-3);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
}
.codeblock__lang {
  position: absolute;
  top: 0.6rem;
  left: 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--coal-muted);
}
.codeblock--labeled pre { padding-top: 2.4rem; }
.codeblock .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--coal-2);
  color: var(--coal-muted);
  border: 1px solid var(--coal-line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.codeblock .copy-btn:hover { color: var(--coal-text); border-color: var(--coal-muted); }

.tok-c { color: #7d786f; }   /* comment */
.tok-k { color: #ff8a75; }   /* keyword / method */
.tok-s { color: #d8d3c8; }   /* string */
.tok-f { color: #f4f2ed; }   /* emphasis */

code:not(pre code) {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.875em;
}
.section--dark code:not(pre code),
.docs-body .section--dark code:not(pre code) { background: var(--coal-2); border-color: var(--coal-line); }

/* ----- 13. FAQ accordion ----- */
.faq-group { margin-top: var(--space-5); }
.faq-group + .faq-group { margin-top: var(--space-6); }
.faq-group > h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
  margin-bottom: var(--space-3);
}
.faq-item {
  border-top: 1px solid var(--line);
}
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  font-size: 1.0938rem;
  font-weight: 600;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--lava-deep);
  transition: transform 0.25s var(--ease-out);
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body {
  padding: 0 0 var(--space-3);
  color: var(--ink-2);
  max-width: 68ch;
}
.faq-body p + p { margin-top: 0.75rem; }

/* ----- 14. Forms ----- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.form-field { display: flex; flex-direction: column; gap: 0.45rem; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { font-size: 0.875rem; font-weight: 600; }
.form-field .optional { color: var(--ink-3); font-weight: 400; }
.form-field input,
.form-field select,
.form-field textarea {
  font-family: var(--font-text);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--lava);
  outline-offset: 0;
  border-color: var(--lava);
}
.form-hidden { display: none; }

/* ----- 15. CTA band ----- */
.cta-band { text-align: left; }
.cta-band .headline { max-width: 26ch; }

/* ----- 16. Footer ----- */
.site-footer {
  background: var(--coal);
  color: var(--coal-muted);
  padding-block: var(--space-6) var(--space-4);
  font-size: 0.9063rem;
}
.site-footer a { color: var(--coal-muted); }
.site-footer a:hover { color: var(--coal-text); text-decoration: none; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--coal-line);
}
.footer-brand .wordmark { color: var(--coal-text); }
.footer-brand p { margin-top: var(--space-2); max-width: 30ch; }
.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--coal-text);
  margin-bottom: var(--space-2);
}
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.footer-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding-top: var(--space-3);
  font-size: 0.8438rem;
}

/* ----- 17. Page hero (interior pages) ----- */
.page-hero { padding-block: var(--space-6) var(--space-5); }
.page-hero--dark { background: var(--coal); color: var(--coal-text); }
.page-hero .headline { max-width: 24ch; }

/* Guarantee list (product pages) */
.guarantees {
  list-style: none;
  padding: 0;
  margin-top: var(--space-4);
  display: grid;
  gap: 0;
}
.guarantees li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2);
  align-items: baseline;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
}
.guarantees li:last-child { border-bottom: 1px solid var(--line); }
.guarantees li::before {
  content: "✓";
  font-family: var(--font-mono);
  color: var(--lava-deep);
  font-weight: 600;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-6);
  align-items: start;
  margin-top: var(--space-5);
}
.split--rev { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

/* ----- 18. Docs layout ----- */
.docs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--space-6);
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-5) var(--space-4) var(--space-7);
}
.docs-nav {
  position: sticky;
  top: calc(72px + var(--space-4));
  align-self: start;
  font-size: 0.9063rem;
}
.docs-nav h2 {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: var(--space-3) 0 var(--space-1);
}
.docs-nav h2:first-child { margin-top: 0; }
.docs-nav ul { list-style: none; padding: 0; display: grid; gap: 0.3rem; }
.docs-nav a { color: var(--ink-2); display: block; padding: 0.15rem 0; }
.docs-nav a:hover { color: var(--ink); text-decoration: none; }

.docs-body { max-width: 76ch; }
.docs-body h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.75rem;
}
.docs-body h2 {
  font-size: 1.5rem;
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.docs-body h3 { font-size: 1.125rem; margin-top: var(--space-4); }
.docs-body p { margin-top: var(--space-2); color: var(--ink-2); }
.docs-body ul, .docs-body ol { margin-top: var(--space-2); color: var(--ink-2); padding-left: 1.4rem; }
.docs-body li + li { margin-top: 0.4rem; }

.endpoint {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
}
.endpoint .method {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  color: #fff;
  background: var(--ink);
}
.endpoint .method--post { background: var(--lava-deep); }
.endpoint .method--del { background: var(--ink-3); }

.docs-table { width: 100%; border-collapse: collapse; margin-top: var(--space-3); font-size: 0.9063rem; }
.docs-table th, .docs-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.docs-table th { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.docs-table code { white-space: nowrap; }
.table-scroll { overflow-x: auto; }

.callout {
  border-left: 3px solid var(--lava);
  background: var(--paper-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-3);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

/* ----- 19. Scroll reveals (JS-gated: no JS ⇒ everything visible) ----- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px) scale(0.99);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ----- 20. Responsive (desktop-first) ----- */
@media (max-width: 1024px) {
  .section { padding-block: var(--space-6); }
  .hero__grid { grid-template-columns: 1fr; gap: var(--space-5); }
  .hero__figure { max-width: 560px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: var(--space-4); }
  .steps { grid-template-columns: 1fr; gap: var(--space-3); }
  .personas__layout { grid-template-columns: 1fr; gap: var(--space-4); }
  .personas__list {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-bottom: 1px solid var(--coal-line);
    gap: 0;
  }
  .personas__tab {
    border-left: none;
    border-bottom: 2px solid transparent;
    margin: 0 0 -1px;
    padding: 0.7rem 1rem;
  }
  .personas__tab[aria-selected="true"] { border-bottom-color: var(--lava); }
  .split, .split--rev { grid-template-columns: 1fr; gap: var(--space-4); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; row-gap: var(--space-4); }
  .footer-brand { grid-column: 1 / -1; }
  .docs-layout { grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-4); }
}

@media (max-width: 768px) {
  body { font-size: 1rem; }
  .container { padding-inline: var(--space-3); }
  .site-header__inner { padding-inline: var(--space-3); height: 64px; }

  /* Mobile nav */
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 44px;
    padding: 10px;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
  }
  .nav-toggle .bar {
    display: block;
    height: 2px;
    background: var(--ink);
    transition: transform 0.25s var(--ease-out), opacity 0.2s ease;
  }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: var(--space-2) var(--space-3) var(--space-3);
  }
  .js .site-nav.is-open { display: flex; }
  .js .site-nav a { padding: 0.8rem 0.25rem; font-size: 1.0625rem; }
  .js .site-nav .btn { margin-top: var(--space-2); }

  .hero { padding-block: var(--space-6) var(--space-5); }
  .card-grid, .card-grid--2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .hero__actions .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .strip__inner { flex-direction: column; align-items: flex-start; gap: var(--space-1); }
}

/* ==========================================================================
   v3 layer — signature moves: canvas hero, masked-line reveals, marquee,
   pinned privacy-stack sequence, manifesto numerals, grain.
   ========================================================================== */

/* ----- Hero v3: full-viewport, canvas field behind ----- */
.hero--v3 {
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding-block: var(--space-6);
}
.hero--v3 .container { position: relative; z-index: 2; width: 100%; }
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero__glow {
  position: absolute;
  right: -10vw;
  top: 10%;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, rgba(232, 64, 45, 0.13), transparent 62%);
  z-index: 1;
  pointer-events: none;
}
.hero__title--xl {
  font-size: clamp(3.25rem, 8.5vw, 7.5rem);
  line-height: 0.98;
  max-width: 12ch;
}
.hero__scroll-hint {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  color: var(--coal-muted);
}
.hero__scroll-hint::after {
  content: "";
  display: block;
  width: 1px;
  height: 34px;
  margin: 10px auto 0;
  background: linear-gradient(var(--lava), transparent);
}

/* Masked-line reveal (hero headline). JS-gated: no JS ⇒ visible. */
.line { display: block; overflow: hidden; }
.line > span { display: block; }
.js .line > span {
  transform: translateY(112%);
  transition: transform 0.9s var(--ease-out);
}
.js .line:nth-child(2) > span { transition-delay: 0.12s; }
.js .line:nth-child(3) > span { transition-delay: 0.24s; }
.js .is-in .line > span { transform: none; }
.js .hero--v3 .hero__lede,
.js .hero--v3 .hero__actions,
.js .hero--v3 .hero__eyebrow {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease-out) 0.45s, transform 0.8s var(--ease-out) 0.45s;
}
.js .hero--v3.is-in .hero__lede,
.js .hero--v3.is-in .hero__actions,
.js .hero--v3.is-in .hero__eyebrow { opacity: 1; transform: none; }

/* Film grain on dark hero — keeps large flat areas from feeling dead */
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ----- Marquee ----- */
.marquee {
  overflow: hidden;
  background: var(--coal);
  border-top: 1px solid var(--coal-line);
  padding-block: 1.1rem;
}
.marquee__track {
  display: flex;
  gap: 3.5rem;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee__track span {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  color: var(--coal-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3.5rem;
}
.marquee__track span::after {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--lava);
  clip-path: polygon(50% 0, 100% 62%, 82% 100%, 18% 100%, 0 62%);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ----- Manifesto (the pragmatic approach) ----- */
.manifesto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5) var(--space-6);
  margin-top: var(--space-6);
}
.principle { position: relative; padding-top: var(--space-3); border-top: 2px solid var(--ink); }
.principle__num {
  font-family: var(--font-display);
  font-size: 4.5rem;
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1px var(--lava);
  display: block;
  margin-bottom: var(--space-2);
}
.principle h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
  margin-bottom: var(--space-2);
}
.principle p { color: var(--ink-2); max-width: 46ch; }

/* ----- Privacy stack: pinned scroll sequence ----- */
.stack { background: var(--coal); color: var(--coal-text); position: relative; }
.stack__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}
.stack__visuals {
  position: sticky;
  top: calc(50vh - 210px);
  height: 420px;
}
.stack__visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  pointer-events: none;
}
.stack__visual.is-active { opacity: 1; transform: none; }
.stack__visual svg { width: 100%; max-width: 440px; height: auto; }
.stack__steps { display: flex; flex-direction: column; }
.stack__step {
  min-height: 68vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.28;
  transition: opacity 0.45s ease;
}
.stack__step.is-active { opacity: 1; }
.stack__step-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--lava);
  letter-spacing: 0.15em;
  margin-bottom: var(--space-2);
}
.stack__step h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  line-height: 1.08;
  max-width: 18ch;
}
.stack__step p {
  margin-top: var(--space-3);
  color: var(--coal-muted);
  max-width: 52ch;
}
.stack__step .unlocks {
  margin-top: var(--space-3);
  font-size: 0.9063rem;
  color: var(--coal-text);
  border-left: 2px solid var(--lava);
  padding-left: var(--space-2);
}
.stack__step .unlocks b { font-weight: 600; }

/* stack visual svg text */
.sv-label { font-family: var(--font-mono); font-size: 11px; fill: var(--coal-muted); }
.sv-strong { font-family: var(--font-mono); font-size: 12px; fill: var(--coal-text); }
.sv-hot { fill: var(--lava); }
.sv-box { fill: var(--coal-2); stroke: var(--coal-line); }
.sv-line { stroke: var(--coal-line); fill: none; }
.sv-line--hot { stroke: var(--lava); fill: none; }

/* ----- v3 responsive ----- */
@media (max-width: 1024px) {
  .hero--v3 { min-height: 0; }
  .hero__title--xl { font-size: clamp(3rem, 9.5vw, 5.5rem); }
  .manifesto-grid { gap: var(--space-5); }
  .stack__layout { grid-template-columns: 1fr; }
  .stack__visuals { display: none; }        /* visuals inline per step instead */
  .stack__step { min-height: 0; padding-block: var(--space-4); opacity: 1; }
}
@media (max-width: 768px) {
  .manifesto-grid { grid-template-columns: 1fr; }
  .hero__scroll-hint { display: none; }
}

/* ----- 21. Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .lava-seam { stroke-dashoffset: 0; }
  .js .line > span { transform: none; }
  .js .hero--v3 .hero__lede,
  .js .hero--v3 .hero__actions,
  .js .hero--v3 .hero__eyebrow { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
  .hero__canvas { display: none; }
  .stack__step { opacity: 1; }
}
