/* ==========================================================================
   DevOps — Pipeline Dashboard Theme
   Palette: deep navy + cyan + amber alert
   Cảm hứng: Grafana / Datadog / GitLab pipeline UI — control panel,
   pipeline graph, status indicator, terminal monospace.
   ========================================================================== */

:root {
  --bg:           #0b1220;          /* deep navy night */
  --bg-alt:       #0f172a;          /* card row alternate */
  --bg-card:      #131c2e;          /* surface card */
  --bg-deep:      #0a1020;          /* deepest emphasis */
  --bg-pane:      #182338;          /* pane / section */

  --text:         #e5e7eb;          /* main text */
  --text-soft:    #cbd5e1;          /* secondary */
  --text-muted:   #94a3b8;          /* muted */
  --ink:          #f8fafc;          /* brightest — headings */

  --cyan:         #22d3ee;          /* primary accent — links/active */
  --cyan-deep:    #0891b2;
  --cyan-soft:    rgba(34, 211, 238, 0.12);
  --cyan-line:    rgba(34, 211, 238, 0.3);

  --amber:        #f59e0b;          /* highlight / warning */
  --amber-soft:   rgba(245, 158, 11, 0.12);

  --orange:       #f97316;          /* alert / danger */
  --orange-soft:  rgba(249, 115, 22, 0.12);

  --green:        #10b981;          /* success / pass */
  --green-soft:   rgba(16, 185, 129, 0.12);

  --red:          #ef4444;          /* fail */
  --red-soft:     rgba(239, 68, 68, 0.12);

  --purple:       #a78bfa;          /* secondary tag */

  --border:       #1f2a44;
  --border-soft:  #1a2336;
  --border-strong:#243047;

  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md:    0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg:    0 14px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow:  0 0 0 1px var(--cyan-line), 0 8px 24px rgba(34, 211, 238, 0.10);

  --font-body:    "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-mono:    "JetBrains Mono", "Fira Code", "Menlo", monospace;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;

  --container: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  /* Subtle grid pattern, like a control-panel underlay */
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
h1 { font-size: 2.6rem; margin: 0 0 0.6rem; }
h2 {
  font-size: 1.85rem;
  margin: 2.6rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-strong);
  position: relative;
}
h2::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
h3 {
  font-size: 1.3rem;
  margin: 2rem 0 0.7rem;
  color: #cbd5e1;
  font-weight: 600;
}
h3::before {
  content: "// ";
  color: var(--cyan);
  font-family: var(--font-mono);
  font-weight: 500;
  margin-right: 4px;
}
h4 {
  font-size: 1.05rem;
  margin: 1.4rem 0 0.5rem;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.02em;
}

p { margin: 0.7rem 0; color: var(--text); }
strong { color: var(--ink); font-weight: 600; }
em { color: var(--amber); font-style: normal; }

a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dotted var(--cyan-line);
  transition: color 0.15s, border-color 0.15s, text-shadow 0.15s;
}
a:hover {
  color: #67e8f9;
  border-bottom-style: solid;
  border-bottom-color: var(--cyan);
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.4);
}

ul, ol { padding-left: 1.4rem; }
li { margin: 0.35rem 0; }
li::marker { color: var(--cyan); }

hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-strong), transparent);
  margin: 2.4rem 0;
}

blockquote {
  border-left: 3px solid var(--cyan);
  margin: 1.6rem 0;
  padding: 0.6rem 0 0.6rem 1.4rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--text-soft);
  background: linear-gradient(90deg, var(--cyan-soft), transparent 60%);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 18px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.005em;
}

.logo::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--cyan) 0% 28%, transparent 30%),
    conic-gradient(from -90deg,
      var(--green) 0% 25%,
      var(--cyan) 25% 50%,
      var(--amber) 50% 75%,
      var(--purple) 75% 100%);
  box-shadow:
    0 0 0 2px rgba(34, 211, 238, 0.2),
    0 0 16px rgba(34, 211, 238, 0.5);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  padding: 6px 0;
  transition: border-color 0.2s, color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 800px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center,
    rgba(34, 211, 238, 0.08) 0%,
    transparent 60%);
  pointer-events: none;
}

.hero h1 {
  font-size: 3.2rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  position: relative;
  background: linear-gradient(90deg, #f8fafc 0%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-soft);
  max-width: 760px;
  line-height: 1.7;
  position: relative;
}

.hero .badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1.4rem;
  position: relative;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--cyan-soft);
  color: var(--cyan);
  border: 1px solid var(--cyan-line);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(245, 158, 11, 0.3); }
