/* ============================================================================
   nautris · landing (cinematic dark)
   Scoped stylesheet for index.html only. docs.html / api.html keep styles.css.
   Near-black ground, one electric-cyan accent, a violet gradient partner,
   massive editorial type (Geist) with a technical mono voice (Geist Mono).
   ==========================================================================*/

:root {
  /* ground + surfaces */
  --ink:      #05060a;
  --ink-2:    #070812;
  --panel:    rgba(255, 255, 255, 0.026);
  --panel-2:  rgba(255, 255, 255, 0.05);
  --line:     rgba(255, 255, 255, 0.09);
  --line-2:   rgba(255, 255, 255, 0.14);

  /* text */
  --t1: #eef1f8;
  --t2: #99a2b4;
  --t3: #626b7d;

  /* accents: one electric accent, one violet partner, one emerald for "clean" */
  --cy:  #35e0ee;
  --cy-2:#22c7d8;
  --vi:  #7c6cff;
  --em:  #35d6a0;
  --warn:#f0a24b;

  /* text-safe accents: identical to the brand hues in dark, darkened in light
     so text keeps WCAG 4.5:1. Fills, glows, and borders keep --cy / --em. */
  --cy-text: #35e0ee;
  --em-text: #35d6a0;

  /* white-alpha component surfaces (become ink-alpha in light) */
  --srf-0: rgba(255, 255, 255, 0.012);
  --srf-1: rgba(255, 255, 255, 0.02);
  --srf-2: rgba(255, 255, 255, 0.03);
  --srf-3: rgba(255, 255, 255, 0.05);

  /* dark blurred overlays: popovers, chips, sticky nav, footer wash */
  --overlay:      rgba(7, 8, 18, 0.97);
  --overlay-soft: rgba(10, 12, 20, 0.7);
  --node-fill:    rgba(5, 6, 10, 0.9);

  --glow-cy: 0 0 0 1px rgba(53, 224, 238, 0.35), 0 12px 46px -12px rgba(53, 224, 238, 0.5);
  --shadow:  0 30px 80px -40px rgba(0, 0, 0, 0.9);
  --shadow-pop: 0 20px 50px rgba(0, 0, 0, 0.5);

  --wrap: 1200px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* Light theme: same mechanism as styles.css and the docs site
   (html[data-theme="light"], storage key "nautris-theme").
   Dark stays the default; this block only flips the tokens. */
:root[data-theme="light"] {
  --ink:      #f5f7fb;
  --ink-2:    #eaeef6;
  --panel:    rgba(11, 16, 32, 0.03);
  --panel-2:  rgba(11, 16, 32, 0.055);
  --line:     rgba(11, 16, 32, 0.1);
  --line-2:   rgba(11, 16, 32, 0.16);

  --t1: #0b1020;
  --t2: #3d4557;
  --t3: #5b6478;

  /* darker cyan/emerald for text (>= 4.5:1 on the light ground);
     the electric fills stay untouched */
  --cy-text: #0b7784;
  --em-text: #0c7d5c;

  --srf-0: rgba(11, 16, 32, 0.02);
  --srf-1: rgba(11, 16, 32, 0.035);
  --srf-2: rgba(11, 16, 32, 0.045);
  --srf-3: rgba(11, 16, 32, 0.07);

  --overlay:      rgba(255, 255, 255, 0.97);
  --overlay-soft: rgba(255, 255, 255, 0.8);
  --node-fill:    #ffffff;

  --glow-cy: 0 0 0 1px rgba(14, 143, 158, 0.3), 0 12px 40px -14px rgba(14, 143, 158, 0.3);
  --shadow:  0 24px 60px -32px rgba(11, 16, 32, 0.25);
  --shadow-pop: 0 16px 40px rgba(11, 16, 32, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
/* while the mobile drawer is open, the page behind it must not scroll */
body.menu-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--t1);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* very subtle film grain + vignette over the whole page */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(53, 224, 238, 0.09), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(124, 108, 255, 0.08), transparent 60%),
    radial-gradient(70% 60% at 0% 40%, rgba(53, 224, 238, 0.05), transparent 60%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 999; pointer-events: none; opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

::selection { background: rgba(53, 224, 238, 0.28); color: #fff; }

a { color: inherit; text-decoration: none; }

.wrap { width: min(100% - 44px, var(--wrap)); margin-inline: auto; position: relative; z-index: 2; }

/* ---- WebGL canvas ---------------------------------------------------------*/
#gl {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 1; pointer-events: none;
  opacity: 0; transition: opacity 1.2s ease;
}
#gl.gl-ready { opacity: 1; }

/* mono micro-labels ------------------------------------------------------- */
.mono {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t3);
}
.mono .on { color: var(--cy-text); }

/* ---- nav ------------------------------------------------------------------*/
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.stuck {
  background: var(--overlay-soft);
  backdrop-filter: blur(18px) saturate(1.2);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 26px; height: 66px; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; letter-spacing: -0.01em; font-size: 15.5px; color: var(--t1);
}
/* emblem inherits the brand text colour for its lattice; the cyan star is baked in */
.brand svg { color: var(--t1); filter: drop-shadow(0 0 9px rgba(53, 224, 238, 0.4)); }
.nav-links { display: flex; gap: 24px; margin-inline-start: auto; align-items: center; }
.nav-links a {
  font-size: 13.5px; color: var(--t2); font-weight: 450; letter-spacing: 0.01em;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--t1); }
/* Account / hosted-console entry: accent it so it reads as the sign-in CTA,
   not another content anchor. Higher specificity than `.nav-links a` above. */
