/* ============================================================
   PITCHROOM — Stumble Guys destination
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&family=Work+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Lato:wght@300;400;700&family=Montserrat:wght@300;400;500;600;700&family=Open+Sans:wght@300;400;600;700&family=Roboto:wght@300;400;500;700&family=Raleway:wght@300;400;500;600;700&family=Nunito:wght@300;400;600;700&family=DM+Sans:wght@300;400;500;600;700&family=Barlow:wght@300;400;500;600;700&family=Oswald:wght@300;400;500;600;700&family=IBM+Plex+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&family=Merriweather:wght@300;400;700&family=Cormorant+Garamond:wght@300;400;500;600;700&family=Cinzel:wght@400;500;600;700&family=Libre+Baskerville:wght@400;700&family=DM+Serif+Display&family=IBM+Plex+Mono:wght@300;400;500&display=swap');

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

:root {
  --grad-start:    #FFD93D;
  --grad-end:      #FF6B35;
  --accent:        #C8102E;
  --bg:            #000000;
  --white:         #ffffff;
  --white-70:      rgba(255,255,255,0.7);
  --white-45:      rgba(255,255,255,0.45);
  --white-30:      rgba(255,255,255,0.3);
  --white-10:      rgba(255,255,255,0.1);
  --white-08:      rgba(255,255,255,0.08);
  --topbar-height: 48px;
  --strip-height:  88px;
  --font-ui:       'Helvetica Neue', Helvetica, Arial, sans-serif;
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-strip:    cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}


/* ============================================================
   KEYNOTE IFRAME
   ============================================================ */

#keynote-player {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: 100vw;
  height: calc(100vh - var(--topbar-height));
  border: none;
  z-index: 1;
  background: transparent;
  transition: height 0.35s var(--ease-strip);
}

body.strip-visible #keynote-player {
  height: calc(100vh - var(--topbar-height) - var(--strip-height));
}


/* ============================================================
   TOP CHROME BAR
   Always visible once player is active.
   ============================================================ */

#chrome {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

#chrome > * {
  pointer-events: auto;
}

#top-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(0,0,0,0.88);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  z-index: 20;
  padding: 0 6px 0 4px;
}

/* ---- Back button ----------------------------------------- */

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  padding: 0 10px 0 6px;
  height: 36px;
  flex-shrink: 0;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--grad-start);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.back-btn:hover {
  color: #fff;
  background: rgba(255,217,61,0.12);
}

.back-btn-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Subtle separator between back button and sections bar */
.back-btn {
  border-right: 1px solid rgba(255,255,255,0.07);
  margin-right: 2px;
}

/* ---- Sections bar ---------------------------------------- */

#sections-bar {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;           /* allow flex child to shrink below content size */
  justify-content: center;
  gap: 2px;
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
  /* fade edges to hint at scroll without hard clipping */
  -webkit-mask-image: linear-gradient(to right, transparent 0px, #000 28px, #000 calc(100% - 28px), transparent 100%);
  mask-image:         linear-gradient(to right, transparent 0px, #000 28px, #000 calc(100% - 28px), transparent 100%);
}

#sections-bar::-webkit-scrollbar { display: none; }

.section-tab {
  position: relative;
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.section-tab:hover {
  color: var(--white);
  background: var(--white-08);
}

.section-tab.active {
  color: var(--grad-start);
}

/* Thin underline on active tab */
.section-tab.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 14px;
  right: 14px;
  height: 1.5px;
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  border-radius: 2px;
}

/* Separator dots between tabs */
.section-tab + .section-tab::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
}

/* ---- Top-right controls ---------------------------------- */

.top-chrome-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* Hide text labels on narrow viewports, keep icons only */
@media (max-width: 680px) {
  .ctrl-btn-label { display: none; }
  .back-btn-label { display: none; }
  .ctrl-btn { padding: 6px 8px; }
}

.ctrl-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.ctrl-btn:hover {
  color: rgba(255,255,255,0.8);
  background: var(--white-08);
}

.ctrl-btn.notes-on {
  color: var(--grad-start);
}

.icon-btn {
  padding: 6px 8px;
}


