/* Eureka · the Pitch Deck (tools/deck.mjs, deck.js): its title with the download, the slide in a frame with the bar under it, and the
   thumbnails. The slides are pictures of the PDF with its own colours, so the frame around them is the page's day or night.
   Without deck.js the slides stand one under the other; with it (.deck-ready) one shows at a time. */
/* as wide as lets the slide and its bar fit in the window under the title (215 px: the title, the bar and the gaps, measured at 1440 × 900),
   never under 560 px: a phone on its side scrolls a little rather than show a stamp */
.deck-main { position: relative; z-index: 1; width: 100%; max-width: clamp(560px, calc((100vh - var(--top-h) - 215px) * 16 / 9 + 2 * var(--pad)), 1240px); margin: 0 auto; padding: calc(var(--top-h) + 28px) var(--pad) 64px; }

/* ---------- the title and the download ---------- */
.deck-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin: 0 0 20px; }
.deck-head .eyebrow { margin-bottom: 10px; }
.deck-title { margin: 0; font: 600 clamp(30px, 3.6vw, 48px)/1.06 var(--font-display); letter-spacing: -0.04em; }
.deck-meta { margin: 8px 0 0; font: 500 12.5px/1.3 var(--font-mono); color: var(--ink-3); }
.deck-download svg { width: 18px; height: 18px; flex: none; }

/* ---------- the slide ---------- */
.deck-view { display: flex; flex-direction: column; gap: 12px; }
.deck-stage { display: grid; gap: 16px; }
.deck-slide { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow); background: #fff; }
.deck-slide img { width: 100%; height: auto; aspect-ratio: 16 / 9; }

.deck-ready .deck-stage { position: relative; display: block; aspect-ratio: 16 / 9; cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.deck-ready .deck-slide { position: absolute; inset: 0; visibility: hidden; opacity: 0; transition: opacity .18s ease, visibility 0s .18s; }
.deck-ready .deck-slide.is-on { visibility: visible; opacity: 1; transition: opacity .18s ease; }
.deck-ready .deck-slide img { height: 100%; object-fit: contain; -webkit-user-drag: none; }

/* ---------- the bar under it ---------- */
.deck-bar { display: none; }
.deck-ready .deck-bar { display: flex; align-items: center; gap: 10px; }
.deck-bar .round:disabled { opacity: .35; cursor: default; border-color: var(--line-2); }
.deck-count { margin: 0; min-width: 64px; text-align: center; font: 500 14px/1 var(--font-mono); color: var(--ink-3); }
.deck-count b { font-weight: 500; color: var(--ink); }
.deck-keys { margin: 0 auto 0 8px; font-size: 13px; line-height: 1.35; color: var(--ink-3); }
.deck-button { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--glass-2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--ink-2); font: 500 13.5px/1 var(--font-body); cursor: pointer; white-space: nowrap; flex: none; }
.deck-button:hover { color: var(--ink); border-color: var(--accent); }
.deck-button svg { width: 16px; height: 16px; flex: none; }
#full .shrink, #full[aria-pressed="true"] .grow { display: none; }
#full[aria-pressed="true"] .shrink { display: block; }
/* a phone keeps the buttons and the count; the keys are for a keyboard */
@media (max-width: 719px), (pointer: coarse) { .deck-keys { display: none; } #full { margin-left: auto; } }

/* ---------- full screen: the browser's, or the window filled ---------- */
.deck-view:fullscreen { justify-content: center; padding: 16px; background: #000; }
.deck-view:-webkit-full-screen { justify-content: center; padding: 16px; background: #000; }
/* the main column makes its own layer (z-index 1, under the header's 50): filling the window lifts the layer above the header and the footer */
.deck-filled { overflow: hidden; }
.deck-filled .deck-main { z-index: 100; }
.deck-filled .deck-view { position: fixed; inset: 0; z-index: 100; justify-content: center; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); background: #000; }
.deck-view:fullscreen .deck-stage { width: min(100%, calc((100vh - 86px) * 16 / 9)); margin: 0 auto; }
.deck-view:-webkit-full-screen .deck-stage { width: min(100%, calc((100vh - 86px) * 16 / 9)); margin: 0 auto; }
.deck-filled .deck-stage { width: min(100%, calc((100dvh - 86px) * 16 / 9)); margin: 0 auto; }
.deck-view:fullscreen .deck-slide, .deck-filled .deck-slide { border: 0; border-radius: 0; box-shadow: none; }
.deck-view:fullscreen .deck-bar, .deck-filled .deck-bar { width: min(100%, 1100px); margin: 0 auto; color-scheme: dark; --ink: #edf1f8; --ink-2: #b2bccf; --ink-3: #7c879d;
  --line: rgba(255, 255, 255, 0.09); --line-2: rgba(255, 255, 255, 0.22); --glass: rgba(255, 255, 255, 0.06); --glass-2: rgba(255, 255, 255, 0.08); --accent: #8fd0ff; color: var(--ink); }

/* ---------- the thumbnails ---------- */
.deck-thumbs { display: none; }
.deck-ready .deck-thumbs { display: block; margin-top: 22px; }
.deck-thumbs ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.deck-thumbs a { position: relative; display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-2); background: #fff; opacity: .72; transition: opacity .15s, box-shadow .15s; }
.deck-thumbs a:hover { opacity: 1; }
.deck-thumbs a[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--accent); border-color: transparent; }
.deck-thumbs img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.deck-thumbs span { position: absolute; left: 6px; bottom: 6px; padding: 3px 6px; border-radius: 5px; background: rgba(12, 18, 34, .72); color: #fff; font: 500 11px/1 var(--font-mono); }
/* a phone scrolls the thumbnails sideways instead of stacking two rows of small ones */
@media (max-width: 719px) {
  .deck-thumbs ol { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .deck-thumbs li { flex: 0 0 38%; scroll-snap-align: start; }
  .deck-slide { border-radius: 10px; }
}
