/*
 * "Control plane" theme for the homelab history deck.
 * Dark slate canvas, amber for time/history, cyan for live/now.
 */
@import url("../vendor/fonts/inter/index.css");
@import url("../vendor/fonts/jetbrains-mono/index.css");

:root {
  --bg: #0b0f16;
  --bg-2: #111827;
  --panel: #151d2b;
  --panel-2: #1b2536;
  --line: #263246;
  --text: #e6ebf2;
  --muted: #93a1b5;
  --dim: #5d6b80;
  --amber: #ffb547;
  --amber-soft: rgba(255, 181, 71, 0.14);
  --cyan: #4fd1e8;
  --cyan-soft: rgba(79, 209, 232, 0.13);
  --green: #5ee0a0;
  --red: #ff6b6b;
  --violet: #a78bfa;
  --pink: #f472b6;

  --font: "Inter Variable", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, monospace;

  --r-background-color: var(--bg);
  --r-main-font: var(--font);
  --r-main-font-size: 34px;
  --r-main-color: var(--text);
  --r-heading-font: var(--font);
  --r-heading-color: var(--text);
  --r-heading-font-weight: 750;
  --r-heading-letter-spacing: -0.02em;
  --r-heading-text-transform: none;
  --r-heading-line-height: 1.1;
  --r-code-font: var(--mono);
  --r-link-color: var(--cyan);
  --r-link-color-hover: var(--amber);
  --r-selection-background-color: var(--amber);
  --r-selection-color: var(--bg);
}

.reveal-viewport {
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(79, 209, 232, 0.07), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(255, 181, 71, 0.06), transparent 60%),
    var(--bg);
}

.reveal {
  font-family: var(--font);
  font-size: var(--r-main-font-size);
  font-weight: 400;
  color: var(--text);
  font-feature-settings: "ss01", "cv11";
}

.reveal .slides section {
  text-align: left;
  line-height: 1.4;
}

.reveal h1, .reveal h2, .reveal h3, .reveal h4 {
  font-family: var(--font);
  font-weight: var(--r-heading-font-weight);
  letter-spacing: var(--r-heading-letter-spacing);
  line-height: var(--r-heading-line-height);
  color: var(--text);
  text-transform: none;
  margin: 0 0 0.5em;
}
.reveal h1 { font-size: 2.6em; }
.reveal h2 { font-size: 1.7em; }
.reveal h3 { font-size: 1.15em; }
.reveal h4 { font-size: 0.9em; color: var(--muted); font-weight: 600; }

.reveal p { margin: 0.4em 0; }
.reveal strong { color: #fff; font-weight: 700; }
.reveal em { color: var(--amber); font-style: normal; }

.reveal ul, .reveal ol { display: block; margin-left: 1.1em; }
.reveal li { margin: 0.28em 0; }
.reveal li::marker { color: var(--dim); }

.reveal a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(79, 209, 232, 0.35); }