/* ============================================================
   NAV ARROWS
   Always visible, floating on the sides, no box.
   ============================================================ */

.nav-arrow {
  position: fixed;
  top: calc(var(--topbar-height) + 50%);
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 20px 14px;
  transition: color 0.25s ease, transform 0.15s ease;
  z-index: 15;
}

/* Proximity-activated by JS — fades in when mouse is near the screen edge */
.nav-arrow.proximity-active {
  color: rgba(255,255,255,0.7);
}

#btn-prev { left: 4px; }
#btn-next { right: 4px; }

.nav-arrow:hover {
  color: rgba(255,255,255,0.9);
}

#btn-prev:hover {
  transform: translateY(-50%) translateX(-2px);
}
#btn-next:hover {
  transform: translateY(-50%) translateX(2px);
}


/* ============================================================
   SLIDE COUNTER — bottom right, always on
   ============================================================ */

#slide-counter {
  position: fixed;
  bottom: calc(var(--strip-height) + 12px);
  right: 20px;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  user-select: none;
  pointer-events: none;
  z-index: 16;
  transition: bottom 0.35s var(--ease-strip);
}

body:not(.strip-visible) #slide-counter {
  bottom: 16px;
}


/* ============================================================
   PARAGRAPH STRIP
   ============================================================ */

#paragraph-strip {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  /* Height set explicitly by JS (computeStripHeight) so it never changes
     during slide navigation — prevents iframe jumping mid-transition. */
  overflow: hidden;
  background: rgba(6,6,8,0.96);
  backdrop-filter: blur(16px);
  transition: transform 0.35s var(--ease-strip);
  z-index: 15;
}

/* Gradient top border instead of plain 1px line */
#paragraph-strip::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--grad-start) 20%, var(--grad-end) 80%, transparent 100%);
  opacity: 0.55;
  z-index: 1;
}

/* Subtle shadow bridging Keynote's internal padding gap */
#paragraph-strip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 0; right: 0;
  height: 28px;
  background: linear-gradient(to bottom, transparent, rgba(6,6,8,0.75));
  pointer-events: none;
}

#paragraph-strip.strip-hidden {
  transform: translateY(100%);
  /* overflow:visible keeps the collapse-tab button accessible above the fold */
  overflow: visible;
}


/* ── Strip collapse tab ── */
#btn-strip-collapse {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 24px;
  background: rgba(6,6,8,0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  padding: 0;
  /* Extended touch target above the visible button */
}

/* Extend the hit area upward for touch devices */
#btn-strip-collapse::before {
  content: '';
  position: absolute;
  inset: -16px -16px 0;
}

#btn-strip-collapse:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(30,30,32,0.95);
}

/* Flip chevron upward when strip is hidden */
#paragraph-strip.strip-hidden #btn-strip-collapse {
  transform: translateX(-50%) translateY(-100%) rotate(180deg);
}

#paragraph-inner {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 72px;
  display: flex;
  align-items: center;
}


#paragraph-text {
  flex: 1;
  min-width: 0;
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: 0.01em;
  /* min-height reserves the full 3-line space even when a slide has no notes,
     so the strip height stays constant as you navigate. */
  min-height: calc(3 * 1.55em);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#paragraph-text .hl {
  color: var(--grad-start);
  font-weight: 600;
}

#paragraph-text.strip-empty {
  opacity: 0.35;
}

.strip-no-notes {
  font-style: italic;
  letter-spacing: 0.02em;
}

/* Progress bar — thin line at top of strip showing deck progress */
#strip-progress-track {
  position: absolute;
  top: 1px; /* sits just below the gradient border ::before */
  left: 0; right: 0;
  height: 2px;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
  z-index: 2;
  border-radius: 0 0 0 0;
}

#strip-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  border-radius: 0 2px 2px 0;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Elapsed presentation timer — bottom-right corner of strip */
#strip-timer {
  position: absolute;
  bottom: 7px;
  right: 14px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.2);
  pointer-events: none;
  line-height: 1;
  transition: color 0.5s ease;
}