.nav-links a.nav-signin { color: var(--cy-text); font-weight: 600; }
.nav-links a.nav-signin:hover { color: var(--cy-text); filter: brightness(1.2); }
.nav-cta { display: inline-flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 13.5px; font-weight: 550; letter-spacing: -0.005em;
  padding: 10px 17px; min-height: 44px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  color: #04121a; background: linear-gradient(180deg, #6ff1fb, var(--cy));
  box-shadow: 0 8px 30px -10px rgba(53, 224, 238, 0.65);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 42px -12px rgba(53, 224, 238, 0.8); }
.btn-ghost { color: var(--t1); border-color: var(--line-2); background: var(--srf-1); }
.btn-ghost:hover { border-color: rgba(53, 224, 238, 0.5); color: var(--t1); background: rgba(53, 224, 238, 0.06); }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 13px; }

/* theme toggle: sun in dark (switch to light), moon in light */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--srf-1); color: var(--t2);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { border-color: rgba(53, 224, 238, 0.4); color: var(--cy-text); }
.theme-toggle .ic-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ic-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ic-moon { display: block; }

/* ---- section rhythm -------------------------------------------------------*/
section { position: relative; z-index: 2; padding: clamp(90px, 13vw, 170px) 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cy-text);
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: linear-gradient(90deg, var(--cy), transparent); }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; margin: 0; }
.grad {
  background: linear-gradient(96deg, #eaf9ff 8%, var(--cy) 46%, var(--vi) 96%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
p { color: var(--t2); }

/* ---- hero -----------------------------------------------------------------*/
.hero {
  min-height: 100svh; display: flex; align-items: center;
  padding-top: 96px; padding-bottom: 40px; overflow: hidden;
}
.hero-grid { display: grid; gap: 30px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; color: var(--t2);
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 100px;
  background: var(--srf-1); backdrop-filter: blur(8px);
}
/* When the pill wraps to 2+ lines on narrow phones, a 100px radius turns it into
   a lopsided stadium - square it off and top-align the dot so it reads clean. */
@media (max-width: 560px) {
  .hero-badge { border-radius: 14px; align-items: flex-start; }
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--em); box-shadow: 0 0 10px var(--em); }
.hero h1 {
  font-size: clamp(46px, 8.4vw, 118px); letter-spacing: -0.045em; line-height: 0.94;
  max-width: 15ch;
}
.hero-sub { font-size: clamp(16px, 1.5vw, 20px); max-width: 56ch; color: var(--t2); line-height: 1.55; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-cap {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em; color: var(--t3);
}
.hero-cap svg { color: var(--em-text); }

/* corner blueprint labels on the hero */
.blueprint { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.bp {
  position: absolute; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--t3); display: flex; align-items: center; gap: 7px;
}
.bp::before { content: ""; width: 5px; height: 5px; border: 1px solid var(--cy); }
.bp.tl { top: 92px; left: 24px; }
.bp.tr { top: 92px; right: 24px; }
.bp.bl { bottom: 26px; left: 24px; }
.bp.br { bottom: 26px; right: 24px; }
@media (max-width: 900px) { .bp { display: none; } }

/* running scroll hint */
.scroll-hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--t3);
}
.scroll-hint .rail { width: 1px; height: 44px; background: linear-gradient(var(--cy), transparent); }
.scroll-hint .bead { width: 4px; height: 4px; border-radius: 50%; background: var(--cy); box-shadow: 0 0 8px var(--cy); animation: bead 2.2s ease-in-out infinite; }
@keyframes bead { 0% { transform: translateY(-6px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(38px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .scroll-hint .bead { animation: none; } }

/* ---- big editorial statement ---------------------------------------------*/
.statement { text-align: left; }
.statement h2 {
  font-size: clamp(34px, 6vw, 84px); letter-spacing: -0.04em; line-height: 1.0; max-width: 20ch;
}
.statement .lead { margin-top: 28px; font-size: clamp(16px, 1.5vw, 19px); max-width: 60ch; }

/* ---- chaos formats --------------------------------------------------------*/
.chaos { position: relative; }

/* ===== Intake pipeline: any input -> nautris -> every output ===== */
.pipeline {
  margin-top: 40px; padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line); border-radius: 20px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(53, 224, 238, 0.06), transparent 60%),
    linear-gradient(180deg, var(--srf-0), transparent);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(56px, 8vw, 108px) auto clamp(56px, 8vw, 108px) minmax(0, 1fr);
  align-items: center; gap: clamp(4px, 1vw, 10px); overflow: hidden;
}
.pl-cap {
  display: block; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--t3); margin-bottom: 12px;
}
.pl-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pl-in { align-items: flex-end; text-align: right; }
.pl-out { align-items: flex-start; text-align: left; }
.pl-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  font-family: var(--mono); font-size: clamp(11px, 1.15vw, 12.5px); color: var(--t1);
  padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--srf-2); white-space: nowrap;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.pl-chip i {
  width: 6px; height: 6px; border-radius: 2px; background: var(--cy);
  box-shadow: 0 0 8px var(--cy); flex: none;
}
.pl-chip.ok i { background: var(--em); box-shadow: 0 0 8px var(--em); }
.pl-out .pl-chip i { background: var(--em); box-shadow: 0 0 8px var(--em); }

