/* ============================================================
   Play Mode — presentation overlay
   ============================================================ */

/* Play toggle button in nav — mirrors .theme-toggle */
.play-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
  background: var(--surface-2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 2px;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.play-toggle:hover,
body.play-mode .play-toggle {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Lock scroll when play mode is active */
body.play-mode {
  overflow: hidden;
}

/* Hide all normal page content while in play mode */
body.play-mode > *:not(#play-shell):not(#play-controls):not(.cursor-glow):not(.grain) {
  visibility: hidden;
}

/* ---- Shell ---- */
#play-shell {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#play-shell.active {
  opacity: 1;
  pointer-events: all;
}

/* ---- Sidebar ---- */
#play-sidebar {
  width: 260px;
  flex-shrink: 0;
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  overflow-x: hidden;
}
#play-shell.active #play-sidebar {
  transform: translateX(0);
}

.play-sidebar-header {
  padding: 28px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.play-sidebar-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.play-nav-list {
  padding: 10px 0 32px;
  flex: 1;
}
.play-nav-item {
  padding: 12px 24px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.play-nav-item:hover {
  color: var(--text);
  background: var(--surface-2);
}
.play-nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
}
.play-nav-index {
  font-size: 0.7rem;
  color: var(--text-faint);
  font-family: monospace;
  min-width: 18px;
}
.play-nav-item.active .play-nav-index {
  color: var(--accent);
  opacity: 0.6;
}

/* ---- Stage ---- */
#play-stage {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

.play-slide {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 90px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.play-slide.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.play-slide.exit {
  opacity: 0;
  transform: translateY(-18px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

/* Force all reveal animations visible inside play slides */
.play-slide .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Normalize min-heights that assume full viewport */
.play-slide .hero {
  min-height: unset;
  padding-top: 48px;
  padding-bottom: 48px;
}
.play-slide .contact-section {
  min-height: unset;
  padding-top: 60px;
  padding-bottom: 60px;
}

/* ---- Controls bar ---- */
#play-controls {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1010;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px 12px;
  background: var(--nav-bg);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}
#play-controls.active {
  opacity: 1;
  pointer-events: all;
}

/* Progress bar strip inside controls pill */
.play-progress-wrap {
  position: absolute;
  bottom: 6px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
}
.play-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 1px;
}

/* Control buttons */
.play-ctrl-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
  background: var(--surface-2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.play-ctrl-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.play-ctrl-btn.primary {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: var(--btn-text);
  border-color: var(--accent);
  font-size: 0.82rem;
}
.play-ctrl-btn.primary:hover {
  box-shadow: 0 4px 16px var(--accent-glow);
  background: var(--accent);
  color: var(--btn-text);
}

/* Slide counter badge */
.play-slide-counter {
  font-size: 0.72rem;
  color: var(--text-faint);
  font-family: monospace;
  padding: 0 4px;
  min-width: 32px;
  text-align: center;
  user-select: none;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  #play-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 220px;
    z-index: 510;
  }
  #play-stage {
    width: 100%;
  }
  #play-controls {
    bottom: 16px;
    gap: 4px;
    padding: 8px 10px 12px;
  }
  .play-ctrl-btn {
    width: 30px;
    height: 30px;
    font-size: 0.68rem;
  }
  .play-ctrl-btn.primary {
    width: 36px;
    height: 36px;
  }
}