#strip-timer.timer-warning { color: rgba(245,166,35,0.6); }
#strip-timer.timer-danger  { color: rgba(200,16,46,0.75); }


/* ============================================================
   MOBILE NOTES VIEW
   Shown on small screens (<768px) in place of the Keynote iframe.
   The hidden iframe still receives key events for navigation.
   ============================================================ */

body.mobile-mode #keynote-player {
  opacity: 0;
  pointer-events: none;
}

body.mobile-mode #paragraph-strip {
  display: none;
}

body.mobile-mode #btn-toggle-notes {
  display: none;
}

#mobile-notes-view {
  position: fixed;
  top: var(--topbar-height);
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body:not(.mobile-mode) #mobile-notes-view {
  display: none !important;
}

.mobile-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.mobile-section-name {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grad-start);
  opacity: 0.85;
}

.mobile-slide-num {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.mobile-notes-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.mobile-notes-text {
  font-size: 18px;
  line-height: 1.65;
  color: rgba(255,255,255,0.88);
  font-weight: 300;
}

.mobile-notes-text .hl {
  color: var(--grad-start);
  font-weight: 600;
}

.mobile-notes-empty {
  color: rgba(255,255,255,0.2);
  font-style: italic;
  font-size: 15px;
}

.mobile-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.mobile-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mobile-nav-btn:active {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
}


/* ============================================================
   HUB PAGE
   ============================================================ */

#hub {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#hub.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hub-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 52px;
  width: 100%;
  max-width: 560px;
  padding: 40px 24px;
  animation: fade-up 0.55s var(--ease-out) both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hub-logo-wrap { display: flex; justify-content: center; }

.hub-logo {
  width: 320px;
  max-width: 80vw;
  height: auto;
  filter:
    drop-shadow(0 0 60px rgba(255,107,53,0.3))
    drop-shadow(0 0 20px rgba(255,107,53,0.15));
}

.hub-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.hub-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(255,217,61,0.08) 0%, rgba(255,107,53,0.08) 100%);
  border: 1px solid rgba(255,217,61,0.22);
  border-radius: 10px;
  color: rgba(255,255,255,0.8);
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
  text-align: left;
}

.hub-btn:not(:disabled):hover {
  background: linear-gradient(135deg, rgba(255,217,61,0.16) 0%, rgba(255,107,53,0.16) 100%);
  border-color: rgba(255,217,61,0.45);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255,107,53,0.18);
}

.hub-btn:disabled {
  cursor: default;
  opacity: 0.35;
}

.hub-btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  border-radius: 8px;
  flex-shrink: 0;
  color: #000;
}

.hub-btn-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex: 1;
}

.hub-btn-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  background: var(--white-08);
  padding: 4px 10px;
  border-radius: 100px;
}

.hub-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}


/* ============================================================
   GATE
   ============================================================ */

#gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

#gate.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  width: 100%;
  max-width: 440px;
  padding: 40px 24px;
  animation: fade-up 0.6s var(--ease-out) both;
}

.show-logo-wrap { display: flex; align-items: center; justify-content: center; }

#show-logo {
  width: 300px;
  max-width: 78vw;
  height: auto;
  filter:
    drop-shadow(0 0 60px rgba(255,107,53,0.35))
    drop-shadow(0 0 20px rgba(255,107,53,0.2));
}

.gate-form-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.gate-label {
  color: rgba(255,255,255,0.28);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

#gate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.input-grad-border {
  position: relative;
  border-radius: 6px;
  padding: 1px;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
}

#passcode-input {
  display: block;
  width: 100%;
  padding: 15px 20px;
  background: #0d0d0d;
  border: none;
  border-radius: 5px;
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 16px;
  letter-spacing: 0.22em;
  text-align: center;
  outline: none;
  transition: background 0.2s;
}

#passcode-input::placeholder {
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.1em;
  font-size: 13px;
}

#passcode-input:focus { background: #111; }

#gate-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  border: none;
  border-radius: 6px;
  color: #000;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

#gate-submit:hover { opacity: 0.9; transform: translateY(-1px); }
#gate-submit:active { transform: translateY(0); }