/* flow conduits */
.pl-flow { align-self: stretch; min-height: 220px; }
.pl-flow svg { display: block; width: 100%; height: 100%; }
.pl-flow path {
  fill: none; stroke: rgba(53, 224, 238, 0.20); stroke-width: 1.3;
  stroke-dasharray: 5 9; animation: plflow 2.2s linear infinite;
}
.pl-flow-out path { stroke: rgba(53, 214, 160, 0.30); animation-direction: reverse; }
@keyframes plflow { to { stroke-dashoffset: -14; } }

/* nautris core */
.pl-core { position: relative; display: grid; place-items: center; padding: 18px 8px; }
.pl-core-ring {
  position: absolute; width: 108px; height: 108px; border-radius: 26px;
  border: 1px solid rgba(53, 224, 238, 0.30); animation: plpulse 2.8s ease-in-out infinite;
}
.pl-core-mark {
  width: clamp(56px, 8vw, 74px); height: clamp(56px, 8vw, 74px); color: var(--cy-text);
  filter: drop-shadow(0 0 14px rgba(53, 224, 238, 0.5)); position: relative;
}
.pl-core-name {
  margin-top: 12px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--t1);
}
.pl-core-sub {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--cy-text); margin-top: 2px;
}
@keyframes plpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(53, 224, 238, 0.16); opacity: 0.7; }
  50% { box-shadow: 0 0 0 10px rgba(53, 224, 238, 0); opacity: 1; }
}

/* output chips light in sequence */
.pl-out .pl-chip { animation: pllight 5s ease-in-out infinite; animation-delay: calc(var(--i) * 0.4s); }
@keyframes pllight {
  0%, 62%, 100% { border-color: var(--line-2); box-shadow: none; }
  10%, 26% { border-color: rgba(53, 214, 160, 0.6); box-shadow: 0 0 0 1px rgba(53, 214, 160, 0.22); }
}

@media (prefers-reduced-motion: reduce) {
  .pl-flow path, .pl-core-ring, .pl-out .pl-chip { animation: none; }
  .pl-core-ring { opacity: 1; }
}

@media (max-width: 760px) {
  .pipeline { grid-template-columns: 1fr; gap: 18px; text-align: center; }
  .pl-flow { display: none; }
  .pl-side { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; }
  .pl-in, .pl-out { text-align: center; align-items: center; }
  .pl-cap { width: 100%; margin-bottom: 2px; }
}
.chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--t2);
  padding: 9px 13px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--overlay-soft); backdrop-filter: blur(6px);
  will-change: transform;
}
.chip .k { width: 6px; height: 6px; border-radius: 2px; background: var(--warn); }
.chip.ok .k { background: var(--em); }

/* ---- generic panel + grid -------------------------------------------------*/
.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 60px); align-items: center; }
@media (max-width: 900px) { .split2 { grid-template-columns: 1fr; } }
.panel {
  border: 1px solid var(--line); border-radius: 18px; background: var(--panel);
  box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.pad { padding: clamp(20px, 3vw, 34px); }

/* CDOM spec list */
.spec { display: flex; flex-direction: column; gap: 0; }
.spec .row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 18px;
  padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.spec .row:last-child { border-bottom: 0; }
.spec .row .key { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--t3); }
.spec .row .val { color: var(--t1); text-align: right; }

/* node diagram */
.nodemap { width: 100%; height: auto; display: block; }
.nodemap .edge { stroke: rgba(53, 224, 238, 0.28); stroke-width: 1; fill: none; }
.nodemap .edge.dash { stroke-dasharray: 3 5; stroke: rgba(124, 108, 255, 0.4); }
.nodemap .node { fill: var(--node-fill); stroke: var(--line-2); stroke-width: 1; }
.nodemap .node.core { fill: rgba(53, 224, 238, 0.14); stroke: var(--cy); }
/* typed blocks wear the same colors as the trust-overlay legend */
.nodemap .node.n-h { fill: rgba(53, 224, 238, 0.09); stroke: rgba(53, 224, 238, 0.55); }
.nodemap .node.n-t { fill: rgba(124, 108, 255, 0.09); stroke: rgba(124, 108, 255, 0.6); }
.nodemap .node.n-i { fill: rgba(53, 214, 160, 0.09); stroke: rgba(53, 214, 160, 0.55); }
.nodemap text { fill: var(--t2); font-family: var(--mono); font-size: 9px; letter-spacing: 0.04em; }
.nodemap .elabel { fill: var(--t3); font-size: 7.5px; letter-spacing: 0.06em; }
.nodemap .prov { fill: var(--em-text); font-size: 7.5px; letter-spacing: 0.05em; opacity: 0.85; }
.nodemap .pulse { fill: var(--cy); }
/* the svg scales ~0.8x on phones; bump user-unit sizes to stay readable */
@media (max-width: 640px) {
  .nodemap text { font-size: 11px; }
  .nodemap .elabel { font-size: 9.5px; }
  .nodemap .prov { font-size: 9.5px; }
}

