/* ============================================================================
   deck.css — GLOBAL slide styles for MuggsOfCompSci decks (manuscript system).
   THE single source of truth: change a value here and every deck that links
   this file updates. Decks link it (<link rel="stylesheet" href="/decks/deck.css">),
   consume the :root tokens (never literal hexes), use these class names, and run
   /decks/deck.js as the controller.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Palette — manuscript-at-night. Canonical token names (master §1a). */
  --ink: #0F241C;         /* deep insular green ground */
  --ink-glow: #17392B;    /* lighter center for the ground gradient */
  --panel: #16382A;       /* raised panels / cards */
  --vellum: #EFE6CE;      /* primary text */
  --vellum-dim: #BEB393;  /* muted text / captions */
  --gold: #C9A24A;        /* gold leaf — illumination (the ancient) */
  --gold-bright: #E7CB78; /* bright gold — headings */
  --green: #34E0A1;       /* electric green — circuitry (the advanced) */
  --oxblood: #9B3B2E;     /* rubric — Discuss pill */

  /* Type */
  --display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(ellipse 90% 70% at 50% 38%, var(--ink-glow) 0%, var(--ink) 70%);
  color: var(--vellum);
  font-family: var(--body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Neural-node motif — the "advanced technology" signature woven behind the
   manuscript ground; gold + electric-green nodes on faint green circuitry. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201200%20800'%20preserveAspectRatio='xMidYMid%20slice'%3E%3Cg%20stroke='%2334E0A1'%20stroke-width='1'%20opacity='0.13'%3E%3Cline%20x1='120'%20y1='140'%20x2='320'%20y2='240'/%3E%3Cline%20x1='320'%20y1='240'%20x2='240'%20y2='470'/%3E%3Cline%20x1='320'%20y1='240'%20x2='560'%20y2='180'/%3E%3Cline%20x1='560'%20y1='180'%20x2='720'%20y2='330'/%3E%3Cline%20x1='720'%20y1='330'%20x2='940'%20y2='250'/%3E%3Cline%20x1='940'%20y1='250'%20x2='1080'%20y2='430'/%3E%3Cline%20x1='720'%20y1='330'%20x2='640'%20y2='560'/%3E%3Cline%20x1='640'%20y1='560'%20x2='420'%20y2='640'/%3E%3Cline%20x1='240'%20y1='470'%20x2='420'%20y2='640'/%3E%3Cline%20x1='1080'%20y1='430'%20x2='900'%20y2='620'/%3E%3Cline%20x1='900'%20y1='620'%20x2='640'%20y2='560'/%3E%3Cline%20x1='560'%20y1='180'%20x2='240'%20y2='470'/%3E%3C/g%3E%3Cg%20opacity='0.55'%3E%3Ccircle%20cx='120'%20cy='140'%20r='5'%20fill='%23C9A24A'/%3E%3Ccircle%20cx='320'%20cy='240'%20r='6'%20fill='%2334E0A1'/%3E%3Ccircle%20cx='560'%20cy='180'%20r='5'%20fill='%23C9A24A'/%3E%3Ccircle%20cx='720'%20cy='330'%20r='7'%20fill='%2334E0A1'/%3E%3Ccircle%20cx='940'%20cy='250'%20r='5'%20fill='%23C9A24A'/%3E%3Ccircle%20cx='1080'%20cy='430'%20r='6'%20fill='%2334E0A1'/%3E%3Ccircle%20cx='240'%20cy='470'%20r='5'%20fill='%2334E0A1'/%3E%3Ccircle%20cx='640'%20cy='560'%20r='6'%20fill='%23C9A24A'/%3E%3Ccircle%20cx='420'%20cy='640'%20r='5'%20fill='%2334E0A1'/%3E%3Ccircle%20cx='900'%20cy='620'%20r='6'%20fill='%23C9A24A'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat;
}

/* ---------- Deck / slides ---------- */
#deck { position: relative; height: 100%; z-index: 1; }
/* Content sits in a CENTERED column (balanced margins both sides), with text
   left-aligned within it — not crammed against the left edge. */
