/* ============================================================================
   CAS-NLP SERIES · LECTURE 18 — INTERACTIVE TRANSFORMER ARCHITECTURE ATLAS
   Zero-dependency, high-readability Sci-Fi Holographic Atlas stylesheet
   ========================================================================== */

:root {
  --bg-abyss: #050811;
  --bg-deep: #080d1a;
  --bg-panel: rgba(12, 19, 36, 0.92);
  --bg-panel-elevated: rgba(17, 27, 50, 0.95);
  --bg-card: rgba(15, 23, 42, 0.88);
  --bg-code: #03060d;

  --line-subtle: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.28);
  --line-glow: rgba(56, 189, 248, 0.48);

  --text-1: #f8fafc;
  --text-2: #dbeafe;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;

  /* Architectural Pillar Accents */
  --c-root: #10b981;
  --c-root-bright: #34d399;
  --c-root-soft: rgba(16, 185, 129, 0.14);

  --c-enc: #06b6d4;
  --c-enc-bright: #22d3ee;
  --c-enc-soft: rgba(6, 182, 212, 0.15);

  --c-seq: #f97316;
  --c-seq-bright: #fb923c;
  --c-seq-soft: rgba(249, 115, 22, 0.15);

  --c-dec: #ec4899;
  --c-dec-bright: #f472b6;
  --c-dec-soft: rgba(236, 72, 153, 0.15);

  --amber: #fbbf24;
  --violet: #a78bfa;

  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  background-color: var(--bg-abyss);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 85% 45% at 50% -10%, rgba(6, 182, 212, 0.16), transparent),
    radial-gradient(ellipse 55% 45% at 92% 18%, rgba(236, 72, 153, 0.11), transparent),
    radial-gradient(ellipse 55% 45% at 8% 75%, rgba(16, 185, 129, 0.09), transparent),
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 36px 36px, 36px 36px;
}

.mono {
  font-family: var(--font-mono);
}

/* ---------------- Skip link ---------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 200;
  background: var(--c-enc-bright);
  color: #021318;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus {
  top: 0.75rem;
}

/* ---------------- Top Navigation Bar (CAS-NLP Standard) ---------------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(5, 8, 17, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line-subtle);
}

.topnav-inner {
  max-width: 1580px;
  margin: 0 auto;
  padding: 0.65rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-1);
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.brand-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-txt strong {
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.brand-txt small {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  color: var(--c-enc-bright);
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.topnav-links a {
  text-decoration: none;
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.38rem 0.7rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.16s ease;
}

.topnav-links a:hover {
  color: #fff;
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.35);
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.back-hub {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--c-enc-bright);
  padding: 0.38rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(6, 182, 212, 0.38);
  background: rgba(6, 182, 212, 0.09);
  transition: all 0.16s ease;
}

.back-hub:hover {
  background: rgba(6, 182, 212, 0.2);
  color: #fff;
}

.lec-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--c-root-bright);
}

/* ---------------- Main Container ---------------- */
.page-wrap {
  max-width: 1580px;
  margin: 0 auto;
  padding: 1.5rem 1.4rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

#atlas-section,
#dossier-section,
#paradigms-section,
#comparator-section,
#quiz-section,
#studio-workspace {
  scroll-margin-top: 5.5rem;
}

/* ---------------- Hero Banner & 3 Pillar Orientation ---------------- */
.hero-card {
  background: linear-gradient(155deg, rgba(14, 23, 43, 0.94), rgba(8, 13, 26, 0.94));
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  padding: 1.8rem 2rem;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hero-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-root-bright);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.36);
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 0.7rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
  margin: 0 0 0.65rem;
  color: var(--text-1);
}

.hero-title .grad {
  background: linear-gradient(120deg, #34d399, #22d3ee 48%, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lede {
  margin: 0;
  max-width: 82ch;
  color: var(--text-body);
  font-size: 1.04rem;
  line-height: 1.68;
}

.hero-lede strong {
  color: var(--text-1);
}

.hero-stats-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-stat {
  background: rgba(8, 13, 25, 0.85);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  min-width: 118px;
}

.hero-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.32rem;
  color: var(--c-enc-bright);
  line-height: 1.15;
}

.hero-stat span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* 3 Interactive Pillar Cards */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.35rem;
}

.pillar-card {
  text-align: left;
  background: rgba(9, 15, 29, 0.85);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  cursor: pointer;
  transition: all 0.18s ease;
  color: var(--text-1);
  font-family: inherit;
}

