/* ============================================================
   CSP SHARED THEME — teal signal Reveal.js theme
   Shared by all presentations in the Decks/CSP/ folder and its subfolders.

   ARCHITECTURE:
   1. Explicit Reveal.js theme rules    → colours, fonts applied via CSS
   2. Custom CSS variables (--*)        → palette + sizing tokens
   3. Reveal.js structural overrides    → layout adjustments
   4. Component styles                  → code cards, callouts, etc.
   5. Slide animations                  → check/x keyframe definitions
   6. Fragment overrides                → custom fade-up easing
   7. Storyboard strip                  → SyncDeck thumbnail strip
   8. Reduced motion                    → accessibility
   ============================================================ */

/* Force visible nav arrows on custom dark theme */
.reveal .controls {
  color: #00c9b1;
  z-index: 30;
}
.reveal .controls .enabled {
  opacity: 0.95;
}

/* ─── 1. Explicit Reveal.js theme application ─────────────────────
   NOTE: --r-* CSS custom properties are only consumed by Reveal's
   bundled theme CSS files. Since we load reveal.css alone (no theme),
   we must apply our colours/fonts with explicit CSS rules instead.
   ─────────────────────────────────────────────────────────────── */

/* Background: .reveal-viewport is the class Reveal adds to <body> */
body,
.reveal-viewport {
  background: #091412;
  background-color: #091412;
}

.reveal {
  background: transparent;
  color: #e2f5f2;
  font-family: 'Space Grotesk', sans-serif;
}

/* Headings */
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
  color: #e2f5f2;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: 0em;
  line-height: 1.15;
  text-transform: none;
  margin: 0;
}

/* Body text */
.reveal p,
.reveal li,
.reveal blockquote {
  color: rgba(226,245,242,0.6);
  font-family: 'Space Grotesk', sans-serif;
}

/* Inline code */
.reveal :not(pre) > code {
  font-family: 'JetBrains Mono', monospace;
  color: #00c9b1;
  background: rgba(0,201,177,0.1);
  padding: 0.1em 0.38em;
  border-radius: 2px;
  border: 1px solid rgba(0,201,177,0.3);
}

