/* =========================================================================
   affective-ai.io — design system
   Theme tokens carried over from the original Vite/Tailwind build.
   ========================================================================= */

:root {
  --bg: #080818;
  --bg-2: #0c0c22;
  --bg-3: #10102b;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);

  --text: #fffffff2;
  --text-2: #ffffffd9;
  --text-3: #ffffffa6;
  --text-4: #ffffff73;
  --text-soft: #e8e8f0;

  --purple: #7b2ff7;
  --purple-10: #7b2ff71a;
  --purple-40: #7b2ff766;
  --purple-70: #7b2ff7b3;
  --purple-75: #7b2ff7bf;
  --magenta: #d4166a;
  --magenta-10: #d4166a1a;
  --cyan: #00b4d8;
  --cyan-10: #00b4d81a;

  --ok: #34d399;
  --ok-10: #34d3991a;
  --warn: #fbbf24;
  --warn-10: #fbbf241a;
  --bad: #ff4d6d;
  --bad-10: #ff4d6d1a;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --nav-h: 68px;
  --max: 1180px;
  --gutter: clamp(20px, 4vw, 40px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 160ms;
  --t-med: 320ms;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html:focus-within { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.92em; }
::selection { background: var(--purple-40); color: #fff; }

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

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- ambient background ---------- */
.bg-orbs {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(800px 500px at 15% -10%, rgba(123, 47, 247, 0.20), transparent 60%),
    radial-gradient(700px 500px at 100% 10%, rgba(212, 22, 106, 0.12), transparent 60%),
    radial-gradient(600px 400px at 50% 110%, rgba(0, 180, 216, 0.10), transparent 60%);
}
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}

/* ---------- layout ---------- */
.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.wrap--narrow { width: min(820px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.sec { position: relative; padding-block: clamp(80px, 11vw, 140px); scroll-margin-top: calc(var(--nav-h) + 8px); }
.sec--tint { background: linear-gradient(180deg, transparent, rgba(255,255,255,0.018) 20%, rgba(255,255,255,0.018) 80%, transparent); }
.sec--tight { padding-block: clamp(56px, 8vw, 96px); }
.sec + .sec { border-top: 1px solid var(--line); }

.sec-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-4); margin-bottom: 18px;
}
.eyebrow .num { color: var(--purple); font-weight: 600; }
.eyebrow .sep { width: 28px; height: 1px; background: var(--line-2); }
.eyebrow .tag { padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 10px; letter-spacing: 0.1em; }
.eyebrow .tag--dev { border-color: var(--warn); color: var(--warn); }
.eyebrow .tag--live { border-color: var(--ok); color: var(--ok); }

h1 { font-size: clamp(38px, 6vw, 72px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; color: var(--text); }
h2 { font-size: clamp(28px, 3.8vw, 44px); font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; color: var(--text); }
h3 { font-size: clamp(18px, 1.8vw, 22px); font-weight: 650; letter-spacing: -0.015em; color: var(--text); }
h4 { font-size: 15px; font-weight: 600; color: var(--text); }
.lede { margin-top: 18px; font-size: clamp(16px, 1.25vw, 18px); line-height: 1.65; color: var(--text-3); max-width: 64ch; }
.lede strong { color: var(--text-2); font-weight: 600; }
.grad { background: linear-gradient(92deg, #c084fc, var(--purple) 40%, var(--magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-cyan { background: linear-gradient(92deg, var(--cyan), #c084fc); -webkit-background-clip: text; background-clip: text; color: transparent; }

.grid { display: grid; gap: 20px; }
.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)); }
.grid-5-7 { grid-template-columns: 5fr 7fr; }
.grid-7-5 { grid-template-columns: 7fr 5fr; }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-5-7, .grid-7-5 { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  background: rgba(8, 8, 24, 0.72);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med), background var(--t-med);
}
.nav.is-scrolled { border-bottom-color: var(--line); background: rgba(8, 8, 24, 0.86); }
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand img { height: 34px; width: auto; }
.brand-name { font-weight: 700; letter-spacing: -0.02em; color: var(--text); font-size: 16px; }
.brand-name small { display: block; font-weight: 500; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-4); line-height: 1.1; }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links > li { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: var(--text-3);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-link:hover, .nav-link[aria-expanded="true"] { color: var(--text); background: var(--surface-2); }
.nav-link.is-active { color: var(--text); }
.nav-link--hi { color: #d8b4fe; }
.nav-link--hi::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 10px var(--purple); }
.nav-link svg { width: 12px; height: 12px; opacity: 0.6; transition: transform var(--t-fast); }
.nav-link[aria-expanded="true"] svg { transform: rotate(180deg); }

.menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px;
  background: rgba(14, 14, 36, 0.98); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 8px; box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.menu.is-open { opacity: 1; transform: none; pointer-events: auto; }
.menu a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; color: var(--text-2); }
.menu a:hover { background: var(--surface-2); color: var(--text); }
.menu a small { font-size: 11.5px; color: var(--text-4); }
.menu a .k { font-family: var(--mono); font-size: 10px; color: var(--purple); letter-spacing: 0.08em; }

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--text);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.nav-cta:hover { border-color: var(--purple-75); background: var(--purple-10); }
.nav-cta svg { width: 16px; height: 16px; }
.nav-cta--blog { border-color: var(--purple-40); color: #d8b4fe; }

.burger { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); place-items: center; }
.burger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; position: relative; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--t-fast), top var(--t-fast); }
.burger span::before { top: -6px; } .burger span::after { top: 6px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.burger[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

.drawer {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 45; background: rgba(8, 8, 24, 0.97);
  overflow-y: auto; padding: 24px var(--gutter) 60px; display: none;
}
.drawer.is-open { display: block; }
.drawer h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-4); margin: 22px 0 8px; }
.drawer a { display: flex; justify-content: space-between; align-items: center; padding: 13px 10px; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 16px; }
.drawer a .k { font-family: var(--mono); font-size: 11px; color: var(--purple); }