/* ---- architecture pipeline -----------------------------------------------*/
.arch { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-top: 46px; }
.stage {
  position: relative; border: 1px solid var(--line); border-radius: 16px; padding: 22px 18px;
  background: var(--panel); overflow: hidden; transition: border-color 0.3s ease, transform 0.3s ease;
}
.stage:hover { border-color: rgba(53, 224, 238, 0.4); transform: translateY(-4px); }
.stage .st-n { font-family: var(--mono); font-size: 11px; color: var(--cy-text); letter-spacing: 0.14em; }
.stage h3 { margin: 12px 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.stage p { font-size: 13px; color: var(--t2); margin: 0; line-height: 1.5; }
.stage.hl { border-color: rgba(53, 224, 238, 0.5); background: linear-gradient(180deg, rgba(53, 224, 238, 0.08), var(--panel)); }
.stage.hl::before {
  content: ""; position: absolute; inset: -1px; border-radius: 16px; pointer-events: none;
  box-shadow: inset 0 0 40px -12px rgba(53, 224, 238, 0.5);
}
.arch-flow { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.arch-flow .tok { font-family: var(--mono); font-size: 12px; color: var(--t2); }
.arch-flow .tok.core { color: var(--cy-text); }
.arch-flow .arw { color: var(--t3); }

/* ---- interactive outputs --------------------------------------------------*/
.outs { margin-top: 40px; }
/* Output-format picker: a styled native <select> (was a tab strip - a dropdown
   reads cleaner and is fully responsive at any width). */
.out-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.out-label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--t3); }
.out-select-wrap { position: relative; display: inline-flex; flex: 1 1 240px; max-width: 340px; }
.out-select {
  appearance: none; -webkit-appearance: none; width: 100%;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--t1); color-scheme: dark;
  background: var(--srf-2); border: 1px solid var(--line-2); border-radius: 11px;
  padding: 11px 42px 11px 16px; min-height: 46px; cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.out-select:hover { border-color: rgba(53, 224, 238, 0.5); background: rgba(53, 224, 238, 0.05); }