.slide {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: min(100%, 54rem);
  justify-content: center;      /* center the column horizontally */
  align-content: safe center;   /* center the content block vertically */
  justify-items: center;        /* center each content block on the slide */
  overflow-y: auto;
  gap: clamp(1rem, 3vh, 2rem);
  padding: clamp(2rem, 5vh, 4rem) clamp(1.6rem, 4vw, 3rem) clamp(3.6rem, 7vh, 5rem);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.slide.active { opacity: 1; visibility: visible; transform: none; }
.slide.center { justify-items: center; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .slide { transition: opacity 0.001s; transform: none; }
}

/* ---------- Eyebrow ---------- */
.eyebrow, .part-eyebrow, .section-eyebrow, .bridge-eyebrow {
  font-family: var(--body); letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--green); font-size: clamp(0.78rem, 1.4vw, 1.05rem); font-weight: 600;
}

/* ---------- Ornament: rule + lozenge ---------- */
.ornament { display: flex; align-items: center; justify-content: center; gap: 0.85rem; }
.ornament .line { height: 1px; width: clamp(44px, 11vw, 120px); background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament .line.r { background: linear-gradient(90deg, var(--gold), transparent); }
.ornament .lozenge { width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 0 3px rgba(201,162,74,0.18); }

/* ---------- Illuminated part-title card ---------- */
.partcard {
  position: relative; background: var(--panel);
  border: 2px solid var(--gold);
  box-shadow: inset 0 0 0 7px var(--panel), inset 0 0 0 8px rgba(201,162,74,0.35), 0 0 44px rgba(52,224,161,0.10);
  padding: clamp(2.6rem, 7vw, 5.5rem) clamp(2.4rem, 8vw, 6rem);
  max-width: 900px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: clamp(1.1rem, 3vh, 2rem);
}
.partcard h1 { font-family: var(--display); font-weight: 600; color: var(--gold-bright); font-size: clamp(3.4rem, 12vw, 8.5rem); line-height: 0.92; letter-spacing: 0.005em; }
.part-sub { font-family: var(--display); font-style: italic; color: var(--vellum); font-size: clamp(1.3rem, 3vw, 2.2rem); line-height: 1.2; }

/* ---------- Section opener: illuminated initial + name ---------- */
.section { display: flex; align-items: center; gap: clamp(1.2rem, 3vw, 2.2rem); }
.section .initial {
  flex: none; width: clamp(4.6rem, 11vw, 7.2rem); height: clamp(4.6rem, 11vw, 7.2rem);
  display: grid; place-items: center; background: var(--panel); border: 2px solid var(--gold);
  box-shadow: inset 0 0 0 5px var(--panel), inset 0 0 0 6px rgba(201,162,74,0.35), 0 0 20px rgba(52,224,161,0.16);
  font-family: var(--display); font-weight: 700; color: var(--gold-bright);
  font-size: clamp(1.9rem, 5vw, 3.2rem); line-height: 1;
}
.section .section-body { display: flex; flex-direction: column; gap: 0.4rem; }
.section .section-name { font-family: var(--display); font-weight: 600; color: var(--vellum); font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: 1.02; }

/* ---------- Big statement ---------- */
.statement { font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 5.6vw, 4.8rem); line-height: 1.05; color: var(--vellum); letter-spacing: -0.005em; max-width: 20ch; }

/* ---------- Supporting text ---------- */
.lead { font-family: var(--body); font-size: clamp(1.1rem, 2.2vw, 1.6rem); color: var(--vellum-dim); max-width: 40ch; line-height: 1.45; }
em { font-style: italic; color: var(--vellum); }

/* ---------- Quote (his voice) ---------- */
.quote { font-family: var(--display); font-style: italic; color: var(--gold-bright); font-size: clamp(1.6rem, 3.6vw, 2.9rem); line-height: 1.2; border-left: 3px solid var(--gold); padding-left: 1rem; max-width: 26ch; }