.pillar-card:hover {
  transform: translateY(-2px);
}

.pillar-card.enc { border-left: 4px solid var(--c-enc); }
.pillar-card.enc:hover, .pillar-card.enc.active { border-color: var(--c-enc-bright); background: rgba(6, 182, 212, 0.1); }

.pillar-card.seq { border-left: 4px solid var(--c-seq); }
.pillar-card.seq:hover, .pillar-card.seq.active { border-color: var(--c-seq-bright); background: rgba(249, 115, 22, 0.1); }

.pillar-card.dec { border-left: 4px solid var(--c-dec); }
.pillar-card.dec:hover, .pillar-card.dec.active { border-color: var(--c-dec-bright); background: rgba(236, 72, 153, 0.1); }

.pillar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.pillar-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.pillar-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--line-subtle);
}

.pillar-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-body);
  line-height: 1.52;
}

.pillar-meta {
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* ---------------- Controls Command Deck ---------------- */
.command-deck {
  background: var(--bg-panel);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

.deck-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.pill-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.deck-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.ui-btn {
  appearance: none;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.46rem 0.82rem;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  transition: all 0.16s ease;
}

.ui-btn:hover {
  border-color: var(--c-enc-bright);
  color: #fff;
  transform: translateY(-1px);
}

.ui-btn.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--c-enc-bright);
  color: #fff;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.26);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}
.dot.enc { background: var(--c-enc-bright); box-shadow: 0 0 8px var(--c-enc); }
.dot.seq { background: var(--c-seq-bright); box-shadow: 0 0 8px var(--c-seq); }
.dot.dec { background: var(--c-dec-bright); box-shadow: 0 0 8px var(--c-dec); }
.dot.root { background: var(--c-root-bright); box-shadow: 0 0 8px var(--c-root); }

.search-input {
  background: rgba(5, 8, 17, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.48rem 0.85rem;
  border-radius: 9px;
  width: 240px;
  outline: none;
  transition: border-color 0.16s ease;
}

.search-input:focus {
  border-color: var(--c-enc-bright);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.18);
}

.chrono-box {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(5, 8, 17, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  padding: 0.36rem 0.78rem;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.chrono-box input[type="range"] {
  width: 110px;
  accent-color: var(--c-enc-bright);
  cursor: pointer;
}

/* ---------------- Studio Split / Poster Workspace ---------------- */
.studio-workspace {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5.4fr);
  gap: 1.35rem;
  align-items: start;
}

.studio-workspace.poster-mode {
  grid-template-columns: 1fr;
}

/* Left Panel: Interactive Vector Tree */
.tree-panel {
  background: var(--bg-panel);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 890px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.studio-workspace.poster-mode .tree-panel {
  height: 1080px;
}

.tree-toolbar {
  padding: 0.7rem 1rem;
  background: rgba(5, 8, 17, 0.88);
  border-bottom: 1px solid var(--line-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

#graph-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  background: radial-gradient(circle at 50% 35%, rgba(16, 26, 48, 0.52) 0%, rgba(4, 7, 15, 0.96) 100%);
}

#graph-viewport.dragging {
  cursor: grabbing;
}

#arch-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.svg-node {
  cursor: pointer;
  transition: opacity 0.22s ease;
}

.svg-node .node-hex-bg {
  transition: filter 0.18s ease, stroke-width 0.18s ease;
}

.svg-node:hover .node-hex-bg {
  stroke-width: 3px;
  filter: url(#neon-glow);
}

.svg-node.is-selected .node-hex-bg {
  stroke-width: 3.4px;
  filter: url(#neon-glow-strong);
}

.svg-node.is-dimmed {
  opacity: 0.13;
}

.edge-base {
  fill: none;
  stroke: rgba(148, 163, 184, 0.36);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.22s ease;
}

.edge-base.is-dimmed {
  opacity: 0.08;
}

.edge-laser {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 10 6;
  animation: laserPulse 0.75s linear infinite;
  filter: url(#neon-glow);
}

@keyframes laserPulse {
  to {
    stroke-dashoffset: -32;
  }
}

.tree-footer-bar {
  padding: 0.65rem 1rem;
  background: rgba(5, 8, 17, 0.92);
  border-top: 1px solid var(--line-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.lineage-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.lineage-chip {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
}

.lineage-chip:hover {
  border-color: var(--c-enc-bright);
  color: #fff;
}

.lineage-chip.current {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--c-root-bright);
  color: var(--c-root-bright);
}

/* ---------------- Right Panel: High-Readability Model Dossier ---------------- */
.dossier-panel {
  background: var(--bg-panel);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.dossier-header {
  padding: 1.35rem 1.5rem 1.15rem;
  background: linear-gradient(180deg, rgba(17, 27, 50, 0.92) 0%, rgba(10, 16, 31, 0.92) 100%);
  border-bottom: 1px solid var(--line-subtle);
}

.dossier-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.fam-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.24rem 0.68rem;
  border-radius: 999px;
  border: 1px solid;
}

.fam-badge.root { background: var(--c-root-soft); color: var(--c-root-bright); border-color: rgba(52, 211, 153, 0.45); }
.fam-badge.encoder { background: var(--c-enc-soft); color: var(--c-enc-bright); border-color: rgba(34, 211, 238, 0.45); }
.fam-badge.seq2seq { background: var(--c-seq-soft); color: var(--c-seq-bright); border-color: rgba(251, 146, 60, 0.45); }
.fam-badge.decoder { background: var(--c-dec-soft); color: var(--c-dec-bright); border-color: rgba(244, 114, 182, 0.45); }

.year-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.22rem 0.58rem;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-1);
  border: 1px solid var(--line-subtle);
}

.dossier-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-1);
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.dossier-org {
  margin: 0.25rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--c-enc-bright);
}

.dossier-paper {
  margin: 0.65rem 0 0;
  padding: 0.5rem 0.75rem;
  background: rgba(5, 8, 17, 0.65);
  border-left: 3px solid var(--c-enc-bright);
  border-radius: 0 8px 8px 0;
  font-size: 0.86rem;
  color: var(--text-2);
  font-style: italic;
}

.dossier-summary {
  margin: 0.8rem 0 0;
  font-size: 0.98rem;
  line-height: 1.66;
  color: var(--text-1);
}

/* 6 Telemetry Mini-Cards */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-top: 1rem;
}

.tele-card {
  background: rgba(6, 11, 23, 0.88);
  border: 1px solid var(--line-subtle);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}

.tele-k {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.tele-v {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-1);
  margin-top: 0.15rem;
  line-height: 1.35;
}

/* Dossier Studio Tabs */
.studio-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(5, 8, 17, 0.92);
  border-bottom: 1px solid var(--line-subtle);
}