/* Links */
.reveal a { color: #00c9b1; }
.reveal a:hover { color: rgba(0,201,177,0.7); }

/* Selection */
.reveal ::selection {
  background: rgba(0,201,177,0.25);
  color: #fff;
}

/* ─── 2. Custom design tokens ─────────────────────────────────────── */
:root {
  /* Palette */
  --bg:            #091412;
  --bg-card:       #0f1d1a;
  --text:          #e2f5f2;
  --text-muted:    rgba(226,245,242,0.6);
  --text-dim:      rgba(226,245,242,0.35);
  --teal:          #00c9b1;
  --teal-border:   rgba(0,201,177,0.25);
  --teal-glow:     rgba(0,201,177,0.12);
  --amber:         #ffd43b;
  --amber-border:  rgba(255,212,59,0.35);
  --yellow:        #ffd43b;
  --green:         #69db7c;
  --red:           #ff6b6b;
  --gold:          #ff9f43;

  /* Fonts */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Space Grotesk', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Typography — px sized for the 1600×900 slide canvas.
     Reveal.js scales the entire .slides container via CSS transform
     so px values scale proportionally on all viewport sizes.
     Reveal.js JS sets font-size on .reveal as floor(viewportHeight*0.04)
     (~28px at 720px tall), then scales slides by e.g. 0.8 at 1280px wide —
     double-shrinking em values. Using px bypasses this entirely. */
  --title:  100px;    /* visual ~80px at 1280×720 — title slide  */
  --h2:      56px;    /* visual ~45px — section headings         */
  --h3:      36px;    /* visual ~29px — sub-headings             */
  --body:    25px;    /* visual ~20px — paragraph text           */
  --small:   19px;    /* visual ~15px — captions / annotations   */
  --code:    21px;    /* visual ~17px — code blocks              */
  --tag:     15px;    /* visual ~12px — slide labels             */

  /* Spacing — px so everything scales with Reveal's transform */
  --pad:     72px;    /* slide inner padding  */
  --gap:     26px;    /* between content items */
  --gap-sm:  13px;    /* tight gaps           */
  --gap-lg:  52px;    /* section gaps         */

  /* Animation easing */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── 3. Reveal.js structural overrides ──────────────────────────── */

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

/* Persistent grid texture on body — subtle teal tint */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,201,177,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,201,177,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Each section = full configured slide height.
   DO NOT set position here — Reveal.js sets position: absolute on sections
   so it can layer, fade, and transition slides. Overriding that with
   position: relative breaks the fade transition (slides go blank after #1).
   Glow divs (position: absolute) are already scoped to the section because
   an absolutely-positioned element is its own positioning context. */
.reveal .slides > section {
  height: 100%;
  padding: 0 !important;  /* override Reveal's default padding: 20px 0 */
  box-sizing: border-box;
  text-align: left;
}

/* Slide inner wrapper — centres content vertically, applies padding */
.slide-inner {
  width: 100%;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* Title/impact slides: centre both axes */
.slide-center { align-items: center; text-align: center; }

/* Reveal progress bar — teal → amber gradient */
.reveal .progress {
  height: 3px;
}
.reveal .progress span {
  background: linear-gradient(90deg, var(--teal), var(--amber));
  box-shadow: 0 0 10px rgba(0,201,177,0.4);
}

/* Slide number */
.reveal .slide-number {
  font-family: var(--font-mono);
  font-size: 1em;
  background: transparent;
  color: var(--text-muted);
  bottom: 0.8em;
  right: 1.2em;
  padding: 0;
}

.reveal .slide-number a,
.reveal .slide-number a:hover,
.reveal .slide-number a:focus {
  color: inherit;
  text-decoration: none;
  cursor: default;
}

/* ─── 4. Typography sizing ─────────────────────────────────────────
   Colours are set in section 1 above. These rules handle font sizes,
   spacing, and Reveal.js resets (box-shadow on pre, etc.).
   ─────────────────────────────────────────────────────────────── */

.reveal h2 {
  font-size: var(--h2);
  margin-bottom: var(--gap);
}

.reveal p {
  font-size: var(--body);
  line-height: 1.65;
  margin: 0;
}

/* Reset Reveal.js defaults on <pre> */
.reveal pre {
  font-family: var(--font-mono);
  font-size: var(--code);
  line-height: 1.8;
  color: rgba(226,245,242,0.85);
  white-space: pre;
  overflow: hidden;
  margin: 0;
  box-shadow: none;  /* Reveal adds a drop-shadow by default */
  width: auto;       /* Reveal sets width: 90% by default */
  text-align: left;
}

/* Reset Reveal.js <code> defaults (the :not(pre) rule in §1 handles chips) */
.reveal pre code {
  font-family: var(--font-mono);
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  max-height: none; /* Reveal sets max-height: 400px */
}

/* Tighter line-height inside cards */
.code-card .code-body pre {
  line-height: 1.5;
}

/* Indentation guides for code cards — teal tint */
.code-card .code-body pre {
  background-image:
    linear-gradient(rgba(0,201,177,0.18), rgba(0,201,177,0.18)),
    linear-gradient(rgba(0,201,177,0.16), rgba(0,201,177,0.16)),
    linear-gradient(rgba(0,201,177,0.14), rgba(0,201,177,0.14)),
    linear-gradient(rgba(0,201,177,0.12), rgba(0,201,177,0.12)),
    linear-gradient(rgba(0,201,177,0.10), rgba(0,201,177,0.10)),
    linear-gradient(rgba(0,201,177,0.08), rgba(0,201,177,0.08)),
    linear-gradient(rgba(0,201,177,0.07), rgba(0,201,177,0.07));
  background-repeat: no-repeat;
  background-size: 1px 100%, 1px 100%, 1px 100%, 1px 100%, 1px 100%, 1px 100%, 1px 100%;
  background-position: 0.1ch 0, 2ch 0, 4ch 0, 6ch 0, 8ch 0, 10ch 0, 12ch 0;
}

/* ─── 5. Layout utilities ──────────────────────────────────────────── */

.glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-lg);
  align-items: center;
  width: 100%;
}
.split-top { align-items: start; }

/* Two-column grid layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-lg);
  width: 100%;
}

/* ─── 6. Slide label ("▸ SECTION") ────────────────────────────────── */

.slide-tag {
  font-size: var(--tag);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--gap);
  display: block;
}
.slide-tag::before { content: '▸ '; color: var(--yellow); }

/* Title slide heading */
.title-h1 {
  font-size: var(--title);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: 0em;
  font-family: var(--font-display);
  color: var(--text);
  margin: 0;
}

/* ─── 7. Bullet lists ──────────────────────────────────────────────── */

.bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}
.bullets li {
  position: relative;
  padding-left: 1.2em;
  font-size: var(--body);
  line-height: 1.55;
  color: var(--text-muted);
}
.bullets li::before {
  content: '○';
  color: var(--teal);
  position: absolute;
  left: 0;
  top: 0.28em;
  font-size: 0.75em;
}
.bullets li strong { color: var(--text); font-weight: 600; }

