/* ==========================================================================
   MUNKU — SIX YEARS, INFINITE UNIVERSES
   Cinematic Editorial Stylesheet
   ========================================================================== */

:root {
  /* Core Cinematic Color Palette */
  --color-void: #08060B;
  --color-midnight: #100911;
  --color-burgundy: #55152F;
  --color-wine: #791C43;
  --color-rose: #D85B8A;
  --color-blush: #F1B7CD;
  --color-champagne: #E9C98C;
  --color-ivory: #FFF5F8;

  /* Alpha Variants for Layers and Glass */
  --glass-bg: rgba(16, 9, 17, 0.72);
  --glass-border: rgba(233, 201, 140, 0.18);
  --glass-glow: rgba(216, 91, 138, 0.25);
  --gold-glow: rgba(233, 201, 140, 0.4);

  /* Typography */
  --font-display: 'Cinzel', 'Times New Roman', Georgia, serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Montserrat', system-ui, -apple-system, sans-serif;

  /* Motion & Easing */
  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-transition: 1000ms;
  --duration-subtle: 400ms;

  /* Viewport dimension helper */
  --app-height: 100vh;
}

@supports (height: 100dvh) {
  :root {
    --app-height: 100dvh;
  }
}

/* --------------------------------------------------------------------------
   Reset & Base Document Setup
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: var(--app-height);
  background-color: var(--color-void);
  color: var(--color-ivory);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.6;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Accessible focus styling */
:focus-visible {
  outline: 2px solid var(--color-champagne);
  outline-offset: 4px;
}

/* Accessibility skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--color-burgundy);
  color: var(--color-ivory);
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  z-index: 1000;
  border-radius: 4px;
  transition: top 0.3s ease;
  text-decoration: none;
}
.skip-link:focus {
  top: 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Atmospheric Layers: Canvas, Grain & Vignette
   -------------------------------------------------------------------------- */
.universe-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: var(--app-height);
  z-index: 1;
  pointer-events: none;
}

.ambient-glow-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(85, 21, 47, 0.22) 0%, transparent 65%),
    radial-gradient(circle at 20% 80%, rgba(121, 28, 67, 0.16) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(216, 91, 138, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at center, transparent 40%, rgba(8, 6, 11, 0.88) 100%);
  mix-blend-mode: screen;
  transition: opacity 1.2s ease;
}

.film-grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Transitions Overlay Layer
   -------------------------------------------------------------------------- */
.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  overflow: hidden;
}

.iris-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250vmax;
  height: 250vmax;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-void) 65%, var(--color-burgundy) 100%);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform var(--duration-transition) var(--ease-cinematic), opacity var(--duration-transition) ease;
}

.transition-overlay.active-iris .iris-circle {
  transform: translate(-50%, -50%) scale(1.1);
  opacity: 1;
}

.light-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(233, 201, 140, 0.8) 0%, rgba(216, 91, 138, 0.5) 40%, transparent 80%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.transition-overlay.active-flash .light-flash {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Cinematic Top Bar UI
   -------------------------------------------------------------------------- */
.experience-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(8, 6, 11, 0.8) 0%, rgba(8, 6, 11, 0) 100%);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-monogram {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--color-champagne);
  padding: 4px 8px;
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  background: rgba(233, 201, 140, 0.05);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--color-ivory);
  opacity: 0.85;
}

.brand-divider {
  color: var(--color-rose);
  margin: 0 4px;
}

.brand-sub {
  color: var(--color-blush);
  font-weight: 400;
  font-size: 11px;
}

/* Chapter Progress Nodes */
.scene-progress {
  display: flex;
  align-items: center;
}

.progress-track {
  display: flex;
  list-style: none;
  gap: 16px;
  align-items: center;
}

.progress-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.progress-node:hover {
  opacity: 0.75;
}

.progress-node.active {
  opacity: 1;
  transform: scale(1.08);
}

.progress-node .node-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-ivory);
  transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}

.progress-node.active .node-dot {
  background: var(--color-champagne);
  box-shadow: 0 0 10px var(--color-champagne), 0 0 18px var(--color-rose);
  transform: scale(1.3);
}

