/* FaceNinja site design system.
   Tokens live on :root; [data-theme] on <html> overrides the OS preference.
   "Stage" surfaces (3D, renders, turntables) stay dark in both themes, like a studio backdrop. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url(/fonts/BricolageGrotesque-latin.woff2) format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url(/fonts/InstrumentSans-latin.woff2) format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url(/fonts/JetBrainsMono-Regular.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url(/fonts/JetBrainsMono-Medium.woff2) format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  /* palette */
  --vermilion-300: #ff9a7f;
  --vermilion-400: #ff7350;
  --vermilion-500: #f2522e;
  --vermilion-600: #cf3a19;
  --jade-400: #4fc59a;
  --jade-600: #1f8a63;
  --amber-400: #f2b44a;
  --amber-700: #8a5a0c;

  /* light theme (paper) */
  --bg: #f5f2ec;
  --bg-raised: #fbf9f5;
  --bg-sunk: #ece7df;
  --text: #1a1714;
  --text-muted: #5e574f;
  --text-faint: #6f675e;
  --line: #ddd5ca;
  --line-strong: #c4b9ab;
  --accent: var(--vermilion-600);
  --accent-strong: #a92c10;
  --accent-ink: #ffffff;
  --accent-soft: rgba(207, 58, 25, .09);
  --ok: var(--jade-600);
  --warn: var(--amber-700);
  --warn-soft: rgba(242, 180, 74, .18);
  --code-bg: #1d1a17;
  --code-text: #ece5da;
  --shadow: 0 1px 0 rgba(26, 23, 20, .04), 0 12px 32px -18px rgba(26, 23, 20, .28);
  --brand-tile: #14120f;

  /* stage: dark in both themes */
  --stage: #14120f;
  --stage-2: #1e1b17;
  --stage-text: #efe9e1;
  --stage-muted: #a59c91;
  --stage-line: rgba(239, 233, 225, .14);

  /* type */
  --font-display: "Bricolage Grotesque", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --step--1: .875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.3rem, 1.1rem + .6vw, 1.55rem);
  --step-3: clamp(1.6rem, 1.25rem + 1.2vw, 2.15rem);
  --step-4: clamp(2.05rem, 1.4rem + 2.4vw, 3.3rem);
  --step-5: clamp(2.5rem, 1.5rem + 3.9vw, 4.6rem);

  /* space & shape */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 7rem;
  --radius-s: 4px;
  --radius: 8px;
  --radius-l: 14px;
  --container: 1200px;
  --gutter: clamp(1rem, .5rem + 2.5vw, 2.5rem);
  --header-h: 64px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #100e0c;
    --bg-raised: #1a1714;
    --bg-sunk: #0b0a08;
    --text: #f1ece5;
    --text-muted: #b2a99e;
    --text-faint: #958b80;
    --line: #2c2823;
    --line-strong: #433d36;
    --accent: var(--vermilion-400);
    --accent-strong: var(--vermilion-300);
    --accent-ink: #1a0b06;
    --accent-soft: rgba(255, 115, 80, .12);
    --ok: var(--jade-400);
    --warn: var(--amber-400);
    --warn-soft: rgba(242, 180, 74, .12);
    --code-bg: #0b0a08;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 18px 40px -22px rgba(0, 0, 0, .8);
    --brand-tile: #2a241e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #100e0c;
  --bg-raised: #1a1714;
  --bg-sunk: #0b0a08;
  --text: #f1ece5;
  --text-muted: #b2a99e;
  --text-faint: #958b80;
  --line: #2c2823;
  --line-strong: #433d36;
  --accent: var(--vermilion-400);
  --accent-strong: var(--vermilion-300);
  --accent-ink: #1a0b06;
  --accent-soft: rgba(255, 115, 80, .12);
  --ok: var(--jade-400);
  --warn: var(--amber-400);
  --warn-soft: rgba(242, 180, 74, .12);
  --code-bg: #0b0a08;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 18px 40px -22px rgba(0, 0, 0, .8);
  --brand-tile: #2a241e;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0)/1.6 var(--font-body);
  font-stretch: 96%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video, svg, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: .2em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--vermilion-400); color: #1a0b06; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}
h1 { font-size: var(--step-5); font-weight: 700; letter-spacing: -.035em; }
h2 { font-size: var(--step-4); letter-spacing: -.03em; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); letter-spacing: -.01em; }
p { margin: 0 0 var(--space-4); text-wrap: pretty; }
ul, ol { margin: 0 0 var(--space-4); padding-left: 1.2em; }
li + li { margin-top: .35em; }
code, kbd, samp, pre { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code {
  padding: .1em .35em;
  border-radius: var(--radius-s);
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  font-size: .85em;
}
hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-7) 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  padding: var(--space-2) var(--space-4); background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-3); }

