/* === Variables === */
:root {
  --bg: #000000;
  --text: #f5f5f7;
  --text-secondary: rgba(245, 245, 247, 0.6);
  --text-tertiary: rgba(245, 245, 247, 0.35);
  --accent: #2997ff;
  --accent-soft: rgba(41, 151, 255, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --glass-blur: 40px;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 20px;
  --radius-sm: 12px;
  --slide-transition: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* === Animated Gradient Mesh Background === */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-mesh::before,
.bg-mesh::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}

.bg-mesh::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(41, 151, 255, 0.4) 0%, transparent 70%);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}

.bg-mesh::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, transparent 70%);
  bottom: -10%;
  left: -5%;
  animation-delay: -10s;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.2;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.4) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: float 25s ease-in-out infinite;
  animation-delay: -5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 35px) scale(1.02); }
}

/* === Slide Container === */
.slide-container {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* === Slide === */
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 4rem 5rem;
  opacity: 0;
  transform: scale(0.97) translateY(10px);
  transition: opacity var(--slide-transition), transform var(--slide-transition);
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.slide.exit-left {
  opacity: 0;
  transform: scale(0.97) translateY(-10px);
}

/* === Glass Card === */
.slide-inner {
  max-width: 900px;
  max-height: calc(100vh - 8rem);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 3rem 3.5rem;
  position: relative;
  overflow: hidden;
}

/* Prismatic top edge — the signature Liquid Glass refraction */
.slide-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 10%,
    rgba(41, 151, 255, 0.3) 25%,
    rgba(168, 85, 247, 0.3) 40%,
    rgba(236, 72, 153, 0.3) 55%,
    rgba(52, 211, 153, 0.3) 70%,
    rgba(41, 151, 255, 0.3) 85%,
    rgba(255, 255, 255, 0.1) 90%,
    transparent 100%
  );
}

/* Inner glow */
.slide-inner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02) 0%,
    transparent 100%
  );
  pointer-events: none;
}

/* === Slide Header === */
.slide-header {
  text-align: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.slide-number {
  position: absolute;
  bottom: 1rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  opacity: 0.4;
}

.slide-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.025em;
}

.slide-title .accent {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === Bullets === */
.slide-bullets {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  z-index: 1;
}

.slide-bullets li {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.6;
  color: var(--text-secondary);
  padding-left: 1.5rem;
  position: relative;
  font-weight: 400;
}

.slide-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

/* === SVG Graphic === */
.slide-graphic {
  width: 100%;
  max-width: 650px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  padding: 0.5rem 0;
}

.slide-graphic svg {
  width: 100%;
  height: auto;
  max-height: 320px;
}

/* === Step Reveal (sub-slide animation) === */
.step-1, .step-2, .step-3 {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.step-1.visible, .step-2.visible, .step-3.visible {
  opacity: 1;
}

/* === Nav Indicator Dots === */
.nav-dots {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 0.5rem 0.75rem;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.nav-dot:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.2);
}

.nav-dot.active {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(41, 151, 255, 0.4);
  transform: scale(1.2);
}

/* === Notes Bar === */
.notes-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: rgba(20, 20, 20, 0.8);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-top: 1px solid var(--glass-border);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 40vh;
  overflow-y: auto;
}

.notes-bar.open {
  transform: translateY(0);
}

.notes-content {
  padding: 1.5rem 3rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto;
  font-weight: 400;
}

.notes-content p {
  margin: 0 0 0.75rem 0;
}

.notes-content p:last-child {
  margin-bottom: 0;
}

.notes-content ul,
.notes-content ol {
  margin: 0 0 0.75rem 0;
  padding-left: 1.5rem;
}

.notes-content li {
  margin-bottom: 0.3rem;
}

.notes-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(41, 151, 255, 0.4);
  transition: text-decoration-color 0.2s ease;
}

.notes-content a:hover {
  text-decoration-color: var(--accent);
}