.progress-node .node-label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--color-ivory);
}

.progress-node.active .node-label {
  color: var(--color-champagne);
  font-weight: 700;
}

/* Header Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ui-button-icon {
  background: rgba(16, 9, 17, 0.4);
  border: 1px solid var(--glass-border);
  color: var(--color-ivory);
  height: 34px;
  padding: 0 14px;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ui-button-icon:hover {
  background: rgba(85, 21, 47, 0.35);
  border-color: var(--color-rose);
  box-shadow: 0 0 12px rgba(216, 91, 138, 0.25);
  color: var(--color-champagne);
}

/* Sound Wave Equalizer Icon */
.sound-wave {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 12px;
}

.sound-wave .bar {
  width: 2px;
  height: 3px;
  background: var(--color-champagne);
  border-radius: 1px;
  transition: height 0.25s ease;
}

.playing .sound-wave .bar:nth-child(1) {
  animation: sound-bar 0.9s infinite ease-in-out alternate;
}
.playing .sound-wave .bar:nth-child(2) {
  animation: sound-bar 1.2s infinite ease-in-out 0.2s alternate;
}
.playing .sound-wave .bar:nth-child(3) {
  animation: sound-bar 0.8s infinite ease-in-out 0.4s alternate;
}
.playing .sound-wave .bar:nth-child(4) {
  animation: sound-bar 1.1s infinite ease-in-out 0.1s alternate;
}

@keyframes sound-bar {
  0% { height: 3px; }
  100% { height: 12px; }
}

/* --------------------------------------------------------------------------
   Scene Architecture & Viewport
   -------------------------------------------------------------------------- */
.experience-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: var(--app-height);
  overflow: hidden;
  z-index: 10;
}

.scene-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 76px 20px 90px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.97);
  transition: opacity 0.8s var(--ease-soft), transform 0.8s var(--ease-cinematic), visibility 0.8s;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--color-rose) rgba(8, 6, 11, 0.4);
  -webkit-overflow-scrolling: touch;
}

.scene-container::-webkit-scrollbar {
  width: 5px;
}
.scene-container::-webkit-scrollbar-thumb {
  background: var(--color-rose);
  border-radius: 4px;
}

.scene-container.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
  z-index: 20;
}

.scene-content {
  width: 100%;
  max-width: 1100px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 22;
  min-height: min-content;
  padding: 10px 0 30px;
}

/* Chapter Eyebrow Tag */
.chapter-tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--color-champagne);
  margin-bottom: 24px;
  opacity: 0.85;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(233, 201, 140, 0.08);
  border: 1px solid rgba(233, 201, 140, 0.16);
}

/* --------------------------------------------------------------------------
   Buttons & Interactive Elements
   -------------------------------------------------------------------------- */
.btn-celestial {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(85, 21, 47, 0.45) 0%, rgba(16, 9, 17, 0.8) 100%);
  border: 1px solid var(--color-champagne);
  color: var(--color-ivory);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  padding: 16px 36px;
  border-radius: 30px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(121, 28, 67, 0.35), inset 0 0 14px rgba(233, 201, 140, 0.15);
  transition: all 0.4s var(--ease-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-celestial:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--color-blush);
  box-shadow: 0 0 35px rgba(216, 91, 138, 0.6), inset 0 0 20px rgba(233, 201, 140, 0.3);
  color: var(--color-champagne);
}

.btn-celestial:active {
  transform: translateY(0) scale(0.98);
}

