/* ============================================================
   CLANKER UNIVERSITY — Cyberpunk stylesheet
   ============================================================ */

:root {
  --bg:        #070a12;
  --bg-2:      #0a0e17;
  --panel:     #0e1422;
  --panel-2:   #121a2e;
  --ink:       #d7e3f4;
  --ink-dim:   #8ea0bd;
  --ink-faint: #5b6b86;
  --line:      #1d2942;

  --cyan:   #00eaff;
  --magenta:#ff2bd6;
  --violet: #8b5cff;
  --lime:   #9dff4d;
  --amber:  #ffb020;

  --glow-cyan:    0 0 12px rgba(0, 234, 255, .55);
  --glow-magenta: 0 0 12px rgba(255, 43, 214, .55);

  --radius: 14px;
  --maxw: 1180px;

  --font-body: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SF Mono", "Consolas", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.15; margin: 0; }

em { color: var(--cyan); font-style: normal; }
strong { color: #fff; }

/* ---------- Animated background ---------- */
.cyber-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(139,92,255,.18), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(0,234,255,.12), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  overflow: hidden;
}
.grid-plane {
  position: absolute;
  inset: -50% -50% -20% -50%;
  background-image:
    linear-gradient(to right, rgba(0,234,255,.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,234,255,.08) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(420px) rotateX(62deg) translateY(6%);
  transform-origin: top center;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
  animation: gridflow 12s linear infinite;
}
@keyframes gridflow { to { background-position: 0 46px, 46px 0; } }

.scanline {
  position: absolute;
  left: 0; right: 0; height: 140px;
  background: linear-gradient(180deg, transparent, rgba(0,234,255,.05), transparent);
  animation: scan 7s linear infinite;
}
@keyframes scan { 0% { top: -140px; } 100% { top: 100%; } }

/* ---------- Layout helpers ---------- */
section { max-width: var(--maxw); margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) clamp(1.1rem, 4vw, 2.2rem); }

.section-head { margin-bottom: 2rem; }
.section-head h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  letter-spacing: .5px;
  display: flex; align-items: baseline; gap: .7rem;
}
.section-index {
  color: var(--magenta);
  text-shadow: var(--glow-magenta);
  font-size: .9em;
}
.section-head p { color: var(--ink-dim); max-width: 62ch; margin: .7rem 0 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: .7rem clamp(1.1rem, 4vw, 2.2rem);
  background: rgba(8, 11, 20, .72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { border-radius: 8px; object-fit: cover; filter: drop-shadow(var(--glow-cyan)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  font-size: 1.02rem;
}
.brand-name.small { font-size: .95rem; }
.brand-accent { color: var(--magenta); text-shadow: var(--glow-magenta); }
.brand-tag { font-family: var(--font-mono); font-size: .62rem; color: var(--cyan); letter-spacing: 1.5px; }

.site-nav { display: flex; gap: 1.4rem; }
.site-nav a {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--ink-dim);
  letter-spacing: .5px;
  position: relative;
}
.site-nav a:hover { color: var(--cyan); text-decoration: none; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--cyan); box-shadow: var(--glow-cyan); transition: width .2s ease;
}
.site-nav a:hover::after { width: 100%; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--cyan); box-shadow: var(--glow-cyan); transition: .25s; }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: .2rem;
  background: rgba(8,11,20,.96);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 60px; z-index: 39;
}
.mobile-nav a { padding: .9rem clamp(1.1rem, 4vw, 2.2rem); font-family: var(--font-mono); color: var(--ink); border-top: 1px solid var(--line); }
.mobile-nav.open { display: flex; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(3rem, 8vw, 6rem); }
.hero-inner { display: flex; align-items: center; gap: clamp(1.5rem, 4vw, 3.5rem); }
.hero-logo {
  flex: 0 0 auto;
  width: clamp(190px, 24vw, 320px);
  height: auto;
  filter: drop-shadow(0 0 32px rgba(0, 234, 255, .26)) drop-shadow(0 0 20px rgba(255, 43, 214, .16));
}
.hero-content { flex: 1 1 auto; min-width: 0; }
.hero-kicker {
  font-family: var(--font-mono); color: var(--lime);
  letter-spacing: 3px; font-size: .8rem; margin: 0 0 1rem;
}
.hero-title {
  font-size: clamp(2.1rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -.5px;
}
.hero-sub { color: var(--ink-dim); max-width: 60ch; font-size: clamp(1rem, 1.6vw, 1.15rem); margin: 1.3rem 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: clamp(1.4rem, 5vw, 3rem);
  margin: 3rem 0 0; padding: 0;
}
.hero-stats div { margin: 0; }
.hero-stats dt {
  font-family: var(--font-mono); font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--cyan); text-shadow: var(--glow-cyan); font-weight: 700;
}
.hero-stats dd { margin: 0; color: var(--ink-faint); font-size: .8rem; letter-spacing: 1px; text-transform: uppercase; }

