/* deck.css — shared chrome for kaldamus slide decks.
   Layout + navigation only. Each deck sets its own palette + content
   classes in an inline <style> AFTER linking this file (so its :root
   overrides the neutral fallbacks below). Pair with deck.js. */

:root {
  /* Neutral fallbacks — decks override these in their own :root. */
  --bg: #f7f6f2;
  --card: #ffffff;
  --ink: #111827;
  --ink-soft: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --accent: #b45309;
  --accent-soft: #fef3c7;
  --accent-ink: #78350f;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;

  /* Liquid-glass surfaces (deck-agnostic; decks flip the palette tokens above
     in dark mode, and these structural tokens flip in the dark block below). */
  --slide-bg: var(--bg);
  --panel: rgba(255, 255, 255, 0.72);        /* .visual — bright, holds the SVG diagrams */
  --panel-html: rgba(255, 255, 255, 0.72);   /* .visual whose content is themed HTML, not SVG */
  --glass-bg: rgba(255, 255, 255, 0.5);      /* chips / small frosted surfaces */
  --glass-brd: rgba(255, 255, 255, 0.7);
  --glass-hi: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 10px 30px -14px rgba(17, 24, 39, 0.22), 0 2px 6px -3px rgba(17, 24, 39, 0.10);
  --blur: 16px;
}

/* Dark-mode liquid glass. The palette tokens (--bg / --ink / --accent / …) are
   flipped per-deck in each page's inline <style>; only these structural surface
   tokens are shared, so they live here. Both paths are covered: the OS default
   (prefers-color-scheme), guarded so a manual light choice still wins, and the
   explicit toggle ([data-theme="dark"], set by deck.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --panel: rgba(233, 238, 244, 0.94);
    --panel-html: rgba(24, 32, 44, 0.55);
    --glass-bg: rgba(30, 41, 57, 0.42);
    --glass-brd: rgba(255, 255, 255, 0.12);
    --glass-hi: rgba(255, 255, 255, 0.16);
    --glass-shadow: 0 18px 44px -16px rgba(0, 0, 0, 0.66), 0 3px 12px -6px rgba(0, 0, 0, 0.55);
    --blur: 18px;
    --slide-bg:
      radial-gradient(120% 120% at 12% 0%, color-mix(in srgb, var(--accent) 13%, transparent) 0%, transparent 46%),
      radial-gradient(115% 115% at 100% 100%, color-mix(in srgb, var(--accent) 9%, transparent) 0%, transparent 44%),
      var(--bg);
  }
}
:root[data-theme="dark"] {
  --panel: rgba(233, 238, 244, 0.94);
  --panel-html: rgba(24, 32, 44, 0.55);
  --glass-bg: rgba(30, 41, 57, 0.42);
  --glass-brd: rgba(255, 255, 255, 0.12);
  --glass-hi: rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 18px 44px -16px rgba(0, 0, 0, 0.66), 0 3px 12px -6px rgba(0, 0, 0, 0.55);
  --blur: 18px;
  --slide-bg:
    radial-gradient(120% 120% at 12% 0%, color-mix(in srgb, var(--accent) 13%, transparent) 0%, transparent 46%),
    radial-gradient(115% 115% at 100% 100%, color-mix(in srgb, var(--accent) 9%, transparent) 0%, transparent 44%),
    var(--bg);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

#deck {
  position: relative;
  width: 100vw; height: 100vh;
}

/* ── Slide shell ─────────────────────────────────────────── */
.slide {
  position: absolute;
  inset: 0;
  padding: clamp(20px, 3.5vw, 52px) clamp(28px, 5vw, 80px);
  display: none;
  flex-direction: column;
  background: var(--slide-bg);
}
.slide.active { display: flex; }

.slide-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: clamp(8px, 1vw, 14px);
  margin-bottom: clamp(14px, 2vw, 28px);
}
.eyebrow {
  font-size: clamp(10px, 0.8vw, 12px);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
}
.eyebrow .sep { color: var(--line-strong); margin: 0 8px; }
.deck-id {
  font-size: clamp(10px, 0.8vw, 12px);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
}
.deck-id strong { color: var(--accent); font-weight: 700; }
h1.title {
  font-size: clamp(24px, 2.8vw, 40px);
  line-height: 1.15;
  margin: clamp(4px, 0.6vw, 10px) 0 clamp(14px, 1.6vw, 24px) 0;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ── Body: visual + text two-column (single-column on cover) ─ */
.body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 56px);
  min-height: 0;
}
.visual {
  background: var(--panel);
  border: 1px solid var(--glass-brd);
  border-radius: 14px;
  padding: clamp(16px, 1.6vw, 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi);
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
/* SVG decks keep the bright --panel in dark mode so the hard-coded diagram
   colors stay legible; a visual whose content is themed HTML (learnings.html)
   follows the theme instead. */
.visual:not(:has(svg)) { background: var(--panel-html); }
.visual svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: block;
}
.text {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.4vw, 20px);
  min-width: 0;
  overflow: hidden;
}
.text p {
  margin: 0;
  font-size: clamp(13px, 1.05vw, 16px);
  line-height: 1.55;
  color: var(--ink-soft);
}
.text p strong { color: var(--ink); font-weight: 600; }
.text ul {
  margin: 0;
  padding-left: 18px;
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.55;
  color: var(--ink-soft);
}
.text ul li { margin-bottom: 4px; }
.text code, .text kbd {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 1px 5px;
  border-radius: 3px;
}
.meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: -4px;
}
.chip {
  font-size: clamp(10px, 0.76vw, 11px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--glass-brd);
  color: var(--muted);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.insight {
  margin-top: auto;
  padding: clamp(12px, 1.3vw, 18px) clamp(14px, 1.5vw, 22px);
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  /* inset hairline gives the frosted edge without adding layout height */
  box-shadow: var(--glass-shadow), inset 0 0 0 1px var(--glass-brd);
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}
.insight .label {
  font-size: clamp(10px, 0.76vw, 11px);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--accent-ink);
  margin-bottom: 4px;
}
.insight .body-text {
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.4;
  color: var(--ink);
  font-weight: 500;
  margin: 0;
}

/* ── Cover slide ─────────────────────────────────────────── */
.slide.cover .body { grid-template-columns: 1fr; }
.slide.cover .text { justify-content: center; align-items: center; text-align: center; }
.slide.cover h1.title { font-size: clamp(38px, 5vw, 68px); margin-bottom: 8px; }
.slide.cover .subtitle {
  font-size: clamp(15px, 1.4vw, 20px);
  color: var(--muted);
  max-width: 680px;
  line-height: 1.5;
}
.slide.cover .attribution {
  margin-top: 32px;
  font-size: clamp(11px, 0.88vw, 13px);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* ── Progress / navigation chrome ────────────────────────── */
.progress {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}
.progress .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}
.progress .dot.active {
  background: var(--accent);
  transform: scale(1.3);
}
.counter {
  position: fixed;
  bottom: 14px;
  right: 22px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  z-index: 10;
}
.hint {
  position: fixed;
  bottom: 14px;
  left: 22px;
  font-size: 11px;
  color: var(--muted);
  z-index: 10;
}
.hint kbd {
  font-family: var(--mono);
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Theme toggle — injected by deck.js, styled as a frosted pill. */
.theme-toggle {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--glass-brd);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--glass-shadow);
  transition: color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { color: var(--accent); transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle .tt-icon { font-size: 12px; }

@media (max-width: 900px) {
  .body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.1fr) auto; }
  .visual { min-height: 180px; }
}