.btn-celestial-sm {
  background: rgba(85, 21, 47, 0.6);
  border: 1px solid var(--color-champagne);
  color: var(--color-ivory);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 2px;
  padding: 9px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-celestial-sm:hover {
  background: var(--color-wine);
  box-shadow: 0 0 15px var(--glass-glow);
  color: var(--color-champagne);
}

.btn-subtle {
  background: transparent;
  border: none;
  color: var(--color-blush);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 2px;
  padding: 8px 16px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.btn-subtle:hover {
  opacity: 1;
  color: var(--color-champagne);
}

.btn-arrow {
  font-size: 15px;
  transition: transform 0.3s ease;
}

.btn-celestial:hover .btn-arrow {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   CHAPTER 1: THE VOID
   -------------------------------------------------------------------------- */
.scene-void {
  min-height: 70vh;
}

/* Central Singularity Point of Light */
.singularity-point {
  position: relative;
  width: 40px;
  height: 40px;
  margin-bottom: 40px;
}

.singularity-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px #fff, 0 0 25px var(--color-champagne), 0 0 45px var(--color-rose);
  animation: singularity-pulse 4s infinite ease-in-out;
}

.singularity-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 201, 140, 0.4) 0%, rgba(216, 91, 138, 0.15) 45%, transparent 70%);
  transform: translate(-50%, -50%);
  animation: halo-breathe 6s infinite ease-in-out alternate;
}

.singularity-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(233, 201, 140, 0.7), transparent);
  transform: translate(-50%, -50%);
  animation: ray-spin 18s infinite linear;
}

@keyframes singularity-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  50% { transform: translate(-50%, -50%) scale(1.6); opacity: 1; box-shadow: 0 0 18px #fff, 0 0 35px var(--color-champagne), 0 0 65px var(--color-rose); }
}

@keyframes halo-breathe {
  0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(1.25); opacity: 0.85; }
}

@keyframes ray-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.text-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.4s var(--ease-soft), transform 1.4s var(--ease-cinematic);
}

.void-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 6px;
  color: var(--color-blush);
  opacity: 0.8;
  margin-bottom: 16px;
}

.void-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 700;
  letter-spacing: clamp(8px, 2vw, 18px);
  color: var(--color-ivory);
  text-shadow: 0 0 25px rgba(233, 201, 140, 0.3), 0 0 60px rgba(216, 91, 138, 0.25);
  margin-bottom: 24px;
}

.void-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.8vw, 1.6rem);
  font-weight: 300;
  font-style: italic;
  color: var(--color-blush);
  max-width: 650px;
  margin: 0 auto 42px;
  line-height: 1.5;
}

.skip-intro-btn {
  margin-top: 36px;
}

/* --------------------------------------------------------------------------
   CHAPTER 2: THE BEGINNING OF US
   -------------------------------------------------------------------------- */
.scene-beginning {
  max-width: 800px;
}

.poetry-lines {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 40px 0 54px;
}

.poetry-line {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3.4vw, 2.2rem);
  font-weight: 300;
  color: var(--color-ivory);
  line-height: 1.45;
  overflow: hidden;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.1s var(--ease-soft), transform 1.1s var(--ease-cinematic);
}

.poetry-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.poetry-line.accent-line {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--color-champagne);
  text-shadow: 0 0 25px rgba(233, 201, 140, 0.4);
}

/* --------------------------------------------------------------------------
   CHAPTER 3: SIX CHAPTERS, ONE STORY (CONSTELLATION)
   -------------------------------------------------------------------------- */
.scene-constellation {
  width: 100%;
  max-width: 1140px;
  height: 100%;
  justify-content: space-between;
  padding: 10px 0 20px;
}

.constellation-header {
  margin-bottom: 12px;
}

.constellation-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--color-ivory);
  margin-bottom: 6px;
}

.constellation-subtitle {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  color: var(--color-blush);
  font-style: italic;
  margin-bottom: 8px;
}

.constellation-counter {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--color-champagne);
}

.counter-val {
  font-weight: 700;
  color: #ffffff;
  padding: 0 2px;
}

/* Constellation Canvas & SVG Map */
.constellation-canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 950px;
  height: clamp(300px, 46vh, 460px);
  margin: 0 auto;
  border-radius: 12px;
  overflow: visible;
}

.constellation-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 15px rgba(85, 21, 47, 0.4));
}

/* SVG Constellation lines */
.constellation-lines line {
  stroke: rgba(233, 201, 140, 0.4);
  stroke-width: 1.5;
  stroke-dasharray: 8, 4;
  animation: dash-flow 25s linear infinite;
  transition: stroke 0.4s ease, stroke-width 0.4s ease;
}

.constellation-lines line.active-line {
  stroke: var(--color-rose);
  stroke-width: 2.5;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 8px var(--color-rose));
}