/* ---------- Points list (lozenge markers) ---------- */
.points { list-style: none; display: flex; flex-direction: column; gap: clamp(0.5rem, 1.4vh, 1rem); max-width: 42ch; }
.points li { font-family: var(--body); font-size: clamp(1.05rem, 2.1vw, 1.5rem); color: var(--vellum); line-height: 1.35; padding-left: 1.5rem; position: relative; }
.points li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }

/* ---------- Two-column layout + side panels ---------- */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 3vw, 2rem); width: 100%; max-width: 1000px; }
.side { border: 1px solid rgba(201,162,74,0.3); background: var(--panel); padding: clamp(1.2rem, 3vw, 2rem); display: flex; flex-direction: column; gap: 0.7rem; }
.side .side-label { font-family: var(--body); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; font-size: clamp(0.9rem, 1.6vw, 1.15rem); color: var(--vellum); }
.side .side-body { font-family: var(--body); color: var(--vellum-dim); font-size: clamp(1rem, 1.9vw, 1.35rem); line-height: 1.4; }
.side ul { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.side li { font-family: var(--body); font-size: clamp(1rem, 1.9vw, 1.3rem); color: var(--vellum); line-height: 1.35; }
@media (max-width: 640px) { .cols { grid-template-columns: 1fr; } }

/* Local-vs-cloud contrast: gold = power WITH (local); oxblood = power OVER (cloud) */
.side--cloud { border-color: rgba(155,59,46,0.5); }
.side--cloud .side-label { color: var(--oxblood); }
.side--local { border-color: var(--gold); }
.side--local .side-label { color: var(--gold-bright); }

/* ---------- Three-zone (ZPD) diagram — nested bands; The Zone (gold) in the middle ---------- */
.zones { width: 100%; max-width: 760px; }
.band { border-radius: 14px; padding: clamp(0.7rem, 1.8vw, 1.1rem) clamp(0.8rem, 2.5vw, 1.6rem); display: flex; flex-direction: column; gap: clamp(0.6rem, 1.8vw, 1.1rem); }
.band > .band-label { font-family: var(--body); font-weight: 700; font-size: clamp(0.85rem, 1.7vw, 1.2rem); letter-spacing: 0.04em; }
.band.easy { border: 2px solid rgba(190,179,147,0.45); }
.band.easy > .band-label { color: var(--vellum-dim); }
.band.zone { border: 2px solid var(--gold); background: rgba(201,162,74,0.10); }
.band.zone > .band-label { color: var(--gold-bright); }
.band.hard { border: 2px solid rgba(155,59,46,0.55); background: rgba(155,59,46,0.06); }
.band.hard > .band-label { color: var(--oxblood); }

/* ---------- Big stat callout ---------- */
.stat { font-family: var(--display); font-weight: 700; font-size: clamp(4.2rem, 14vw, 10rem); line-height: 0.82; color: var(--gold-bright); letter-spacing: -0.03em; }
.stat.oxblood { color: var(--oxblood); }
.stat.green { color: var(--green); }

/* ---------- Multi-stat row (recap slides) ---------- */
.statrow { display: flex; flex-wrap: wrap; gap: clamp(1rem, 3.5vw, 3rem); justify-content: center; }
.statblock { display: flex; flex-direction: column; align-items: center; text-align: center; }
.statblock .n { font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 7vw, 5rem); line-height: 0.9; color: var(--gold-bright); letter-spacing: -0.02em; }
.statblock.green .n { color: var(--green); }
.statblock.oxblood .n { color: var(--oxblood); }
.statblock .l { font-family: var(--body); font-size: clamp(0.85rem, 1.5vw, 1.15rem); color: var(--vellum-dim); margin-top: 0.35rem; max-width: 16ch; line-height: 1.3; }

/* ---------- Discuss / Reflect pill ---------- */
.pill { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--oxblood); color: var(--gold-bright); font-family: var(--body); font-size: clamp(0.72rem, 1.3vw, 0.92rem); letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600; padding: 0.45em 0.95em; border-radius: 999px; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ---------- Question (discussion decks) ---------- */
.question { font-family: var(--display); font-weight: 600; font-size: clamp(2.4rem, 6vw, 5.2rem); line-height: 1.04; color: var(--vellum); letter-spacing: -0.005em; max-width: 19ch; }
.subprompt { font-family: var(--body); font-size: clamp(1rem, 2vw, 1.5rem); color: var(--vellum-dim); max-width: 34ch; line-height: 1.4; }

