/* =========================================================================
 *  Presenter shell styles.
 *  Visual identity matches slides/_shared/theme.css (coral, teal, JetBrains).
 *  Slide iframe is authored at exactly 1920×1080; we scale-to-fit and centre.
 * ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Space+Grotesk:wght@500;600&display=swap');

:root {
  --bg-deep:        #0E1218;
  --bg-surface:     #161E2B;
  --bg-elevated:    #1E283A;
  --border:         #2A3245;
  --border-strong:  #3D4A66;
  --accent-coral:   #FF5A4E;
  --accent-teal:    #00D9C5;
  --accent-amber:   #FFD60A;
  --text-primary:   #F5F7FA;
  --text-secondary: #B5BECF;
  --text-tertiary:  #7E8AA0;
  --text-muted:     #5A6478;
  --font-display:   'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono:      'JetBrains Mono', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* ---------- Stage: full viewport, slide iframes centered ---------- */

#stage {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
}

.slide-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1920px;
  height: 1080px;
  border: 0;
  background: var(--bg-deep);
  /* JS sets `transform: translate(-50%, -50%) scale(<fit>)` */
  transform-origin: center center;
  transition: opacity 180ms ease;
  will-change: transform, opacity;
  /* Critical: pointer-events:none keeps focus on the parent document so
     keyboard arrows always reach the presenter — even after the user clicks
     somewhere on the slide or switches windows and comes back. Slides are
     display-only, no interactive elements. */
  pointer-events: none;
}

.slide-frame.active {
  opacity: 1;
  z-index: 2;
}

.slide-frame.preload {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Exit breadcrumb (top-left): back to the gallery ---------- */

#exit-deck {
  position: fixed;
  left: 28px;
  top: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  background: rgba(14, 18, 24, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-decoration: none;
  z-index: 120;
  opacity: 0.82;
  transition: opacity 160ms ease, border-color 140ms ease, color 140ms ease, background 140ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#exit-deck .chev {
  color: var(--accent-coral);
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  margin-top: -1px;
}

#exit-deck:hover {
  opacity: 1;
  border-color: var(--accent-coral);
  background: rgba(255, 90, 78, 0.14);
  color: var(--text-primary);
}

/* ---------- Status bar (bottom-left, auto-hides) ---------- */

#status {
  position: fixed;
  left: 28px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  background: rgba(14, 18, 24, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  z-index: 100;
  opacity: 0.92;
  transition: opacity 400ms ease;
  user-select: none;
  white-space: nowrap;
}

#status.idle { opacity: 0; }

#status .sep { color: var(--text-muted); margin: 0 2px; }
#status .slide-counter { color: var(--accent-coral); font-weight: 700; }
#status .status-title  { color: var(--text-primary); max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
#status .step-counter  { color: var(--accent-teal); font-weight: 500; }
#status .status-beat   { color: var(--text-tertiary); font-style: italic; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- On-screen step controls (bottom-right) ---------- */

#controls {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 110;
  opacity: 0.55;
  transition: opacity 200ms ease;
  user-select: none;
}

#controls:hover { opacity: 1; }

#controls button {
  width: 56px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(14, 18, 24, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  transition: border-color 140ms ease, background 140ms ease, transform 90ms ease;
}

#controls button:hover {
  border-color: var(--accent-coral);
  background: rgba(255, 90, 78, 0.16);
  color: var(--accent-coral);
}

#controls button:active {
  transform: scale(0.94);
}

#controls button:focus {
  outline: none;
}

#controls .ctrl-sep {
  width: 1px;
  height: 28px;
  background: var(--border);
  align-self: center;
  margin: 0 4px;
}

/* Fullscreen toggle glyph sits a touch smaller than the chevrons */
#ctrl-fullscreen {
  font-size: 22px;
}

/* When the document is in fullscreen mode, swap the icon's affordance */
body:fullscreen #ctrl-fullscreen,
body:-webkit-full-screen #ctrl-fullscreen {
  color: var(--accent-coral);
  border-color: var(--accent-coral);
}

