/* ========================================
   TASYA JOURNEY — Custom Styles
   Design system, animations, scene-specific
   ======================================== */

/* --- Google Fonts are loaded in HTML --- */

/* ========== CSS Custom Properties ========== */
:root {
  --bg-primary: #FFF8F5;
  --bg-secondary: #FAF4F1;
  --bg-dark: #0f0f1a;
  --bg-dark-secondary: #1a1a2e;
  --accent-pink: #F5D7D7;
  --accent-rose: #D8A7A7;
  --text-primary: #2D2D2D;
  --text-secondary: #6B6B6B;
  --text-light: #e8e0dc;
  --text-light-secondary: #b0a8a4;
  --gold: #E9C46A;
  --gold-glow: rgba(233, 196, 106, 0.4);
  --white: #ffffff;
  --overlay: rgba(0, 0, 0, 0.6);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.14);
  --card-shadow-dark: 0 8px 32px rgba(0, 0, 0, 0.3);
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Lenis smooth scroll */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* ========== Typography ========== */
.font-heading {
  font-family: 'Dancing Script', cursive;
}

.font-body {
  font-family: 'Poppins', sans-serif;
}

.font-quote {
  font-family: 'Playfair Display', serif;
}

/* ========== Scene Base ========== */
.scene {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: clip; /* contains particles but allows internal scroll containers */
}

/* Scene locked state — collapsed and invisible until unlocked */
.scene--locked {
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  visibility: hidden;
  opacity: 0;
  padding: 0 !important;
  pointer-events: none;
}

/* Body scroll lock */
body.scroll-locked {
  overflow: hidden;
}

.scene--dark {
  background: var(--bg-dark);
  color: var(--text-light);
}

.scene--light {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.scene--cream {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Scene particles container */
.scene__particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.scene__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  padding: 2rem 1.25rem;
}

/* ========== Scene 0 — Loading ========== */
#scene-0 {
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
  position: fixed;
  inset: 0;
  z-index: 9999;
  transition: opacity 0.8s var(--transition-smooth), visibility 0.8s;
}

#scene-0.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__logo {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--gold);
  text-align: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s var(--transition-smooth), transform 0.6s var(--transition-bounce);
}

.loader__logo.visible {
  opacity: 1;
  transform: scale(1);
}

.loader__bar-container {
  width: min(80%, 320px);
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  margin-top: 2rem;
  overflow: hidden;
}

.loader__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--accent-rose));
  border-radius: 999px;
  transition: width 0.3s var(--transition-smooth);
}

.loader__text {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-light-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-height: 1.4em;
}

/* ========== Scene 1 — Opening ========== */
#scene-1 {
  background: linear-gradient(180deg, #0a0a1a 0%, #0f0f2a 40%, #1a1a3e 100%);
  min-height: 100vh;
  padding: 0;
}

.opening__text {
  max-width: 600px;
  text-align: center;
  padding: 0 1.5rem;
}

.opening__text p {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 1rem;
  opacity: 0;
}

.opening__text p.visible {
  opacity: 1;
}

/* Typewriter cursor */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--gold);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.btn-begin {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding: 1rem 2.5rem;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--bg-dark);
  background: linear-gradient(135deg, var(--gold), #f0d67b);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s var(--transition-smooth);
  box-shadow: 0 4px 24px var(--gold-glow);
  min-width: 44px;
  min-height: 44px;
}

.btn-begin.visible {
  opacity: 1;
  transform: translateY(0);
}

.btn-begin:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--gold-glow);
}

.btn-begin:active {
  transform: translateY(0) scale(0.97);
}

/* ========== Scene 2 — The Beginning (Timeline) ========== */
#scene-2 {
  background: var(--bg-primary);
  min-height: 100vh;
}

.timeline-container {
  position: relative;
  padding: 3rem 0;
}

.timeline__line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-rose), var(--gold), var(--accent-rose), transparent);
  transform: translateY(-50%);
}

.timeline__scroll {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2rem 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Right fade gradient to hint more content */
  mask-image: linear-gradient(to right, black 0%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 0%, black 85%, transparent 100%);
  cursor: grab;
}

.timeline__scroll.active-drag {
  cursor: grabbing;
}

.timeline__scroll.scrolled-end {
  mask-image: linear-gradient(to left, black 0%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to left, black 0%, black 85%, transparent 100%);
}

.timeline__scroll.scrolled-mid {
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 85%, transparent 100%);
}

.timeline__scroll::-webkit-scrollbar {
  display: none;
}