@keyframes dash-flow {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 200; }
}

/* Star Node Styling */
.star-node {
  cursor: pointer;
  outline: none;
  transition: transform 0.3s var(--ease-bounce);
}

.star-node:focus-visible circle {
  stroke: #ffffff;
  stroke-width: 2.5px;
}

.star-pulse-ring {
  fill: none;
  stroke: var(--color-rose);
  stroke-width: 1;
  opacity: 0.6;
  animation: star-pulse 3s infinite ease-out;
  transform-origin: center;
}

.star-core {
  fill: var(--color-ivory);
  transition: fill 0.3s ease, filter 0.3s ease;
}

.star-node:hover .star-core,
.star-node.visited .star-core {
  fill: var(--color-champagne);
  filter: drop-shadow(0 0 8px var(--color-champagne));
}

.star-node:hover .star-pulse-ring {
  stroke: var(--color-champagne);
  animation-duration: 1.2s;
}

.star-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  fill: var(--color-ivory);
  text-anchor: middle;
  pointer-events: none;
  transition: fill 0.3s ease;
}

.star-node:hover .star-label {
  fill: var(--color-champagne);
}

@keyframes star-pulse {
  0% { r: 6; opacity: 0.8; }
  100% { r: 24; opacity: 0; }
}

/* Star Detail Modal Window */
.star-detail-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 90%;
  max-width: 480px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s var(--ease-cinematic);
}

.star-detail-modal:not([hidden]) {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.star-modal-glass {
  background: rgba(16, 9, 17, 0.88);
  border: 1px solid var(--color-champagne);
  box-shadow: 0 0 40px rgba(85, 21, 47, 0.7), 0 0 80px rgba(0, 0, 0, 0.9);
  border-radius: 12px;
  padding: 32px 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
}

.star-modal-decor {
  font-size: 16px;
  color: var(--color-champagne);
  margin-bottom: 8px;
  text-shadow: 0 0 10px var(--color-champagne);
}

.star-modal-year {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--color-blush);
  text-transform: uppercase;
}

.star-modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 2px;
  color: var(--color-champagne);
  margin: 6px 0 12px;
}

.star-modal-divider {
  width: 40px;
  height: 1px;
  background: var(--color-rose);
  margin: 0 auto 16px;
}

.star-modal-message {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--color-ivory);
  margin-bottom: 24px;
}

.star-modal-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.constellation-footer {
  margin-top: 10px;
}

/* --------------------------------------------------------------------------
   CHAPTER 4: SIX THINGS I WANT YOU TO KNOW (DECLARATIONS)
   -------------------------------------------------------------------------- */
.scene-declarations {
  max-width: 900px;
  width: 100%;
}

.declarations-stage {
  width: 100%;
  margin: 20px 0 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.declaration-item-wrapper {
  position: relative;
  width: 100%;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.declaration-index-number {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--color-blush);
  margin-bottom: 24px;
  opacity: 0.7;
}

.declaration-card {
  position: relative;
  width: 100%;
  padding: 30px 24px;
}

.beam-light-effect {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 380px;
  height: 180px;
  background: radial-gradient(ellipse, rgba(216, 91, 138, 0.18) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: blur(20px);
}

.declaration-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.7rem);
  font-weight: 300;
  line-height: 1.4;
  color: var(--color-ivory);
  max-width: 760px;
  margin: 0 auto;
  opacity: 1;
  transition: opacity 0.5s var(--ease-soft), transform 0.5s var(--ease-cinematic), filter 0.5s ease;
}

.declaration-quote.fade-out {
  opacity: 0;
  transform: scale(0.96) translateY(-10px);
  filter: blur(6px);
}

.declarations-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
}

.declaration-dots {
  display: flex;
  gap: 10px;
}

.decl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--color-blush);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.decl-dot.active {
  background: var(--color-champagne);
  border-color: var(--color-champagne);
  box-shadow: 0 0 10px var(--color-champagne);
  transform: scale(1.25);
}

.declarations-footer {
  margin-top: 15px;
  min-height: 52px;
}