/* ---------- layout ---------- */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(760px + 2 * var(--gutter)); }
.section { padding: var(--space-9) 0; }
.section.tight { padding: var(--space-8) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section.sunk { background: var(--bg-sunk); }
.section-head { max-width: 760px; margin-bottom: var(--space-7); }
.section-head.center { margin-inline: auto; text-align: center; }
.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); align-items: center; }
.split.wide-left { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.split.wide-right { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.stack > * + * { margin-top: var(--space-4); }
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split.wide-left, .split.wide-right { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .section { padding: var(--space-8) 0; }
  .section.tight { padding: var(--space-7) 0; }
}

/* ---------- type helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  margin-bottom: var(--space-4);
  font: 500 .78rem/1 var(--font-mono);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow::before {
  content: ""; width: 18px; height: 2px; background: var(--accent);
  transform: skewX(-30deg);
}
.eyebrow .num { color: var(--accent); }
.lead { font-size: var(--step-1); color: var(--text-muted); max-width: 62ch; }
.lead.big { font-size: var(--step-2); line-height: 1.45; letter-spacing: -.005em; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: var(--step--1); }
.mono { font-family: var(--font-mono); font-size: .88em; }
.accent { color: var(--accent); }
.nowrap { white-space: nowrap; }
.prose { max-width: 70ch; }
.prose h2 { font-size: var(--step-3); margin-top: var(--space-7); }
.prose h3 { margin-top: var(--space-6); }
.prose li::marker { color: var(--accent); }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: var(--space-5); height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand svg { width: 30px; height: 30px; }
.brand svg rect { fill: var(--brand-tile); }
.brand-name { font: 700 1.2rem/1 var(--font-display); letter-spacing: -.03em; }
.brand-name b { color: var(--accent); font-weight: 700; }
.nav { display: flex; align-items: center; gap: var(--space-1); margin-left: var(--space-4); }
.nav a, .nav summary {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .45rem .7rem; border-radius: var(--radius);
  color: var(--text-muted); text-decoration: none; font-size: .95rem; font-weight: 500;
  cursor: pointer; list-style: none;
}
.nav summary::-webkit-details-marker { display: none; }
.nav a:hover, .nav summary:hover, .nav details[open] > summary { color: var(--text); background: var(--bg-sunk); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-left: .15rem;
}
.nav details { position: relative; }
.nav summary svg { width: 12px; height: 12px; transition: transform .2s; }
.nav details[open] summary svg { transform: rotate(180deg); }
.nav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 300px;
  padding: var(--space-2); background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow);
}
.nav-menu a { display: block; padding: .6rem .75rem; color: var(--text); }
.nav-menu a span { display: block; color: var(--text-muted); font-size: .85rem; font-weight: 400; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--text-muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .menu-toggle { display: inline-grid; }
  .header-actions .btn.ghost { display: none; }
  .nav {
    display: none; position: fixed; inset: var(--header-h) 0 auto 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: var(--space-3) var(--gutter) var(--space-5);
    background: var(--bg); border-bottom: 1px solid var(--line);
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  }
  .nav.open { display: flex; }
  .nav a, .nav summary { padding: .8rem .25rem; font-size: 1.05rem; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav a:hover, .nav summary:hover, .nav details[open] > summary { background: transparent; }
  .nav-menu { position: static; min-width: 0; border: 0; box-shadow: none; padding: 0 0 var(--space-2) var(--space-4); background: transparent; }
  .nav-menu a { border-bottom: 0; padding: .55rem 0; }
  .nav .nav-only-mobile { display: flex; }
}
@media (min-width: 961px) { .nav .nav-only-mobile { display: none; } }
@media (max-width: 420px) {
  .header-actions .btn.primary { padding-inline: .8rem; }
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: transparent; --btn-fg: var(--text); --btn-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .6rem 1.15rem;
  border: 1px solid var(--btn-line); border-radius: var(--radius);
  background: var(--btn-bg); color: var(--btn-fg);
  font: 600 .95rem/1.1 var(--font-body); text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { border-color: var(--text-muted); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-line: var(--accent); }
.btn.primary:hover { --btn-bg: var(--accent-strong); --btn-line: var(--accent-strong); }
.btn.sm { min-height: 36px; padding: .4rem .85rem; font-size: .9rem; }
.btn.lg { min-height: 52px; padding: .8rem 1.5rem; font-size: 1.02rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.link-arrow { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.link-arrow::after { content: "→"; transition: transform .15s; }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------- chips, badges, notices ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 999px;
  font: 500 .78rem/1.2 var(--font-mono); color: var(--text-muted); background: var(--bg-raised);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.badge {
  display: inline-block; padding: .15rem .45rem; border-radius: var(--radius-s);
  font: 500 .7rem/1.3 var(--font-mono); letter-spacing: .05em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent); vertical-align: middle;
}
.badge.later { background: var(--bg-sunk); color: var(--text-muted); border: 1px dashed var(--line-strong); }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.notice[hidden] { display: none; }   /* FN-BILLING: data-unconfirmed banners are hidden by the attribute */
.notice {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4) var(--space-5); border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  background: var(--warn-soft); color: var(--text);
}
.notice svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--warn); margin-top: .15rem; }
.notice p:last-child { margin-bottom: 0; }
.notice.draft { border-style: dashed; }

