/* =====================================================================
   deck.css — the deck's foundation: tokens, shell, base type, chrome,
   accessibility and print.

   Loaded by public/index.html (the skeleton) and by every file in
   public/slides/, so that opening a single slide file directly renders it
   styled and standalone.

   url() below resolves relative to THIS file (public/css/), which is why
   asset paths start with ../ — unlike paths in index.html.
   ===================================================================== */

/* =====================================================================
   1. TOKENS — Bunthaus. Swap this :root block to rebrand; nothing below
   needs to change. Dark is default; light lives under [data-theme="light"].
   ===================================================================== */
:root, :root[data-theme="dark"] {
  --accent-rgb: 245 149 6;                 /* Bunthaus orange #F59506 */
  --accent: rgb(var(--accent-rgb));
  --accent-dark: #CF7119;
  --accent-grad: linear-gradient(180deg, #F59506, #CF7119);
  --accent-soft: rgb(var(--accent-rgb) / 0.14);
  --on-accent: #1C1917;                    /* text/ink on an accent fill */
  --success: #87BA49;
  --flag: #E36751;
  --bg: #1C1917; --surface: #292524; --surface-2: #221F1D; --fg: #F5F5F4; --fg-muted: #A8A29E;
  --border: #44403C;
  --font-sans: "Google Sans Flex", "Google Sans", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --radius: 0;                             /* Bunthaus: square cards/buttons */
  --radius-input: 12px;                    /* rounded exception: inputs only */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fade: 0.32s;
  --logo-light-bg: url("../assets/deck/brand-mark-light-bg.webp");  /* dark mark, for light theme */
  --logo-dark-bg: url("../assets/deck/brand-mark-dark-bg.webp");    /* light mark, for dark theme */
}
:root[data-theme="light"] {
  --bg: #FAFAF9; --surface: #FFFFFF; --surface-2: #F1EEEA; --fg: #1C1917; --fg-muted: #57534E;
  --border: #D6D3D1;
}

/* =====================================================================
   2. DECK SHELL — one container; slides stacked absolutely; cross-fade.
   ===================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg); color: var(--fg);
  -webkit-font-smoothing: antialiased;
  transition: background var(--fade) var(--ease), color var(--fade) var(--ease);
}
.deck { position: relative; width: 100vw; height: 100dvh; overflow: hidden; }

.stage {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity var(--fade) var(--ease);
  overflow-y: auto;
}
.stage[aria-hidden="false"] { opacity: 1; pointer-events: auto; }

.stage::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 55% at 50% 0%,
              rgb(var(--accent-rgb) / 0.12), transparent 72%);
}

.inner {
  position: relative; z-index: 1; flex: 1;
  width: 100%; max-width: 72rem; margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2.75rem, 5vw, 3.75rem);
  display: flex; flex-direction: column; justify-content: center;
  gap: 0.9rem;
}
.inner.cols {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.inner.centered { text-align: center; align-items: center; }
@media (max-width: 760px) { .inner.cols { grid-template-columns: 1fr; } }

/* A slide file opened on its own has no .deck around it. Give it the same
   frame so the file is readable standalone — this is the whole point of
   one-file-per-slide, and it must not require running the deck. */
body:not(.deck-host) > .inner { min-height: 100dvh; }

/* =====================================================================
   3. CONTENT TYPE
   ===================================================================== */
.kicker { font-family: var(--font-mono); font-size: clamp(0.68rem,1vw,0.78rem);
          letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }
h1 { font-size: clamp(2.2rem,5vw,3.7rem); line-height: 1.04; margin: 0;
     font-weight: 300; letter-spacing: -0.02em; text-wrap: balance; max-width: 20ch; }
h2 { font-size: clamp(1.6rem,3.1vw,2.4rem); line-height: 1.1; margin: 0;
     font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; max-width: 22ch; }
h3 { font-size: clamp(1.05rem,1.6vw,1.25rem); line-height: 1.25; margin: 0;
     font-weight: 500; color: var(--fg); }
p, li { font-size: clamp(0.95rem,1.4vw,1.13rem); line-height: 1.55; font-weight: 300;
        color: var(--fg-muted); max-width: 46ch; }
.lede { font-size: clamp(1rem,1.6vw,1.2rem); max-width: 52ch; }
.centered h1, .centered h2, .centered p { margin-left: auto; margin-right: auto; }
ul { margin: 0.3rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.5rem; }
strong { color: var(--fg); font-weight: 500; }
pre { font-family: var(--font-mono); font-size: 0.9rem; margin: 0; overflow-x: auto;
      color: var(--fg); line-height: 1.6; }

/* =====================================================================
   4. CHROME
   ===================================================================== */
.chrome { position: fixed; z-index: 10; transition: opacity 0.25s var(--ease); }
.nav { inset: auto 0 1.25rem 0; display: flex; justify-content: center; gap: 0.5rem;
       align-items: center; }
.tools { top: 1.1rem; right: 1.1rem; display: flex; gap: 0.4rem; }
button.ui { font: inherit; font-size: 0.85rem; color: var(--fg); background: var(--surface);
       border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
       padding: 0.4rem 0.7rem; line-height: 1; transition: border-color 0.15s var(--ease); }
button.ui:hover { border-color: var(--accent); }
button.ui:disabled { opacity: 0.3; cursor: default; }
.dots { display: flex; gap: 0.4rem; padding: 0 0.5rem; }
.dot { width: 9px; height: 9px; border: 0; padding: 0; border-radius: var(--radius);
       background: var(--border); cursor: pointer; transition: all 0.2s var(--ease); }
.dot[aria-selected="true"] { background: var(--accent); transform: scaleY(1.35); }
.progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent-grad);
            width: 0; z-index: 10; transition: width var(--fade) var(--ease); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.presenting .chrome { opacity: 0; pointer-events: none; }

