/* ==========================================================================
   slopguard.dev — design system
   Zero dependencies. Self-hosted fonts. Dark only.
   ========================================================================== */

/* ---- Fonts (self-hosted) ------------------------------------------------ */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
}

/* ---- Tokens -------------------------------------------------------------- */
:root {
  --bg: #07080b;
  --bg-raised: #0d0f14;
  --bg-panel: #10131a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  --ink: #f2f4f8;
  --ink-soft: #b8bec9;
  --ink-faint: #79808d;

  --lime: #c8ff3e;
  --lime-soft: rgba(200, 255, 62, 0.14);
  --red: #ff4d5e;
  --red-soft: rgba(255, 77, 94, 0.13);
  --amber: #ffb224;
  --cyan: #5fd4ff;

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --radius-lg: 22px;
  --container: 1180px;
  --nav-h: 65px;
}

/* ---- Reset / base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--lime); color: #0a0c04; }

img, video, canvas { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

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

.container {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

/* ---- Backdrop texture ----------------------------------------------------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(200, 255, 62, 0.07), transparent 60%),
    radial-gradient(800px 600px at -10% 25%, rgba(95, 212, 255, 0.05), transparent 55%),
    var(--bg);
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  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: 56px 56px;
  mask-image: radial-gradient(1200px 800px at 50% 0%, black 30%, transparent 80%);
}

/* ---- Nav ------------------------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 8, 11, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
}
.brand svg { width: 28px; height: 28px; }
.brand .tld { color: var(--ink-faint); font-weight: 500; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15.5px;
  font-weight: 500;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink) !important;
  transition: border-color 0.15s, background 0.15s;
}
.nav-cta:hover { border-color: var(--lime); background: var(--lime-soft); }
.nav-cta svg { width: 17px; height: 17px; }

/* ---- Hero ------------------------------------------------------------------ */
.hero {
  padding: 80px 0 72px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 26vw, 360px);
  gap: clamp(40px, 5vw, 88px);
  align-items: center;
}
.hero-video .video-frame {
  border-radius: 26px;
}
.hero-video-caption {
  margin: 16px 0 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lime);
  border: 1px solid rgba(200, 255, 62, 0.3);
  background: rgba(200, 255, 62, 0.06);
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 34px;
}
.hero-eyebrow .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px var(--lime);
}
.hero h1 {
  font-size: clamp(46px, 7.4vw, 96px);
  max-width: 13ch;
}
.hero h1 .accent {
  color: var(--lime);
  text-shadow: 0 0 50px rgba(200, 255, 62, 0.35);
}
.hero h1 .strike {
  position: relative;
  color: var(--ink-faint);
  white-space: nowrap;
}
.hero h1 .strike::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  top: 54%;
  height: 0.07em;
  background: var(--red);
  transform: rotate(-2deg);
  border-radius: 2px;
}
.hero-sub {
  margin: 32px 0 0;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 62ch;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  padding: 15px 28px;
  border-radius: 12px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.btn-primary {
  background: var(--lime);
  color: #0b0d04;
  box-shadow: 0 0 0 1px rgba(200, 255, 62, 0.4), 0 8px 32px rgba(200, 255, 62, 0.22);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(200,255,62,.5), 0 14px 44px rgba(200,255,62,.3); }
.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink-faint); transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; }

.hero-install {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink-soft);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
}
.hero-install .ps1 { color: var(--lime); user-select: none; }

/* ---- Language switcher (Swift / TypeScript / Go / Kotlin / Python) --------- */
/* Visibility is driven by html[data-lang], set synchronously by a tiny head
   script, so there's no flash of the wrong language. We only ever hide — never
   force a display value — so each block keeps its own author display. */