.timeline__card {
  flex: 0 0 min(85vw, 320px);
  scroll-snap-align: center;
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transform: translateY(40px);
  opacity: 0;
  transition: transform 0.6s var(--transition-smooth), opacity 0.6s var(--transition-smooth), box-shadow 0.3s;
  user-select: none;
  -webkit-user-drag: none;
}

.timeline__card.in-view {
  transform: translateY(0);
  opacity: 1;
}

.timeline__card:hover {
  box-shadow: var(--card-shadow-hover);
}

.timeline__card-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--accent-pink);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.timeline__card-illustration {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px 20px 0 0;
  user-select: none;
  -webkit-user-drag: none;
}

.timeline__card-ill-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #FFF0F0, #FFF9F5, #FFE4E4);
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
  z-index: 0;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.timeline__card-ill-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
}

.timeline__card-ill-date {
  font-size: 0.75rem;
  color: var(--accent-rose);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.timeline__card-ill-icon {
  margin: 0.25rem 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline__card-ill-icon svg {
  width: 32px;
  height: 32px;
  color: var(--accent-rose);
  animation: floatFlower 3s ease-in-out infinite;
  stroke-width: 1.5px;
}

@keyframes floatFlower {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(8deg); }
}

.timeline__card-ill-subtitle {
  font-family: 'Dancing Script', cursive;
  font-size: 1.6rem;
  color: var(--text-primary);
}

.timeline__card-body {
  padding: 1.25rem;
}

.timeline__card-date {
  font-size: 0.75rem;
  color: var(--accent-rose);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.timeline__card-title {
  font-family: 'Dancing Script', cursive;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.timeline__card-story {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Swipe Hint */
.timeline__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  transition: opacity 0.5s var(--transition-smooth);
}

.timeline__hint.hidden {
  opacity: 0;
  pointer-events: none;
}

.timeline__hint-text {
  font-size: 0.8rem;
  color: var(--accent-rose);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.timeline__hint-arrow {
  display: inline-block;
  font-size: 1.1rem;
  color: var(--gold);
  animation: swipeArrow 1.2s ease-in-out infinite;
}

@keyframes swipeArrow {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(8px); opacity: 0.6; }
}

/* ========== Scene 3 — Adventures (Map) ========== */
#scene-3 {
  background: var(--bg-secondary);
  padding: 4rem 0;
}

.adventures__map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.adventure-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform 0.3s var(--transition-bounce);
  min-height: 44px;
}

.adventure-node:hover {
  transform: scale(1.08);
}

.adventure-node__icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--white);
  border: 3px solid var(--accent-pink);
  border-radius: 50%;
  box-shadow: var(--card-shadow);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.adventure-node:hover .adventure-node__icon {
  border-color: var(--gold);
  box-shadow: 0 0 20px var(--gold-glow);
}

.adventure-node.visited .adventure-node__icon {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fff9e6, #fff);
}

.adventure-node__label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

/* Dotted path connecting nodes */
.adventures__path {
  display: none; /* shown only on desktop */
}

/* ========== Scene 4 — Secrets (Floating Cards) ========== */
#scene-4 {
  background: linear-gradient(180deg, #0f0f1a 0%, #1a1025 50%, #0f0f1a 100%);
  padding: 4rem 0;
  min-height: 100vh;
}

.secrets__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.secret-card {
  position: relative;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: transform 0.4s var(--transition-bounce), border-color 0.3s, box-shadow 0.3s;
  animation: float var(--float-duration, 4s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
  min-height: 44px;
}

.secret-card:hover {
  transform: scale(1.05);
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(233, 196, 106, 0.15);
}

.secret-card__front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 0.3s;
}

.secret-card__front-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(233, 196, 106, 0.2);
  margin-bottom: 0.75rem;
  color: var(--gold);
  transition: all 0.3s var(--transition-bounce);
}

.secret-card:hover .secret-card__front-icon {
  background: rgba(233, 196, 106, 0.15);
  border-color: var(--gold);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(233, 196, 106, 0.2);
}

.secret-card__front-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2px;
}

.secret-card__front-label {
  font-size: 0.7rem;
  line-height: 1.3;
  padding: 0 0.5rem;
  color: var(--text-light-secondary);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.secret-card__back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  opacity: 0;
  transition: opacity 0.4s;
  background: linear-gradient(135deg, rgba(233,196,106,0.1), rgba(216,167,167,0.08));
  border-radius: 16px;
}