@media (max-width: 1080px) {
  .nav-links, .nav-cta--gh { display: none; }
  .burger { display: grid; }
  .brand-name small { display: none; }
}

/* ---------- scroll-spy rail ---------- */
.rail {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 40;
  display: none; flex-direction: column; gap: 10px;
}
@media (min-width: 1360px) { .rail { display: flex; } }
.rail a { position: relative; display: block; width: 22px; height: 14px; }
.rail a::before {
  content: ""; position: absolute; right: 6px; top: 4px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-4); opacity: 0.55; transition: all var(--t-fast);
}
.rail a:hover::before, .rail a.is-active::before { background: var(--purple); opacity: 1; box-shadow: 0 0 12px var(--purple); transform: scale(1.35); }
.rail a .lbl {
  position: absolute; right: 26px; top: -5px; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--text-2);
  background: rgba(14, 14, 36, 0.96); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 9px;
  opacity: 0; transform: translateX(6px); pointer-events: none; transition: all var(--t-fast);
}
.rail a:hover .lbl, .rail a:focus-visible .lbl { opacity: 1; transform: none; }
.rail a .lbl b { color: var(--purple); font-weight: 600; margin-right: 6px; }

.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 42px; height: 42px; border-radius: 12px;
  background: rgba(14, 14, 36, 0.9); border: 1px solid var(--line-2); display: grid; place-items: center;
  opacity: 0; pointer-events: none; transform: translateY(8px); transition: all var(--t-med);
}
.to-top.is-show { opacity: 1; pointer-events: auto; transform: none; }
.to-top svg { width: 16px; height: 16px; }

