/* =================================================================
   Build with Vibe — Slide System CSS
   Architecture mirrors Cortex Results Phase A (Strive Studio).
   Re-skinned for BWV brand: DM Sans + Outfit + Caveat, Tangerine accent.
   Canvas: 1280×720. Reveal.js 5.2.1.
   ================================================================= */

/* ---------- 1. Fonts: Google Fonts (loaded in <head>) ----------
   DM Sans — body / footer / labels
   Outfit  — headings / chips / eyebrows
   Caveat  — handwriting accent (rotate -3deg, Tangerine color)
   No Inter. No Tokyo Neon. No JetBrains Mono on slides. */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Caveat:wght@400;500;700&display=swap');

/* ---------- 2. Slide-scoped tokens ---------- */
.slide-root {
  /* Backgrounds */
  --slide-bg:      #141414;
  --slide-fg:      #f2f1ee;
  --slide-accent:  #ff5500;
  --slide-accent-2: #ff7a14;
  --slide-muted:   rgba(242, 241, 238, 0.65);
  --slide-dark-muted: rgba(242, 241, 238, 0.55);

  /* Type scale — fixed px, resolved from the former clamp() at 1280px.
     vw units resolve against the window, not the canvas: on a 1920px window
     they grew type 1.5x while Reveal also scaled the canvas 1.44x (double
     growth → wrapping, overflow). Reveal's transform is the only scaling. */
  --slide-display: 89.6px;
  --slide-h1:      71.68px;
  --slide-h2:      48.64px;
  --slide-h3:      25.6px;
  --slide-body:    23.04px;
  --slide-caption: 15.2px;

  /* Font families */
  --font-body:        'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --font-heading:     'Outfit', ui-sans-serif, system-ui, sans-serif;
  --font-handwriting: 'Caveat', cursive;

  /* Spacing scale */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 48px;  --s-8: 64px;
  --s-9: 96px;

  /* Easing */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  /* Surface tokens (light default) */
  --surface:       #f2f1ee;
  --surface-2:     #ffffff;
  --on-surface:    #0a0a0c;
  --on-surface-2:  #484848;
  --on-surface-3:  #767676;
  --rule:          rgba(10, 10, 12, 0.12);
  --rule-2:        rgba(10, 10, 12, 0.06);
}

/* Dark mode via data-theme="dark" on <html> (D-key toggle) */
[data-theme="dark"] {
  --surface:       #141414;
  --surface-2:     #1a1a1f;
  --on-surface:    #f2f1ee;
  --on-surface-2:  #c8c7c2;
  --on-surface-3:  rgba(242, 241, 238, 0.55);
  --rule:          rgba(242, 241, 238, 0.12);
  --rule-2:        rgba(242, 241, 238, 0.06);
}

/* =================================================================
   Reveal.js Overrides — 1280x720 canvas, scaled via transform
   ================================================================= */

html, body, .reveal { background: var(--surface); }