.badge-green { background: var(--green-soft); color: var(--green); border-color: rgba(16, 185, 129, 0.3); }
.badge-orange { background: var(--orange-soft); color: var(--orange); border-color: rgba(249, 115, 22, 0.3); }
.badge-purple { background: rgba(167, 139, 250, 0.12); color: var(--purple); border-color: rgba(167, 139, 250, 0.3); }

/* ---------- Section ---------- */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}
.section:last-child { border-bottom: none; }
.section .lead {
  font-size: 1.05rem;
  color: var(--text-soft);
  max-width: 820px;
  line-height: 1.65;
}

/* ---------- Pipeline-style Roadmap (chapter cards) ---------- */
.roadmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
  margin-top: 32px;
}

.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px 22px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
  border-bottom: none;
  overflow: hidden;
}

.chapter-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--cyan), var(--cyan-deep));
  opacity: 0.5;
  transition: opacity 0.2s, width 0.2s;
}

.chapter-card::after {
  content: "● PASS";
  position: absolute;
  top: 14px; right: 14px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 100px;
  opacity: 0.85;
}

.chapter-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  box-shadow: var(--shadow-glow);
}
.chapter-card:hover::before { opacity: 1; width: 5px; }

.chapter-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--cyan);
  letter-spacing: 0.16em;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 500;
}

.chapter-card h3 {
  margin: 0 0 10px;
  font-size: 1.18rem;
  color: var(--ink);
  font-weight: 600;
  padding-right: 60px;
}
.chapter-card h3::before { content: ""; margin: 0; }

.chapter-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

.chapter-card .topics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 14px;
}

.chapter-card .topic-tag {
  font-size: 0.7rem;
  padding: 2px 9px;
  background: var(--bg-pane);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---------- Chapter pages ---------- */
.chapter-hero {
  padding: 55px 0 32px;
  border-bottom: 1px solid var(--border);
  position: relative;
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.03), transparent);
}

.chapter-hero .label {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chapter-hero .label::before {
  content: "▸";
  color: var(--cyan);
}

.chapter-hero h1 {
  font-size: 2.5rem;
  margin: 0 0 16px;
}

.chapter-hero .subtitle {
  font-size: 1.08rem;
  color: var(--text-soft);
  max-width: 820px;
  line-height: 1.65;
}

.chapter-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 50px;
  padding: 36px 0 70px;
}

.toc {
  position: sticky;
  top: 80px;
  align-self: start;
  font-size: 0.86rem;
  border-left: 2px solid var(--cyan);
  padding-left: 18px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.toc h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 14px;
  font-weight: 600;
}
.toc h4::before { content: ""; margin: 0; }

.toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.toc li { margin: 5px 0; }

.toc a {
  color: var(--text-soft);
  border-bottom: none;
  display: block;
  padding: 3px 0;
  line-height: 1.4;
  transition: color 0.15s, padding-left 0.15s;
}

.toc a:hover {
  color: var(--cyan);
  padding-left: 4px;
  text-shadow: none;
}

.chapter-body {
  max-width: 840px;
}

.chapter-body section {
  scroll-margin-top: 80px;
  margin-bottom: 38px;
}

/* ---------- Cards & Callouts ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 18px 0;
}

.callout {
  border-left: 3px solid var(--cyan);
  background: var(--bg-card);
  padding: 16px 22px;
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.callout-title {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 6px;
  font-weight: 600;
}

.callout-warn { border-left-color: var(--orange); background: var(--orange-soft); }
.callout-warn .callout-title { color: var(--orange); }

.callout-tip { border-left-color: var(--green); background: var(--green-soft); }
.callout-tip .callout-title { color: var(--green); }

.callout-note { border-left-color: var(--amber); background: var(--amber-soft); }
.callout-note .callout-title { color: var(--amber); }

.callout-fail { border-left-color: var(--red); background: var(--red-soft); }
.callout-fail .callout-title { color: var(--red); }

/* ---------- Code blocks ---------- */
pre {
  background: #050810;
  color: #e5e7eb;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  position: relative;
  margin: 16px 0;
}

pre code { font-family: inherit; color: inherit; background: none; padding: 0; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-pane);
  color: var(--cyan);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}

.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  border: 1px solid var(--cyan-line);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s, background 0.15s;
  letter-spacing: 0.08em;
}

pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: var(--cyan); color: var(--bg-deep); }
.copy-btn.copied { background: var(--green); color: var(--bg-deep); border-color: var(--green); }

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.92rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

th, td {
  padding: 11px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}

th {
  background: var(--bg-pane);
  color: var(--cyan);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-strong);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(34, 211, 238, 0.04); }

/* ---------- Compare boxes ---------- */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 20px 0;
}

.compare > div {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
}

.compare h4 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- ASCII / Pipeline diagram ---------- */
.ascii {
  background: #050810;
  color: #cbd5e1;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre;
  overflow-x: auto;
  margin: 18px 0;
}