/* ---------- Capture note ---------- */
.capture { font-family: var(--body); font-style: italic; color: var(--vellum-dim); font-size: clamp(0.85rem, 1.5vw, 1.1rem); }

/* ---------- Helper prompts — small, muted angles under a question (never answers) ---------- */
.helpers { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.3rem; max-width: 44ch; }
.helper { font-family: var(--body); font-size: clamp(0.9rem, 1.6vw, 1.2rem); color: var(--vellum-dim); line-height: 1.4; padding-left: 1.2rem; position: relative; }
.helper::before { content: "\2014"; position: absolute; left: 0; color: var(--green); opacity: 0.85; }

/* ---------- Attribution line (last slide) ---------- */
.attribution { font-family: var(--body); font-style: italic; font-size: clamp(0.72rem, 1.3vw, 0.95rem); color: var(--vellum-dim); max-width: 46ch; line-height: 1.4; }

/* ---------- Phase label — "Before you watch" / "After you watch" ---------- */
.phase { font-family: var(--body); letter-spacing: 0.26em; text-transform: uppercase; font-weight: 700; font-size: clamp(0.75rem, 1.4vw, 1rem); color: var(--gold); }

/* ---------- Bridge ---------- */
.bridge { font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 6vw, 4.6rem); color: var(--gold-bright); line-height: 1.1; max-width: 24ch; }

/* ---------- Images (in content slides) ---------- */
.deck-img { max-width: 100%; max-height: 46vh; border-radius: 8px; border: 1px solid rgba(201,162,74,0.3); margin-top: 0.3rem; }

/* ---------- Font themes (deck.font) ---------- */
body.font-modern { --display: 'Inter', system-ui, -apple-system, sans-serif; }
body.font-classic { --display: Georgia, 'Times New Roman', serif; --body: Georgia, 'Times New Roman', serif; }

/* ---------- Edit link (CMS) ---------- */
.edit-link {
  position: fixed; top: clamp(0.8rem, 2vh, 1.4rem); right: clamp(1.2rem, 3vw, 2.4rem); z-index: 6;
  font-family: var(--body); font-size: 0.8rem; text-decoration: none; color: var(--vellum-dim);
  border: 1px solid rgba(201,162,74,0.35); border-radius: 999px; padding: 0.35em 0.85em;
  background: rgba(22,56,42,0.6);
}
.edit-link:hover { color: var(--gold-bright); border-color: var(--gold); }

/* ---------- HUD ---------- */
.hud { position: fixed; z-index: 5; bottom: clamp(0.9rem, 2.4vh, 1.6rem); }
.hud.right { right: clamp(1.2rem, 3vw, 2.4rem); display: flex; align-items: center; gap: 0.7rem; }
.hud.left { left: clamp(1.2rem, 3vw, 2.4rem); font-size: 0.78rem; color: var(--vellum-dim); letter-spacing: 0.12em; font-family: var(--body); }
.counter { font-size: clamp(0.85rem, 1.4vw, 1.05rem); color: var(--vellum-dim); font-variant-numeric: tabular-nums; font-family: var(--body); }
.navbtn { width: 2.4rem; height: 2.4rem; border-radius: 999px; border: 1px solid rgba(201,162,74,0.4); background: rgba(22,56,42,0.7); color: var(--gold); font-size: 1.2rem; cursor: pointer; line-height: 1; display: grid; place-items: center; transition: border-color 0.2s, color 0.2s; }
.navbtn:hover { border-color: var(--gold); color: var(--gold-bright); }
.navbtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.navbtn:disabled { opacity: 0.3; cursor: default; border-color: rgba(201,162,74,0.2); }
.navbtn:disabled:hover { border-color: rgba(201,162,74,0.2); color: var(--gold); }