html[data-lang="swift"]  :is(.ts-only, .go-only, .kotlin-only, .python-only),
html[data-lang="ts"]     :is(.swift-only, .go-only, .kotlin-only, .python-only),
html[data-lang="go"]     :is(.swift-only, .ts-only, .kotlin-only, .python-only),
html[data-lang="kotlin"] :is(.swift-only, .ts-only, .go-only, .python-only),
html[data-lang="python"] :is(.swift-only, .ts-only, .go-only, .kotlin-only) { display: none !important; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}
.lang-select {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  background-color: var(--bg-raised);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8bec9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 15px 42px 15px 18px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.lang-select:hover { border-color: var(--lime); background-color: var(--bg-panel); }
.lang-select:focus-visible { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.lang-select option { background: var(--bg-panel); color: var(--ink); }

/* ---- Hero terminal --------------------------------------------------------- */
.terminal {
  background: #0b0d12;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.02) inset;
  overflow: hidden;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}
.terminal-bar .b { width: 12px; height: 12px; border-radius: 50%; background: #3a3f4b; }
.terminal-bar .b:nth-child(1) { background: #ff5f57; }
.terminal-bar .b:nth-child(2) { background: #febc2e; }
.terminal-bar .b:nth-child(3) { background: #28c840; }
.terminal-bar .title {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-faint);
}
.terminal pre {
  margin: 0;
  padding: 22px 24px 26px;
  font-size: 14px;
  line-height: 1.66;
  overflow-x: auto;
  color: #cdd3de;
}
.terminal .cmd { color: var(--ink); font-weight: 500; }
.terminal .ps1 { color: var(--lime); }
.terminal .dim { color: var(--ink-faint); }
.terminal .bad { color: var(--red); font-weight: 500; }
.terminal .warn { color: var(--amber); }
.terminal .good { color: var(--lime); }
.terminal .cy { color: var(--cyan); }

.hero-terminal { margin-top: 72px; }

/* ---- Sections --------------------------------------------------------------- */
section { padding: 110px 0; }
.section-kicker {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 18px;
}
.section-title {
  font-size: clamp(34px, 4.6vw, 58px);
  max-width: 22ch;
}
.section-lede {
  margin: 24px 0 0;
  font-size: 20px;
  color: var(--ink-soft);
  max-width: 62ch;
}
.section-lede strong { color: var(--ink); }

/* ---- Thesis cards ------------------------------------------------------------ */
.thesis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 58px;
}
.thesis-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 30px 34px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.thesis-card:hover { border-color: rgba(200, 255, 62, 0.35); transform: translateY(-4px); }
.thesis-card .num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--lime);
  letter-spacing: 0.08em;
}
.thesis-card h3 {
  font-size: 23px;
  margin: 14px 0 12px;
  letter-spacing: -0.01em;
}
.thesis-card p { margin: 0; font-size: 16.5px; color: var(--ink-soft); }
.thesis-card p strong { color: var(--ink); }

/* ---- CRAP demo (typed code + tests, live score below) ------------------------ */
.crap-demo {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 52px;
}
.demo-editors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.demo-pane {
  background: #0b0d12;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.45s ease, box-shadow 0.45s ease;
}
.demo-pane.active { border-color: rgba(200, 255, 62, 0.34); }
.crap-demo.is-bad .demo-report {
  border-color: rgba(255, 77, 94, 0.42);
  box-shadow: 0 0 0 1px rgba(255, 77, 94, 0.1), 0 22px 50px rgba(255, 77, 94, 0.06);
}
.crap-demo.is-good .demo-report {
  border-color: rgba(200, 255, 62, 0.42);
  box-shadow: 0 0 0 1px rgba(200, 255, 62, 0.1), 0 22px 50px rgba(200, 255, 62, 0.07);
}
.demo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  flex: 0 0 auto;
}
.demo-dots { display: inline-flex; gap: 6px; }
.demo-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.demo-dots i:nth-child(1) { background: #ff5f57; }
.demo-dots i:nth-child(2) { background: #febc2e; }
.demo-dots i:nth-child(3) { background: #28c840; }
.demo-file { color: var(--ink-soft); }
.demo-stage {
  margin-left: auto;
  color: var(--lime);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.demo-pre {
  margin: 0;
  padding: 16px 18px;
  height: 356px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
  color: #ccd2dd;
  tab-size: 2;
}
.demo-pre code { font-family: inherit; }
.demo-caret {
  display: inline-block;
  width: 6px;
  height: 1.05em;
  margin-left: 1px;
  background: var(--lime);
  vertical-align: text-bottom;
  animation: demo-blink 1s steps(1) infinite;
}
@keyframes demo-blink { 50% { opacity: 0; } }

.demo-report-body {
  display: flex;
  align-items: stretch;
  min-height: 132px;
}
.demo-readout {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 16px 22px;
  border-right: 1px solid var(--line);
}
.demo-score {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  transition: color 0.5s ease;
}
.demo-score.bad { color: var(--red); text-shadow: 0 0 38px rgba(255, 77, 94, 0.3); }
.demo-score.ok { color: var(--lime); text-shadow: 0 0 38px rgba(200, 255, 62, 0.28); }
.demo-verdict {
  font-family: var(--font-mono);
  font-size: 12px;
  transition: color 0.5s ease;
}
.demo-verdict.bad { color: var(--red); }
.demo-verdict.ok { color: var(--lime); }
.demo-table {
  flex: 1 1 auto;
  align-self: center;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.demo-table th {
  text-align: right;
  padding: 7px 18px;
  color: var(--ink-faint);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}
.demo-table th:first-child { text-align: left; }
.demo-table td {
  text-align: right;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.demo-table tbody tr:last-child td { border-bottom: 0; }
.demo-table td:first-child { text-align: left; color: var(--ink); }
.demo-table td:last-child { width: 26px; }
.demo-row { animation: demo-rowin 0.34s ease both; }
@keyframes demo-rowin { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.demo-status {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  vertical-align: middle;
}
.demo-status.bad { background: var(--red); box-shadow: 0 0 9px var(--red); }
.demo-status.ok { background: var(--lime); box-shadow: 0 0 9px var(--lime); }
.demo-note {
  margin: 0;
  padding: 12px 22px 15px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
}
@media (max-width: 820px) {
  .demo-editors { grid-template-columns: 1fr; }
  .demo-pre { height: auto; min-height: 280px; }
  .demo-report-body { flex-direction: column; }
  .demo-readout { flex-basis: auto; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .demo-caret { animation: none; }
  .demo-row { animation: none; }
}

.pull-quote {
  margin: 64px 0 0;
  padding: 38px 42px;
  border: 1px solid rgba(200, 255, 62, 0.25);
  background: linear-gradient(120deg, rgba(200, 255, 62, 0.07), rgba(95, 212, 255, 0.04));
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(21px, 2.6vw, 28px);
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.pull-quote em { font-style: normal; color: var(--lime); }

/* ---- Video ------------------------------------------------------------------- */
.video-section { padding-top: 40px; }
.video-grid {
  display: grid;
  grid-template-columns: minmax(0, 420px) 1fr;
  gap: 72px;
  align-items: center;
  margin-top: 56px;
}
.video-frame {
  position: relative;
  border-radius: 30px;
  border: 1px solid var(--line-strong);
  background: #000;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), 0 0 80px rgba(200, 255, 62, 0.07);
}
.video-frame video {
  width: 100%;
  aspect-ratio: 480 / 854;
  object-fit: cover;
  background: #000;
}
.video-copy h3 {
  font-size: clamp(26px, 3vw, 36px);
  margin-bottom: 18px;
}
.video-copy p { color: var(--ink-soft); font-size: 18.5px; max-width: 54ch; }
.video-copy p strong { color: var(--ink); }
.video-meta {
  display: flex;
  gap: 26px;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink-faint);
}

/* ---- Formula lab --------------------------------------------------------------- */
.formula-section {
  border-block: 1px solid var(--line);
  background:
    radial-gradient(800px 400px at 50% 0%, rgba(200, 255, 62, 0.05), transparent 70%),
    var(--bg-raised);
}
.formula-display {
  margin: 48px 0 14px;
  font-family: var(--font-mono);
  font-size: clamp(17px, 2.6vw, 27px);
  font-weight: 500;
  text-align: center;
  padding: 34px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  white-space: nowrap;
}
.formula-display .f-tangle { color: var(--cyan); }
.formula-display .f-risk { color: var(--red); }
.formula-display .f-floor { color: var(--amber); }
.formula-display .f-dim { color: var(--ink-faint); }
.formula-terms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 14px 0 0;
}
.formula-terms .term {
  display: flex;
  gap: 12px;
  align-items: baseline;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-panel);
  padding: 14px 18px;
}
.formula-terms dt {
  flex: none;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
}
.formula-terms dd {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.formula-terms dd b { color: var(--ink); font-weight: 600; }
.term-cyc dt, .term-cog dt { color: var(--cyan); }
.term-cov dt { color: var(--red); }
.formula-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 26px 0 0;
}
.formula-legend .leg {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-panel);
  padding: 18px 20px;
  font-size: 15.5px;
  color: var(--ink-soft);
}
.formula-legend .leg b {
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 6px;
}
.leg-tangle b { color: var(--cyan); }
.leg-risk b { color: var(--red); }
.leg-floor b { color: var(--amber); }

.lab {
  margin-top: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 26px;
  align-items: stretch;
}
.lab-plot {
  background: #0b0d12;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 22px 22px 14px;
  min-width: 0;
}
.lab-plot canvas {
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}
.lab-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lab-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.lab-card h4 {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.slider-row { margin-bottom: 18px; }
.slider-row:last-child { margin-bottom: 0; }
.slider-row .slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  margin-bottom: 8px;
}
.slider-row .slider-head .val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--lime);
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(to right, var(--lime) 0%, var(--lime) var(--fill, 50%), rgba(255,255,255,0.12) var(--fill, 50%));
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--lime);
  box-shadow: 0 0 14px rgba(200, 255, 62, 0.5);
  cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--lime);
  box-shadow: 0 0 14px rgba(200, 255, 62, 0.5);
  cursor: grab;
}
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preset {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}
.preset:hover { border-color: var(--lime); color: var(--ink); }
.preset.active { background: var(--lime-soft); border-color: var(--lime); color: var(--lime); }

.lab-readout {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--line);
}
.lab-readout .score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(54px, 6vw, 76px);
  line-height: 1;
  letter-spacing: -0.03em;
  transition: color 0.2s;
}
.lab-readout .score.ok { color: var(--lime); text-shadow: 0 0 40px rgba(200,255,62,.3); }
.lab-readout .score.bad { color: var(--red); text-shadow: 0 0 40px rgba(255,77,94,.35); }
.lab-readout .verdict {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 10px;
}
.lab-readout .verdict.ok { color: var(--lime); }
.lab-readout .verdict.bad { color: var(--red); }
.lab-readout .explain {
  margin: 16px auto 0;
  font-size: 15.5px;
  color: var(--ink-soft);
  max-width: 36ch;
  min-height: 4.6em;
}
.lab-readout .explain strong { color: var(--ink); }