/* === Notes Toggle Button === */
.notes-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 25;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.notes-toggle:hover {
  border-color: var(--glass-border-hover);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.notes-toggle.active {
  background: var(--accent-soft);
  border-color: rgba(41, 151, 255, 0.3);
  color: var(--accent);
}

/* === Keyboard Hint === */
.kbd-hint {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 10;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
}

kbd {
  display: inline-block;
  padding: 0.1em 0.4em;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.04);
}

/* === Hero Portrait (Slide 1) === */
.hero-portrait {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  width: 100%;
}

.hero-portrait--solo {
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.portrait-frame {
  flex-shrink: 0;
  width: 220px;
  height: 220px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  position: relative;
  box-shadow:
    0 0 40px rgba(41, 151, 255, 0.08),
    0 0 80px rgba(168, 85, 247, 0.05);
}

.portrait-frame--hero {
  width: min(580px, 90vw);
  height: auto;
  border-radius: 20px;
  flex-shrink: 1;
  min-height: 0;
  box-shadow:
    0 4px 60px rgba(41, 151, 255, 0.12),
    0 0 100px rgba(168, 85, 247, 0.06);
}

.portrait-frame--hero .portrait-img {
  max-height: 38vh;
  object-fit: contain;
}

.hero-quote.hero-quote--centered {
  border-left: none;
  padding-left: 0;
  text-align: center;
  max-width: 620px;
  font-style: italic;
}

/* Prismatic edge shimmer on the portrait */
.portrait-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 1px solid transparent;
  background: linear-gradient(
    135deg,
    rgba(41, 151, 255, 0.15) 0%,
    rgba(168, 85, 247, 0.15) 35%,
    rgba(236, 72, 153, 0.1) 55%,
    rgba(52, 211, 153, 0.1) 75%,
    transparent 100%
  ) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.portrait-img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(0.3) contrast(1.05);
}

.hero-quote {
  flex: 1;
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.7;
  color: var(--text-secondary);
  border-left: 2px solid rgba(41, 151, 255, 0.25);
  padding-left: 1.5rem;
  position: relative;
}

.hero-quote cite {
  display: block;
  margin-top: 0.6rem;
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.03em;
  opacity: 0.8;
}

/* === References Slide === */
.references-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reference-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  text-decoration: none;
  transition: all 0.25s ease;
}

.reference-item:hover {
  border-color: var(--glass-border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.reference-source {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0.8;
}

.reference-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}

.reference-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* === Debug Toggle & Panel === */
.debug-toggle {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 101;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s, background 0.2s;
  user-select: none;
}
.debug-toggle:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.debug-panel {
  position: fixed;
  top: 3rem;
  right: 0.75rem;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 320px;
  word-break: break-all;
  display: none;
}
.debug-panel.open {
  display: block;
}

.debug-panel .debug-label {
  color: var(--accent);
  font-weight: 500;
}

/* === Responsive === */
@media (max-width: 768px) {
  .slide {
    padding: 2rem 1.5rem 5rem;
  }

  .slide-inner {
    padding: 2rem 1.75rem;
    gap: 1.5rem;
    border-radius: var(--radius-sm);
  }

  .slide-graphic svg {
    max-height: 180px;
  }

  .hero-portrait {
    flex-direction: column;
    text-align: center;
  }

  .portrait-frame {
    width: 160px;
    height: 160px;
  }

  .portrait-frame--hero {
    width: min(420px, 85vw);
    height: auto;
  }

  .hero-quote {
    border-left: none;
    padding-left: 0;
    border-top: 2px solid rgba(41, 151, 255, 0.25);
    padding-top: 1rem;
  }

  .notes-content {
    padding: 1rem 1.5rem;
  }

  .kbd-hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .slide {
    padding: 1.5rem 1rem 5rem;
  }

  .slide-inner {
    padding: 1.5rem 1.25rem;
  }

  .nav-dots {
    bottom: 1.25rem;
  }

  .notes-toggle {
    bottom: 1.25rem;
    right: 1.25rem;
  }
}