/* Pipeline stage row — for visualizing pipeline flow */
.pipeline {
  display: flex;
  gap: 0;
  margin: 24px 0;
  flex-wrap: wrap;
  align-items: stretch;
}

.pipeline-stage {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  position: relative;
  min-width: 110px;
  text-align: center;
  margin-right: 26px;
  border-radius: var(--radius-sm);
}
.pipeline-stage:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cyan);
  font-size: 1.2rem;
}
.pipeline-stage.pass {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}
.pipeline-stage.fail {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}
.pipeline-stage.run {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-soft);
}

/* ---------- Quiz ---------- */
.quiz {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--cyan);
  border-radius: var(--radius);
  padding: 26px 30px;
  margin: 32px 0;
}

.quiz h3 {
  margin-top: 0;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 12px;
}
.quiz h3::before {
  content: "?";
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--cyan);
  color: var(--bg-deep);
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.1rem;
  margin-right: 0;
}

.quiz-question {
  margin: 20px 0;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border-strong);
}
.quiz-question:last-child { border-bottom: none; padding-bottom: 0; }

.quiz-question .q-text {
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink);
}

.quiz-options {
  list-style: none;
  padding: 0;
  margin: 0;
}

.quiz-option {
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  margin: 7px 0;
  cursor: pointer;
  background: var(--bg-deep);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.quiz-option::before {
  content: "○";
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.quiz-option:hover {
  border-color: var(--cyan);
  background: var(--cyan-soft);
}

.quiz-option.correct {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
}
.quiz-option.correct::before { content: "✓"; color: var(--green); }

.quiz-option.wrong {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red);
}
.quiz-option.wrong::before { content: "✗"; color: var(--red); }

.quiz-explain {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg-pane);
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
  color: var(--text-soft);
  display: none;
}
.quiz-explain.show { display: block; }

/* ---------- Chapter dropdown ---------- */
.chapter-jump { position: relative; }

.chapter-jump-btn {
  background: var(--bg-card);
  color: var(--cyan);
  border: 1px solid var(--cyan-line);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}

.chapter-jump-btn:hover {
  background: var(--cyan);
  color: var(--bg-deep);
}

.chapter-jump-btn::after { content: "▾"; font-size: 0.75rem; }

.chapter-jump-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 380px;
  max-height: 480px;
  overflow-y: auto;
  z-index: 100;
  padding: 6px;
}

.chapter-jump-menu.open { display: block; }

.chapter-jump-menu a {
  display: flex;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: none;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.4;
  align-items: center;
  transition: background 0.12s, color 0.12s;
}

.chapter-jump-menu a:hover {
  background: var(--cyan-soft);
  color: var(--cyan);
  text-shadow: none;
}

.chapter-jump-menu a.current {
  background: var(--cyan);
  color: var(--bg-deep);
}

.chapter-jump-menu .ch-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 44px;
  letter-spacing: 0.04em;
}
.chapter-jump-menu a.current .ch-num { color: var(--bg-deep); opacity: 0.85; }

/* ---------- Steps list ---------- */
.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.steps li {
  counter-increment: step;
  padding: 12px 0 12px 56px;
  position: relative;
  border-bottom: 1px dashed var(--border-strong);
}
.steps li:last-child { border-bottom: none; }

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 12px;
  width: 40px; height: 36px;
  background: var(--bg-pane);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

/* ---------- Status / Metric tiles ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.metric-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
}
.metric-tile .metric-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.metric-tile .metric-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.metric-tile .metric-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.metric-tile.green { border-left: 3px solid var(--green); }
.metric-tile.green .metric-value { color: var(--green); }
.metric-tile.amber { border-left: 3px solid var(--amber); }
.metric-tile.amber .metric-value { color: var(--amber); }
.metric-tile.cyan  { border-left: 3px solid var(--cyan); }
.metric-tile.cyan  .metric-value { color: var(--cyan); }
.metric-tile.red   { border-left: 3px solid var(--red); }
.metric-tile.red   .metric-value { color: var(--red); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 36px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 40px;
}

.site-footer a { color: var(--cyan); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .chapter-layout { grid-template-columns: 1fr; }
  .toc {
    position: static;
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    margin-bottom: 24px;
    max-height: none;
  }
  .compare { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.3rem; }
  .nav-links { gap: 12px; }
  .nav-links a:not(.chapter-jump-btn) { display: none; }
  .pipeline-stage:not(:last-child)::after { display: none; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .hero { padding: 50px 0 35px; }
  .hero h1 { font-size: 2rem; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.4rem; }
  pre { font-size: 0.78rem; padding: 14px 14px; }
}

::selection {
  background: var(--cyan);
  color: var(--bg-deep);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-deep); }