/* ---------- hero ---------- */
.hero { padding-top: calc(var(--nav-h) + clamp(64px, 10vw, 120px)); padding-bottom: clamp(56px, 8vw, 96px); }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 9px; border-radius: 999px;
  border: 1px solid var(--purple-40); background: var(--purple-10); color: #e9d5ff;
  font-size: 12.5px; font-weight: 500; letter-spacing: 0.01em; margin-bottom: 28px;
}
.hero-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.hero h1 { max-width: 22ch; }
.hero .lede { font-size: clamp(17px, 1.4vw, 20px); max-width: 58ch; margin-top: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--purple); color: #fff; box-shadow: 0 10px 30px -10px var(--purple-75); }
.btn--primary:hover { background: #8a45ff; box-shadow: 0 14px 34px -10px var(--purple); }
.btn--ghost { border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: var(--text-4); background: var(--surface); }
.btn--sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn svg { width: 16px; height: 16px; }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; margin-top: clamp(48px, 7vw, 80px); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--line); }
.stat { background: var(--bg-2); padding: 20px 18px; }
.stat b { display: block; font-size: clamp(22px, 2.2vw, 30px); font-weight: 750; letter-spacing: -0.03em; color: var(--text); line-height: 1.05; }
.stat b em { font-style: normal; color: var(--purple); }
.stat span { display: block; margin-top: 6px; font-size: 12px; color: var(--text-4); letter-spacing: 0.02em; }
@media (max-width: 960px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- cards & primitives ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.card:hover { border-color: var(--line-2); }
.card--glow { position: relative; overflow: hidden; }
.card--glow::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, var(--purple-70), transparent 40%, transparent 60%, var(--magenta-10)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-3); font-size: 14.5px; }
.card .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 16px; background: var(--purple-10); color: #d8b4fe; border: 1px solid var(--purple-40); }
.card .ico svg { width: 19px; height: 19px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 11.5px; color: var(--text-2); background: var(--surface); white-space: nowrap; }
.chip--p { border-color: var(--purple-40); color: #d8b4fe; background: var(--purple-10); }
.chip--c { border-color: rgba(0,180,216,0.4); color: #7dd3fc; background: var(--cyan-10); }
.chip--ok { border-color: rgba(52,211,153,0.4); color: var(--ok); background: var(--ok-10); }
.chip--warn { border-color: rgba(251,191,36,0.4); color: var(--warn); background: var(--warn-10); }
.chip--bad { border-color: rgba(255,77,109,0.4); color: var(--bad); background: var(--bad-10); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 9px; border-radius: 6px; }
.badge--ok { color: var(--ok); background: var(--ok-10); }
.badge--warn { color: var(--warn); background: var(--warn-10); }
.badge--bad { color: var(--bad); background: var(--bad-10); }
.badge--p { color: #d8b4fe; background: var(--purple-10); }
.badge--muted { color: var(--text-4); background: var(--surface-2); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-4); font-family: var(--mono); font-size: 12px; }
.kv dd { margin: 0; color: var(--text-2); }

.source {
  margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline;
  font-family: var(--mono); font-size: 11.5px; color: var(--text-4);
}
.source::before { content: "source"; letter-spacing: 0.12em; text-transform: uppercase; font-size: 10px; color: var(--purple); }
.source code { color: var(--text-3); font-size: 11.5px; }

.callout { border-left: 3px solid var(--purple); background: var(--purple-10); border-radius: 0 var(--r-md) var(--r-md) 0; padding: 16px 20px; color: var(--text-2); font-size: 15px; }
.callout--warn { border-color: var(--warn); background: var(--warn-10); }
.callout--bad { border-color: var(--bad); background: var(--bad-10); }
.callout--ok { border-color: var(--ok); background: var(--ok-10); }
.callout strong { color: var(--text); }

.expander { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.expander + .expander { margin-top: 10px; }
.expander summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-weight: 600; color: var(--text); font-size: 15px; }
.expander summary::-webkit-details-marker { display: none; }
.expander summary::after { content: "+"; font-family: var(--mono); color: var(--text-4); font-size: 18px; transition: transform var(--t-fast); }
.expander[open] summary::after { transform: rotate(45deg); }
.expander .body { padding: 0 18px 18px; color: var(--text-3); font-size: 14.5px; border-top: 1px solid var(--line); padding-top: 14px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-4); font-weight: 500; }
.tbl td { color: var(--text-2); }
.tbl td.mono, .tbl td code { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl .up { color: var(--ok); } .tbl .down { color: var(--ok); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }

/* ---------- widget chrome ---------- */
.widget { border: 1px solid var(--line-2); border-radius: var(--r-xl); background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); overflow: hidden; box-shadow: 0 30px 80px -40px rgba(0,0,0,0.8); }
.widget-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.02); }
.widget-head .title { font-weight: 600; font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 10px; }
.widget-head .title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 8px var(--purple); }
.widget-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.widget-body { padding: 22px; }
@media (max-width: 600px) { .widget-body { padding: 16px; } }

.ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ctl label { font-size: 12.5px; color: var(--text-4); font-family: var(--mono); letter-spacing: 0.04em; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { padding: 8px 13px; font-size: 13px; font-weight: 500; color: var(--text-3); border-right: 1px solid var(--line); transition: background var(--t-fast), color var(--t-fast); }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--purple); color: #fff; }
.seg--sm button { padding: 6px 10px; font-size: 12px; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--text-2); user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .sw { width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background var(--t-fast); flex: none; }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--t-fast); }
.toggle input:checked + .sw { background: var(--purple); border-color: var(--purple); }
.toggle input:checked + .sw::after { transform: translateX(16px); }
.toggle input:focus-visible + .sw { outline: 2px solid var(--cyan); outline-offset: 2px; }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: var(--surface-3); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid var(--purple); cursor: pointer; box-shadow: 0 0 0 4px var(--purple-10); }
.range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid var(--purple); cursor: pointer; }
.range:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; }

.readout { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-2); }
.readout b { color: var(--text); font-weight: 600; }
.big { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: clamp(28px, 3vw, 40px); font-weight: 600; letter-spacing: -0.03em; color: var(--text); line-height: 1; }

.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), #c084fc); transition: width var(--t-med) var(--ease); }
.bar--ok > i { background: linear-gradient(90deg, #059669, var(--ok)); }
.bar--warn > i { background: linear-gradient(90deg, #d97706, var(--warn)); }
.bar--bad > i { background: linear-gradient(90deg, #be123c, var(--bad)); }
.bar--cyan > i { background: linear-gradient(90deg, #0369a1, var(--cyan)); }

.panel { border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(0,0,0,0.25); padding: 16px 18px; }
.panel--code { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--text-3); white-space: pre-wrap; word-break: break-word; }
.panel--code .k { color: #7dd3fc; } .panel--code .s { color: #c4b5fd; } .panel--code .n { color: #fda4af; } .panel--code .c { color: var(--text-4); font-style: italic; } .panel--code .b { color: var(--ok); }
.panel h4 { margin-bottom: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4); font-weight: 500; }

.verdict { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; font-family: var(--mono); font-weight: 600; letter-spacing: 0.08em; font-size: 14px; }
.verdict--ok { background: var(--ok-10); color: var(--ok); border: 1px solid rgba(52,211,153,0.35); }
.verdict--warn { background: var(--warn-10); color: var(--warn); border: 1px solid rgba(251,191,36,0.35); }
.verdict--bad { background: var(--bad-10); color: var(--bad); border: 1px solid rgba(255,77,109,0.35); }
.verdict--muted { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--line-2); }

.log { font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--text-3); max-height: 190px; overflow-y: auto; }
.log div { padding: 2px 0; border-bottom: 1px dashed var(--line); }
.log .t { color: var(--text-4); margin-right: 8px; }
.log .ok { color: var(--ok); } .log .bad { color: var(--bad); } .log .warn { color: var(--warn); } .log .p { color: #d8b4fe; }

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-row .pill { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background var(--t-fast); }
.pill-row .pill.on { background: var(--purple); border-color: var(--purple); }
.pill-row .pill.bad { background: var(--bad); border-color: var(--bad); }
.pill-row .pill.ok { background: var(--ok); border-color: var(--ok); }

/* ---------- architecture explorer ---------- */
.arch { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
@media (max-width: 900px) { .arch { grid-template-columns: 1fr; } }
.arch-nodes { display: flex; flex-direction: column; gap: 6px; position: relative; }
.arch-node {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  transition: all var(--t-fast);
}
.arch-node:hover { border-color: var(--line-2); background: var(--surface-2); }
.arch-node[aria-selected="true"] { border-color: var(--purple-75); background: var(--purple-10); box-shadow: 0 0 0 1px var(--purple-40) inset; }
.arch-node .n { font-family: var(--mono); font-size: 11px; color: var(--purple); }
.arch-node .t { font-weight: 600; color: var(--text); font-size: 14px; }
.arch-node .t small { display: block; font-weight: 400; color: var(--text-4); font-size: 12px; margin-top: 1px; }
.arch-node .arrow { color: var(--text-4); font-size: 12px; }
.arch-node--hi { border-color: var(--magenta); }
.arch-node--hi .n { color: var(--magenta); }
.arch-detail { min-height: 320px; }
.arch-detail .paths { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.arch-detail ul.bul { margin-top: 12px; display: grid; gap: 7px; }
.arch-detail ul.bul li { position: relative; padding-left: 16px; font-size: 14.5px; color: var(--text-3); }
.arch-detail ul.bul li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--purple); }

/* ---------- ticker ---------- */
.ticker { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
@media (max-width: 800px) { .ticker { grid-template-columns: 1fr; } }
.ticker .row { display: grid; grid-template-columns: 70px 1fr 54px; gap: 12px; align-items: center; margin-bottom: 10px; }
.ticker .row .lab { font-family: var(--mono); font-size: 12px; color: var(--text-3); text-transform: capitalize; }
.ticker .row .val { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ticker .meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ticker .meta .cell { padding: 12px 14px; border-radius: 10px; background: rgba(0,0,0,0.25); border: 1px solid var(--line); }
.ticker .meta .cell small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-4); margin-bottom: 4px; }
.ticker .meta .cell b { font-size: 14px; color: var(--text); font-weight: 600; font-family: var(--mono); }
.ticker .live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--ok); }
.ticker .live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- API console ---------- */
.api { display: grid; grid-template-columns: 300px 1fr; gap: 18px; }
@media (max-width: 900px) { .api { grid-template-columns: 1fr; } }
.api-routes { display: flex; flex-direction: column; gap: 4px; }
.api-route { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid transparent; font-family: var(--mono); font-size: 12px; color: var(--text-3); transition: all var(--t-fast); }
.api-route:hover { background: var(--surface-2); color: var(--text); }
.api-route[aria-selected="true"] { background: var(--purple-10); border-color: var(--purple-40); color: var(--text); }
.api-route .m { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; padding: 3px 0; text-align: center; border-radius: 5px; }
.api-route .m.get { background: rgba(52,211,153,0.15); color: var(--ok); } .api-route .m.post { background: rgba(0,180,216,0.15); color: #7dd3fc; } .api-route .m.put { background: rgba(251,191,36,0.15); color: var(--warn); } .api-route .m.ws { background: var(--purple-10); color: #d8b4fe; }
.api-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .api-panes { grid-template-columns: 1fr; } }
.api-status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; }
.api-status .code { padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.api-status .code.ok { background: var(--ok-10); color: var(--ok); } .api-status .code.bad { background: var(--bad-10); color: var(--bad); }

/* ---------- calibration chart ---------- */
.cal-chart svg { width: 100%; height: auto; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-top: 8px; }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- AU explorer ---------- */
.au-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.au-btn { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); transition: all var(--t-fast); }
.au-btn:hover { border-color: var(--line-2); }
.au-btn[aria-pressed="true"] { border-color: var(--purple-75); background: var(--purple-10); }
.au-btn b { display: block; font-family: var(--mono); font-size: 12px; color: var(--text); }
.au-btn span { display: block; font-size: 11.5px; color: var(--text-4); margin-top: 2px; line-height: 1.3; }

/* ---------- ekman accordion ---------- */
.ek-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 800px) { .ek-list { grid-template-columns: repeat(2, 1fr); } }
.ek-btn { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; transition: all var(--t-fast); }
.ek-btn:hover { border-color: var(--line-2); }
.ek-btn[aria-selected="true"] { border-color: var(--purple-75); background: var(--purple-10); }
.ek-btn b { display: block; color: var(--text); font-size: 14px; text-transform: capitalize; }
.ek-btn small { display: block; font-family: var(--mono); font-size: 11px; color: var(--text-4); margin-top: 3px; }

/* ---------- tiers ---------- */
.tiers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
@media (max-width: 700px) { .tiers { grid-template-columns: repeat(5, 1fr); font-size: 11px; } }
.tier { padding: 10px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-align: center; transition: all var(--t-fast); }
.tier b { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.tier small { display: block; font-family: var(--mono); font-size: 10px; color: var(--text-4); margin-top: 3px; }
.tier.on { border-color: var(--purple); background: var(--purple-10); }
.tier.on b { color: #d8b4fe; }
.tier.abst.on { border-color: var(--bad); background: var(--bad-10); } .tier.abst.on b { color: var(--bad); }

/* ---------- robot figure ---------- */
.robot { width: 100%; max-width: 220px; margin-inline: auto; }
.robot .arm { transform-origin: 48px 66px; transition: transform var(--t-med) var(--ease); }
.robot .arm-r { transform-origin: 112px 66px; }
.robot .head { transform-origin: 80px 40px; transition: transform var(--t-med) var(--ease); }

/* ---------- timeline / whats-new ---------- */
.tl { position: relative; display: grid; gap: 14px; }
.tl-item { display: grid; grid-template-columns: 26px 1fr; gap: 14px; }
.tl-item .dot { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--purple-40); background: var(--purple-10); display: grid; place-items: center; color: #d8b4fe; font-family: var(--mono); font-size: 10px; margin-top: 2px; }
.tl-item .body h4 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-item .body p { color: var(--text-3); font-size: 14px; margin-top: 4px; }
.tl-item .body .paths { margin-top: 8px; }

/* ---------- context strip ---------- */
.ctx-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
@media (max-width: 900px) { .ctx-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .ctx-strip { grid-template-columns: repeat(2, 1fr); } }
.ctx { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.ctx b { display: block; font-size: 14px; color: var(--text); text-transform: capitalize; }
.ctx small { display: block; font-family: var(--mono); font-size: 10.5px; margin-top: 6px; letter-spacing: 0.06em; text-transform: uppercase; }
.ctx--ok small { color: var(--ok); } .ctx--bad { border-color: rgba(255,77,109,0.35); } .ctx--bad small { color: var(--bad); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 56px 0 40px; color: var(--text-4); font-size: 13.5px; }
.footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
@media (max-width: 900px) { .footer .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer .cols { grid-template-columns: 1fr; } }
.footer h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.footer a { display: block; padding: 4px 0; color: var(--text-3); }
.footer a:hover { color: var(--text); }
.footer .fine { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 12.5px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---- "A turn, end to end" interaction widget ---- */
.turn-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.turn-stage { display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: center; }
@media (max-width: 640px) { .turn-stage { grid-template-columns: 1fr; } }
.turn-line { display: grid; grid-template-columns: 62px 1fr; gap: 10px; align-items: baseline; margin-top: 12px; }
@media (max-width: 480px) { .turn-line { grid-template-columns: 1fr; gap: 3px; } }
.turn-line .who { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-4); }
.turn-line .said { color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.turn-line--bot .said { color: var(--text); }
.gtok { font-family: var(--mono); font-size: 10.5px; margin: 0 3px; vertical-align: 1px; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.gtok--live { background: var(--purple); color: #fff; border-color: var(--purple); }

/* ---- Use cases: alternating value-card / privacy-panel rows ---- */
.usecase-row { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; align-items: start; margin-top: 26px; }
@media (max-width: 780px) { .usecase-row { grid-template-columns: 1fr; } }
.usecase-card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.usecase-card .ico svg { width: 21px; height: 21px; }
.usecase-card .seg-eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-4); margin-bottom: 6px; }
.usecase-card h3 { font-size: 19px; margin-bottom: 2px; }
.usecase-card .sub { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.usecase-card p.desc { color: var(--text-3); font-size: 14.5px; margin-bottom: 14px; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.check-list svg { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.privacy-panel .why { font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.privacy-panel .why svg { width: 13px; height: 13px; }
.privacy-panel p { color: var(--text-3); font-size: 13.5px; line-height: 1.55; margin-bottom: 14px; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.stat-pair .cell { background: var(--bg-2); padding: 14px 14px 12px; }
.stat-pair .cell b { display: block; font-size: 22px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.stat-pair .cell span { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.stat-pair .cell small { display: block; margin-top: 1px; font-size: 10.5px; color: var(--text-4); }