/* ─── 8. Code blocks ───────────────────────────────────────────────── */

.code-card {
  background: var(--bg-card);
  border: 1px solid rgba(0,201,177,0.4);
  border-radius: 4px;
  overflow: hidden;
}
.code-card.accent { border-color: rgba(0,201,177,0.7); }

.code-hdr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.35em 1em;
  background: rgba(0,201,177,0.12);
  border-bottom: 1px solid rgba(0,201,177,0.4);
}
.cdot { display: none; }
.clang {
  font-family: var(--font-mono);
  font-size: var(--tag);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-left: 0;
}
.clang::before { content: '[ '; }
.clang::after  { content: ' ]'; }
.code-body {
  padding: 0.6em 1em;
  overflow: hidden;
}

/* Python syntax highlight colours */
.kw { color: var(--amber);   font-weight: 500; }
.tp { color: var(--teal); }
.nm { color: var(--gold); }
.cm { color: rgba(226,245,242,0.5); font-style: italic; }

/* ─── 9. Info / callout cards ──────────────────────────────────────── */

.callout {
  background: var(--bg-card);
  border: 1px solid var(--teal-border);
  border-radius: 4px;
  padding: 0.8em 1em;
}
.callout h3 {
  font-size: var(--h3);
  font-weight: 600;
  color: var(--teal);
  margin-bottom: var(--gap-sm);
}
.callout.accent-amber  { border-color: rgba(255,212,59,0.4);  background: rgba(255,212,59,0.05); }
.callout.accent-amber h3  { color: var(--amber); }
.callout.accent-green  { border-color: rgba(105,219,124,0.4); background: rgba(105,219,124,0.05); }
.callout.accent-green h3 { color: var(--green); }
.callout.accent-red    { border-color: rgba(255,107,107,0.4); background: rgba(255,107,107,0.05); }
.callout.accent-red h3 { color: var(--red); }
.callout.accent-yellow { border-color: rgba(255,212,59,0.4); background: rgba(255,212,59,0.05); }
.callout.accent-yellow h3 { color: var(--yellow); }
.callout.accent-purple { border-color: rgba(167,139,250,0.4); background: rgba(167,139,250,0.05); }
.callout.accent-purple h3 { color: #a78bfa; }
.callout p, .callout li { font-size: var(--body); }

/* ─── 10. Rubric checklist component ───────────────────────────────── */

.rubric-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}
.rubric-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--body);
  color: var(--text-muted);
  line-height: 1.4;
}
.rubric-list li .ri {
  font-size: 1.1em;
  flex-shrink: 0;
  min-width: 1.4em;
  display: inline-block;
}
.rubric-list li .ri-yes { color: var(--green); }
.rubric-list li .ri-no  { color: var(--red); }

/* ─── 11. Check/X animation classes ───────────────────────────────── */

