/* ============================================
   BACKBONE PRESENTATION — Cinematic Dark Theme
   ============================================ */

:root {
  --bg: #08090a;
  --surface: #111827;
  --surface-elevated: #1e293b;
  --border: #334155;
  --primary: #22d3ee;
  --secondary: #f59e0b;
  --accent: #a78bfa;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #475569;
  --success: #34d399;
  --danger: #f87171;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --control-height: 48px;
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; height: 100dvh; overflow: hidden; background: var(--bg); font-family: var(--font); color: var(--text); -webkit-text-size-adjust: 100%; }

/* ---- Presentation Container ---- */
#presentation {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

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

/* ---- Scene ---- */
.scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 80px;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
}
.scene.active {
  visibility: visible;
}
/* Ensure first scene is visible on mobile before GSAP kicks in */
.scene.active.scene-ready {
  opacity: 1;
}

/* ---- Background overlays ---- */
.scene-bg-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.scene-bg-overlay.grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.scene-bg-overlay.dots {
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* ---- Scene content wrapper ---- */
.scene-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* ---- Element positioning ---- */
.el { opacity: 0; }
.el-positioned {
  position: absolute;
  z-index: 1;
}

/* ---- Typography ---- */
.el-text {
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.size-xl  { font-size: 4rem;   font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.size-lg  { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.size-md  { font-size: 1.5rem; font-weight: 500; line-height: 1.4; }
.size-sm  { font-size: 1.1rem; font-weight: 400; line-height: 1.5; }
.size-xs  { font-size: 0.85rem; font-weight: 400; line-height: 1.5; letter-spacing: 0.02em; }
.weight-light   { font-weight: 300; }
.weight-normal  { font-weight: 400; }
.weight-medium  { font-weight: 500; }
.weight-semi    { font-weight: 600; }
.weight-bold    { font-weight: 700; }
.weight-black   { font-weight: 900; }
.align-left     { text-align: left; }
.align-center   { text-align: center; }
.align-right    { text-align: right; }
.uppercase      { text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- Split text ---- */
.split-char, .split-word {
  display: inline-block;
  opacity: 0;
}
.split-char { min-width: 0.3em; }

/* ---- Counter ---- */
.el-counter {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 4rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.counter-suffix, .counter-prefix {
  font-weight: 500;
  font-size: 0.5em;
  opacity: 0.7;
  margin: 0 0.1em;
}

/* ---- Badge ---- */
.el-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid;
}

/* ---- Card ---- */
.el-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  border-left: 3px solid var(--primary);
  max-width: 400px;
  width: 100%;
}
.card-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- Cards grid ---- */
.el-cards {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: 1100px;
}
.el-cards.cols-2 { grid-template-columns: repeat(2, 1fr); }
.el-cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
.el-cards.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- List ---- */
.el-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 800px;
}
.el-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.list-marker {
  flex-shrink: 0;
  color: var(--primary);
  font-weight: 700;
}
.list-marker.bullet::before { content: '\2022'; font-size: 1.4em; }
.list-marker.dash::before   { content: '\2014'; }

/* ---- Table ---- */
.el-table {
  border-collapse: collapse;
  font-size: 0.9rem;
  max-width: 1000px;
  width: 100%;
}
.el-table thead th {
  text-align: left;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.el-table tbody td {
  padding: 10px 16px;
  color: var(--text);
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}
.el-table tbody tr { opacity: 0; }

/* ---- Diagram ---- */
.el-diagram {
  position: relative;
  width: 100%;
  max-width: 1000px;
}
.el-diagram svg {
  width: 100%;
  height: 100%;
}
.diagram-node {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  opacity: 0;
  white-space: nowrap;
}
.diagram-node.highlight {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
}
.diagram-edge {
  stroke: var(--border);
  stroke-width: 2;
  fill: none;
}

/* ---- Divider ---- */
.el-divider {
  height: 1px;
  width: 80px;
  background: var(--border);
  border: none;
}

/* ---- Group ---- */
.el-group {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.el-group.layout-column {
  flex-direction: column;
}
.el-group.layout-row {
  flex-direction: row;
}
.el-group.layout-stack {
  position: relative;
}

/* ============================================
   Controls
   ============================================ */
#controls {
  height: var(--control-height);
  background: rgba(8, 9, 10, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  z-index: 100;
  transition: opacity 0.4s ease;
}
#controls.hidden {
  opacity: 0;
  pointer-events: none;
}

#controls button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}
#controls button:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

/* Progress bar */
#progress-wrap {
  flex: 1;
  height: 4px;
  background: var(--surface-elevated);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  margin: 0 8px;
}
#progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
  pointer-events: none;
}
#progress-input {
  position: absolute;
  inset: -8px 0;
  width: 100%;
  height: 20px;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
#progress-wrap:hover {
  height: 6px;
}

/* Time */
#time-display {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 80px;
  text-align: center;
  white-space: nowrap;
}