.secret-card__back-text {
  font-family: 'Playfair Display', serif;
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.4;
  font-style: italic;
}

.secret-card.revealed .secret-card__front {
  opacity: 0;
}

.secret-card.revealed .secret-card__back {
  opacity: 1;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ========== Scene 5 — Museum ========== */
#scene-5 {
  background: var(--bg-primary);
  padding: 4rem 0;
}

.museum__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.exhibit-card {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.4s var(--transition-smooth), box-shadow 0.3s;
}

.exhibit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.exhibit-card__number {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-family: 'Playfair Display', serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--white);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 2;
}

.exhibit-card__image {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  object-position: center 20%;
  background: var(--accent-pink);
  transition: transform 0.5s var(--transition-smooth);
}

.exhibit-card:hover .exhibit-card__image {
  transform: scale(1.05);
}

.exhibit-card__image-wrapper {
  overflow: hidden;
}

.exhibit-card__body {
  padding: 1.25rem;
}

.exhibit-card__category {
  font-family: 'Dancing Script', cursive;
  font-size: 1.3rem;
  color: var(--accent-rose);
  margin-bottom: 0.5rem;
}

.exhibit-card__story {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========== Scene 6 — Why You Matter ========== */
#scene-6 {
  background: linear-gradient(180deg, var(--bg-primary), var(--bg-secondary));
  padding: 4rem 0;
}

.counters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin: 3rem 0;
}

.counter-item {
  text-align: center;
  min-width: 180px;
}

.counter-item__value {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2.5rem, 8vw, 4rem);
  color: var(--gold);
  line-height: 1;
}

.counter-item__label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-weight: 500;
}

.appreciation-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.appreciation-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.6;
  font-style: italic;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s, transform 0.5s var(--transition-smooth);
}

.appreciation-card.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Scene 7 — Gift Room ========== */
#scene-7 {
  background: linear-gradient(180deg, #1a1025 0%, #0f0f1a 100%);
  padding: 4rem 0;
  min-height: 100vh;
}

.gifts__progress {
  text-align: center;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 2rem;
  letter-spacing: 0.04em;
}

.gifts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.25rem;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem;
}

.gift-box {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(233,196,106,0.12), rgba(216,167,167,0.08));
  border: 2px solid rgba(233,196,106,0.2);
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.4s var(--transition-bounce);
  min-height: 44px;
}

.gift-box:hover {
  transform: scale(1.06);
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(233,196,106,0.2);
}

.gift-box.opened {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(233,196,106,0.2), rgba(216,167,167,0.15));
}

.gift-box__icon {
  font-size: 2rem;
  transition: transform 0.4s var(--transition-bounce);
}

.gift-box:hover .gift-box__icon {
  transform: scale(1.15) rotate(-5deg);
}

.gift-box.opened .gift-box__icon {
  animation: unwrap 0.6s var(--transition-bounce);
}