.lab-insight {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.insight {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 20px 22px;
  font-size: 15.5px;
  color: var(--ink-soft);
}
.insight b {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.insight b .hl { color: var(--lime); }

/* ---- Code / report tabs --------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 6px;
  margin-top: 48px;
  border-bottom: 1px solid var(--line);
}
.tab {
  font-family: var(--font-mono);
  font-size: 14.5px;
  padding: 11px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 0.15s;
}
.tab:hover { color: var(--ink-soft); }
.tab.active { color: var(--lime); border-bottom-color: var(--lime); }
.tab-panels { margin-top: 26px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Code blocks ------------------------------------------------------------------ */
.codeblock {
  position: relative;
  background: #0b0d12;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.codeblock pre {
  margin: 0;
  padding: 22px 24px;
  font-size: 14px;
  line-height: 1.7;
  overflow-x: auto;
  color: #ccd2dd;
}
.codeblock .label {
  position: absolute;
  top: 10px;
  right: 52px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover { color: var(--lime); border-color: var(--lime); }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn.copied { color: var(--lime); border-color: var(--lime); background: var(--lime-soft); }

/* syntax tint */
.tok-k { color: #ff7ab2; }          /* keyword */
.tok-t { color: #5fd4ff; }          /* type */
.tok-s { color: #c8ff3e; }          /* string */
.tok-n { color: #ffb224; }          /* number */
.tok-c { color: #6b7280; font-style: italic; } /* comment */
.tok-f { color: #b69bff; }          /* function */
.tok-p { color: #8b93a1; }          /* punctuation-ish */

/* ---- CLI grid ----------------------------------------------------------------------- */
.cli-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 56px;
}
.cli-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 26px 22px;
  transition: border-color 0.2s;
}
.cli-card:hover { border-color: var(--line-strong); }
.cli-card h3 { font-size: 19px; margin-bottom: 6px; }
.cli-card p { margin: 0 0 16px; font-size: 15.5px; color: var(--ink-soft); }
.cli-card .codeblock pre { padding: 16px 18px; font-size: 13.5px; }

/* ---- Agents section ------------------------------------------------------------------- */
.agents-section {
  border-block: 1px solid var(--line);
  background: var(--bg-raised);
}
.agents-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  margin-top: 56px;
  align-items: start;
}
.agent-points { display: flex; flex-direction: column; gap: 8px; }
.agent-point {
  display: flex;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.agent-point:last-child { border-bottom: none; }
.agent-point .icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--lime-soft);
  border: 1px solid rgba(200, 255, 62, 0.3);
  color: var(--lime);
}
.agent-point .icon svg { width: 21px; height: 21px; }
.agent-point h3 { font-size: 19.5px; margin-bottom: 6px; }
.agent-point p { margin: 0; font-size: 16px; color: var(--ink-soft); }
.agent-point p code {
  font-size: 14px;
  background: rgba(255,255,255,0.06);
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--ink);
}

/* ---- Install steps ------------------------------------------------------------------------ */
.install-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 56px;
}
.step {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.step .step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--lime);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}
.step h3 { font-size: 20px; margin-bottom: 14px; }
.step .codeblock { margin-top: 4px; }
.step .codeblock pre { padding: 16px 48px 16px 18px; font-size: 13px; }
.step p { font-size: 15px; color: var(--ink-soft); margin: 10px 0 0; }
.req-note {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-faint);
}

/* ---- Posture ------------------------------------------------------------------------------- */
.posture-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 56px;
}
.posture {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  background: var(--bg-panel);
}
.posture .glyph {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--lime);
}
.posture .glyph svg { width: 20px; height: 20px; }
.posture h3 { font-size: 17.5px; margin-bottom: 8px; }
.posture p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