/* ---------- cards ---------- */
.card {
  position: relative; padding: var(--space-6);
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-l);
}
.card h3 { font-size: var(--step-1); font-weight: 650; margin-bottom: var(--space-2); letter-spacing: -.015em; }
.card p:last-child { margin-bottom: 0; }
.card .card-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: var(--space-4);
  border-radius: var(--radius); background: var(--accent-soft); color: var(--accent);
}
.card .card-icon svg { width: 22px; height: 22px; }
.card.link { text-decoration: none; transition: border-color .15s, transform .15s; }
.card.link:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card-num { font: 500 .78rem/1 var(--font-mono); color: var(--accent); margin-bottom: var(--space-3); display: block; }
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { position: relative; padding-left: 1.6rem; }
.feature-list li::before {
  content: ""; position: absolute; left: 0; top: .62em; width: 10px; height: 2px; background: var(--accent);
  transform: skewX(-30deg);
}
.feature-list.check li::before {
  content: ""; top: .45em; width: 11px; height: 6px; background: none;
  border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg);
}
.feature-list.cross li::before {
  content: "–"; top: 0; width: auto; height: auto; background: none; transform: none; color: var(--text-faint);
}

/* ---------- stage (dark media surface) ---------- */
.stage {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(70% 55% at 50% 30%, #2a251f 0%, transparent 70%),
    linear-gradient(180deg, var(--stage-2), var(--stage));
  color: var(--stage-text);
  border-radius: var(--radius-l);
  border: 1px solid var(--stage-line);
}
.stage img, .stage video { width: 100%; height: 100%; object-fit: cover; }
.stage .ticks::before, .stage .ticks::after {
  content: ""; position: absolute; width: 14px; height: 14px; z-index: 2; pointer-events: none;
  border-color: rgba(239, 233, 225, .35); border-style: solid;
}
.stage .ticks::before { top: 12px; left: 12px; border-width: 1px 0 0 1px; }
.stage .ticks::after { bottom: 12px; right: 12px; border-width: 0 1px 1px 0; }
.stage-label {
  position: absolute; z-index: 2; left: 34px; top: 14px;
  padding: .3rem .45rem; border-radius: var(--radius-s); background: rgba(20, 18, 15, .6);
  font: 500 .72rem/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--stage-muted);
}
.stage-label.right { left: auto; right: 34px; }
.stage-label.bottom { top: auto; bottom: 12px; }
figure { margin: 0; }
figcaption { margin-top: var(--space-3); font-size: var(--step--1); color: var(--text-muted); }
.ratio-45 { aspect-ratio: 4 / 5; }
.ratio-1 { aspect-ratio: 1; }

/* ---------- hero ---------- */
.hero { padding: var(--space-8) 0 var(--space-7); position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--space-7); align-items: center; }
.hero h1 { margin-bottom: var(--space-5); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { margin-bottom: var(--space-6); }
.hero-meta { margin-top: var(--space-6); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); color: var(--text-muted); font-size: var(--step--1); }
.hero-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.hero-meta svg { width: 15px; height: 15px; color: var(--accent); }
@media (max-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } .hero { padding-top: var(--space-6); } }