.gift-box__label {
  font-size: 0.7rem;
  color: var(--text-light-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

.gift-box__number {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold);
  border: 1.5px solid var(--gold);
  border-radius: 50%;
}

@keyframes unwrap {
  0% { transform: scale(1); }
  30% { transform: scale(1.3) rotate(10deg); }
  60% { transform: scale(0.9) rotate(-5deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ========== Scene Photobooth — Archive ========== */
#scene-photobooth {
  background-color: #FAF4F0;
  background-image: radial-gradient(rgba(216, 167, 167, 0.15) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  min-height: 100vh;
  padding: 4rem 0;
  display: flex;
  align-items: center;
}

.photobooth__collage {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 2rem auto 0 auto;
  padding: 0 1rem;
}

.photobooth-strip {
  position: relative;
  background-color: #ffffff;
  padding: 10px 10px 24px 10px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04), 0 2px 5px rgba(216, 167, 167, 0.05);
  max-width: 140px;
  transition: transform 0.4s var(--transition-bounce), box-shadow 0.3s ease, z-index 0.1s;
  cursor: pointer;
  user-select: none;
  /* Gentle sway animation */
  animation: photoboothSway var(--sway-duration, 5s) ease-in-out var(--sway-delay, 0s) infinite alternate;
}

.photobooth-strip img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

/* Scrapbook Predefined Rotations & Sway Limits */
.pb-rotate-left-sm {
  --pb-sway-min: -3deg;
  --pb-sway-max: -1deg;
  transform: rotate(-2deg);
}

.pb-rotate-right-sm {
  --pb-sway-min: 1deg;
  --pb-sway-max: 3deg;
  transform: rotate(2deg);
}

.pb-rotate-left-md {
  --pb-sway-min: -5deg;
  --pb-sway-max: -3deg;
  transform: rotate(-4deg);
}

.pb-rotate-right-md {
  --pb-sway-min: 3deg;
  --pb-sway-max: 5deg;
  transform: rotate(4deg);
}

.photobooth-strip:hover {
  transform: translateY(-8px) scale(1.05) rotate(0deg) !important;
  box-shadow: 0 15px 35px rgba(216, 167, 167, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
  z-index: 10;
}

@keyframes photoboothSway {
  0% { transform: rotate(var(--pb-sway-min, -2deg)); }
  100% { transform: rotate(var(--pb-sway-max, 2deg)); }
}

/* ========== Scene 8 — Final Door ========== */
#scene-8 {
  background: linear-gradient(180deg, #0f0f1a 0%, #0a0a14 100%);
  min-height: 100vh;
}

.door-container {
  perspective: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.door {
  position: relative;
  width: min(280px, 70vw);
  height: min(400px, 55vh);
  border-radius: 140px 140px 0 0;
  background: linear-gradient(180deg, #2a1f3d, #1a1025);
  border: 3px solid var(--gold);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(233, 196, 106, 0.15);
  transition: transform 1s var(--transition-smooth), box-shadow 0.5s;
}

.door.opening {
  animation: doorOpen 1.5s var(--transition-smooth) forwards;
}

.door__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(233,196,106,0.15) 0%, transparent 70%);
  animation: pulseGlow 2s ease-in-out infinite;
}

.door__handle {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 16px var(--gold-glow);
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes doorOpen {
  0% { transform: perspective(1000px) rotateY(0); }
  100% { transform: perspective(1000px) rotateY(-85deg); opacity: 0; }
}

.btn-final {
  margin-top: 2rem;
  padding: 1rem 2.5rem;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg-dark);
  background: linear-gradient(135deg, var(--gold), #f0d67b);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 24px var(--gold-glow);
  transition: all 0.4s var(--transition-smooth);
  min-width: 44px;
  min-height: 44px;
}

.btn-final:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.btn-final:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px var(--gold-glow);
}

/* White flash overlay */
.flash-overlay {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

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

/* ========== Scene 9 — Celebration ========== */
#scene-9 {
  background: linear-gradient(180deg, #1a0a2e 0%, #0f0f1a 100%);
  min-height: 100vh;
}

.celebration__text {
  text-align: center;
  opacity: 0;
  transform: scale(0.5);
}

.celebration__text.visible {
  animation: celebrationReveal 1.2s var(--transition-bounce) forwards;
}

.celebration__title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2.5rem, 10vw, 5rem);
  color: var(--gold);
  text-shadow: 0 0 40px var(--gold-glow), 0 0 80px rgba(233,196,106,0.2);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.celebration__heart {
  font-size: clamp(3rem, 12vw, 6rem);
  display: inline-block;
  animation: heartBeat 1.2s ease-in-out infinite;
}

@keyframes celebrationReveal {
  0% { opacity: 0; transform: scale(0.5); }
  60% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
  60% { transform: scale(1); }
}

/* ========== Scene 10 — Letter ========== */
#scene-10 {
  background: var(--bg-primary);
  padding: 4rem 0;
  min-height: 100vh;
}

.envelope {
  position: relative;
  width: min(320px, 85vw);
  height: min(220px, 50vw);
  margin: 0 auto;
  cursor: pointer;
  perspective: 600px;
}

.envelope__body {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5e6d3, #ede0d0);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s;
}

.envelope__body:hover {
  transform: translateY(-4px);
}

.envelope__flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, #e8d5c0, #f5e6d3);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  transition: transform 0.8s var(--transition-smooth);
  z-index: 2;
}

.envelope.opened .envelope__flap {
  transform: rotateX(180deg);
}

.envelope__seal {
  width: 48px;
  height: 48px;
  background: var(--accent-rose);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.envelope__label {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Letter content */
.letter-content {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1.25rem;
  display: none;
}

.letter-content.visible {
  display: block;
}

.letter-section {
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(20px);
}

.letter-section.in-view {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s, transform 0.6s var(--transition-smooth);
}

.letter-section__title {
  font-family: 'Dancing Script', cursive;
  font-size: 1.6rem;
  color: var(--accent-rose);
  margin-bottom: 0.75rem;
}

.letter-section__text {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.9;
  white-space: pre-line;
}

/* ========== Scene 11 — Video ========== */
#scene-11 {
  background: var(--bg-dark);
  padding: 4rem 0;
  min-height: 100vh;
}

.video-player {
  position: relative;
  max-width: 640px;
  margin: 2rem auto;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 16px 64px rgba(0,0,0,0.5);
}

.video-player video {
  width: 100%;
  display: block;
}

.video-player__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.3s;
}

.video-player__overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.video-player__play-btn {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  transition: transform 0.3s var(--transition-bounce);
}

.video-player__play-btn:hover {
  transform: scale(1.1);
}

.video-player__play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 24px;
  border-color: transparent transparent transparent var(--bg-dark);
  margin-left: 4px;
}

.video-fallback {
  display: none;
  text-align: center;
  padding: 2rem;
  color: var(--text-light-secondary);
  font-size: 0.9rem;
}

/* ========== Scene 12 — Epilogue ========== */
#scene-12 {
  background: linear-gradient(180deg, #0a0a1a 0%, #0f0f2a 50%, #0a0a1a 100%);
  min-height: 100vh;
  padding: 4rem 0;
}

.epilogue__closing {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: var(--text-light);
  text-align: center;
  line-height: 1.8;
  max-width: 500px;
  margin: 0 auto 3rem;
  opacity: 0;
}

.epilogue__closing.in-view {
  opacity: 1;
  transition: opacity 1.2s;
}

.epilogue__counter {
  text-align: center;
  margin-bottom: 3rem;
  opacity: 0;
}

.epilogue__counter.in-view {
  opacity: 1;
  transition: opacity 1s 0.5s;
}

.epilogue__counter-label {
  font-size: 0.8rem;
  color: var(--text-light-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.epilogue__counter-value {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2.5rem, 8vw, 4rem);
  color: var(--gold);
}

.epilogue__counter-unit {
  font-size: 0.9rem;
  color: var(--text-light-secondary);
  margin-top: 0.25rem;
}

.epilogue__final {
  text-align: center;
  opacity: 0;
  margin-top: 3rem;
}

.epilogue__final.in-view {
  opacity: 1;
  transition: opacity 1.5s 1s;
}

.epilogue__final-text {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(1.8rem, 6vw, 3rem);
  color: var(--gold);
  text-shadow: 0 0 30px var(--gold-glow);
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s var(--transition-bounce);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal--dark {
  background: var(--bg-dark-secondary);
  color: var(--text-light);
}

.modal__image {
  width: 100%;
  max-height: 48vh;
  object-fit: contain;
  background: #f7ebe6;
  border-radius: 20px 20px 0 0;
}

.modal__body {
  padding: 1.5rem;
}

.modal__title {
  font-family: 'Dancing Script', cursive;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--accent-rose);
}

.modal__text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 51;
  transition: background 0.3s;
  min-width: 44px;
  min-height: 44px;
}

.modal__close:hover {
  background: rgba(0,0,0,0.7);
}

/* Gift modal specific */
.gift-modal__content {
  padding: 2rem;
  text-align: center;
}

.gift-modal__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.gift-modal__title {
  font-family: 'Dancing Script', cursive;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--gold);
}