/* --------------------------------------------------------------------------
   CHAPTER 5: THE LETTER I MADE FOR YOU
   -------------------------------------------------------------------------- */
.scene-letter {
  max-width: 850px;
  width: 100%;
  height: 100%;
  justify-content: flex-start;
  padding-top: 72px;
}

.letter-experience-wrap {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

/* 3D Envelope Stage */
.envelope-3d-stage {
  perspective: 1200px;
  width: 100%;
  max-width: 440px;
  height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.envelope-object {
  position: relative;
  width: 320px;
  height: 210px;
  background: #3a101f;
  border-radius: 4px;
  transform-style: preserve-3d;
  cursor: pointer;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.7), 0 0 30px rgba(121, 28, 67, 0.3);
  transition: transform 0.5s var(--ease-soft);
}

.envelope-object:hover {
  transform: translateY(-5px);
}

.envelope-shadow {
  position: absolute;
  bottom: -25px;
  left: 5%;
  width: 90%;
  height: 20px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.6) 0%, transparent 75%);
  filter: blur(6px);
}

.envelope-back {
  position: absolute;
  inset: 0;
  background: #280a15;
  border-radius: 4px;
}

/* Inside Letter Preview */
.letter-sheet-inside {
  position: absolute;
  bottom: 8px;
  left: 14px;
  width: 292px;
  height: 190px;
  background: #fff8eb;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  transform: translateY(0);
  transition: transform 0.9s var(--ease-cinematic);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.letter-preview-lines span {
  display: block;
  height: 3px;
  background: rgba(85, 21, 47, 0.2);
  border-radius: 2px;
  margin-bottom: 8px;
}
.letter-preview-lines span:nth-child(1) { width: 60%; }
.letter-preview-lines span:nth-child(2) { width: 90%; }
.letter-preview-lines span:nth-child(3) { width: 75%; }

/* Envelope Folded Pocket Wings (Left, Right, Bottom) */
.envelope-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 105px 0 105px 160px;
  border-color: transparent transparent transparent #4a1327;
  z-index: 3;
}

.envelope-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 105px 160px 105px 0;
  border-color: transparent #431123 transparent transparent;
  z-index: 3;
}

.envelope-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 160px 120px 160px;
  border-color: transparent transparent #55152F transparent;
  z-index: 4;
}

/* Envelope Top Flap */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 125px 160px 0 160px;
  border-color: #631937 transparent transparent transparent;
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform 0.8s var(--ease-cinematic), z-index 0.8s;
  z-index: 5;
}

/* Opened State of Envelope Flap */
.envelope-object.opened .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

.envelope-object.opened .letter-sheet-inside {
  transform: translateY(-90px);
}

/* Luxury Wax Seal */
.wax-seal {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f1b7cd 0%, #d85b8a 50%, #791c43 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.6), inset 0 2px 4px rgba(255,255,255,0.4), inset 0 -3px 6px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  cursor: pointer;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.wax-seal-emboss {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.seal-letter {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-champagne);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.seal-sub {
  font-size: 7px;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--color-ivory);
}

.envelope-object.opened .wax-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.6);
  pointer-events: none;
}

.envelope-prompt {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.envelope-hint {
  font-size: 12px;
  color: var(--color-blush);
  letter-spacing: 1px;
  opacity: 0.7;
}

/* Full Letter Parchment View */
.letter-parchment-container {
  width: 100%;
  max-width: 720px;
  max-height: 72vh;
  max-height: calc(var(--app-height) - 160px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 30px;
  margin: 0 auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-rose) rgba(8, 6, 11, 0.4);
}

.letter-parchment-container::-webkit-scrollbar {
  width: 5px;
}
.letter-parchment-container::-webkit-scrollbar-thumb {
  background: var(--color-rose);
  border-radius: 4px;
}

.parchment-card {
  background: linear-gradient(175deg, #170d18 0%, #120914 100%);
  border: 1px solid rgba(233, 201, 140, 0.25);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 50px rgba(85, 21, 47, 0.4);
  padding: clamp(28px, 5vw, 50px);
  text-align: left;
  position: relative;
}

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

.letter-crest {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--color-champagne);
}

.letter-date {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--color-blush);
}