.studio-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.82rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.16s ease;
}

.studio-tab:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.03);
}

.studio-tab.active {
  color: var(--c-enc-bright);
  border-bottom-color: var(--c-enc-bright);
  background: rgba(6, 182, 212, 0.1);
}

.dossier-body {
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Content Cards inside Dossier */
.info-card {
  background: rgba(8, 14, 28, 0.92);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
}

.info-card.highlight-cyan {
  background: rgba(6, 182, 212, 0.09);
  border-color: rgba(34, 211, 238, 0.35);
}

.info-card.highlight-emerald {
  background: rgba(16, 185, 129, 0.09);
  border-color: rgba(52, 211, 153, 0.38);
}

.info-card.highlight-amber {
  background: rgba(245, 158, 11, 0.09);
  border-color: rgba(251, 191, 36, 0.38);
}

.card-kicker {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-prose {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-1);
}

.formula-banner {
  background: var(--bg-code);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: #a5f3fc;
  overflow-x: auto;
  line-height: 1.55;
}

/* Stack Pipeline Layers */
.stack-list {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.55rem;
}

.stack-btn {
  width: 100%;
  text-align: left;
  background: rgba(11, 18, 35, 0.9);
  border: 1px solid var(--line-subtle);
  border-radius: 11px;
  padding: 0.75rem 1rem;
  color: var(--text-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.16s ease;
}

.stack-btn:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #fff;
}

.stack-btn.active {
  background: rgba(6, 182, 212, 0.16);
  border-color: var(--c-enc-bright);
  color: #fff;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.15);
}

.stack-step-name {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
}

.stack-shape-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.2rem 0.58rem;
  border-radius: 6px;
  background: rgba(3, 6, 13, 0.9);
  border: 1px solid var(--line-subtle);
  color: var(--c-enc-bright);
  white-space: nowrap;
}

/* Interactive Token Chips & Matrix */
.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.65rem 0;
}

