/* tango deck — presenter chrome + slide base styles.
   Slides themselves are inline-styled <section>s on a fixed 1920×1080 canvas. */

@font-face {
  font-family: "Fugaz One";
  src: url("/fonts/FugazOne-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Quicksand";
  src: url("/fonts/Quicksand-Variable.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --ink: #201e1d;
  --cream: #f5ead8;
  --orange: #fb8b24;
  --red: #e4432d;
  --purple: #881bee;
  --lilac: #b26bfa;
  --slide-w: 1920px;
  --slide-h: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); overflow: hidden; }
body { font-family: Quicksand, system-ui, sans-serif; color: var(--cream); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--red); }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* ── stage ─────────────────────────────────────────────────────────────── */
.deck-stage {
  position: fixed; inset: 0;
  touch-action: pan-y pinch-zoom;
  user-select: none; -webkit-user-select: none;
}
.deck-canvas {
  position: absolute; left: 50%; top: 50%;
  width: var(--slide-w); height: var(--slide-h);
  transform: translate(-50%, -50%) scale(var(--scale, 0.5));
  transform-origin: center;
  font-size: 15px; line-height: 1.55;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.deck-canvas h1, .deck-canvas h2 { letter-spacing: -0.015em; }

.deck-canvas > section {
  position: absolute; inset: 0;
  width: var(--slide-w); height: var(--slide-h);
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
.deck-canvas > section.is-active {
  opacity: 1; visibility: visible;
  transition: opacity 0.45s ease, visibility 0s;
}

/* ── progress + controls ───────────────────────────────────────────────── */
.deck-progress {
  position: fixed; left: 0; top: 0; height: 5px; width: 100%;
  background: rgba(245, 234, 216, 0.08); z-index: 20; pointer-events: none;
}
.deck-progress span {
  display: block; height: 100%; width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--orange), var(--red) 50%, var(--purple));
  transition: width 0.45s ease;
}

.deck-controls {
  position: fixed; left: 50%; bottom: 18px; z-index: 20;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 6px; border-radius: 999px;
  background: rgba(32, 30, 29, 0.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(245, 234, 216, 0.1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.is-idle .deck-controls { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.is-idle .deck-stage { cursor: none; }

.deck-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--cream); cursor: pointer;
}
.deck-btn:hover { background: rgba(245, 234, 216, 0.12); }
.deck-btn:disabled { opacity: 0.3; cursor: default; background: transparent; }
.deck-btn svg { width: 20px; height: 20px; }

.deck-counter {
  display: flex; align-items: baseline; gap: 10px;
  min-width: 190px; padding: 0 12px; justify-content: center;
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.deck-counter b { font-family: "Fugaz One", sans-serif; font-weight: 400; font-size: 16px; color: var(--orange); }
.deck-counter .deck-label { color: rgba(245, 234, 216, 0.7); font-weight: 500; }
.deck-sep { width: 1px; height: 22px; background: rgba(245, 234, 216, 0.14); margin: 0 4px; }

/* ── overview grid ─────────────────────────────────────────────────────── */
.deck-overview {
  position: fixed; inset: 0; z-index: 30;
  overflow-y: auto; padding: 56px clamp(20px, 5vw, 80px) 80px;
  background: rgba(32, 30, 29, 0.97);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.deck-overview.is-open { opacity: 1; visibility: visible; transition: opacity 0.25s ease, visibility 0s; }
.deck-overview-head {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1400px; margin: 0 auto 28px;
}
.deck-overview-head h2 { margin: 0; font-family: "Fugaz One", sans-serif; font-weight: 400; font-size: 28px; color: var(--cream); }
.deck-overview-head h2 span { color: var(--orange); }
.deck-grid {
  display: grid; gap: 28px; max-width: 1400px; margin: 0 auto;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.deck-thumb {
  display: flex; flex-direction: column; gap: 10px;
  padding: 0; border: 0; background: none; color: var(--cream);
  font: inherit; text-align: left; cursor: pointer;
}
.deck-thumb-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 14px; box-shadow: 0 0 0 2px rgba(245, 234, 216, 0.1);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.deck-thumb:hover .deck-thumb-frame { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--lilac); }
.deck-thumb.is-current .deck-thumb-frame { box-shadow: 0 0 0 4px var(--orange); }
.deck-thumb-frame > section {
  position: absolute; left: 0; top: 0;
  width: var(--slide-w); height: var(--slide-h);
  transform: scale(var(--thumb-scale, 0.15)); transform-origin: 0 0;
  pointer-events: none; font-size: 15px; line-height: 1.55;
}
.deck-thumb-frame h1, .deck-thumb-frame h2 { letter-spacing: -0.015em; }
.deck-thumb-label { font-size: 14px; font-weight: 600; }
.deck-thumb-label b { font-family: "Fugaz One", sans-serif; font-weight: 400; color: var(--orange); margin-right: 8px; }

/* ── help hint ─────────────────────────────────────────────────────────── */
.deck-hint {
  position: fixed; right: 18px; bottom: 24px; z-index: 20;
  font-size: 12px; color: rgba(245, 234, 216, 0.55);
  transition: opacity 0.3s ease;
}
.deck-hint kbd {
  font: inherit; font-weight: 700; padding: 1px 6px; border-radius: 5px;
  background: rgba(245, 234, 216, 0.1); color: var(--cream);
}
.is-idle .deck-hint { opacity: 0; }
@media (max-width: 760px), (hover: none) {
  .deck-hint { display: none; }
  .deck-counter { min-width: 0; }
  .deck-counter .deck-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .deck-canvas > section, .deck-progress span, .deck-controls, .deck-overview { transition: none !important; }
}

/* ── print / save as PDF: one slide per page ──────────────────────────── */
@page { size: 1920px 1080px; margin: 0; }
@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  .deck-progress, .deck-controls, .deck-overview, .deck-hint { display: none !important; }
  .deck-stage { position: static; }
  .deck-canvas { position: static; transform: none; height: auto; box-shadow: none; }
  .deck-canvas > section {
    position: relative; opacity: 1; visibility: visible; transition: none;
    break-after: page; page-break-after: always;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}