.reveal {
  font-family: var(--font-body);
  color: var(--on-surface);
  font-size: 22px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.reveal .slides { text-align: left; }

/* Sections fill the full 1280x720 canvas.
   Child-combinator selector wins by source order over Reveal's own specificity.
   No !important on the base rule — that would break Reveal's display:none on
   .past/.future.
   Stacking: Reveal keeps neighbouring slides (viewDistance 3) at display:block
   and relies on position:absolute to stack them. `position: relative` puts
   them into normal flow and slide 2+ land below the canvas (reproduced on this
   template 2026-09-17). Reveal sets inline `top`; we only pin `left`. */
.reveal .slides > section {
  background: var(--surface);
  color: var(--on-surface);
  padding: 96px 80px 88px;
  box-sizing: border-box;
  height: 100%;
  position: absolute;
  left: 0;
  overflow: hidden;
}
/* Vertical centring. Reveal writes `display:block` INLINE on the current slide,
   which beats any plain rule. !important is scoped to `.present` only, so
   Reveal's inline display:none on past/future slides stays intact. */
.reveal .slides > section.present {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
}

/* Dark section override */
.reveal .slides > section.dark-section {
  background: var(--slide-bg);
  color: var(--slide-fg);
}

/* ---------- Type ---------- */
.reveal h1, .reveal h2, .reveal h3, .reveal h4 {
  font-family: var(--font-heading);
  color: var(--on-surface);
  margin: 0 0 var(--s-4) 0;
  text-transform: none;
}

.dark-section .reveal h1,
.dark-section .reveal h2,
.dark-section .reveal h3,
.reveal .slides > section.dark-section h1,
.reveal .slides > section.dark-section h2,
.reveal .slides > section.dark-section h3 {
  color: var(--slide-fg);
}

.reveal h1 {
  font-size: var(--slide-h1);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.0;
}
.reveal h2 {
  font-size: var(--slide-h2);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.reveal h3 {
  font-size: var(--slide-h3);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.reveal p, .reveal td {
  font-family: var(--font-body);
  font-size: 16.64px;
  line-height: 1.55;
  color: var(--on-surface-2);
  margin: 0 0 var(--s-3);
}

.reveal strong { color: var(--on-surface); font-weight: 600; }

/* Eyebrow / mono label — uses Outfit (not a monospace font; semibold = code-label feel) */
.reveal .mono {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-surface-3);
  margin: 0 0 var(--s-3);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

/* Handwriting accent — Caveat, Tangerine, slight rotation */
.reveal .handwriting {
  font-family: var(--font-handwriting);
  font-weight: 500;
  color: var(--slide-accent);
  display: inline-block;
  transform: rotate(-3deg);
  transform-origin: left center;
}
.reveal .handwriting--light {
  color: var(--slide-accent-2);
}

/* ---------- Tangerine i-bar echo (section anchor) ---------- */
.reveal .bar-tangerine {
  display: inline-block;
  width: 36px;
  height: 4px;
  margin: 0 0 var(--s-5);
  background: var(--slide-accent);
}

/* Longer decorative bar for title slides */
.reveal .bar-tangerine--lg {
  display: block;
  width: 64px;
  height: 4px;
  margin: 0 0 var(--s-6);
  background: var(--slide-accent);
}

/* =================================================================
   Chip — solid Tangerine fill eyebrow / status pill
   ================================================================= */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--slide-accent);
  padding: 5px 10px;
  border-radius: 3px;
  white-space: nowrap;
}
.chip--ghost {
  background: transparent;
  color: var(--on-surface-2);
  border: 1px solid var(--rule);
}
.chip--dark {
  background: rgba(255, 255, 255, 0.1);
  color: var(--slide-fg);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* =================================================================
   Pull-quote — Tangerine left-rule, serif body
   ================================================================= */

.pullquote {
  position: relative;
  padding: var(--s-2) 0 var(--s-2) var(--s-6);
  border-left: 4px solid var(--slide-accent);
}
.pullquote .q {
  font-family: Georgia, 'Times New Roman', ui-serif, serif;
  font-style: italic;
  font-size: 26.88px;
  line-height: 1.3;
  color: var(--on-surface);
  margin: 0 0 var(--s-3);
}
.pullquote .a {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-surface-3);
  margin: 0;
}

/* Dark-section pull-quote overrides */
.reveal .slides > section.dark-section .pullquote .q {
  color: var(--slide-fg);
}
.reveal .slides > section.dark-section .pullquote .a {
  color: var(--slide-muted);
}

/* =================================================================
   Layout primitives
   ================================================================= */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); }

.split { display: flex; gap: var(--s-7); align-items: flex-start; }
.split > * { flex: 1; min-width: 0; }

/* Stat — big number + label */
.stat-number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 71.68px;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--on-surface);
  font-feature-settings: "tnum";
}
.stat-number.accent { color: var(--slide-accent); }
.stat-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-surface-3);
  margin-top: var(--s-2);
}

/* =================================================================
   Grain overlay — depth on dark slides
   ================================================================= */

.slide-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

/* =================================================================
   Tangerine spotlight — bottom-right warm radial glow
   ================================================================= */