/* 3D viewer */
.viewer { aspect-ratio: 4 / 4.4; min-height: 360px; }
.viewer canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; touch-action: pan-y; }
.viewer .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; transition: opacity .5s; z-index: 0; }
.viewer.is-live .poster { opacity: 0; pointer-events: none; }
.viewer-bar {
  position: absolute; z-index: 3; left: 12px; right: 12px; bottom: 12px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between;
}
.viewer-group { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(20, 18, 15, .72); border: 1px solid var(--stage-line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.viewer-group button {
  min-height: 32px; padding: .3rem .65rem; border: 0; border-radius: 7px; background: transparent;
  color: var(--stage-muted); font: 500 .8rem/1 var(--font-body); cursor: pointer;
}
.viewer-group button:hover { color: var(--stage-text); }
.viewer-group button[aria-pressed="true"] { background: var(--stage-text); color: var(--stage); }
.viewer-status {
  position: absolute; z-index: 3; top: 12px; right: 14px;
  font: 500 .72rem/1 var(--font-mono); color: var(--stage-muted); letter-spacing: .04em;
}
.viewer-progress { position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 3; }
.viewer-progress i { display: block; height: 100%; width: 0; background: var(--vermilion-400); transition: width .2s; }
.viewer-start {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.viewer.is-live .viewer-start, .viewer.is-loading .viewer-start { display: none; }
.subject-tabs { display: flex; gap: 6px; margin-top: var(--space-3); flex-wrap: wrap; }
.subject-tabs button {
  display: inline-flex; align-items: center; gap: .5rem; padding: 4px 10px 4px 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-raised); color: var(--text-muted);
  font: 500 .82rem/1 var(--font-body); cursor: pointer;
}
.subject-tabs button img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.subject-tabs button[aria-pressed="true"] { border-color: var(--accent); color: var(--text); }

/* ---------- pipeline strip ---------- */
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); counter-reset: step; }
.pipeline .step { position: relative; }
.pipeline .step .stage { aspect-ratio: 4 / 5; }
.pipeline .step h3 { font-size: var(--step-1); margin: var(--space-4) 0 var(--space-2); }
.pipeline .step h3::before { counter-increment: step; content: "0" counter(step) "  "; font: 500 .8rem var(--font-mono); color: var(--accent); white-space: pre; }
.pipeline .step p { color: var(--text-muted); font-size: var(--step--1); margin: 0; }
.pipeline .step.diagram .stage { display: grid; place-items: center; padding: var(--space-5); }
@media (max-width: 960px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- gallery ---------- */
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6) var(--space-5); }
.person .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-radius: var(--radius-l); overflow: hidden; }
.person .pair > * { aspect-ratio: 4 / 5; border-radius: 0; border: 0; }
.person .pair img { width: 100%; height: 100%; object-fit: cover; }
.person h3 { font-size: var(--step-0); margin: var(--space-3) 0 var(--space-1); }
.person p { font-size: var(--step--1); color: var(--text-muted); margin: 0; }
@media (max-width: 620px) { .people { grid-template-columns: minmax(0, 1fr); } }

.turntable-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.turntable-row .stage { aspect-ratio: 4 / 5; }
@media (max-width: 960px) { .turntable-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.before-after .stage { aspect-ratio: 9 / 11; }
.before-after img { object-fit: contain; }

/* ---------- stats / spec table ---------- */
.spec { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.spec th, .spec td { text-align: left; padding: .8rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec th { font-weight: 600; color: var(--text); width: 34%; }
.spec td { color: var(--text-muted); }
.spec thead th { font: 500 .72rem/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); width: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--bg-raised); }
.table-wrap .spec tr:last-child > * { border-bottom: 0; }
.yes { color: var(--ok); font-weight: 600; }
.no { color: var(--text-faint); }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.stat { padding: var(--space-5); background: var(--bg-raised); }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font: 650 var(--step-3)/1 var(--font-display); letter-spacing: -.03em; margin-bottom: var(--space-2); }
.stat span { color: var(--text-muted); font-size: var(--step--1); }
@media (max-width: 960px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- code ---------- */
.code {
  position: relative; margin: 0; padding: var(--space-5); overflow-x: auto;
  background: var(--code-bg); color: var(--code-text); border-radius: var(--radius-l);
  font: 400 .84rem/1.7 var(--font-mono); tab-size: 2;
  border: 1px solid var(--stage-line);
}
.code .c { color: #8f857a; }
.code .k { color: var(--vermilion-300); }
.code .s { color: #a7d7b8; }
.code-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-2); font: 500 .75rem var(--font-mono); color: var(--text-muted); }

/* ---------- pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.price-card { display: flex; flex-direction: column; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.price-card .amount { font: 700 var(--step-4)/1 var(--font-display); letter-spacing: -.04em; margin: var(--space-3) 0 var(--space-1); }
.price-card .per { color: var(--text-muted); font-size: var(--step--1); }
.price-card .feature-list { margin: var(--space-5) 0; flex: 1; font-size: var(--step--1); }
.price-card .btn { width: 100%; }
.price-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); }
.price-hero .amount { font: 700 var(--step-5)/1 var(--font-display); letter-spacing: -.05em; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; gap: var(--space-4); align-items: center;
  padding: var(--space-5) 0; cursor: pointer; list-style: none;
  font: 600 var(--step-1)/1.3 var(--font-display); letter-spacing: -.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.5rem/1 var(--font-mono); color: var(--accent); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding-bottom: var(--space-5); color: var(--text-muted); max-width: 70ch; }

/* ---------- forms ---------- */
.form { display: grid; gap: var(--space-4); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 620px) { .form .row { grid-template-columns: 1fr; } }
.field label { display: block; margin-bottom: .35rem; font-weight: 600; font-size: .9rem; }
.field label .opt { color: var(--text-faint); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: .65rem .8rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--bg-raised); color: var(--text); font: inherit;
}
.textarea { min-height: 140px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; color: var(--text-muted); }
.consent input { margin-top: .3rem; accent-color: var(--accent); }
.form-status { min-height: 1.5em; font-size: .92rem; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--accent); }

