/* Custom slide engine — fixed 1280×720 canvas scaled to fit (projector-safe) */

.deck {
  --deck-w: 1280;
  --deck-h: 720;
  display: flex; flex-direction: column;
  height: calc(100dvh - 62px);   /* viewport minus topbar */
  background: var(--bg);
}
.deck.is-fullscreen { height: 100vh; height: 100dvh; }

.deck-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-2) var(--sp-5); font-size: .85rem; color: var(--muted);
  border-bottom: 1px solid var(--border); flex: none; min-height: 34px;
}
.deck.is-fullscreen .deck-header { background: var(--surface); }

.deck-stage {
  position: relative; flex: 1; overflow: hidden;
  background: var(--deck-letterbox);
  display: grid; place-items: center;
  touch-action: pan-y;
}

/* Fixed canvas; JS applies transform: scale() to fill the stage */
.deck-canvas {
  position: absolute; top: 50%; left: 50%;
  width: 1280px; height: 720px;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(1);
}

.slide {
  position: absolute; inset: 0;
  display: none; flex-direction: column; justify-content: flex-start;
  padding: 64px 84px;
  background: var(--surface); color: var(--text);
  overflow: hidden;
}
.slide.is-active { display: flex; }
.slide[data-layout="lead"] { justify-content: center; align-items: center; text-align: center; }

/* slide typography (scaled by the fixed canvas, so px is safe) */
.slide h1 { font-size: 58px; line-height: 1.15; font-weight: 700; margin-bottom: 14px; }
.slide h2 { font-size: 40px; line-height: 1.2; font-weight: 700; margin-bottom: 22px; }
.slide h3 { font-size: 30px; line-height: 1.25; font-weight: 600; margin-bottom: 14px; color: var(--muted); }
.slide[data-layout="lead"] h1 { font-size: 74px; }
.slide[data-layout="lead"] h2 { font-size: 46px; color: var(--primary); }
.slide p { font-size: 28px; line-height: 1.5; margin-bottom: 16px; }
.slide ul, .slide ol { font-size: 28px; line-height: 1.5; padding-left: 1.1em; margin-bottom: 16px; }
.slide li { margin: 12px 0; }
.slide li > ul, .slide li > ol { font-size: .92em; margin: 8px 0; }
.slide strong { font-weight: 700; }
.slide em { color: var(--muted); font-style: italic; }
.slide blockquote {
  border-left: 6px solid var(--primary); background: var(--primary-weak);
  padding: 18px 28px; border-radius: 0 12px 12px 0; margin-bottom: 18px;
  font-size: 30px;
}
.slide code { font-family: var(--font-mono); background: var(--surface-2); padding: .08em .3em; border-radius: 6px; font-size: .92em; }
.slide pre {
  font-family: var(--font-mono); background: var(--surface-2);
  padding: 18px 22px; border-radius: 12px; line-height: 1.35;
  font-size: 21px; overflow: hidden; align-self: center;
}
.slide pre code { background: none; padding: 0; white-space: pre; }
.slide table { border-collapse: collapse; font-size: 26px; margin: 6px 0; }
.slide th, .slide td { border: 2px solid var(--border); padding: 12px 20px; text-align: left; }
.slide thead th { background: var(--surface-2); }
.slide hr { border: 0; border-top: 2px solid var(--border); margin: 18px 0; width: 100%; }
.slide a { color: var(--primary); }

/* Fragments — hidden until revealed */
.slide .fragment { opacity: 0; transition: opacity .25s ease; }
.slide .fragment.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .slide .fragment { transition: none; } }

/* footer chrome: label + progress + counter */
.deck-footer {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-5); flex: none; min-height: 40px;
  border-top: 1px solid var(--border);
  font-size: .85rem; color: var(--muted);
}
.deck.is-fullscreen .deck-footer { background: var(--surface); }
.deck-footer .footer-label { flex: none; }
.progress { flex: 1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s ease; }
.counter { flex: none; font-variant-numeric: tabular-nums; }
.deck-footer.is-hidden-count .counter,
.deck-footer.is-hidden-count .progress { visibility: hidden; }

/* controls */
.deck-controls { display: flex; align-items: center; gap: var(--sp-2); }
.deck-controls .icon-btn { width: 38px; height: 38px; font-size: 1rem; }

/* invisible tap zones for touch nav */
.tap-zone { position: absolute; top: 0; bottom: 0; width: 28%; z-index: 3; background: transparent; border: 0; }
.tap-zone--prev { left: 0; }
.tap-zone--next { right: 0; }

@media (max-width: 640px) {
  .deck-header .footer-label, .deck-header .deck-header__title { font-size: .75rem; }
}