.out-select:focus-visible { outline: none; border-color: var(--cy-text); box-shadow: 0 0 0 3px rgba(53, 224, 238, 0.22); }
.out-select option { background: var(--ink-2); color: var(--t1); }
.out-select-caret { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--cy-text); pointer-events: none; }
.out-stage { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; align-items: stretch; }
@media (max-width: 860px) { .out-stage { grid-template-columns: 1fr; } }
.code {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: #cfe9f2;
  padding: 22px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 12, 20, 0.9), rgba(6, 8, 14, 0.95));
  overflow: auto; min-height: 320px; white-space: pre; box-shadow: var(--shadow);
}
.code .cm { color: #55627a; }
.code .ky { color: var(--cy); }
.code .st { color: #a5f0c8; }
.code .nu { color: var(--vi); }
.out-note { display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.out-note h3 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.03em; }
.out-note p { font-size: 14.5px; }
.out-note .from { font-family: var(--mono); font-size: 11.5px; color: var(--t3); letter-spacing: 0.06em; }
.out-note .from b { color: var(--cy-text); }
.fade-swap { animation: fadeSwap 0.4s ease; }
@keyframes fadeSwap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-swap { animation: none; } }

/* ---- deterministic vs AI --------------------------------------------------*/
.versus { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 44px; }
@media (max-width: 780px) { .versus { grid-template-columns: 1fr; } }
.vs-col { border: 1px solid var(--line); border-radius: 18px; padding: 28px; background: var(--panel); }
.vs-col.bad { background: linear-gradient(180deg, rgba(240, 90, 90, 0.05), var(--panel)); }
.vs-col.good { border-color: rgba(53, 224, 238, 0.35); background: linear-gradient(180deg, rgba(53, 224, 238, 0.07), var(--panel)); box-shadow: var(--glow-cy); }
.vs-col .vs-h { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.vs-col.bad .vs-h { color: #f0776b; }
.vs-col.good .vs-h { color: var(--cy-text); }
.vs-col ul { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 15px; }
.vs-col li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--t1); }
.vs-col li span { color: var(--t2); font-size: 13.5px; display: block; margin-top: 2px; }
.vs-col li svg { flex: 0 0 auto; margin-top: 3px; }
.vs-col.bad li svg { color: #f0776b; }
.vs-col.good li svg { color: var(--cy-text); }
.vs-foot { margin-top: 26px; font-family: var(--mono); font-size: 12px; color: var(--t3); letter-spacing: 0.03em; text-align: center; }
.vs-foot b { color: var(--cy-text); }

/* ---- enterprise band ------------------------------------------------------*/
.sectors { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.sector {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em; color: var(--t1);
  padding: 11px 16px; border: 1px solid var(--line-2); border-radius: 100px;
  background: var(--srf-1); transition: all 0.25s ease;
}
.sector:hover { border-color: rgba(53, 224, 238, 0.5); color: var(--cy-text); }
.guarantees { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 34px; }
.gtee { border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: var(--panel); }
.gtee .g-k { font-family: var(--mono); font-size: 11px; color: var(--cy-text); letter-spacing: 0.12em; }
.gtee h3 { margin: 10px 0 5px; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.gtee p { font-size: 13px; margin: 0; color: var(--t2); line-height: 1.5; }

/* stat strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 20px; margin-top: 44px; }
.stat .n {
  font-size: clamp(34px, 5vw, 58px); font-weight: 600; letter-spacing: -0.04em; line-height: 1;
  background: linear-gradient(180deg, #fff, var(--cy)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat .l { margin-top: 10px; font-size: 13px; color: var(--t2); max-width: 22ch; }

/* languages strip */
.langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.lang { font-family: var(--mono); font-size: 12px; color: var(--t2); padding: 8px 13px; border: 1px solid var(--line); border-radius: 9px; }
.lang.acc { color: var(--cy-text); border-color: rgba(53, 224, 238, 0.35); }

/* ---- license --------------------------------------------------------------*/
.license-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 44px; }
.lic-card { border: 1px solid var(--line); border-radius: 20px; padding: 30px; background: var(--panel); display: flex; flex-direction: column; }
.lic-card.featured { border-color: rgba(53, 224, 238, 0.4); background: linear-gradient(180deg, rgba(53, 224, 238, 0.08), var(--panel)); box-shadow: var(--glow-cy); }
.lic-tier { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t3); }
.lic-card.featured .lic-tier { color: var(--cy-text); }
.lic-price { margin-top: 12px; font-size: clamp(30px, 4vw, 44px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.lic-price span { display: block; margin-top: 8px; font-size: 13px; font-weight: 450; letter-spacing: 0; color: var(--t2); font-family: var(--mono); }
.lic-card ul { list-style: none; padding: 0; margin: 26px 0 28px; display: flex; flex-direction: column; gap: 13px; }
.lic-card li { display: flex; gap: 11px; align-items: flex-start; font-size: 14.5px; color: var(--t1); line-height: 1.4; }
.lic-card li svg { flex: 0 0 auto; margin-top: 2px; color: var(--cy-text); }
.lic-card .btn { margin-top: auto; justify-content: center; }
.lic-note { margin-top: 26px; font-family: var(--mono); font-size: 12px; color: var(--t3); letter-spacing: 0.03em; }
.lic-note a { color: var(--cy-text); }

/* ---- final cta ------------------------------------------------------------*/
.finale { text-align: center; min-height: 92svh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.finale h2 { font-size: clamp(38px, 7.4vw, 104px); letter-spacing: -0.045em; line-height: 0.96; max-width: 16ch; margin-inline: auto; }
.finale p { margin: 26px auto 0; max-width: 52ch; font-size: clamp(16px, 1.6vw, 19px); }
.finale .hero-cta { justify-content: center; margin-top: 40px; }

/* ---- footer ---------------------------------------------------------------*/
footer { position: relative; z-index: 2; border-top: 1px solid var(--line); padding: 42px 0; background: var(--overlay-soft); }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-links a { font-size: 13.5px; color: var(--t2); transition: color 0.2s ease; display: inline-flex; align-items: center; min-height: 44px; }
.foot-links a:hover { color: var(--cy-text); }
.foot-meta { font-family: var(--mono); font-size: 11.5px; color: var(--t3); letter-spacing: 0.05em; }

/* ---- reveal on scroll -----------------------------------------------------*/
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* mobile nav trim */
.nav-burger { display: none; }
/* Burger engages at 1100px (not 1020) so the 10-link desktop nav never
   overflows in the 1021-1090px band (iPad portrait / small laptops). */
@media (max-width: 1100px) {
  .nav-links { display: none; }
  /* Burger is the only right-hand control on mobile; the "Start building"
     nav button crowded it and the hero + drawer already cover that action. */
  .nav-cta { display: none; }
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-inline-start: auto; flex: none;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--srf-1); color: var(--t1); cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
  }
  .nav-burger:hover { border-color: rgba(53, 224, 238, 0.4); color: var(--cy-text); }
  .nav-burger .ic-close { display: none; }
  .nav.open .nav-burger .ic-close { display: block; }
  .nav.open .nav-burger .ic-menu { display: none; }
  .nav.open {
    background: var(--overlay);
    backdrop-filter: blur(18px) saturate(1.2);
    border-bottom-color: var(--line);
  }
  .nav.open .nav-links {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 66px; left: 0; right: 0; margin: 0;
    max-height: calc(100dvh - 66px); overflow-y: auto;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding: 8px clamp(20px, 5vw, 40px) 16px;
    background: var(--overlay);
    backdrop-filter: blur(18px) saturate(1.2);
    border-bottom: 1px solid var(--line);
  }
  .nav.open .nav-links a {
    display: flex; align-items: center; min-height: 46px;
    font-size: 15px; border-bottom: 1px solid var(--srf-3);
  }
  .nav.open .nav-links a:last-child { border-bottom: none; }
}

/* ================= SEMANTIC LAYER / FIELDS ================= */
.spec .conf { color: var(--em-text); font-family: var(--mono); font-size: 11px; margin-left: 8px; opacity: 0.85; }

/* ================= TRUST OVERLAY PROOF ================= */
.dp-page {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, var(--srf-3), var(--srf-0));
  border: 1px solid var(--line); padding: 22px 22px 26px; box-shadow: var(--shadow);
}
.dp-line { height: 8px; border-radius: 3px; background: var(--srf-3); margin: 0 0 13px; }
.bx { position: absolute; border: 1.5px solid; border-radius: 5px; pointer-events: none; }
.bx::before {
  content: attr(data-n); position: absolute; top: -9px; left: -1px;
  font: 600 10px/1 var(--mono); padding: 2px 5px; border-radius: 4px; color: #05060a;
}
.bx.head  { border-color: var(--cy); background: rgba(53, 224, 238, 0.09); }
.bx.head::before  { background: var(--cy); }
.bx.table { border-color: var(--vi); background: rgba(124, 108, 255, 0.09); }
.bx.table::before { background: var(--vi); }
.bx.image { border-color: var(--em); background: rgba(53, 214, 160, 0.09); }
.bx.image::before { background: var(--em); }
.bx.pii   { border-style: dashed; border-color: var(--warn); background: rgba(240, 162, 75, 0.11); }
.bx.pii::before   { content: "PII"; background: var(--warn); }
.proof-legend { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 22px; }
.leg { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--t2); }
.leg .sw { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid; flex: none; }
.leg.head .sw  { border-color: var(--cy); background: rgba(53, 224, 238, 0.14); }
.leg.table .sw { border-color: var(--vi); background: rgba(124, 108, 255, 0.14); }
.leg.image .sw { border-color: var(--em); background: rgba(53, 214, 160, 0.14); }
.leg.pii .sw   { border-color: var(--warn); border-style: dashed; background: rgba(240, 162, 75, 0.16); }

/* ================= A11Y: SKIP LINK + FOCUS ================= */
.skip-link {
  position: fixed; top: -56px; left: 16px; z-index: 200;
  padding: 12px 18px; border-radius: 10px;
  background: var(--cy); color: #04121a; font-weight: 600; font-size: 13.5px;
  transition: top 0.2s ease;
}
.skip-link:focus-visible { top: 12px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--cy-text); outline-offset: 3px; border-radius: 6px;
}

