/* ── Google Fonts ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:        #08090f;
  --bg-card:   #0e1017;
  --bg-dark:   #060709;
  --border:    rgba(255,255,255,0.07);
  --text:      #e2e4ef;
  --text-muted:#7b8099;
  --accent:    #818cf8;
  --accent2:   #34d399;
  --accent-red:#f87171;
  --grad-start:#6366f1;
  --grad-end:  #8b5cf6;
  --nav-h:     60px;
  --font:      'Inter', system-ui, sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --radius:    12px;
  --section-pad: 96px;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ────────────────────────────────────────────────────────── */
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; line-height: 1.12; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; font-weight: 600; margin: 1.8rem 0 0.6rem; }
p  { color: var(--text); margin-bottom: 1rem; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

strong { color: #fff; }

.gradient-text {
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── HERO ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: 120px 24px 80px;
  overflow: hidden;
  gap: 40px;
  justify-content: center;
}

.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse at center,
    rgba(99,102,241,0.18) 0%,
    rgba(139,92,246,0.10) 40%,
    transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 560px;
  flex-shrink: 0;
}

.hero-badge {
  display: inline-block;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.4);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 20px 0 32px;
  line-height: 1.65;
}

.hero-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  color: #fff !important;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  text-decoration: none !important;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none !important;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* ── HERO MINI ANIMATION ────────────────────────────────────────────────── */
.hero-anim {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mini-hbm, .mini-sram {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  position: relative;
}

.mem-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.mem-block {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}
.q-block { background: rgba(99,102,241,0.25); border: 1px solid rgba(99,102,241,0.5); color: #818cf8; }
.k-block { background: rgba(52,211,153,0.2);  border: 1px solid rgba(52,211,153,0.4); color: #34d399; }
.v-block { background: rgba(251,191,36,0.2);  border: 1px solid rgba(251,191,36,0.4); color: #fbbf24; }
.o-block { background: rgba(248,113,113,0.2); border: 1px solid rgba(248,113,113,0.4); color: #f87171; }

.tile {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.q-tile { background: rgba(99,102,241,0.35); border: 2px solid rgba(99,102,241,0.8); color: #c7d2fe;
  animation: pulse-q 2s ease-in-out infinite; }
.k-tile { background: rgba(52,211,153,0.30); border: 2px solid rgba(52,211,153,0.7); color: #a7f3d0;
  animation: pulse-k 2s ease-in-out 0.3s infinite; }
.v-tile { background: rgba(251,191,36,0.25); border: 2px solid rgba(251,191,36,0.6); color: #fde68a;
  animation: pulse-v 2s ease-in-out 0.6s infinite; }

.mini-sram {
  margin-top: 28px;
  gap: 8px;
}

.mini-arrows {
  display: flex;
  gap: 26px;
  margin: 4px 0;
}
.arrow-down, .arrow-up {
  width: 2px;
  height: 24px;
  background: var(--border);
  position: relative;
}
.arrow-down::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -4px;
  border: 5px solid transparent;
  border-top-color: var(--accent);
}
.arrow-up::after {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  border: 5px solid transparent;
  border-bottom-color: var(--accent2);
}
.a1 { animation: flow-down 1.8s ease-in-out infinite; }
.a2 { animation: flow-down 1.8s ease-in-out 0.3s infinite; }
.a3 { animation: flow-down 1.8s ease-in-out 0.6s infinite; }
.a4 { animation: flow-up   1.8s ease-in-out 1.2s infinite; }

/* ── NAV ───────────────────────────────────────────────────────────────── */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,9,15,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.nav-brand { font-weight: 700; font-size: 0.95rem; color: #fff; }
.sticky-nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(720px, 90vw);
  row-gap: 4px;
}
@media (max-width: 1100px) {
  .nav-inner { flex-wrap: wrap; height: auto; min-height: var(--nav-h); padding: 8px 20px; }
  .sticky-nav { height: auto; }
  .sticky-nav ul { justify-content: flex-start; }
}
.sticky-nav a { color: var(--text-muted); font-size: 0.88rem; font-weight: 500;
  transition: color 0.2s; }
.sticky-nav a:hover { color: #fff; text-decoration: none; }

/* ── SECTIONS ──────────────────────────────────────────────────────────── */
.section      { padding: var(--section-pad) 0; }
.section-dark { background: var(--bg-dark); }
#code.section-dark {
  border-top: 1px solid var(--border);
}

#code .kernel-grid {
  margin-top: 2rem;
}

.impl-subheading {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem;
}
.impl-lede {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 1rem;
}

.code-compare {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.code-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s;
  font-family: var(--font);
}
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-btn:hover {
  color: var(--text);
}

.code-panel {
  display: none;
}
.code-panel.active {
  display: block;
}
.code-panel pre {
  margin: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 0.8rem;
  line-height: 1.55;
  max-height: min(520px, 65vh);
  overflow-y: auto;
}

.tag-naive {
  color: var(--accent-red);
  font-weight: 600;
}
.tag-flash {
  color: var(--accent2);
  font-weight: 600;
}

.section-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.subsection-title {
  margin-top: 2.5rem;
}

/* ── MATH ──────────────────────────────────────────────────────────────── */
.math-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin: 1.2rem 0;
  overflow-x: auto;
  font-size: 1.05rem;
}

/* ── CARDS ─────────────────────────────────────────────────────────────── */
.cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 2rem 0;
}
@media (max-width: 600px) { .cards-row { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-red  { border-top: 3px solid var(--accent-red); }
.card-green{ border-top: 3px solid var(--accent2); }
.card-icon { font-size: 1.8rem; margin-bottom: 10px; }
.card h3   { font-size: 1rem; margin: 0 0 8px; }
.card p    { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 12px; }
.card-stat {
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  padding: 6px 12px;
  border-radius: 8px;
  display: inline-block;
}

/* ── SPEC TABLE ────────────────────────────────────────────────────────── */
.spec-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0 1.5rem;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.spec-row:last-child { border-bottom: none; }
.spec-row span { color: var(--text-muted); }

/* ── HPC VIZ ───────────────────────────────────────────────────────────── */
.hpc-viz {
  background: #0b0d14; /* Deep, rich tech dark background */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px;
  margin: 2rem 0;
  box-shadow: inset 0 2px 20px rgba(0,0,0,0.8), 0 10px 40px rgba(0,0,0,0.4);
}

.hpc-zone {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.zone-hbm { 
  background: linear-gradient(145deg, rgba(30, 33, 44, 0.8), rgba(15, 17, 23, 0.9));
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.zone-sm { 
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.02)); 
  border-color: rgba(99,102,241,0.3); 
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.zone-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.zone-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-top: 4px;
}

.viz-mats { display: flex; gap: 24px; margin-top: 24px; }
.hbm-mat {
  position: relative; width: 90px; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hbm-mat > span { font-size: 0.8rem; font-weight: 700; color: #fff; letter-spacing: 0.05em; }
.hbm-mat::before {
  content: ''; display: block; width: 90px; height: 110px;
  border-radius: 8px; background: rgba(0,0,0,0.4);
  border: 1px dashed rgba(255,255,255,0.2);
}
.hbm-tile {
  position: absolute; top: 6px; left: 6px; width: 78px; height: 32px;
  border-radius: 4px; transition: top 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s;
  background: rgba(99,102,241,0.6); border: 1px solid rgba(99,102,241,1);
  box-shadow: 0 0 10px rgba(99,102,241,0.3);
}
.hbm-tile.kv-tile { background: rgba(52,211,153,0.5); border-color: rgba(52,211,153,0.9); box-shadow: 0 0 10px rgba(52,211,153,0.3); }

/* Data Bus */
.data-bus {
  height: 60px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}
.bus-text {
  font-size: 0.85rem; font-family: var(--mono); color: rgba(255,255,255,0.3);
  letter-spacing: 0.25em; transition: color 0.3s; z-index: 2;
}
.data-bus.active .bus-text { color: var(--accent); font-weight: bold; text-shadow: 0 0 12px var(--accent); }

.bus-traces {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: hidden; display: flex; justify-content: center; gap: 30px;
}
.trace {
  width: 3px; height: 100%; background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  opacity: 0; transform: translateY(-100%);
}
.data-bus.active .trace {
  animation: trace-flow 0.5s linear infinite;
}
@keyframes trace-flow {
  0% { transform: translateY(-100%); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}

/* SM Internals */
.sm-header { margin-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 12px; }
.sm-internals {
  display: flex; gap: 24px;
}

.sm-col {
  flex: 1;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 20px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}
.sm-col-title { font-size: 0.9rem; font-weight: 800; color: #fff; margin-bottom: 4px; letter-spacing: 0.05em; }
.sm-col-desc { font-size: 0.75rem; color: var(--accent); margin-bottom: 20px; font-family: var(--mono); }

.sram-box {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap; min-height: 80px;
}
.sram-tile {
  width: 70px; height: 50px; border-radius: 8px; background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.2); transition: background 0.4s, border-color 0.4s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem; font-weight: 800; color: rgba(255,255,255,0.3);
}
.sram-tile.active-q { background: rgba(99,102,241,0.25); border: 2px solid rgba(99,102,241,1); box-shadow: 0 0 20px rgba(99,102,241,0.5); color: #fff; }
.sram-tile.active-k { background: rgba(52,211,153,0.2); border: 2px solid rgba(52,211,153,0.9); box-shadow: 0 0 20px rgba(52,211,153,0.4); color: #fff; }
.sram-tile.active-v { background: rgba(251,191,36,0.2); border: 2px solid rgba(251,191,36,0.8); box-shadow: 0 0 20px rgba(251,191,36,0.4); color: #fff; }

.sram-regs {
  background: #050608;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: box-shadow 0.2s, background 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.warp-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.warp-thread {
  aspect-ratio: 1; background: rgba(255,255,255,0.08); border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.15); transition: background 0.15s, box-shadow 0.15s;
}

.math-box {
  background: rgba(99,102,241,0.05); padding: 12px; border-radius: 8px;
  font-size: 0.9rem; font-family: var(--mono); color: #e2e4ef; min-height: 60px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px solid rgba(99,102,241,0.2);
}

/* Compute Flash Effect */
@keyframes compute-pulse {
  0% { box-shadow: inset 0 0 0px rgba(248,113,113,0); border-color: rgba(255,255,255,0.08); }
  20% { box-shadow: inset 0 0 50px rgba(248,113,113,0.3); border-color: rgba(248,113,113,0.8); }
  100% { box-shadow: inset 0 0 0px rgba(248,113,113,0); border-color: rgba(255,255,255,0.08); }
}
.compute-active { animation: compute-pulse 0.8s ease-out; }
.compute-active .warp-thread { background: var(--accent-red); box-shadow: 0 0 12px var(--accent-red); border-color: #fff; }

.step-info {
  margin-top: 32px; font-size: 1.05rem; color: #fff; min-height: 24px; font-weight: 700; text-align: center;
  border-top: 1px dashed rgba(255,255,255,0.1); padding-top: 20px;
}

.step-info {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--accent);
  min-height: 24px;
  font-weight: 500;
}
.anim-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 2rem;
}
.step-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 8px;
  font-weight: bold;
}
.anim-desc { color: var(--text-muted); font-size: 0.9rem; }

/* ── CHARTS ────────────────────────────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 2rem 0;
}
@media (max-width: 720px) { .chart-grid { grid-template-columns: 1fr; } }

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.chart-card h3 {
  font-size: 0.9rem;
  margin: 0 0 12px;
  color: var(--text-muted);
}
.chart-div { width: 100%; height: 280px; }

.result-callout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: rgba(52,211,153,0.07);
  border: 1px solid rgba(52,211,153,0.25);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 0.92rem;
  margin-top: 1.5rem;
}
.callout-icon { font-size: 1.6rem; flex-shrink: 0; }

/* ── BLOG TEXT FORMATTING ──────────────────────────────────────────────── */
.blog-text {
  max-width: 800px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.8;
  font-size: 1.1rem;
  color: #d1d5db;
}
.blog-text strong {
  color: #fff;
}
.blog-heading {
  max-width: 800px;
  margin: 2.5rem auto 1rem auto;
  font-size: 1.5rem;
  color: #fff;
  font-weight: 700;
}
.blog-list {
  max-width: 760px;
  margin: 0 auto 2rem auto;
  padding-left: 1.5rem;
  line-height: 1.8;
  font-size: 1.1rem;
  color: #d1d5db;
}
.blog-list li {
  margin-bottom: 0.8rem;
}

.math-block {
  max-width: 800px;
  margin: 1.5rem auto;
  overflow-x: auto;
  padding: 1rem 0;
  text-align: center;
}

/* ── FOOTER ────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-links { margin-top: 8px; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }

/* ── Scroll reveal ─────────────────────────────────────────────────────── */
.section > .container {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.section > .container.visible {
  opacity: 1;
  transform: none;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { flex-direction: column; min-height: auto; padding: 100px 24px 60px; }
  .hero-anim { display: none; }
}

/* ── Scroll progress ────────────────────────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 200;
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end), var(--accent2));
  pointer-events: none;
  transition: width 0.1s ease-out;
}

/* ── Nav active (scroll spy) ──────────────────────────────────────────── */
.sticky-nav a.nav-active {
  color: #fff !important;
  text-decoration: none;
  position: relative;
}
.sticky-nav a.nav-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* ── Hero KPI strip ───────────────────────────────────────────────────── */
.hero-kpi {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius);
  max-width: 100%;
}
.hero-kpi-label { font-weight: 600; color: var(--text); }
.hero-kpi-n { font-family: var(--mono); color: #a5b4fc; }
.hero-kpi-sep { color: var(--text-muted); }
.hero-kpi-val {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent2);
}
.hero-kpi-hint { font-size: 0.8rem; opacity: 0.85; width: 100%; }

/* ── Interactive lab ─────────────────────────────────────────────────── */
.section-lab {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, transparent 40%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.lab-lede {
  max-width: 800px;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.lab-lede code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 6px;
}

.chart-shell {
  position: relative;
  height: min(380px, 55vh);
  margin: 1rem 0 0.5rem;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.lab-hint {
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0 0 1.25rem;
  font-family: var(--mono);
}

.lab-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}
.lab-toolbar-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lab-toolbar-wide {
  flex: 1;
  min-width: 240px;
}
.lab-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.n-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.n-pill {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.n-pill:hover {
  color: var(--text);
  border-color: rgba(129, 140, 248, 0.5);
}
.n-pill.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(129, 140, 248, 0.9);
  color: #fff;
  font-weight: 700;
}

.kernel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.kernel-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s, background 0.2s;
}
.kernel-chip:hover {
  border-color: rgba(255, 255, 255, 0.2);
}
.kernel-chip.is-on {
  border-color: rgba(129, 140, 248, 0.55);
  background: rgba(99, 102, 241, 0.12);
}
.kernel-chip input {
  accent-color: var(--accent);
  cursor: pointer;
}

.lab-cards-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--text-muted);
}
.lab-cards-title .mono {
  font-family: var(--mono);
  color: #a5b4fc;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 0.85rem;
}
.metric-card-wide {
  grid-column: 1 / -1;
}
.metric-card-head {
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.metric-card-head .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.metric-row:last-of-type {
  border-bottom: none;
}
.metric-row strong {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
}
.metric-foot {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.metric-foot strong {
  color: var(--accent2);
}

/* ── Kernel zoo ────────────────────────────────────────────────────────── */
.kernel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.kernel-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.kernel-card:hover {
  border-color: rgba(129, 140, 248, 0.35);
}
.kernel-card-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.kc-title {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
}
.kc-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kc-chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}
.kernel-card.is-open .kc-chevron {
  transform: rotate(-180deg);
}
.kc-summary {
  padding: 0 18px 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}
.kc-body {
  display: none;
  padding: 0 18px 18px;
  font-size: 0.85rem;
  color: #c4c9dc;
  line-height: 1.65;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
  margin: 0;
}
.kernel-card.is-open .kc-body {
  display: block;
}
.kernel-card-note {
  border-style: dashed;
  background: rgba(52, 211, 153, 0.05);
  border-color: rgba(52, 211, 153, 0.25);
}
.kc-note-inner {
  padding: 20px;
}
.kc-note-inner strong {
  color: var(--accent2);
}

/* ── Repro block ─────────────────────────────────────────────────────── */
.repro-block {
  margin-top: 1rem;
  padding: 20px 22px;
  background: #050608;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.55;
}
.repro-block code {
  font-family: var(--mono) !important;
  background: none !important;
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
html.reduce-motion .section > .container {
  opacity: 1 !important;
  transform: none !important;
}
html.reduce-motion .scroll-progress {
  transition: none;
}
