/* Playback mode: the deck on top, the speaker notes underneath as captions
   that arrive at roughly speaking pace. Built into dist/ by tools/build_play.py. */

:root {
  --cap-h: 200px;
  --stage-h: calc(100vh - var(--cap-h));
}

html, body { height: 100%; background: var(--ink); overflow: hidden; }

.reveal {
  position: fixed !important;
  inset: 0 0 auto 0;
  height: var(--stage-h) !important;
  width: 100vw !important;
}
body.cc-off { --cap-h: 64px; }

/* ---------- caption band ---------- */
#play {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--cap-h);
  box-sizing: border-box;
  padding: 14px max(16px, 4vw) calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 10px;
  background: #0b0c0e;
  border-top: 1px solid #23262b;
  color: var(--bone);
  font-family: var(--serif);
  z-index: 40;
}

#cap {
  flex: 1; min-height: 0;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  mask-image: linear-gradient(to bottom, transparent 0, #000 38%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 38%);
}
body.cc-off #cap { display: none; }

#cap p {
  margin: 0 0 .55em;
  max-width: 62rem;
  font-size: clamp(17px, 1.9vw, 28px);
  line-height: 1.4;
  transition: opacity .6s ease, transform .6s ease;
}
#cap p.past { opacity: .32; }
#cap p.leaving { opacity: 0; transform: translateY(-12px); }

#cap .w {
  display: inline-block;
  opacity: .24;
  transform: translateY(.06em);
  transition: opacity .28s ease, transform .28s ease, color .9s ease;
}
#cap .w.on { opacity: 1; transform: none; }
#cap .w.now { color: var(--crane); transition: opacity .28s ease, transform .28s ease; }

/* ---------- controls ---------- */
#bar {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 13px; color: var(--steel);
}
#bar button {
  appearance: none; border: 1px solid #2c3036; background: #15171a; color: var(--bone);
  font: inherit; height: 34px; min-width: 34px; padding: 0 10px; border-radius: 6px; cursor: pointer;
}
#bar button:hover { border-color: var(--crane); }
#bar button:focus-visible { outline: 2px solid var(--crane); outline-offset: 2px; }
#bar button[aria-pressed="true"] { color: var(--crane); border-color: var(--crane); }
#bar #pp { min-width: 64px; color: var(--ink); background: var(--crane); border-color: var(--crane); font-weight: 600; }

#track {
  flex: 1; height: 34px; position: relative; cursor: pointer;
  display: flex; align-items: center;
}
#track .rail { position: absolute; left: 0; right: 0; height: 4px; background: #23262b; border-radius: 2px; overflow: hidden; }
#track .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--crane); }
#track .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: #0b0c0e; }
#time, #count { white-space: nowrap; font-variant-numeric: tabular-nums; }
#bar a { color: var(--steel); text-decoration: none; white-space: nowrap; }
#bar a:hover { color: var(--crane); }

/* ---------- start card ---------- */
#start {
  position: fixed; inset: 0 0 auto 0; height: var(--stage-h);
  display: flex; align-items: center; justify-content: center;
  background: rgba(11, 12, 14, .55);
  z-index: 30;
  cursor: pointer;
}
#start button {
  appearance: none; border: 0; cursor: pointer;
  background: var(--crane); color: var(--ink);
  font-family: var(--display); font-weight: 800; letter-spacing: .5px;
  font-size: clamp(22px, 3vw, 40px);
  padding: .5em 1.1em; border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
#start small { display: block; font-family: var(--mono); font-weight: 400; font-size: .4em; letter-spacing: 1px; margin-top: .4em; }

@media (max-width: 640px) {
  :root { --cap-h: 46vh; }
  body.cc-off { --cap-h: 64px; }
  #bar { gap: 8px; font-size: 12px; flex-wrap: wrap; }
  #track { order: 9; flex-basis: 100%; height: 18px; }
  #bar .wide { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #cap p, #cap .w { transition: none; }
  #cap .w { transform: none; }
}