/* ================= STATS FOOTNOTE ================= */
.stats-note { margin-top: 18px; font: 400 12.5px/1.7 var(--mono); color: var(--t3); }
.stats-note a { color: var(--t2); text-decoration: underline; text-underline-offset: 3px; }
.stats-note a:hover { color: var(--cy-text); }

/* ================= QUICKSTART ================= */
.qs { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; margin-top: 44px; }
.qs-step {
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--line); border-radius: 16px; padding: 22px;
  background: linear-gradient(180deg, var(--srf-2), var(--srf-0));
}
.qs-n { font: 500 11.5px/1 var(--mono); color: var(--cy-text); letter-spacing: 0.16em; }
.qs-step h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.qs-step > p { font-size: 13.5px; color: var(--t2); }
.qs-step .code { margin-top: auto; min-height: 0; padding: 16px 18px; font-size: 12px; }
.qs-foot { margin-top: 20px; font-size: 13.5px; color: var(--t3); }
.qs-foot a { color: var(--t2); text-decoration: underline; text-underline-offset: 3px; }
.qs-foot a:hover { color: var(--cy-text); }

/* ================= FAQ ================= */
.faq { max-width: 780px; margin-top: 40px; }
.qa {
  border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px;
  background: linear-gradient(180deg, var(--srf-1), var(--srf-0));
}
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 20px; min-height: 44px; cursor: pointer; list-style: none;
  font-weight: 550; font-size: 15.5px; color: var(--t1); letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+"; flex: none; font: 300 22px/1 var(--mono); color: var(--cy-text);
  transition: transform 0.25s ease;
}
.qa[open] summary::after { transform: rotate(45deg); }
.qa summary:hover { color: var(--cy-text); }
.qa .qa-a { padding: 0 20px 18px; color: var(--t2); font-size: 14.5px; max-width: 66ch; }
@media (prefers-reduced-motion: reduce) { .qa summary::after { transition: none; } }

/* Benchmarks: a terminal-styled run log (how the numbers were actually
   produced) beside CSS-only bars. Single cyan hue carries magnitude; every
   value is also plain text, so nothing depends on the bars to be read. */
.bench-term { padding: clamp(18px, 2.4vw, 26px); font-family: var(--mono); font-size: 12.5px; display: flex; flex-direction: column; gap: 11px; }
.bt-line {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 9px; align-items: baseline; color: var(--t2); line-height: 1.5;
}
.bt-x { min-width: 0; }
.bt-prompt { color: var(--t1); }
.bt-dollar { color: var(--cy-text); }
.bt-ok { color: var(--em-text); font-weight: 500; flex: none; }
.bt-t { color: var(--cy-text); font-variant-numeric: tabular-nums; text-align: right; padding-inline-start: 8px; white-space: nowrap; }
.bt-dim { color: var(--t3); font-size: 11.5px; margin-top: 3px; }
.bt-dim, .bt-prompt .bt-x { grid-column: span 2; }
.bench-bars { display: flex; flex-direction: column; gap: 12px; }
.bb-title { font: 500 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--t3); margin-top: 10px; }
.bb-title:first-child { margin-top: 4px; }
.bb-row { display: grid; grid-template-columns: 118px 1fr 52px; align-items: center; gap: 12px; }
.bb-k { font-size: 12.5px; color: var(--t2); }
.bb-v { font-family: var(--mono); font-size: 12.5px; color: var(--t1); text-align: right; font-variant-numeric: tabular-nums; }
.bb-track { height: 8px; border-radius: 4px; background: var(--srf-3); overflow: hidden; }
.bb-fill { height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--cy-2), var(--cy)); transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s; }
.bench-bars.in .bb-fill { width: var(--w); }
.bb-stack { display: flex; gap: 2px; }
.bb-seg { height: 30px; border-radius: 6px; display: flex; align-items: center; padding: 0 10px; width: var(--w); min-width: 0; }
.bb-seg span { font-family: var(--mono); font-size: 11px; color: var(--t1); white-space: nowrap; }
.bb-seg-net { background: var(--srf-3); border: 1px solid var(--line); }
.bb-seg-eng { background: rgba(53, 224, 238, 0.16); border: 1px solid rgba(53, 224, 238, 0.4); }
.bb-cost { font-size: 13px; color: var(--t2); margin: 0; }
.bb-cost .bb-num { font-family: var(--mono); font-size: 15px; color: var(--t1); font-weight: 500; }
.bb-cost .bb-note { color: var(--t3); font-size: 12px; }
.bb-legend { display: none; margin: 0; gap: 16px; }
.bb-leg { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; color: var(--t2); }
.bb-sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.bb-sw-net { background: var(--srf-3); border: 1px solid var(--line); }
.bb-sw-eng { background: rgba(53, 224, 238, 0.16); border: 1px solid rgba(53, 224, 238, 0.4); }
@media (prefers-reduced-motion: reduce) { .bb-fill { transition: none; } .bench-bars .bb-fill { width: var(--w); } }
@media (max-width: 640px) {
  .bb-row { grid-template-columns: 96px 1fr 46px; gap: 9px; }
  .bb-seg { height: 16px; padding: 0; }
  .bb-seg span { display: none; }
  .bb-legend { display: flex; }
  .bt-t { padding-inline-start: 0; }
}