.foot { position: absolute; bottom: 0; left: 0; right: 0; z-index: 1;
        display: flex; justify-content: space-between; align-items: center;
        padding: 1rem clamp(2rem,5vw,4rem); font-family: var(--font-mono);
        font-size: 0.72rem; color: var(--fg-muted); }

/* brand mark — theme-aware, top-right, below the tools row. Injected into
   each .stage (like .foot) so it repeats correctly on every printed page —
   a single position:fixed element would only print once. */
.brand-mark { position: absolute; z-index: 1; top: clamp(4.4rem,7vw,5.2rem); right: clamp(2rem,5vw,4rem);
              width: clamp(64px,8vw,96px); aspect-ratio: 700 / 275; pointer-events: none; }
/* on narrow screens content starts close to the top (dense slides especially) —
   the fixed-position mark would collide with headings, so it steps aside there.
   Print always renders at the fixed 1280px @page width below, so this query
   never matches there and the mark still appears on every printed page. */
@media (max-width: 640px) { .brand-mark { display: none; } }
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; inset: 0; background-repeat: no-repeat; background-position: right center;
  background-size: contain; transition: opacity var(--fade) var(--ease);
}
.brand-mark::before { background-image: var(--logo-dark-bg); opacity: 1; }
.brand-mark::after  { background-image: var(--logo-light-bg); opacity: 0; }
:root[data-theme="light"] .brand-mark::before { opacity: 0; }
:root[data-theme="light"] .brand-mark::after  { opacity: 1; }

/* A slide whose markup never arrived says so. Deliberately loud: an empty
   chart reads as "zero", and this needs to be noticed in rehearsal rather
   than in the room. Set by DECK.unavailable(). */
.deck-missing {
  margin-top: 1rem; padding: 1rem 1.25rem; max-width: none;
  border: 1px dashed var(--flag); border-radius: 8px;
  color: var(--flag); font-size: 0.85rem; line-height: 1.5;
}

/* =====================================================================
   5. ACCESSIBILITY + PRINT
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .progress-fill { transform: scaleX(1) !important; }
}
@media print {
  @page { size: 1280px 720px; margin: 0; }
  .chrome, .progress { display: none !important; }
  .deck { width: auto; height: auto; overflow: visible; }
  .stage { position: static !important; opacity: 1 !important; transition: none !important;
           width: 1280px; height: 720px; break-after: page; overflow: visible; }
  .stage:last-of-type { break-after: avoid; }
  .stage::before { display: none; }
  .progress-fill { transform: scaleX(1) !important; }
}