/* Glitch text */
.glitch { position: relative; color: var(--cyan); text-shadow: var(--glow-cyan); }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%; overflow: hidden;
}
.glitch::before { color: var(--magenta); clip-path: inset(0 0 55% 0); animation: glitch-a 3.2s infinite steps(2); }
.glitch::after  { color: var(--violet);  clip-path: inset(55% 0 0 0); animation: glitch-b 2.6s infinite steps(2); }
@keyframes glitch-a { 0%,92%,100% { transform: none; } 94% { transform: translate(-3px,-1px); } 96% { transform: translate(2px,1px);} }
@keyframes glitch-b { 0%,90%,100% { transform: none; } 93% { transform: translate(3px,1px);} 97% { transform: translate(-2px,-1px);} }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .9rem; letter-spacing: .5px;
  padding: .8rem 1.3rem; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; transition: .18s ease; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-sm { padding: .55rem .9rem; font-size: .8rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #05070d; font-weight: 700; box-shadow: var(--glow-cyan);
}
.btn-primary:hover { box-shadow: 0 0 22px rgba(0,234,255,.7); }
.btn-ghost {
  background: rgba(0,234,255,.06); color: var(--cyan);
  border-color: var(--cyan);
}
.btn-ghost:hover { background: rgba(0,234,255,.14); }

/* ---------- Glossary controls ---------- */
.controls {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
  margin-bottom: 1.3rem;
}
.search-wrap {
  position: relative; flex: 1 1 320px; display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 14px; color: var(--cyan); font-size: 1.2rem; pointer-events: none;
}
#search {
  width: 100%;
  padding: .9rem 2.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: .95rem;
  transition: .18s;
}
#search::placeholder { color: var(--ink-faint); }
#search:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,234,255,.15), var(--glow-cyan);
}
.search-clear {
  position: absolute; right: 10px; background: none; border: 0; color: var(--ink-faint);
  font-size: 1rem; cursor: pointer; padding: 6px;
}
.search-clear:hover { color: var(--magenta); }

.depth-toggle { display: flex; align-items: center; gap: .4rem; }
.depth-label { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-faint); letter-spacing: 1px; }
.depth-btn, .lab-depth-btn, .viz-depth-btn {
  font-family: var(--font-mono); font-size: .82rem;
  padding: .5rem .95rem; border-radius: 7px; cursor: pointer;
  background: var(--panel); color: var(--ink-dim);
  border: 1px solid var(--line); transition: .15s;
}
.depth-btn:hover, .lab-depth-btn:hover, .viz-depth-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.depth-btn.is-active, .lab-depth-btn.is-active, .viz-depth-btn.is-active {
  background: rgba(255,43,214,.12); color: var(--magenta);
  border-color: var(--magenta); box-shadow: var(--glow-magenta);
}

/* Category filter chips */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.chip {
  font-family: var(--font-mono); font-size: .78rem;
  padding: .45rem .8rem; border-radius: 999px; cursor: pointer;
  background: var(--panel); color: var(--ink-dim);
  border: 1px solid var(--line); transition: .15s; white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: var(--cyan); }
.chip.is-active {
  background: rgba(0,234,255,.12); color: var(--cyan);
  border-color: var(--cyan); box-shadow: var(--glow-cyan);
}
.chip .chip-icon { margin-right: .3rem; opacity: .8; }

.result-count { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-faint); margin: 0 0 1.2rem; }