/* ---------- Auto-play: play button + speed toggle ---------- */
#ctrl-play { font-size: 20px; }
#ctrl-play.playing {
  color: var(--accent-coral);
  border-color: var(--accent-coral);
  background: rgba(255, 90, 78, 0.16);
}

#speed-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 56px;
  padding: 4px;
  background: rgba(14, 18, 24, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
}
#speed-toggle .speed-opt {
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 140ms ease, background 140ms ease;
}
#speed-toggle .speed-opt:hover { color: var(--text-secondary); }
#speed-toggle .speed-opt.active { background: var(--accent-coral); color: var(--bg-deep); }

/* ---------- Auto-play: progress bar (bottom edge, non-interactive) ---------- */
#progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  z-index: 90;
  pointer-events: none;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-coral);
  box-shadow: 0 0 10px var(--accent-coral);
  transition: width 280ms ease;
}

/* ---------- Speaker notes overlay (right side) ---------- */

#notes {
  position: fixed;
  top: 0;
  right: 0;
  width: 540px;
  height: 100%;
  background: rgba(14, 18, 24, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-left: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 220ms ease;
}

#notes.hidden {
  transform: translateX(100%);
  pointer-events: none;
}

.notes-inner {
  padding: 32px 36px 40px;
  overflow-y: auto;
  height: 100%;
}

.notes-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.notes-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent-coral);
}

.notes-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}

.notes-hint {
  font-size: 11px;
  color: var(--text-tertiary);
}

.notes-hint kbd, #help kbd, #goto kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.notes-body {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.notes-body h1, .notes-body h2, .notes-body h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin: 18px 0 8px;
  font-weight: 600;
}
.notes-body h1 { font-size: 20px; }
.notes-body h2 { font-size: 17px; }
.notes-body h3 { font-size: 15px; color: var(--accent-teal); letter-spacing: 0.04em; }
.notes-body p { margin: 0 0 12px; }
.notes-body strong { color: var(--text-primary); font-weight: 600; }
.notes-body em { color: var(--accent-amber); font-style: italic; }
.notes-body code {
  font-family: var(--font-mono);
  background: var(--bg-surface);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--accent-coral);
}
.notes-body ul, .notes-body ol { margin: 0 0 12px 22px; }
.notes-body li { margin: 4px 0; }
.notes-body blockquote {
  border-left: 3px solid var(--accent-coral);
  padding-left: 14px;
  margin: 10px 0;
  color: var(--text-tertiary);
  font-style: italic;
}

/* ---------- Help overlay ---------- */

#help {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 10, 15, 0.78);
  backdrop-filter: blur(8px);
  z-index: 300;
  opacity: 1;
  transition: opacity 160ms ease;
}

#help.hidden {
  opacity: 0;
  pointer-events: none;
}

.help-inner {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 36px 44px;
  min-width: 480px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}

.help-inner h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.help-inner table {
  border-collapse: collapse;
  width: 100%;
}

.help-inner td {
  padding: 6px 18px 6px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}

.help-inner td:first-child {
  white-space: nowrap;
  color: var(--text-primary);
}

.help-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* ---------- Go-to-slide modal ---------- */

#goto {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 10, 15, 0.6);
  backdrop-filter: blur(6px);
  z-index: 350;
}

#goto.hidden {
  display: none;
}

.goto-inner {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}

.goto-inner label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-coral);
}

#goto-input {
  width: 80px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  outline: none;
}
#goto-input:focus {
  border-color: var(--accent-coral);
  box-shadow: 0 0 0 2px rgba(255, 90, 78, 0.22);
}

.goto-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---------- Blackout ---------- */

#blackout {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 500;
  opacity: 1;
  transition: opacity 120ms ease;
}

#blackout.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Loading flash (first slide before timeline grabbed) ---------- */

body.loading::after {
  content: '';
  position: fixed;
  bottom: 22px;
  right: 28px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-coral);
  box-shadow: 0 0 14px var(--accent-coral);
  animation: pulse 1.1s ease-in-out infinite;
  z-index: 99;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.2); }
}