.token-chip {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(4, 8, 18, 0.92);
  color: var(--text-1);
  cursor: pointer;
  transition: all 0.15s ease;
}

.token-chip:hover {
  border-color: var(--c-enc-bright);
}

.token-chip.masked {
  background: rgba(249, 115, 22, 0.22);
  border: 1.5px dashed var(--c-seq-bright);
  color: #fed7aa;
}

.token-chip.generated {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--c-root-bright);
  color: #a7f3d0;
}

.attn-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-align: center;
  margin-top: 0.5rem;
}

.attn-table th, .attn-table td {
  padding: 0.48rem 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.attn-table th {
  background: rgba(5, 8, 17, 0.85);
  color: var(--text-2);
}

.code-block {
  margin: 0;
  padding: 1rem 1.15rem;
  border-radius: 11px;
  background: var(--bg-code);
  border: 1px solid var(--line-subtle);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #bae6fd;
  overflow-x: auto;
}

/* ---------------- Section Cards (Paradigm Shifts, Comparator, Quiz) ---------------- */
.section-card {
  background: var(--bg-panel);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
}

.sec-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-enc-bright);
  display: block;
  margin-bottom: 0.3rem;
}

.sec-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  font-weight: 700;
  margin: 0;
  color: var(--text-1);
}

.sec-sub {
  margin: 0.35rem 0 0;
  color: var(--text-body);
  font-size: 0.96rem;
  max-width: 78ch;
}

/* 6 Paradigm Shifts Grid (Symmetrical 3×2 on Desktop) */
.paradigm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.1rem;
}

.paradigm-card {
  background: rgba(8, 14, 28, 0.9);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.paradigm-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0;
  color: var(--text-1);
}

.paradigm-ladder {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--c-enc-bright);
  background: rgba(3, 6, 13, 0.85);
  border: 1px solid var(--line-subtle);
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  line-height: 1.5;
}

.paradigm-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.58;
}

/* Comparator Table */
.cmp-select {
  background: rgba(6, 11, 23, 0.95);
  border: 1px solid var(--line-strong);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}

.cmp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.cmp-table th, .cmp-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line-subtle);
  vertical-align: top;
  line-height: 1.55;
}

.cmp-table thead th {
  background: rgba(5, 8, 17, 0.9);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cmp-table tbody th {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  width: 20%;
}

.cmp-table tbody td {
  color: var(--text-1);
  width: 40%;
}

/* Quiz Grid */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.1rem;
}

.quiz-card {
  background: rgba(8, 14, 28, 0.9);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.quiz-q {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.45;
}

.quiz-opt {
  width: 100%;
  text-align: left;
  background: rgba(4, 8, 18, 0.88);
  border: 1px solid var(--line-subtle);
  border-radius: 9px;
  padding: 0.65rem 0.85rem;
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.45;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-opt:hover {
  border-color: var(--c-enc-bright);
  color: #fff;
}

.quiz-opt.correct {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--c-root-bright);
  color: #d1fae5;
  font-weight: 600;
}

.quiz-opt.wrong {
  background: rgba(236, 72, 153, 0.2);
  border-color: var(--c-dec-bright);
  color: #fce7f3;
}

.quiz-exp {
  margin: 0.2rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.1);
  border-left: 3px solid var(--c-enc-bright);
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* ---------------- Footer ---------------- */
.page-footer {
  border-top: 1px solid var(--line-subtle);
  background: rgba(4, 7, 15, 0.92);
  padding: 2.2rem 1.4rem;
  margin-top: 1rem;
}

.footer-inner {
  max-width: 1580px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.footer-nav {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.footer-btn {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-1);
  transition: all 0.16s ease;
}

.footer-btn:hover {
  border-color: var(--c-enc-bright);
  color: var(--c-enc-bright);
}

.footer-btn.primary {
  background: rgba(6, 182, 212, 0.16);
  border-color: var(--c-enc-bright);
  color: var(--c-enc-bright);
}

/* ---------------- Responsive Breakpoints ---------------- */
@media (max-width: 1220px) {
  .studio-workspace {
    grid-template-columns: 1fr;
  }
  .tree-panel {
    height: 760px;
  }
}

@media (max-width: 820px) {
  .pillar-grid {
    grid-template-columns: 1fr;
  }
  .telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-card, .section-card {
    padding: 1.25rem;
  }
}