/* Custom audio player */
.audio-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  margin: 1rem auto;
  max-width: 300px;
}

.audio-player__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
  min-width: 44px;
  min-height: 44px;
}

.audio-player__btn:hover {
  transform: scale(1.1);
}

.audio-player__progress {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  overflow: hidden;
}

.audio-player__progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
  width: 0%;
  transition: width 0.1s;
}

.audio-player__time {
  font-size: 0.7rem;
  color: var(--text-light-secondary);
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}

/* Playlist styling */
.playlist {
  list-style: none;
  text-align: left;
  margin: 1rem 0;
}

.playlist__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.85rem;
}

.playlist__item-number {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
}

.playlist__item-title {
  color: var(--text-light);
  font-weight: 500;
}

.playlist__item-artist {
  color: var(--text-light-secondary);
  font-size: 0.75rem;
}

/* Mini letter inside gift */
.mini-letter {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.8;
  text-align: left;
  padding: 1.5rem;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--gold);
  border-radius: 0 12px 12px 0;
  white-space: pre-line;
  margin: 1rem 0;
}

/* ========== Global Mute Button ========== */
.mute-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  transition: background 0.3s, transform 0.3s;
  min-width: 44px;
  min-height: 44px;
  opacity: 0;
  visibility: hidden;
}

.mute-toggle.visible {
  opacity: 1;
  visibility: visible;
}

