/* ============================================================
   AI Startup Lecture — deck styling
   Designed for projector use: high contrast, large type, calm.
   ============================================================ */

:root {
  --bg: #0f1419;
  --panel: #161c24;
  --ink: #f0f3f7;
  --muted: #93a1b3;
  --rule: #283140;

  --accent: #6ee7b7;      /* shared / default */
  --foundations: #f4b860; /* warm gold for beginners */
  --operator: #7eaaff;    /* cool blue for operators */
  --builder: #c084fc;     /* purple for builders */

  --radius: 14px;
  --serif: "Iowan Old Style", "Source Serif Pro", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
#deck {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4vh 6vw;
}

section.slide {
  display: none;
  width: 100%;
  max-width: 1100px;
  animation: fade 280ms ease;
}
section.slide.active { display: flex; flex-direction: column; gap: 24px; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Typography ---------- */
h1.deck-title { font-family: var(--serif); font-size: clamp(2.5rem, 6vw, 4.5rem); margin: 0; line-height: 1.05; letter-spacing: -0.02em; }
h2.slide-title { font-family: var(--serif); font-size: clamp(2rem, 4.5vw, 3rem); margin: 0; line-height: 1.1; letter-spacing: -0.02em; }
h3 { font-family: var(--serif); font-size: clamp(1.3rem, 2.5vw, 1.6rem); margin: 0; }
p, li { font-size: clamp(1.05rem, 1.8vw, 1.3rem); line-height: 1.55; }
.lede { color: var(--muted); font-size: clamp(1.2rem, 2.2vw, 1.6rem); }
.eyebrow { color: var(--muted); font-family: var(--mono); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 12px; }

ul, ol { padding-left: 1.3em; }
li { margin-bottom: 10px; }

/* ---------- HUD (top-right corner) ---------- */
.hud {
  position: fixed;
  inset: 0 0 auto 0;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  z-index: 50;
}
.hud-left, .hud-right { display: flex; gap: 14px; align-items: center; pointer-events: auto; }
.hud-btn {
  background: var(--panel);
  border: 1px solid var(--rule);
  color: var(--ink);
  border-radius: 999px;
  width: 28px; height: 28px;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.hud-btn:hover { border-color: var(--accent); color: var(--accent); }
.hud-btn-text {
  width: auto;
  height: auto;
  padding: 6px 14px;
  border-radius: 999px;
  border-color: var(--rule);
  color: var(--muted);
}
.hud-btn-text:hover { background: var(--accent); color: #06231a; border-color: var(--accent); }
.fork-label[data-fork="foundations"] { color: var(--foundations); }
.fork-label[data-fork="operator"] { color: var(--operator); }
.fork-label[data-fork="builder"] { color: var(--builder); }
.fork-label[data-fork="shared"], .fork-label[data-fork="intro"] { color: var(--muted); }

/* ---------- Help dialog ---------- */
dialog#help-dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 480px;
}
dialog#help-dialog::backdrop { background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
dialog table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
dialog td { padding: 6px 4px; border-bottom: 1px solid var(--rule); }
dialog kbd {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--mono);
  font-size: 0.85rem;
}
dialog button { margin-top: 12px; padding: 6px 16px; background: var(--accent); color: #06231a; border: 0; border-radius: 8px; font-weight: 600; }
.help-note { color: var(--muted); font-size: 0.9rem; }

/* ---------- Poll component ---------- */
.poll {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}
.poll .options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.poll .opt {
  background: var(--panel);
  border: 2px solid var(--rule);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 22px 24px;
  text-align: left;
  transition: border-color 120ms ease, transform 120ms ease, background 200ms ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
}
.poll .opt:hover { border-color: var(--accent); transform: translateY(-2px); }
.poll .opt .label { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.poll .opt .text { font-weight: 600; }
.poll .opt .sub { color: var(--muted); font-weight: 400; font-size: 0.92em; }
.poll[data-locked="true"] .opt { cursor: default; opacity: 0.5; transform: none; }
.poll[data-locked="true"] .opt.chosen { opacity: 1; border-color: var(--accent); background: rgba(110, 231, 183, 0.06); }
.poll .meta { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }
.poll-confirm { color: var(--accent); font-family: var(--mono); font-size: 0.95rem; margin-top: 8px; }

/* Tap-tally poll (no locking — record approximate counts) */
.tally { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.tally .opt {
  background: var(--panel);
  border: 1px solid var(--rule);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.tally .opt:hover { border-color: var(--accent); }
.tally .count { background: var(--bg); border-radius: 999px; padding: 2px 10px; font-family: var(--mono); font-size: 0.9rem; color: var(--accent); min-width: 28px; text-align: center; }

/* ---------- Reveal component ---------- */
.reveal-list { list-style: none; padding: 0; }
.reveal-list li {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease, transform 240ms ease;
  margin-bottom: 14px;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.reveal-list li.shown { opacity: 1; transform: none; }
.reveal-list li::before { content: "›"; color: var(--accent); font-family: var(--mono); }
.reveal-hint { color: var(--muted); font-family: var(--mono); font-size: 0.85rem; margin-top: 6px; }

/* ---------- Toggle component ---------- */
.toggle {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 12px;
}
.toggle-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.toggle-tabs button {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.toggle-tabs button[aria-selected="true"] { background: var(--accent); color: #06231a; border-color: var(--accent); font-weight: 600; }
.toggle-content { display: none; }
.toggle-content.shown { display: block; }

/* ---------- Timer component ---------- */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-top: 12px;
}
.timer .display {
  font-family: var(--mono);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-variant-numeric: tabular-nums;
  min-width: 140px;
}
.timer.warning .display { color: var(--foundations); }
.timer.done .display { color: var(--accent); }
.timer button {
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--mono);
}
.timer button:hover { border-color: var(--accent); }

/* ---------- QR component ---------- */
.qr {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  margin-top: 12px;
}
.qr img { width: 220px; height: 220px; image-rendering: pixelated; }
.qr .qr-url { color: #1a1a1a; font-family: var(--mono); font-size: 0.85rem; }

/* ---------- Fork-tinted slide accents ---------- */
section.slide[data-fork="foundations"] .eyebrow { color: var(--foundations); }
section.slide[data-fork="operator"] .eyebrow { color: var(--operator); }
section.slide[data-fork="builder"] .eyebrow { color: var(--builder); }
section.slide[data-fork="shared"] .eyebrow { color: var(--accent); }

/* ---------- Two-column slide layout ---------- */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }

/* Centered title slide */
section.slide.title-slide { text-align: center; align-items: center; }
section.slide.title-slide .subtitle { color: var(--muted); font-size: clamp(1.1rem, 2vw, 1.4rem); }

/* Byline (co-author credits) */
.byline { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.byline p { line-height: 1.4; }

/* Closing/Q&A slide */
section.slide.qa { text-align: center; }
section.slide.qa h2 { font-size: clamp(3rem, 8vw, 6rem); }