/* ---------- guidelines ---------- */
.do-dont { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.do-dont .card { padding: var(--space-5); }
.do-dont .card.do { border-top: 3px solid var(--ok); }
.do-dont .card.dont { border-top: 3px solid var(--accent); }
@media (max-width: 620px) { .do-dont { grid-template-columns: 1fr; } }
.check-table td:first-child { font-weight: 600; color: var(--text); white-space: nowrap; }

/* ---------- toc ---------- */
.with-toc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + var(--space-5)); font-size: var(--step--1); }
.toc a { display: block; padding: .3rem 0 .3rem .8rem; border-left: 2px solid var(--line); color: var(--text-muted); text-decoration: none; }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
@media (max-width: 960px) { .with-toc { grid-template-columns: minmax(0, 1fr); } .toc { position: static; } }

/* ---------- page head / cta / footer ---------- */
.page-head { padding: var(--space-8) 0 var(--space-7); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: var(--step-5); max-width: 18ch; }
.page-head .lead { margin-bottom: 0; }
.crumbs { font: 500 .78rem var(--font-mono); color: var(--text-faint); margin-bottom: var(--space-4); }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.cta-band {
  position: relative; overflow: hidden;
  padding: var(--space-8) var(--space-7); border-radius: var(--radius-l);
  background: var(--stage); color: var(--stage-text);
  display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: var(--space-6); align-items: center;
}
.cta-band::before {
  content: ""; position: absolute; right: -10%; top: -60%; width: 55%; height: 220%;
  background: linear-gradient(90deg, transparent, rgba(242, 82, 46, .22), transparent);
  transform: rotate(24deg); pointer-events: none;
}
.cta-band h2 { font-size: var(--step-4); margin-bottom: var(--space-3); }
.cta-band p { color: var(--stage-muted); margin: 0; }
.cta-band .btn:not(.primary) { --btn-fg: var(--stage-text); --btn-line: var(--stage-line); }
.cta-band .btn.primary { --btn-bg: var(--vermilion-500); --btn-line: var(--vermilion-500); --btn-fg: #fff; }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; padding: var(--space-7) var(--space-5); } }

.site-footer { padding: var(--space-8) 0 var(--space-6); border-top: 1px solid var(--line); background: var(--bg-sunk); font-size: var(--step--1); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: var(--space-6); }
.footer-grid .footer-h { font: 500 .74rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: var(--space-4); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li + li { margin-top: .5rem; }
.footer-grid a { color: var(--text-muted); text-decoration: none; }
.footer-grid a.brand { color: var(--text); }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; color: var(--text-faint); }
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- 404 ---------- */
.lost { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: var(--space-9) 0; }
.lost .code-num { font: 700 clamp(5rem, 3rem + 10vw, 10rem)/1 var(--font-display); letter-spacing: -.06em; color: var(--accent); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
  .js .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- utilities ---------- */
.mt-0 { margin-top: 0; } .mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); } .mt-7 { margin-top: var(--space-7); }
.mb-0 { margin-bottom: 0; } .mb-6 { margin-bottom: var(--space-6); }
.center { text-align: center; }
.hide-sm { } @media (max-width: 620px) { .hide-sm { display: none !important; } }
.btn-row.center { justify-content: center; }
.mx-auto { margin-inline: auto; }
.viewer .ticks::after { display: none; }
@media (max-width: 620px) { .viewer .stage-label { display: none; } }