.slide-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse at 85% 110%,
    rgba(255, 111, 0, 0.09),
    transparent 55%
  );
}

/* =================================================================
   slide-stagger — sequenced fade-up for direct children
   ================================================================= */

@keyframes slide-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.slide-stagger > * {
  opacity: 0;
  animation: slide-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.slide-stagger > *:nth-child(1)  { animation-delay:   0ms; }
.slide-stagger > *:nth-child(2)  { animation-delay:  80ms; }
.slide-stagger > *:nth-child(3)  { animation-delay: 160ms; }
.slide-stagger > *:nth-child(4)  { animation-delay: 240ms; }
.slide-stagger > *:nth-child(5)  { animation-delay: 320ms; }
.slide-stagger > *:nth-child(6)  { animation-delay: 400ms; }
.slide-stagger > *:nth-child(7)  { animation-delay: 480ms; }
.slide-stagger > *:nth-child(8)  { animation-delay: 560ms; }

/* =================================================================
   Persistent UI — brand mark top-left, footer bottom strip
   ================================================================= */

/* Header band */
.deck-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  z-index: 49;
  background: var(--surface);
  border-bottom: 1px solid var(--rule-2);
  pointer-events: none;
  transition: background 220ms var(--ease-out), border-color 220ms var(--ease-out);
}
body.slide-is-dark .deck-header {
  background: #0e0e0e;
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

/* Brand mark — logo via <img>, never CSS-rendered */
.brand-mark {
  position: fixed;
  top: 16px;
  left: 32px;
  z-index: 50;
  pointer-events: none;
  line-height: 0;
}
.brand-mark img {
  height: 32px;
  width: auto;
  display: block;
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 19px;
  right: 32px;
  z-index: 60;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-surface-3);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 7px 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: color 180ms var(--ease-out),
              border-color 180ms var(--ease-out),
              transform 160ms var(--ease-out);
}
.theme-toggle:hover {
  color: var(--on-surface);
  border-color: var(--on-surface-2);
}
.theme-toggle:active { transform: scale(0.97); }
body.slide-is-dark .theme-toggle {
  color: rgba(242, 241, 238, 0.45);
  border-color: rgba(255, 255, 255, 0.12);
}
body.slide-is-dark .theme-toggle:hover {
  color: var(--slide-fg);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Footer band */
.deck-footer-bg {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  z-index: 49;
  background: var(--surface);
  border-top: 1px solid var(--rule-2);
  pointer-events: none;
  transition: background 220ms var(--ease-out), border-color 220ms var(--ease-out);
}
body.slide-is-dark .deck-footer-bg {
  background: #0e0e0e;
  border-top-color: rgba(255, 255, 255, 0.07);
}

/* Footer content */
.deck-footer {
  position: fixed;
  bottom: 18px;
  left: 32px;
  right: 32px;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-surface-3);
  pointer-events: none;
}
body.slide-is-dark .deck-footer {
  color: rgba(242, 241, 238, 0.38);
}
.deck-footer .authors,
.deck-footer .date,
.deck-footer .count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
/* Tangerine divider dot in footer */
.deck-footer .x {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--slide-accent);
  vertical-align: middle;
}

/* Hide Reveal's built-in slide number and progress — we render our own */
.reveal .slide-number { display: none !important; }
.reveal .progress     { display: none !important; }

/* Progress hairline — Tangerine, bottom of viewport */
.progress-line {
  position: fixed;
  bottom: 0; left: 0;
  height: 2px;
  background: var(--slide-accent);
  width: 0%;
  transition: width 0.45s var(--ease-out);
  z-index: 100;
}

/* =================================================================
   Page-wipe — Tangerine sliver sweeps left→right on slide change.
   6px wide, glows. Mirrors site view-transitions.
   ================================================================= */