/* ---------- Terms grid ---------- */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.term-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  position: relative;
  overflow: hidden;
  transition: .2s ease;
}
.term-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--cat-color, var(--cyan)); box-shadow: 0 0 10px var(--cat-color, var(--cyan));
}
.term-card:hover { border-color: var(--cat-color, var(--cyan)); transform: translateY(-3px); }
.term-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; margin-bottom: .55rem; }
.term-name { font-family: var(--font-mono); font-size: 1.08rem; font-weight: 700; color: #fff; }
.term-aka { display: block; font-size: .72rem; color: var(--ink-faint); font-family: var(--font-mono); margin-top: 2px; }
.term-cat {
  flex: none; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .5px;
  text-transform: uppercase; padding: .25rem .5rem; border-radius: 6px;
  color: var(--cat-color, var(--cyan));
  background: color-mix(in srgb, var(--cat-color, var(--cyan)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat-color, var(--cyan)) 40%, transparent);
  white-space: nowrap;
}
.term-def { color: var(--ink-dim); font-size: .93rem; margin: 0; }
.term-def .xref {
  color: var(--cat-color, var(--cyan)); cursor: pointer;
  border-bottom: 1px dotted currentColor; text-decoration: none;
}
.term-def .xref:hover { color: #fff; border-bottom-style: solid; }
.term-def.is-complex { color: var(--ink); }

/* highlight for search matches */
mark { background: rgba(157,255,77,.25); color: var(--lime); border-radius: 3px; padding: 0 2px; }

.no-results { text-align: center; padding: 3rem 1rem; color: var(--ink-dim); font-family: var(--font-mono); }
.no-results-face { display: block; color: var(--magenta); font-size: 2rem; margin-bottom: .5rem; }

/* ---------- Inference Lab ---------- */
.lab-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; }
.lab-stage {
  background: linear-gradient(180deg, var(--panel), #0b1020);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 2rem);
  text-align: center;
}
/* SVG scales to fit its container — its viewBox holds all content, so nothing clips */
.lab-stage svg { width: 100%; height: auto; display: inline-block; vertical-align: top; }
.lab-stage svg.is-vertical { max-width: 420px; }

/* SVG node styles driven via classes */
.node-box { fill: var(--panel-2); stroke: var(--line); stroke-width: 1.5; rx: 10; }
.node-box.stage-token { stroke: var(--cyan); }
.node-box.stage-infer { stroke: var(--magenta); }
.node-box.stage-out   { stroke: var(--lime); }
.node-box.stage-violet { stroke: var(--violet); }
.node-label { fill: #fff; font-family: var(--font-mono); font-weight: 700; }
.node-sub   { fill: var(--ink-dim); font-family: var(--font-body); }
.flow-arrow { stroke: var(--ink-faint); stroke-width: 2; marker-end: url(#arrow); fill: none; }
.flow-arrow.active { stroke: var(--cyan); filter: drop-shadow(0 0 6px var(--cyan)); }
.pulse-dot { fill: var(--cyan); filter: drop-shadow(0 0 6px var(--cyan)); }

/* Diagram tooltips */
.tip-target { cursor: help; }
.tip-target rect.node-box { transition: stroke-width .12s, filter .12s; }
.tip-target:hover rect.node-box { stroke-width: 3; }
.tip-target.nn-col:hover circle { stroke-width: 3.4; }
.viz-tip {
  position: fixed; z-index: 70; max-width: 288px;
  background: rgba(9, 14, 24, .98);
  border: 1px solid var(--cyan);
  border-radius: 10px; padding: .7rem .85rem;
  color: var(--ink); font-family: var(--font-body);
  font-size: .84rem; line-height: 1.5;
  box-shadow: 0 0 16px rgba(0, 234, 255, .28), 0 10px 28px rgba(0, 0, 0, .55);
  pointer-events: none;
}
.viz-tip[hidden] { display: none; }

/* Neural-net node graph (Anatomy · Simple) */
.nn-lines line { stroke: var(--line); stroke-width: 1; transition: stroke .25s, opacity .25s; }
.nn-lines.active line { stroke: var(--cyan); stroke-width: 1.4; opacity: .95; filter: drop-shadow(0 0 3px var(--cyan)); }
.nn-col circle { transform-box: fill-box; transform-origin: center; }
.nn-col.pulse circle { animation: nnpulse .56s ease; }
@keyframes nnpulse { 0% { transform: scale(1); } 42% { transform: scale(1.5); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .nn-col.pulse circle { animation: none; } }

.lab-explainer { margin-top: 1.4rem; display: grid; gap: .8rem; }
.lab-step {
  display: flex; gap: .9rem; align-items: flex-start;
  padding: .9rem 1.1rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; border-left: 3px solid var(--step-color, var(--cyan));
}
.lab-step-num {
  font-family: var(--font-mono); font-weight: 700; color: var(--step-color, var(--cyan));
  flex: none; width: 1.8rem;
}
.lab-step-body h4 { margin: 0 0 .25rem; font-family: var(--font-mono); color: #fff; font-size: .95rem; }
.lab-step-body p { margin: 0; color: var(--ink-dim); font-size: .9rem; }

/* ---------- Learning Tracks ---------- */
.track-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.track-card {
  --tc: var(--cyan);
  text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  display: flex; flex-direction: column; gap: .5rem;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.35rem; position: relative; overflow: hidden; transition: .2s ease;
}
.track-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--tc); box-shadow: 0 0 12px var(--tc);
}
.track-card:hover { transform: translateY(-4px); border-color: var(--tc); box-shadow: 0 0 26px -8px var(--tc); }
.track-card-top { display: flex; align-items: center; justify-content: space-between; }
.track-icon { font-size: 1.8rem; filter: drop-shadow(0 0 8px var(--tc)); }
.track-level { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: color-mix(in srgb, var(--tc) 45%, transparent); }
.track-tag { font-family: var(--font-mono); font-size: .66rem; letter-spacing: 2px; text-transform: uppercase; color: var(--tc); }
.track-name { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 700; color: #fff; }
.track-blurb { color: var(--ink-dim); font-size: .9rem; flex: 1; }
.track-foot-row { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.track-count { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-faint); letter-spacing: 1px; text-transform: uppercase; }
.track-start { font-family: var(--font-mono); font-size: .82rem; color: var(--tc); font-weight: 700; }

/* Slideshow overlay */
.track-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 1.2rem;
  background: rgba(4, 6, 12, .72); backdrop-filter: blur(8px);
  animation: tk-fade .2s ease;
}
.track-overlay[hidden] { display: none; }
@keyframes tk-fade { from { opacity: 0; } to { opacity: 1; } }
.track-modal {
  --tc: var(--cyan);
  width: min(680px, 100%); max-height: min(88vh, 720px);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--panel), #0b1020);
  border: 1px solid var(--tc); border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 40px -8px var(--tc), 0 20px 60px rgba(0, 0, 0, .6);
}
.track-bar { height: 4px; background: var(--line); flex: none; }
.track-bar-fill { display: block; height: 100%; width: 0; background: var(--tc); box-shadow: 0 0 10px var(--tc); transition: width .3s ease; }
.track-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.3rem .3rem; flex: none; }
.track-headinfo { display: flex; flex-direction: column; }
.track-eyebrow { font-family: var(--font-mono); font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--tc); }
.track-step { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-faint); margin-top: 2px; }
.track-close { background: none; border: 0; color: var(--ink-dim); font-size: 1.2rem; cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.track-close:hover { color: var(--tc); background: rgba(255, 255, 255, .05); }
.track-slide { padding: .5rem 1.6rem 1.4rem; overflow-y: auto; }
.track-slide-inner { animation: tk-in .32s ease; }
@keyframes tk-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.track-slide-num { font-family: var(--font-mono); font-size: 2.4rem; font-weight: 800; color: color-mix(in srgb, var(--tc) 32%, transparent); line-height: 1; display: block; }
.track-slide h3 { font-size: clamp(1.3rem, 3.2vw, 1.7rem); color: #fff; margin: .3rem 0 .7rem; }
.track-slide p { color: var(--ink-dim); font-size: 1rem; line-height: 1.6; margin: 0; }
.track-terms { margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.track-terms-label { font-family: var(--font-mono); font-size: .64rem; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-faint); width: 100%; margin-bottom: .1rem; }
.track-term {
  font-family: var(--font-mono); font-size: .76rem; cursor: pointer;
  padding: .3rem .6rem; border-radius: 999px;
  color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent); transition: .15s;
}
.track-term:hover { background: color-mix(in srgb, var(--tc) 24%, transparent); color: #fff; }
.track-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.3rem 1.1rem; border-top: 1px solid var(--line); flex: none; }
.track-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; flex: 1; }
.track-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: .2s; }
.track-dot.on { background: var(--tc); box-shadow: 0 0 8px var(--tc); transform: scale(1.15); }
.track-prev:disabled { opacity: .35; cursor: default; }
.track-next { background: var(--tc); color: #05070d; border-color: var(--tc); box-shadow: 0 0 16px -4px var(--tc); }
.track-next:hover { box-shadow: 0 0 22px -2px var(--tc); }
@media (max-width: 560px) {
  .track-dots { display: none; }
  .track-slide { padding: .4rem 1.1rem 1.2rem; }
}

/* ---------- Inference engines table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
}
table.cmp { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 760px; }
.cmp thead th {
  text-align: left; font-family: var(--font-mono);
  font-size: .68rem; letter-spacing: 1px; text-transform: uppercase;
  color: var(--cyan); padding: .9rem 1rem;
  background: rgba(0, 234, 255, .05); border-bottom: 1px solid var(--line);
}
.cmp td {
  padding: .9rem 1rem; border-bottom: 1px solid var(--line);
  color: var(--ink-dim); vertical-align: top; line-height: 1.45;
}
.cmp tbody tr { transition: background .15s; }
.cmp tbody tr:hover { background: rgba(0, 234, 255, .045); }
.cmp tbody tr:last-child td { border-bottom: 0; }
.eng-name { display: block; font-family: var(--font-mono); font-weight: 700; color: #fff; font-size: .95rem; }
.eng-tag {
  display: inline-block; margin-top: 5px;
  font-family: var(--font-mono); font-size: .58rem; letter-spacing: .5px; text-transform: uppercase;
  padding: .15rem .45rem; border-radius: 5px; border: 1px solid;
}
.eng-tag.server { color: var(--magenta); border-color: var(--magenta); background: rgba(255, 43, 214, .1); }
.eng-tag.local  { color: var(--lime);    border-color: var(--lime);    background: rgba(157, 255, 77, .1); }
.eng-tag.gui    { color: var(--cyan);     border-color: var(--cyan);     background: rgba(0, 234, 255, .1); }
.engines-note { font-family: var(--font-mono); font-size: .76rem; color: var(--ink-faint); margin: .9rem 0 0; }

@media (max-width: 760px) {
  .table-wrap { overflow-x: visible; background: none; border: 0; border-radius: 0; }
  table.cmp { min-width: 0; }
  .cmp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cmp, .cmp tbody, .cmp tr, .cmp td { display: block; width: 100%; }
  .cmp tr {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: .5rem .2rem .7rem; margin-bottom: 1rem;
  }
  .cmp td { border: 0; padding: .35rem 1.1rem; }
  .cmp td::before {
    content: attr(data-label); display: block;
    font-family: var(--font-mono); font-size: .6rem; letter-spacing: 1px; text-transform: uppercase;
    color: var(--cyan); margin-bottom: 2px;
  }
  .cmp td[data-label="Engine"] { padding-bottom: .5rem; margin-bottom: .3rem; border-bottom: 1px solid var(--line); }
  .cmp td[data-label="Engine"]::before { display: none; }
}

/* ---------- About ---------- */
.about-body { max-width: 68ch; }
.about-body p { color: var(--ink-dim); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 1.6rem clamp(1.1rem, 4vw, 2.2rem);
  display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; justify-content: space-between;
}
.footer-note { color: var(--ink-faint); font-size: .82rem; font-family: var(--font-mono); }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 30;
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--cyan); color: var(--cyan);
  border-radius: 10px; box-shadow: var(--glow-cyan); cursor: pointer;
}
.to-top:hover { background: rgba(0,234,255,.14); text-decoration: none; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .controls { flex-direction: column; align-items: stretch; }
  .depth-toggle { justify-content: flex-start; }
  .terms-grid { grid-template-columns: 1fr; }
  .hero-logo { display: none; }
}

@media (max-width: 420px) {
  .brand-tag { display: none; }
  .hero-stats { gap: 1.2rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .grid-plane, .scanline, .glitch::before, .glitch::after { animation: none; }
  html { scroll-behavior: auto; }
}