.parchment-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 201, 140, 0.4), transparent);
  margin-bottom: 28px;
}

.parchment-body {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  line-height: 1.85;
  color: var(--color-ivory);
}

.parchment-body p {
  margin-bottom: 22px;
}

.parchment-body p:first-of-type {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  color: var(--color-champagne);
  letter-spacing: 2px;
}

.parchment-footer {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.letter-closing {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--color-champagne);
}

.parchment-seal-impression {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 2px;
  padding: 6px 12px;
  border: 1px dashed rgba(233, 201, 140, 0.4);
  color: var(--color-blush);
}

.letter-next-action {
  margin-top: 40px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   CHAPTER 6: IN EVERY UNIVERSE (FINALE)
   -------------------------------------------------------------------------- */
.scene-finale {
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 0 50px;
}

.finale-heart-stage {
  position: relative;
  width: clamp(170px, 30vw, 290px);
  height: clamp(170px, 30vw, 290px);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.finale-heart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 16px var(--color-rose)) drop-shadow(0 0 35px var(--color-wine));
}

.finale-heart-path {
  stroke-dasharray: 1800;
  stroke-dashoffset: 1800;
  transition: stroke-dashoffset 3.2s var(--ease-cinematic);
}

.scene-finale.ignited .finale-heart-path {
  stroke-dashoffset: 0;
  animation: heart-glow-breathe 4s infinite alternate ease-in-out;
}

@keyframes heart-glow-breathe {
  0% { stroke-width: 3; filter: drop-shadow(0 0 12px var(--color-rose)); }
  100% { stroke-width: 4.5; filter: drop-shadow(0 0 28px var(--color-champagne)) drop-shadow(0 0 50px var(--color-wine)); }
}

.heart-pulse-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.scene-finale.ignited .heart-pulse-glow {
  opacity: 1;
}

.glow-burgundy {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(85, 21, 47, 0.45) 0%, transparent 70%);
}

.glow-rose {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(216, 91, 138, 0.3) 0%, transparent 65%);
}

.glow-champagne {
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(233, 201, 140, 0.35) 0%, transparent 60%);
}

/* 6 Anchored Star Nodes forming the constellation heart */
.heart-star-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orbit-star {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 10px #fff, 0 0 20px var(--color-champagne);
  opacity: 0;
  transform: scale(0);
  transition: all 1s var(--ease-bounce);
}

.scene-finale.ignited .orbit-star {
  opacity: 1;
  transform: scale(1);
}

.orbit-star.star-1 { top: 30%; left: 50%; }
.orbit-star.star-2 { top: 20%; left: 32%; }
.orbit-star.star-3 { top: 20%; left: 68%; }
.orbit-star.star-4 { top: 48%; left: 16%; }
.orbit-star.star-5 { top: 48%; left: 84%; }
.orbit-star.star-6 { bottom: 15%; left: 50%; }

/* Finale Typography Stages */
.finale-message-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 820px;
}

.finale-line {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.2s var(--ease-soft), transform 1.2s var(--ease-cinematic);
}

.finale-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.line-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--color-blush);
}

.line-hero {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 8px;
  color: var(--color-ivory);
  text-shadow: 0 0 25px rgba(233, 201, 140, 0.4), 0 0 50px rgba(216, 91, 138, 0.3);
}

.line-sub {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  font-style: italic;
  color: var(--color-blush);
}

.line-pre-climax {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 6px;
  color: var(--color-champagne);
  margin-top: 14px;
}

.line-climax {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.8vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ffffff 0%, #E9C98C 50%, #D85B8A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 25px rgba(233, 201, 140, 0.5));
  margin-bottom: 24px;
}

.finale-actions {
  margin-top: 26px;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
  z-index: 30;
  width: 100%;
}

/* --------------------------------------------------------------------------
   CHAPTER 7: OUR FUTURE (PROPOSAL & ZULU LOVE DECLARATION)
   -------------------------------------------------------------------------- */
.scene-proposal {
  max-width: 860px;
  width: 100%;
}