/* ---- Language carousel -------------------------------------------------------------------------- */
.lang-marquee {
  margin-top: 56px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.lang-track {
  display: flex;
  gap: 18px;
  width: max-content;
  padding-block: 6px;
  animation: lang-scroll 28s linear infinite;
}
.lang-marquee:hover .lang-track { animation-play-state: paused; }
@keyframes lang-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - 9px)); }
}
.lang-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s, transform 0.2s;
}
.lang-card.live { border-color: rgba(200, 255, 62, 0.35); }
.lang-card.live:hover { border-color: var(--lime); transform: translateY(-3px); }
.lang-card:not(.live) { opacity: 0.7; }
.lang-mono {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  background: var(--lc, #555);
}
.lang-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}
.lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-faint);
}
.lang-badge.live {
  border-color: rgba(200, 255, 62, 0.4);
  background: var(--lime-soft);
  color: var(--lime);
}
.lang-badge svg { width: 13px; height: 13px; }
@media (prefers-reduced-motion: reduce) {
  .lang-track { animation: none; }
  .lang-marquee { overflow-x: auto; mask-image: none; -webkit-mask-image: none; }
}

/* ---- Final CTA -------------------------------------------------------------------------------- */
.cta-final {
  text-align: center;
  padding: 130px 0 140px;
}
.cta-final h2 {
  font-size: clamp(38px, 5.4vw, 70px);
  max-width: 18ch;
  margin-inline: auto;
}
.cta-final h2 .accent { color: var(--lime); text-shadow: 0 0 60px rgba(200,255,62,.35); }
.cta-final p {
  font-size: 20px;
  color: var(--ink-soft);
  margin: 26px auto 0;
  max-width: 52ch;
}
.cta-final .hero-actions { justify-content: center; }