.mute-toggle:hover {
  background: rgba(0,0,0,0.6);
  transform: scale(1.1);
}

/* ========== Section Headings ========== */
.scene__heading {
  text-align: center;
  margin-bottom: 2rem;
}

.scene__heading-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  margin-bottom: 0.5rem;
}

.scene__heading-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.5;
}

.scene--dark .scene__heading-title {
  color: var(--gold);
}

.scene--dark .scene__heading-subtitle {
  color: var(--text-light-secondary);
}

.scene--light .scene__heading-title,
.scene--cream .scene__heading-title {
  color: var(--text-primary);
}

/* ========== Secret Gallery Overlay (Easter Egg) ========== */
.secret-gallery {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s, visibility 0.5s;
}

.secret-gallery.active {
  opacity: 1;
  visibility: visible;
}

.secret-gallery__title {
  font-family: 'Dancing Script', cursive;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.secret-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  max-width: 500px;
  padding: 0 1rem;
}

.secret-gallery__close {
  margin-top: 2rem;
  padding: 0.75rem 2rem;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 999px;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: background 0.3s;
  min-width: 44px;
  min-height: 44px;
}

.secret-gallery__close:hover {
  background: rgba(233,196,106,0.15);
}

/* ========== Birthday Cake Easter Egg ========== */
.cake-easter-egg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s, visibility 0.5s;
}

.cake-easter-egg.active {
  opacity: 1;
  visibility: visible;
}

.cake {
  font-size: 6rem;
  cursor: pointer;
  transition: transform 0.3s;
}

.cake:hover {
  transform: scale(1.1);
}

.cake__wish-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin-top: 1rem;
  opacity: 0;
  transition: opacity 0.5s;
}

.cake__wish-text.visible {
  opacity: 1;
}

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

  .secret-card {
    animation: none;
  }

  .celebration__heart {
    animation: none;
  }

  .door__glow {
    animation: none;
  }
}

/* ========== Responsive ========== */
@media (min-width: 768px) {
  .scene__content {
    padding: 3rem 2rem;
  }

  .secrets__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .gifts__grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .adventures__map {
    grid-template-columns: repeat(5, 1fr);
  }

  .museum__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .photobooth__collage {
    gap: 2rem;
    margin-top: 3rem;
  }

  .photobooth-strip {
    padding: 12px 12px 30px 12px;
    max-width: 175px;
  }
}

@media (min-width: 1024px) {
  .museum__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .timeline__card {
    flex: 0 0 340px;
  }
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--accent-rose);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ========== Password Protected Gates ========== */
.password-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  max-width: 320px;
  margin: 0 auto;
  text-align: center;
}

.password-input {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 2px solid var(--accent-rose);
  background: transparent;
  color: var(--text-primary);
  text-align: center;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.scene--dark .password-input,
.modal--dark .password-input {
  color: var(--text-light);
  border-color: rgba(233,196,106,0.3);
}

.password-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(233, 196, 106, 0.2);
}

.password-btn {
  padding: 0.6rem 2rem;
  background: var(--accent-rose);
  color: white;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s var(--transition-bounce);
  min-width: 44px;
  min-height: 44px;
}

.password-btn:hover {
  background: var(--accent-rose);
  transform: scale(1.05);
}

.scene--dark .password-btn,
.modal--dark .password-btn {
  background: var(--gold);
  color: var(--bg-dark);
}

.scene--dark .password-btn:hover,
.modal--dark .password-btn:hover {
  background: #f0d67b;
}

/* Shake animation for incorrect password entry */
.password-input.error {
  border-color: #E76F51 !important;
  animation: shakeInput 0.4s ease-in-out;
  box-shadow: 0 0 10px rgba(231, 111, 81, 0.2);
}

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

/* Photobooth modal specific styling */
.modal--photobooth {
  max-width: 320px;
  background: #ffffff;
  padding: 12px 12px 28px 12px;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  transform: scale(0.9) rotate(-1deg);
  transition: transform 0.4s var(--transition-bounce);
}

.modal-overlay.active .modal--photobooth {
  animation: modalCuteWobble 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalCuteWobble {
  0% { transform: scale(0.6) rotate(-15deg); opacity: 0; }
  50% { transform: scale(1.05) rotate(5deg); }
  75% { transform: scale(0.98) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.photobooth-modal__body {
  width: 100%;
}

.photobooth-modal__image {
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* ========== Utility ========== */
.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;
}

.hidden {
  display: none !important;
}