#gate-error {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.05em;
  min-height: 18px;
  text-align: center;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.input-grad-border.error {
  animation: shake 0.4s ease;
  background: linear-gradient(135deg, var(--accent), #ff3355);
}

/* ---- Shared footer --------------------------------------- */

.gate-footer,
.hub-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.presented-by {
  color: rgba(255,255,255,0.25);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eureka-credit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eureka-logo-sm {
  height: 56px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.45;
}

.eureka-wordmark {
  color: rgba(255,255,255,0.55);
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.15em;
}


/* ============================================================
   KEYBOARD HINT
   ============================================================ */

#keyboard-hint {
  position: fixed;
  bottom: calc(var(--strip-height) + 20px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.05em;
  pointer-events: none;
  z-index: 30;
  opacity: 1;
  transition: opacity 0.6s ease;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.hint-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}

.hint-sep {
  color: rgba(255,255,255,0.2);
  margin: 0 4px;
}


/* ============================================================
   MOBILE — safe area + responsive overrides
   ============================================================ */

/* Safe-area insets for notch / Dynamic Island / home indicator */
#top-chrome {
  padding-top: env(safe-area-inset-top);
  height: calc(var(--topbar-height) + env(safe-area-inset-top));
}

#keynote-player {
  top: calc(var(--topbar-height) + env(safe-area-inset-top));
  height: calc(100vh - var(--topbar-height) - env(safe-area-inset-top));
}

body.strip-visible #keynote-player {
  height: calc(100vh - var(--topbar-height) - env(safe-area-inset-top) - var(--strip-height));
}

#paragraph-strip {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Slide counter above strip + home indicator */
#slide-counter {
  bottom: calc(var(--strip-height) + env(safe-area-inset-bottom) + 12px);
}

body:not(.strip-visible) #slide-counter {
  bottom: calc(env(safe-area-inset-bottom) + 16px);
}

/* Nav arrows clear the sides on notched phones */
.nav-arrow-left  { left:  max(4px, env(safe-area-inset-left));  }
.nav-arrow-right { right: max(4px, env(safe-area-inset-right)); }

/* ---- Tablet & small desktop (≤ 768px) -------------------- */
@media (max-width: 768px) {
  #paragraph-inner { padding: 0 20px; }

  /* Hub page: tighter vertical gaps on short screens */
  .hub-actions { gap: 8px; }
  .hub-container { gap: 28px; padding: 28px 20px; }

  /* Gate: tighter spacing */
  .gate-container { gap: 28px; padding: 28px 20px; }
}

/* ---- Phone (≤ 480px) ------------------------------------- */
@media (max-width: 480px) {
  /* Strip inner padding */
  #paragraph-inner { padding: 0 16px; }

  /* Hub logo smaller */
  .hub-logo { width: 200px; }

  /* Tighter hub layout */
  .hub-container { gap: 20px; padding: 20px 16px; }
  .hub-actions { gap: 8px; }
  .hub-btn { padding: 14px 18px; gap: 12px; }

  /* Gate tighter */
  .gate-container { gap: 20px; padding: 20px 16px; }
  .gate-logo { width: 200px; }

  /* Larger touch targets for nav controls on phone */
  .ctrl-btn  { min-height: 44px; min-width: 44px; padding: 0 8px; }
  .back-btn  { min-height: 44px; }
  .icon-btn  { min-height: 44px; min-width: 44px; }

  /* Section tabs easier to tap */
  .section-tab { padding: 10px 12px; min-height: 44px; }

  /* Nav arrows: bigger tap area, pushed inward more */
  .nav-arrow { padding: 20px 14px; }

  /* Keyboard hint hidden on phones (swipe handles navigation) */
  #keyboard-hint { display: none; }
}

/* ---- Tiny phones (≤ 375px) ------------------------------- */
@media (max-width: 375px) {
  #paragraph-inner { padding: 0 12px; }
  .hub-btn { padding: 12px 14px; }
  .hub-btn-label { font-size: 13px; }
  .hub-logo { width: 180px; }
}