.page-wipe {
  position: fixed;
  top: 0; bottom: 0;
  left: -8px;
  width: 6px;
  background: var(--slide-accent);
  box-shadow: 0 0 28px 4px rgba(255, 85, 0, 0.7);
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}
.page-wipe.active {
  animation: deck-wipe 360ms var(--ease-in-out) both;
}
@keyframes deck-wipe {
  0%   { transform: translateX(0);                  opacity: 0; }
  12%  {                                             opacity: 1; }
  88%  {                                             opacity: 1; }
  100% { transform: translateX(calc(100vw + 8px));   opacity: 0; }
}

/* =================================================================
   Reveal nav controls
   ================================================================= */

.reveal .controls { color: var(--on-surface-2); }
body.slide-root .reveal .controls button.navigate-left,
body.slide-root .reveal .controls button.navigate-right {
  position: fixed;
  top: 50%;
  bottom: auto;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  z-index: 30;
  opacity: 0.25;
  transition: opacity 180ms var(--ease-out);
}
.reveal .controls .navigate-left:hover,
.reveal .controls .navigate-right:hover { opacity: 0.8; }
body.slide-root .reveal .controls button.navigate-left  { left: 12px;  right: auto; }
body.slide-root .reveal .controls button.navigate-right { right: 12px; left: auto; }
.reveal .controls .navigate-up,
.reveal .controls .navigate-down { display: none !important; }

/* =================================================================
   CTA Button (slide-only, no box-shadow, no glow)
   ================================================================= */

.slide-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 17.92px;
  font-weight: 700;
  color: #ffffff;
  background: var(--slide-accent);
  padding: 14px 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms var(--ease-out);
}
.slide-cta:hover { transform: translateY(-2px); }
.slide-cta:active { transform: scale(0.97); background: #cc3d00; }

/* Outline variant */
.slide-cta--outline {
  background: transparent;
  border: 2px solid var(--slide-accent);
  color: var(--slide-accent);
}
.slide-cta--outline:active { background: rgba(255, 85, 0, 0.08); }

/* =================================================================
   Reduced motion
   ================================================================= */

@media (prefers-reduced-motion: reduce) {
  .page-wipe.active,
  .progress-line {
    animation: none !important;
    transition: none !important;
    opacity: 0 !important;
  }
  .slide-stagger > * {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* =================================================================
   Print — A4 landscape (Chrome ?print-pdf)
   ================================================================= */

/* Reveal's ?print-pdf mode wraps every section in a .pdf-page div and forces
   padding:0 / display:block / position:absolute with inline top/left offsets.
   The rules above only target `.reveal .slides > section` (child combinator),
   so on paper the padding, the dark-section background and the dark-section
   colours vanish. Re-apply them here: the section fills the page and flex does
   the centring instead of Reveal's inline top/left. */
html.reveal-print .reveal .slides section {
  padding: 96px 80px 88px !important;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden;
  background: var(--surface);
  color: var(--on-surface);
}
html.reveal-print .reveal .slides section.dark-section {
  background: var(--slide-bg);
  color: var(--slide-fg);
}
html.reveal-print .reveal .slides section.dark-section h1,
html.reveal-print .reveal .slides section.dark-section h2,
html.reveal-print .reveal .slides section.dark-section h3,
html.reveal-print .reveal .slides section.dark-section .pullquote .q { color: var(--slide-fg); }
html.reveal-print .reveal .slides section.dark-section .pullquote .a { color: var(--slide-muted); }
/* Stagger starts at opacity 0 — paper never sees the animation end. */
html.reveal-print .slide-stagger > * { animation: none !important; opacity: 1 !important; }
/* Screen preview of ?print-pdf matches paper: chrome off, brand mark stays. */
html.reveal-print .deck-header,
html.reveal-print .deck-footer-bg,
html.reveal-print .deck-footer,
html.reveal-print .theme-toggle,
html.reveal-print .progress-line,
html.reveal-print .page-wipe { display: none !important; }

@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  @page { size: 297mm 210mm; margin: 0; }
  body, html { background: var(--surface); }
  .deck-header,
  .deck-footer-bg,
  .deck-footer,
  .theme-toggle,
  .progress-line,
  .page-wipe,
  .reveal .controls { display: none !important; }
}