/* Scene indicator */
#scene-indicator {
  display: flex;
  gap: 4px;
  margin: 0 4px;
}
.scene-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background 0.3s, transform 0.3s;
  cursor: pointer;
}
.scene-dot.active {
  background: var(--primary);
  transform: scale(1.4);
}

/* Speed select */
#speed-select {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
}
#speed-select:hover { color: var(--text); }
#speed-select option { background: var(--surface); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .scene { padding: 40px 48px; }
  .size-xl { font-size: 3rem; }
  .size-lg { font-size: 2rem; }
  .el-counter { font-size: 3rem; }
  .el-cards.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .scene { padding: 24px 24px; }
  .size-xl { font-size: 2.2rem; }
  .size-lg { font-size: 1.6rem; }
  .size-md { font-size: 1.2rem; }
  .el-counter { font-size: 2.2rem; }
  .el-cards.cols-3,
  .el-cards.cols-4 { grid-template-columns: 1fr; }
  .el-cards.cols-2 { grid-template-columns: 1fr; }
  #scene-indicator { display: none; }
  #speed-select { display: none; }
}

/* ============================================
   Fullscreen
   ============================================ */
#presentation:fullscreen,
#presentation:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
}

/* ============================================
   Utilities
   ============================================ */
.glow-primary { text-shadow: 0 0 40px rgba(34, 211, 238, 0.3); }
.glow-secondary { text-shadow: 0 0 40px rgba(245, 158, 11, 0.3); }

/* ============================================
   Version Selector
   ============================================ */
#version-selector {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.vs-container {
  width: 100%;
  max-width: 800px;
  padding: 60px 32px;
}

.vs-header {
  text-align: center;
  margin-bottom: 48px;
}

.vs-logo {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  text-shadow: 0 0 40px rgba(34, 211, 238, 0.25);
  margin-bottom: 8px;
}

.vs-subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.vs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vs-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.vs-card:hover {
  border-color: var(--primary);
  background: var(--surface-elevated);
  transform: translateY(-2px);
}

.vs-card-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
}
.vs-card:hover .vs-card-number {
  color: var(--primary);
}

.vs-card-body {
  flex: 1;
  min-width: 0;
}

.vs-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vs-card-date {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.vs-card-play {
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
}
.vs-card:hover .vs-card-play {
  color: var(--primary);
  transform: scale(1.2);
}

.vs-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 60px 0;
}

/* ── Stage logo (top-right on all scenes) ── */
#stage-logo {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 150;
  height: 28px;
  width: auto;
  opacity: 0.8;
  pointer-events: none;


/* ── Responsive version selector ── */
@media (max-width: 640px) {
  .vs-container { padding: 32px 16px; }
  .vs-logo { font-size: 1.8rem; }
  .vs-card { padding: 16px; gap: 12px; }
  .vs-card-number { font-size: 1.2rem; min-width: 30px; }
  .vs-card-date { display: none; }
}