@keyframes x-stamp {
  0%   { transform: scale(0.25) rotate(-20deg); opacity: 0; }
  55%  { transform: scale(1.25) rotate(6deg);   opacity: 1; }
  80%  { transform: scale(0.92) rotate(-2deg);              }
  100% { transform: scale(1)    rotate(0deg);   opacity: 1; }
}
.x-stamp {
  display: inline-block;
  color: var(--red);
  transform: scale(0.25) rotate(-20deg);
  opacity: 0;
}
.reveal .fragment.visible .x-stamp {
  animation: x-stamp 0.6s var(--ease) 0.05s both;
}

@keyframes check-wobble {
  0%   { transform: scale(0.2) rotate(-12deg); opacity: 0; }
  40%  { transform: scale(1.3) rotate(10deg);  opacity: 1; }
  58%  { transform: scale(0.88) rotate(-6deg);             }
  72%  { transform: scale(1.12) rotate(4deg);              }
  86%  { transform: scale(0.96) rotate(-1deg);             }
  100% { transform: scale(1)    rotate(0deg);  opacity: 1; }
}
.check-wobble {
  display: inline-block;
  color: var(--green);
  transform: scale(0.2) rotate(-12deg);
  opacity: 0;
}
.reveal .fragment.visible .check-wobble {
  animation: check-wobble 0.7s var(--ease) 0.05s both;
}

/* ─── 12. Fragment overrides ───────────────────────────────────────── */
/* Override Reveal's default fragment transition with our easing curve.
   Transition is placed on .visible so it only fires when a fragment is
   being revealed — not during slide entry, which avoids the brief flash
   where the first fragment appears visible as the slide fades in. */

.reveal .fragment {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}
.reveal .fragment.visible {
  opacity: 1 !important;
  visibility: inherit !important;
  transition:
    opacity 0.55s var(--ease),
    transform 0.55s var(--ease),
    filter 0.55s var(--ease) !important;
}
.reveal .fragment.fade-up {
  transform: translateY(22px);
}
.reveal .fragment.fade-up.visible {
  transform: translateY(0);
}

/* ─── 13. Storyboard strip ─────────────────────────────────────────── */

.storyboard {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  overflow: hidden;
  background: rgba(4,12,11,0.96);
  border-top: 1px solid var(--teal-border);
  box-shadow: 0 -12px 30px rgba(0,0,0,0.35);
  z-index: 35;
  transition: height 0.28s var(--ease);
}

.storyboard-track {
  height: 100%;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  overflow-x: auto;
  overflow-y: hidden;
}

.story-thumb {
  min-width: 212px;
  max-width: 212px;
  height: 150px;
  border: 1px solid var(--teal-border);
  border-radius: 8px;
  background: rgba(5,16,14,0.9);
  color: var(--text);
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.story-thumb:hover {
  border-color: rgba(0,201,177,0.5);
  color: var(--text);
}

.story-thumb.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px rgba(0,201,177,0.35) inset;
  color: var(--text);
}

.story-thumb-locked {
  cursor: default;
  border-style: dashed;
  border-color: rgba(255,212,59,0.45);
  background: rgba(5,14,12,0.92);
}

.story-lock-body {
  width: 192px;
  height: 108px;
  flex: 0 0 108px;
  border-radius: 6px;
  border: 1px dashed rgba(255,212,59,0.45);
  background: rgba(5,20,18,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--yellow);
  text-transform: uppercase;
}

.story-num {
  position: absolute;
  top: 6px;
  left: 8px;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(4,12,11,0.78);
  border: 1px solid var(--teal-border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--yellow);
  letter-spacing: 0.08em;
}

.story-preview {
  width: 192px;
  height: 108px;
  flex: 0 0 108px;
  border-radius: 6px;
  border: 1px solid rgba(0,201,177,0.2);
  overflow: hidden;
  background: #091412;
}

.story-scene {
  width: 1600px;
  height: 900px;
  transform: scale(0.12);
  transform-origin: top left;
  pointer-events: none;
}