/* FAQ: two-column accordion at desktop for the same reason. align-items:start
   keeps closed cards top-aligned when a neighbor opens. */
@media (min-width: 900px) {
  .faq { max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; align-items: start; }
  .faq .qa { margin-bottom: 0; }
}

/* Small screens: spec rows stack (long benchmark keys/values would otherwise
   squeeze into two skinny columns), and the FAQ marker pins to the first line
   of a wrapped question instead of floating mid-block. */
@media (max-width: 640px) {
  .spec .row { flex-direction: column; align-items: flex-start; gap: 5px; }
  .spec .row .val { text-align: left; }
  .qa summary { align-items: flex-start; font-size: 14.5px; padding: 15px 16px; }
  .qa summary::after { margin-top: 1px; }
  .qa .qa-a { padding: 0 16px 16px; font-size: 13.5px; }
}

/* Finale: subordinate "try the hosted cloud" line under the self-host CTAs.
   Self-host stays the primary path; this is the quiet alternative. */
.cloud-alt { margin-top: 20px; font-size: 14px; color: var(--t2); }
.cloud-alt a { color: var(--cy-text); font-weight: 600; }
.cloud-alt a:hover { filter: brightness(1.15); }

/* ================= contact ================= */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 44px; }
.contact-card {
  display: flex; flex-direction: column; gap: 9px; padding: 26px 24px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
  color: inherit; text-decoration: none; transition: border-color 0.2s ease, transform 0.2s ease;
}
a.contact-card:hover { border-color: rgba(53, 224, 238, 0.45); transform: translateY(-2px); }
.contact-card .cc-k { font: 500 11px/1 var(--mono); letter-spacing: 0.14em; color: var(--cy-text); }
.contact-card h3 { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
.contact-card p { font-size: 13.5px; color: var(--t2); margin: 0; line-height: 1.6; }
.contact-card .cc-links a { color: var(--t1); text-decoration: underline; text-underline-offset: 3px; }
.contact-card .cc-links a:hover { color: var(--cy-text); }
@media (prefers-reduced-motion: reduce) { a.contact-card:hover { transform: none; } }

/* ================= scripted guide widget =================
   Not an AI and not a service: a static, scripted helper. Runs entirely in
   the visitor's browser; nothing typed in it ever leaves the page. */
.chat { position: fixed; right: 18px; bottom: 18px; z-index: 500; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.chat-fab {
  width: 52px; height: 52px; border-radius: 50%; cursor: pointer; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(53, 224, 238, 0.35); color: var(--cy-text);
  background: var(--overlay); box-shadow: var(--shadow-pop);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.chat-fab:hover { border-color: var(--cy-text); transform: translateY(-2px); }
.chat-ping { position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--em); box-shadow: 0 0 10px var(--em); }
.chat-panel {
  width: min(360px, calc(100vw - 36px));
  border: 1px solid var(--line-2); border-radius: 18px; overflow: hidden;
  background: var(--overlay); backdrop-filter: blur(14px);
  box-shadow: var(--shadow-pop);
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.chat-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--em); box-shadow: 0 0 9px var(--em); flex: none; }
.chat-title { font-size: 13.5px; font-weight: 600; color: var(--t1); line-height: 1.25; }
.chat-title span { display: block; font: 400 10.5px/1.4 var(--mono); color: var(--t3); letter-spacing: 0.04em; }
.chat-close { margin-inline-start: auto; width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: transparent; color: var(--t3); cursor: pointer; }
.chat-close:hover { color: var(--t1); background: var(--srf-3); }
.chat-log { max-height: min(320px, 45vh); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.chat-log .msg { max-width: 88%; padding: 10px 13px; border-radius: 13px; font-size: 13.5px; line-height: 1.55; }
.chat-log .bot { align-self: flex-start; background: var(--srf-3); border: 1px solid var(--line); color: var(--t1); border-bottom-left-radius: 5px; }
.chat-log .user { align-self: flex-end; background: rgba(53, 224, 238, 0.12); border: 1px solid rgba(53, 224, 238, 0.25); color: var(--t1); border-bottom-right-radius: 5px; overflow-wrap: anywhere; }
.chat-log .bot a { color: var(--cy-text); text-decoration: underline; text-underline-offset: 3px; }
.chat-log .bot .mono { font-family: var(--mono); font-size: 12px; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 14px 12px; }
.chat-chip { font: 500 12px/1 var(--mono); color: var(--t2); padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease; }
.chat-chip:hover { color: var(--cy-text); border-color: rgba(53, 224, 238, 0.4); }
.chat-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; min-width: 0; height: 40px; padding: 0 13px; font: 400 13.5px/1 var(--font); color: var(--t1);
  background: var(--srf-2); border: 1px solid var(--line); border-radius: 11px; outline: none;
}
.chat-form input:focus { border-color: rgba(53, 224, 238, 0.45); }
.chat-form input::placeholder { color: var(--t3); }
.chat-form button { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(53, 224, 238, 0.35); border-radius: 11px; background: rgba(53, 224, 238, 0.1); color: var(--cy-text); cursor: pointer; }
.chat-form button:hover { background: rgba(53, 224, 238, 0.18); }
@media (prefers-reduced-motion: reduce) { .chat-fab:hover { transform: none; } }
@media (max-width: 560px) { .chat { right: 12px; bottom: 12px; } }

/* ================= public benchmark ranking ================= */
.pubbench { margin-top: clamp(48px, 7vw, 84px); }
.pb-head { font-size: clamp(22px, 3vw, 34px); letter-spacing: -0.025em; max-width: 26ch; }
.pb-sub { margin-top: 14px; max-width: 64ch; font-size: 14.5px; color: var(--t2); }
.pb-table { margin-top: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.pb-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: baseline;
  gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.pb-row:last-child { border-bottom: 0; }
.pb-rank { font-family: var(--mono); font-size: 13px; color: var(--t3); }
.pb-name { font-size: 14px; color: var(--t2); min-width: 0; }
.pb-scores { font-family: var(--mono); font-size: 12px; color: var(--t3); text-align: right; font-variant-numeric: tabular-nums; }
.pb-scores em { font-style: normal; color: var(--t2); font-weight: 550; }
.pb-you { background: rgba(53, 224, 238, 0.06); border-left: 2px solid var(--cy); }
.pb-fast { background: rgba(53, 224, 238, 0.03); border-left: 2px solid rgba(53, 224, 238, 0.45); }
.pb-you .pb-rank { color: var(--cy-text); font-weight: 700; }
.pb-you .pb-name { color: var(--t1); font-weight: 600; }
.pb-you .pb-scores, .pb-you .pb-scores em { color: var(--t1); }
.pb-more .pb-name { color: var(--t3); font-size: 13px; }
@media (max-width: 720px) {
  .pb-row { grid-template-columns: 32px minmax(0, 1fr); }
  .pb-scores { grid-column: 2; text-align: left; white-space: normal; }
}

/* ================= nav dropdown groups ================= */
.nav-group { position: relative; display: flex; align-items: center; }
.nav-links > .nav-signin { display: inline-flex; align-items: center; min-height: 44px; }
.nav-group-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none;
  font: 450 13.5px/1 var(--font); letter-spacing: 0.01em; color: var(--t2); cursor: pointer;
  min-height: 44px; transition: color 0.2s ease;
}
.nav-group-btn:hover, .nav-group.open .nav-group-btn { color: var(--t1); }
.nav-group-btn .chev { transition: transform 0.2s ease; opacity: 0.7; }
.nav-group.open .nav-group-btn .chev { transform: rotate(180deg); }
.nav-drop {
  position: absolute; top: calc(100% - 8px); left: 50%; transform: translateX(-50%);
  min-width: 188px; padding: 8px; display: none; flex-direction: column; gap: 1px;
  background: var(--overlay); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--shadow-pop); backdrop-filter: blur(14px);
}
.nav-group.open .nav-drop { display: flex; }
.nav-links .nav-drop a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 9px; }
.nav-links .nav-drop a:hover { color: var(--t1); background: var(--srf-3); }
.nav-drop .nav-soon { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; font-size: 13.5px; color: var(--t3); cursor: default; }
.soon-tag {
  font: 550 9.5px/1 var(--mono); font-style: normal; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cy-text); border: 1px solid rgba(53, 224, 238, 0.35); padding: 3px 7px; border-radius: 999px;
}
@media (prefers-reduced-motion: reduce) { .nav-group-btn .chev { transition: none; } }