/* ---- Footer ------------------------------------------------------------------------------------ */
footer {
  border-top: 1px solid var(--line);
  padding: 46px 0;
  font-size: 15px;
  color: var(--ink-faint);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.footer-links { display: flex; gap: 26px; }
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* ---- Reveal animation ---------------------------------------------------------------------------- */
.reveal { opacity: 1; transform: none; }

/* ---- Page-view: stacked content sections (normal document scroll) --------------------------------- */
.page {
  display: flex;
  flex-direction: column;
  padding: calc(var(--nav-h) + 40px) 0 56px;
}
/* keep the formula band's top/bottom borders flush with the page edges */
.page.formula-section { padding-top: 0; padding-bottom: 0; }
.page.formula-section > .container { padding-block: calc(var(--nav-h) + 40px) 56px; }
/* the final CTA shares its page with the footer, so let it sit a touch higher */
.page.cta-final { justify-content: center; min-height: auto; padding: clamp(96px, 16vh, 180px) 0 120px; }

/* ---- Page dots (the "page control") --------------------------------------------------------------- */
.page-dots {
  position: fixed;
  top: 50%;
  right: 22px;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 10px;
}
.page-dot {
  position: relative;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.page-dot::before {
  content: "";
  position: absolute;
  inset: -7px;
}
.page-dot:hover { border-color: var(--ink-soft); transform: scale(1.15); }
.page-dot.active {
  border-color: var(--lime);
  background: var(--lime);
  box-shadow: 0 0 14px rgba(200, 255, 62, 0.65);
}
.page-dot-label {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: rgba(13, 15, 20, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.page-dot:hover .page-dot-label,
.page-dot.active .page-dot-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.page-dot.active .page-dot-label { color: var(--lime); border-color: rgba(200, 255, 62, 0.4); }

@media (max-width: 720px) { .page-dots { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---- Docs page ------------------------------------------------------------------------------------ */
.docs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 64px;
  padding: 64px 0 120px;
}
.docs-nav {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 96px - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 15px;
}
.docs-nav .group {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 26px 0 10px;
}
.docs-nav .group:first-child { margin-top: 0; }
.docs-lang {
  margin: 0 0 28px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
}
.docs-lang .group { margin: 0 0 10px; }
.docs-lang .lang-select { width: 100%; }
.docs-nav a {
  display: block;
  padding: 6px 12px;
  margin-left: -12px;
  text-decoration: none;
  color: var(--ink-soft);
  border-radius: 8px;
}
.docs-nav a:hover { color: var(--ink); background: rgba(255,255,255,0.04); }

.docs-content h1 {
  font-size: clamp(38px, 5vw, 56px);
  margin-bottom: 18px;
}
.docs-content > p { color: var(--ink-soft); }
.docs-content h2 {
  font-size: 30px;
  margin: 72px 0 18px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.docs-content h3 {
  font-size: 21px;
  margin: 40px 0 12px;
  font-weight: 700;
}
.docs-content p { font-size: 17px; color: var(--ink-soft); }
.docs-content p strong { color: var(--ink); }
.docs-content p code, .docs-content li code, .docs-content td code {
  font-size: 14.5px;
  background: rgba(255,255,255,0.06);
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--ink);
}
.docs-content ul, .docs-content ol { color: var(--ink-soft); font-size: 17px; padding-left: 24px; }
.docs-content li { margin-bottom: 8px; }
.docs-content .codeblock { margin: 22px 0; }
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  margin: 22px 0;
}
.docs-content th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-strong);
}
.docs-content td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: top;
}
.docs-content td:first-child { white-space: nowrap; }
.callout {
  display: flex;
  gap: 14px;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(200, 255, 62, 0.3);
  background: rgba(200, 255, 62, 0.05);
  font-size: 16px;
  color: var(--ink-soft);
  margin: 26px 0;
}
.callout.amber { border-color: rgba(255, 178, 36, 0.35); background: rgba(255, 178, 36, 0.05); }
.callout svg { flex-shrink: 0; width: 20px; height: 20px; color: var(--lime); margin-top: 3px; }
.callout.amber svg { color: var(--amber); }
.callout p { margin: 0; }
.callout code { color: var(--ink); }

.docs-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  text-decoration: none;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  padding: 9px 16px;
  border-radius: 999px;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--lime); color: var(--lime); }
.chip svg { width: 15px; height: 15px; }

/* ---- Responsive --------------------------------------------------------------------------------------- */
@media (max-width: 1020px) {
  .thesis-grid, .install-steps, .formula-legend, .formula-terms, .lab-insight { grid-template-columns: 1fr; }
  .posture-grid { grid-template-columns: 1fr 1fr; }
  .lab { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; gap: 44px; }
  .video-frame { max-width: 380px; margin-inline: auto; }
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-video .video-frame { max-width: 320px; }
  .agents-grid { grid-template-columns: 1fr; gap: 44px; }
  .cli-grid { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; gap: 0; }
  /* Collapse the section nav on narrow screens, but keep the language switcher. */
  .docs-nav { position: static; top: auto; max-height: none; overflow: visible; margin-bottom: 8px; }
  .docs-nav > .group, .docs-nav > a { display: none; }
  .docs-lang { margin-bottom: 0; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  section { padding: 76px 0; }
  .nav-links a:not(.nav-cta) { display: none; }
  .hero { padding: 64px 0 48px; }
  .posture-grid { grid-template-columns: 1fr; }
  .hero-install { width: 100%; overflow-x: auto; }
  .pull-quote { padding: 28px 26px; }
}