.reveal code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 0.05em 0.35em;
  border-radius: 6px;
  color: #f5d9a8;
}
.reveal pre {
  width: 100%;
  margin: 0.6em 0;
  box-shadow: none;
  font-size: 0.5em;
  line-height: 1.5;
}
.reveal pre code {
  background: #0d1320;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9em 1.1em;
  max-height: 560px;
  color: var(--text);
}
.reveal .hljs { background: #0d1320; }

/* ---------- Layout helpers ---------- */

.reveal .kicker {
  font-family: var(--mono);
  font-size: 0.5em;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.9em;
  display: flex;
  align-items: center;
  gap: 0.8em;
}
.reveal .kicker::before {
  content: "";
  width: 2.2em;
  height: 2px;
  background: currentColor;
  display: inline-block;
}
.reveal .kicker.now { color: var(--cyan); }

.reveal .lede { font-size: 0.92em; color: var(--muted); max-width: 30em; }
.reveal .small { font-size: 0.62em; color: var(--muted); }
.reveal .tiny { font-size: 0.45em; color: var(--dim); }
.reveal .mono { font-family: var(--mono); }
.reveal .muted { color: var(--muted); }
.reveal .amber { color: var(--amber); }
.reveal .cyan { color: var(--cyan); }
.reveal .green { color: var(--green); }
.reveal .red { color: var(--red); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4em; align-items: start; }
.cols.c3 { grid-template-columns: repeat(3, 1fr); }
.cols.wide-left { grid-template-columns: 1.4fr 1fr; }
.cols.wide-right { grid-template-columns: 1fr 1.4fr; }
.cols.center { align-items: center; }

.card {
  background: linear-gradient(180deg, var(--panel), #121a27);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.8em 1em;
}
.card h3 { margin-bottom: 0.3em; font-size: 0.8em; }
.card p, .card li { font-size: 0.62em; color: var(--muted); }
.card.amber { border-color: rgba(255, 181, 71, 0.45); background: linear-gradient(180deg, #221c12, #15161a); }
.card.cyan { border-color: rgba(79, 209, 232, 0.4); background: linear-gradient(180deg, #0f2129, #111822); }
.card.red { border-color: rgba(255, 107, 107, 0.4); background: linear-gradient(180deg, #2a1517, #161419); }

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.45em;
  padding: 0.25em 0.7em;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
  margin: 0 0.3em 0.3em 0;
  vertical-align: middle;
}
.pill.amber { color: var(--amber); border-color: rgba(255, 181, 71, 0.45); background: var(--amber-soft); }
.pill.cyan { color: var(--cyan); border-color: rgba(79, 209, 232, 0.45); background: var(--cyan-soft); }
.pill.green { color: var(--green); border-color: rgba(94, 224, 160, 0.4); background: rgba(94, 224, 160, 0.1); }
.pill.red { color: var(--red); border-color: rgba(255, 107, 107, 0.45); background: rgba(255, 107, 107, 0.1); }
.pill.strike { text-decoration: line-through; opacity: 0.6; }

/* ---------- Title ---------- */

.title-slide h1 { font-size: 2.9em; line-height: 1.02; margin-bottom: 0.35em; }
.title-slide h1 .grad {
  background: linear-gradient(90deg, var(--amber), #ffd48a 40%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title-slide .byline { font-size: 0.7em; color: var(--muted); margin-top: 1.6em; }
.title-slide .byline strong { color: var(--text); }

/* ---------- Big number / stat tiles ---------- */

.big-number {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 3.6em;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}
.big-number .unit { font-size: 0.32em; color: var(--muted); letter-spacing: 0; margin-left: 0.2em; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6em; }
.stats.s3 { grid-template-columns: repeat(3, 1fr); }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.55em 0.75em 0.6em;
  position: relative;
  overflow: hidden;
}
.stat .label {
  font-family: var(--mono);
  font-size: 0.38em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.stat .value {
  font-family: var(--mono);
  font-weight: 650;
  font-size: 1.25em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat .value .unit { font-size: 0.45em; color: var(--muted); margin-left: 0.15em; font-weight: 500; }
.stat .sub { font-size: 0.4em; color: var(--muted); font-family: var(--mono); }
.stat .meter { height: 5px; border-radius: 3px; background: var(--line); margin-top: 0.4em; overflow: hidden; }
.stat .meter > span { display: block; height: 100%; width: 0; background: var(--cyan); border-radius: 3px; transition: width 0.8s ease; }
.stat.hl .value { color: var(--cyan); }

.live-dot {
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(94, 224, 160, 0.6);
  animation: pulse 2s infinite;
  vertical-align: middle;
  margin-right: 0.35em;
}
.live-dot.stale { background: var(--dim); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(94, 224, 160, 0.55); }
  70% { box-shadow: 0 0 0 0.6em rgba(94, 224, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 224, 160, 0); }
}

/* ---------- Terminal ---------- */

.term {
  background: #0a0e15;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 0.5em;
  line-height: 1.55;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.term .bar {
  background: #141b27;
  border-bottom: 1px solid var(--line);
  padding: 0.45em 0.8em;
  display: flex;
  gap: 0.45em;
  align-items: center;
  color: var(--dim);
  font-size: 0.85em;
}
.term .bar i { width: 0.75em; height: 0.75em; border-radius: 50%; background: #2c3647; display: inline-block; }
.term .bar i:nth-child(1) { background: #ff5f57; }
.term .bar i:nth-child(2) { background: #febc2e; }
.term .bar i:nth-child(3) { background: #28c840; }
.term .bar span { margin-left: 0.6em; }
.term .body { padding: 0.8em 1em; white-space: pre; color: #cfd8e3; overflow-x: auto; }
.term .p { color: var(--green); }
.term .c { color: var(--dim); }
.term .h { color: var(--amber); font-weight: 700; }
.term .k { color: var(--cyan); }

/* ---------- Era slides ---------- */

.era {
  display: grid;
  grid-template-columns: 5.2em 1fr;
  gap: 1.2em;
  align-items: start;
}
.era .year {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 2.2em;
  line-height: 0.95;
  color: var(--amber);
  letter-spacing: -0.05em;
  writing-mode: horizontal-tb;
}
.era .year small { display: block; font-size: 0.26em; letter-spacing: 0.08em; color: var(--dim); font-weight: 500; margin-top: 0.6em; }
.era h2 { font-size: 1.35em; margin-bottom: 0.3em; }
.era .why {
  margin-top: 0.7em;
  padding: 0.55em 0.8em;
  border-left: 3px solid var(--cyan);
  background: var(--cyan-soft);
  border-radius: 0 10px 10px 0;
  font-size: 0.6em;
  color: #cfeff5;
}
.era ul { font-size: 0.66em; }
.era li { color: var(--muted); }
.era li strong { color: var(--text); }

.commit {
  font-family: var(--mono);
  font-size: 0.48em;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5em 0.75em;
  margin: 0.35em 0;
}
.commit .sha { color: var(--amber); margin-right: 0.6em; }
.commit .date { color: var(--dim); margin-right: 0.6em; }
.commit .msg { color: var(--text); }

/* ---------- Timeline strip (progress through the decade) ---------- */

.decade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -40px;
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
  font-family: var(--mono);
  font-size: 0.34em;
  color: var(--dim);
}
.decade span { border-top: 3px solid var(--line); padding-top: 0.4em; text-align: center; }
.decade span.on { border-color: var(--amber); color: var(--amber); }
.decade span.past { border-color: rgba(255, 181, 71, 0.35); }

/* ---------- Charts ---------- */

.chart { width: 100%; }
.chart text { font-family: var(--mono); fill: var(--muted); }
.chart .bar { fill: var(--amber); opacity: 0.9; }
.chart .bar.quiet { fill: #6b5b3e; }
.chart .bar.now { fill: var(--cyan); }
.chart .val { fill: var(--text); font-size: 13px; font-weight: 600; }
.chart .axis { stroke: var(--line); }
.chart .annot { fill: var(--amber); font-size: 12px; }
.chart .annot-line { stroke: var(--amber); stroke-dasharray: 3 3; opacity: 0.6; }

/* lineage swimlanes */
.lanes { font-family: var(--mono); }
.lanes .lane-label { fill: var(--muted); font-size: 13px; }
.lanes .grid { stroke: #1d2738; }
.lanes .yr { fill: var(--dim); font-size: 12px; }
.lanes .seg { rx: 6; }
.lanes .seg-label { fill: #0b0f16; font-size: 11.5px; font-weight: 700; }
.lanes .seg-label.light { fill: var(--text); }

/* ---------- Architecture diagram ---------- */

.arch text { font-family: var(--font); }
.arch .box { fill: var(--panel); stroke: var(--line); stroke-width: 1.5; }
.arch .box.amber { stroke: var(--amber); fill: #1f1a12; }
.arch .box.cyan { stroke: var(--cyan); fill: #0f1f27; }
.arch .box.violet { stroke: var(--violet); fill: #1a1729; }
.arch .box.green { stroke: var(--green); fill: #10211b; }
.arch .t { fill: var(--text); font-size: 15px; font-weight: 650; }
.arch .s { fill: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.arch .edge { stroke: #3b4a63; stroke-width: 1.8; fill: none; marker-end: url(#arrow); }
.arch .edge.hot { stroke: var(--cyan); }
.arch .zone { fill: none; stroke: #243044; stroke-dasharray: 6 5; rx: 14; }
.arch .zone-label { fill: var(--dim); font-size: 11px; font-family: var(--mono); letter-spacing: 0.12em; }

/* ---------- War stories ---------- */

.incident { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; }
.incident .card h3 { font-family: var(--mono); font-size: 0.5em; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); }
.incident .card p { font-size: 0.6em; color: var(--text); }
.lesson {
  margin-top: 0.8em;
  font-size: 0.72em;
  padding: 0.6em 0.9em;
  border-radius: 12px;
  background: var(--amber-soft);
  border: 1px solid rgba(255, 181, 71, 0.4);
  color: #ffe2b5;
}
.lesson::before { content: "LESSON  "; font-family: var(--mono); font-size: 0.7em; letter-spacing: 0.14em; color: var(--amber); }

.quote {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.quote .mark { color: var(--amber); }

/* ---------- Footer / served-by badge ---------- */

.served-by {
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 30;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  backdrop-filter: blur(6px);
  transition: color 0.3s, border-color 0.3s;
}
.served-by b { color: var(--muted); font-weight: 600; }
.served-by.changed { color: var(--cyan); border-color: var(--cyan); }

.reveal .progress { color: var(--amber); height: 3px; }
.reveal .controls { color: var(--dim); }
.reveal .slide-number { background: transparent; color: var(--dim); font-family: var(--mono); font-size: 12px; left: 18px; bottom: 14px; right: auto; }

/* Section dividers */
.divider h2 { font-size: 2.6em; }
.divider .num { font-family: var(--mono); color: var(--amber); font-size: 0.8em; margin-bottom: 0.6em; }

/* Fragments: a gentle rise instead of reveal's default fade */
.reveal .fragment.rise { opacity: 0; transform: translateY(12px); transition: all 0.45s ease; }
.reveal .fragment.rise.visible { opacity: 1; transform: none; }

.center-all { text-align: center !important; }
.center-all .kicker { justify-content: center; }
.center-all .kicker::before { display: none; }

/* ---------- Sizing pass (projector legibility) ---------- */

/* Slides fill the frame so bottom-anchored elements sit at the bottom. */
.reveal .slides > section { height: 100%; box-sizing: border-box; }

.era ul { font-size: 0.76em; }
.era li { margin: 0.32em 0; }
.era .commit { font-size: 0.52em; }
.era .why { font-size: 0.66em; }
.era h2 { font-size: 1.45em; }
.decade { bottom: 8px; }

.card p, .card li { font-size: 0.7em; }
.card h3 { font-size: 0.85em; }
.incident .card p { font-size: 0.66em; }
.lesson { font-size: 0.76em; }

.paradox li { font-size: 0.78em; }
.title-slide { padding-top: 110px; }
.divider { padding-top: 170px; }
.term.big { font-size: 0.62em; }
.reveal .small { font-size: 0.7em; }
.reveal .tiny { font-size: 0.5em; }
.reveal .commit + .tiny { margin: 0.1em 0 0.7em; }
.card ol.agenda { margin-left: 1.1em; }
.card ol.agenda li { font-size: 0.62em; color: var(--text); margin: 0.35em 0; }
.principles li { font-size: 0.82em; margin: 0.5em 0; }
.lightning .tiny { font-size: 0.56em; }
/* PDF export: slides don't get the full-height frame, so drop the strip. */
html.reveal-print .decade, html.print-pdf .decade { display: none; }
html.reveal-print .served-by, html.print-pdf .served-by { display: none; }