/* mobile drawer: dropdown groups flatten into labeled sections */
@media (max-width: 1100px) {
  .nav.open .nav-links .nav-group { display: block; width: 100%; }
  .nav.open .nav-group-btn {
    pointer-events: none; width: 100%; min-height: 38px; margin-top: 6px;
    font: 500 10.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--t3);
  }
  .nav.open .nav-group-btn .chev { display: none; }
  .nav.open .nav-drop {
    display: flex; position: static; transform: none; min-width: 0; padding: 0; gap: 0;
    background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none;
  }
  .nav.open .nav-links .nav-drop a { min-height: 46px; padding: 0; border-radius: 0; }
  .nav.open .nav-links .nav-drop a:hover { background: none; }
}

/* ================= light-mode art direction =================
   Component-level fixes the tokens alone cannot express. The WebGL canvas,
   grain, and gradient text were tuned for a near-black ground; in light they
   are toned down or re-anchored so the page reads intentional.
   Code blocks (.code) deliberately STAY dark in both themes. */
:root[data-theme="light"] #gl.gl-ready { opacity: 0.22; filter: saturate(0.8); }
:root[data-theme="light"] body::before { opacity: 0.5; }
:root[data-theme="light"] body::after { opacity: 0.14; }
:root[data-theme="light"] ::selection { background: rgba(14, 143, 158, 0.22); color: #04121a; }
:root[data-theme="light"] .grad {
  background-image: linear-gradient(96deg, #101828 8%, #0b7784 46%, #5a48e0 96%);
}
:root[data-theme="light"] .stat .n {
  background-image: linear-gradient(180deg, #101828, #0b7784);
}
:root[data-theme="light"] .vs-col.bad .vs-h,
:root[data-theme="light"] .vs-col.bad li svg { color: #c0392b; }
:root[data-theme="light"] .out-select { color-scheme: light; }
:root[data-theme="light"] .brand svg { filter: drop-shadow(0 0 9px rgba(53, 224, 238, 0.25)); }