/* ---- Landscape on phones --------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --topbar-height: 40px; --strip-height: 52px; }
  #paragraph-text { font-size: 12px; line-height: 1.4; }
  .hub-container { gap: 16px; padding: 16px 20px; }
  #keyboard-hint { display: none; }
}


/* ============================================================
   JUMP-TO-SLIDE OVERLAY  (#16)
   ============================================================ */

/* ============================================================
   SLIDE NAVIGATOR PANEL
   ============================================================ */

#slide-nav-panel {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  width: 280px;
  background: rgba(10,10,12,0.96);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255,255,255,0.08);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.28s cubic-bezier(0.16,1,0.3,1);
}

#slide-nav-panel.sn-hidden-panel {
  transform: translateX(100%);
  pointer-events: none;
}

.sn-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.sn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.sn-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.sn-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.sn-close:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.08); }

.sn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.sn-grid::-webkit-scrollbar { width: 4px; }
.sn-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.sn-tile {
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  font-size: 0; /* hide stray text */
}

.sn-tile:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  transform: scale(1.04);
}

.sn-tile.sn-current {
  border-color: var(--grad-start, #F5A623);
  box-shadow: 0 0 0 1px var(--grad-start, #F5A623);
  background: rgba(255,255,255,0.06);
}

.sn-tile.sn-hidden {
  opacity: 0.3;
}

.sn-num {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-ui, sans-serif);
  line-height: 1;
}

.sn-tile.sn-current .sn-num {
  color: var(--grad-start, #F5A623);
}

/* Slides button active state */
#btn-slides.active {
  color: var(--grad-start, #F5A623);
  background: rgba(255,255,255,0.06);
}

/* ============================================================ */

#jump-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fade-in-overlay 0.15s ease;
}

@keyframes fade-in-overlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.jump-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(12,12,12,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 32px 44px;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: jump-modal-in 0.2s var(--ease-out) both;
}

@keyframes jump-modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.jump-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.jump-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

#jump-input {
  width: 90px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 30px;
  font-weight: 600;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

#jump-input::-webkit-outer-spin-button,
#jump-input::-webkit-inner-spin-button { -webkit-appearance: none; }

#jump-input:focus {
  border-color: var(--grad-start);
  box-shadow: 0 0 0 2px rgba(255,217,61,0.15);
}

.jump-total {
  font-size: 15px;
  color: rgba(255,255,255,0.3);
}

.jump-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.06em;
}


/* ============================================================
   KEYBOARD SHORTCUTS MODAL  (#17)
   ============================================================ */

#shortcuts-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fade-in-overlay 0.15s ease;
}

.shortcuts-inner {
  background: rgba(10,10,10,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 28px 32px;
  min-width: 300px;
  max-width: 460px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: jump-modal-in 0.2s var(--ease-out) both;
}

.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.shortcuts-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.shortcuts-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}
.shortcuts-close:hover { color: rgba(255,255,255,0.8); }

.shortcuts-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 3px 0;
}

.shortcut-row kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  flex-shrink: 0;
}

.shortcut-row span {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}


/* ============================================================
   PRESENTER MODE POPUP  (#25)
   ============================================================ */

.presenter-popup {
  position: fixed;
  top: 60px;
  right: 20px;
  width: 300px;
  max-height: 260px;
  background: rgba(8,8,8,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 60px rgba(0,0,0,0.65);
  z-index: 50;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: jump-modal-in 0.2s var(--ease-out) both;
}

.presenter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  user-select: none;
  flex-shrink: 0;
}

.presenter-slide-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grad-start);
}

.presenter-slide-total { color: rgba(255,255,255,0.3); }

.presenter-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  transition: color 0.15s;
}
.presenter-close:hover { color: rgba(255,255,255,0.8); }

.presenter-notes {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.72);
  font-weight: 300;
  overflow-y: auto;
  flex: 1;
}

.presenter-notes .hl {
  color: var(--grad-start);
  font-weight: 600;
}

.presenter-empty {
  color: rgba(255,255,255,0.2);
  font-style: italic;
  font-size: 12px;
}

/* Active state for presenter button */
#btn-presenter.active {
  color: var(--grad-start);
  background: rgba(255,217,61,0.08);
}