.proposal-card {
  background: rgba(16, 9, 17, 0.84);
  border: 1px solid var(--glass-border);
  box-shadow: 0 0 50px rgba(85, 21, 47, 0.6), 0 0 100px rgba(0, 0, 0, 0.95);
  border-radius: 16px;
  padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 44px);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.6s var(--ease-soft);
}

.proposal-decor {
  font-size: 16px;
  color: var(--color-champagne);
  letter-spacing: 4px;
  margin-bottom: 20px;
  text-shadow: 0 0 12px var(--color-champagne);
}

.proposal-question {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.8vw, 2.45rem);
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1.45;
  color: var(--color-ivory);
  max-width: 720px;
  margin-bottom: 34px;
  text-shadow: 0 0 30px rgba(233, 201, 140, 0.35);
}

.proposal-buttons {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.proposal-btn {
  min-width: 150px;
}

.btn-secondary-celestial {
  background: rgba(16, 9, 17, 0.7);
  border-color: rgba(233, 201, 140, 0.35);
  color: var(--color-blush);
  box-shadow: none;
}

.btn-secondary-celestial:hover {
  border-color: var(--color-rose);
  color: var(--color-champagne);
  box-shadow: 0 0 20px rgba(216, 91, 138, 0.4);
}

/* Playful reaction message when clicking "Not yet" */
.proposal-playful-reaction {
  margin: 12px 0 22px;
  padding: 10px 24px;
  background: rgba(85, 21, 47, 0.45);
  border: 1px dashed var(--color-rose);
  border-radius: 30px;
  animation: playful-pop 0.6s var(--ease-bounce);
}

.playful-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--color-champagne);
  text-shadow: 0 0 12px rgba(233, 201, 140, 0.4);
}

@keyframes playful-pop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Final Love Declaration: "Ngiyak'Thanda Sthandwa sam yezwa" */
.proposal-final-message {
  margin-top: 15px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: final-message-glow 1.4s var(--ease-soft) forwards;
}

.final-message-divider {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-champagne), transparent);
  margin-bottom: 24px;
}

.zulu-love-declaration {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.8vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #ffffff 0%, #E9C98C 50%, #D85B8A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(233, 201, 140, 0.55)) drop-shadow(0 0 50px rgba(216, 91, 138, 0.4));
  line-height: 1.35;
  margin-bottom: 12px;
}

.final-love-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--color-blush);
  margin-bottom: 28px;
}

.proposal-replay-action {
  margin-top: 8px;
}

@keyframes final-message-glow {
  0% { opacity: 0; transform: translateY(20px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* --------------------------------------------------------------------------
   Responsive Layout Adaptations (Mobile-First)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .experience-header {
    padding: 12px 16px;
  }

  .brand-title {
    font-size: 11px;
    letter-spacing: 2px;
  }

  .scene-progress {
    display: none; /* Hide progress dots in very narrow viewports to avoid header clutter */
  }

  .scene-container {
    padding: 70px 16px 20px;
  }

  .constellation-canvas-wrapper {
    height: 320px;
  }

  .star-modal-glass {
    padding: 24px 18px;
  }

  .star-modal-title {
    font-size: 1.15rem;
  }

  .star-modal-message {
    font-size: 1rem;
    line-height: 1.5;
  }

  .declaration-quote {
    font-size: 1.45rem;
  }

  .envelope-object {
    width: 270px;
    height: 180px;
  }

  .envelope-left {
    border-width: 90px 0 90px 135px;
  }

  .envelope-right {
    border-width: 90px 135px 90px 0;
  }

  .envelope-bottom {
    border-width: 0 135px 105px 135px;
  }

  .envelope-flap {
    border-width: 110px 135px 0 135px;
  }

  .letter-sheet-inside {
    width: 242px;
    height: 160px;
  }

  .wax-seal {
    top: 95px;
    width: 42px;
    height: 42px;
  }

  .parchment-card {
    padding: 22px 18px;
  }

  .parchment-body {
    font-size: 1.05rem;
    line-height: 1.65;
  }
}

/* --------------------------------------------------------------------------
   Reduced Motion Preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .universe-canvas {
    opacity: 0.35;
  }
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