.story-scene .slides {
  position: static;
  width: 1600px;
  height: 900px;
  inset: auto;
  transform: none;
}

.story-scene .slides > section {
  position: relative;
  display: block;
  top: auto;
  left: auto;
  width: 1600px;
  height: 900px;
  opacity: 1;
  visibility: visible;
  transform: none;
}

.story-caption {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1.25;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}

body.storyboard-open .storyboard {
  height: 172px;
}

body.storyboard-open .reveal {
  padding-bottom: 172px;
}

/* ─── 14. CSP-specific components ──────────────────────────────────── */

/* Requirement list item (video requirements) */
.req-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: var(--body);
  color: var(--text-muted);
  line-height: 1.4;
}
.req-check {
  font-size: 1.2em;
  flex-shrink: 0;
  min-width: 1.5em;
  display: inline-flex;
  justify-content: center;
}
.req-true  { color: var(--green); }
.req-false { color: var(--red); }

/* Section banner for transition slides */
.section-banner {
  background: linear-gradient(135deg, var(--teal), var(--amber));
  padding: 12px 24px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: var(--gap);
  font-weight: 700;
  color: #fff;
  font-size: var(--h3);
}

/* Big quote for final thought */
.big-quote {
  font-size: var(--h2);
  font-style: italic;
  color: var(--text);
  border-left: 4px solid var(--teal);
  padding-left: var(--gap-lg);
  line-height: 1.4;
  font-family: var(--font-display);
}

/* Planning field — input-looking box */
.planning-field {
  background: rgba(0,201,177,0.05);
  border: 1px solid var(--teal-border);
  border-radius: 4px;
  padding: 12px 16px;
  min-height: 48px;
  font-size: var(--body);
  color: var(--text-dim);
  font-family: var(--font-body);
}

/* Badge — small inline pill */
.badge {
  background: var(--teal-glow);
  border: 1px solid var(--teal-border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: var(--small);
  color: var(--teal);
  font-family: var(--font-mono);
  display: inline-block;
}
.badge-yellow {
  background: rgba(255,212,59,0.1);
  border-color: rgba(255,212,59,0.35);
  color: var(--yellow);
}
.badge-red {
  background: rgba(255,107,107,0.1);
  border-color: rgba(255,107,107,0.35);
  color: var(--red);
}
.badge-green {
  background: rgba(105,219,124,0.1);
  border-color: rgba(105,219,124,0.35);
  color: var(--green);
}
.badge-amber {
  background: rgba(255,212,59,0.1);
  border-color: rgba(255,212,59,0.35);
  color: var(--amber);
}

/* FRQ prompt box — used for standalone fallback on resonance slides */
.frq-box {
  background: var(--bg-card);
  border: 1px solid rgba(255,212,59,0.4);
  border-left: 3px solid var(--yellow);
  border-radius: 3px;
  padding: 1em 1.4em;
}
.frq-box p {
  font-size: var(--body);
  line-height: 1.6;
  color: var(--text-muted);
}

/* MCQ options list */
.mcq-opts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  margin-top: var(--gap);
}
.mcq-opts li {
  display: flex;
  align-items: baseline;
  gap: var(--gap-sm);
  font-family: var(--font-mono);
  font-size: var(--body);
  color: var(--text-muted);
}
.opt-key {
  display: inline-block;
  min-width: 2.2em;
  padding: 0.1em 0.45em;
  background: var(--teal-glow);
  border: 1px solid var(--teal-border);
  border-radius: 2px;
  font-size: 0.8em;
  color: var(--teal);
  font-weight: 700;
  text-align: center;
  flex-shrink: 0;
}

/* ─── 15. Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal .fragment { transition: opacity 0.3s ease !important; }
  .reveal .fragment.fade-up { transform: none !important; }
  .reveal .fragment.visible .x-stamp { animation: none; opacity: 1; transform: none; }
  .reveal .fragment.visible .check-wobble { animation: none; opacity: 1; transform: none; }
  .storyboard { transition: none; }
}
