@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Cinzel+Decorative:wght@700;900&family=Great+Vibes&family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,400&display=swap');

/* --- Root Theme Color Variables (Light Premium Theme) --- */
:root {
  --color-cream: #FFFDF7;
  --color-pink-soft: #FDF0F3;
  --color-gold: #E5A93C;
  --color-rose: #E85D75;
  --color-saffron: #F58252;
  --color-velvet: #4A0E17;

  --font-serif: 'Playfair Display', serif;
  --font-display: 'Cinzel Decorative', cursive, serif;
  --font-script: 'Great Vibes', cursive;
  --font-handwritten: 'Caveat', cursive;
  --font-sans: 'Outfit', sans-serif;
}

/* --- Global Reset & Lock Scroll Base --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden; /* Zero Page Scroll Required! */
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-cream);
  color: var(--color-velvet);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  display: none;
}

/* --- Top Progress Line Indicator --- */
#top-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 12.5%;
  background: linear-gradient(to right, var(--color-saffron), var(--color-rose), var(--color-gold));
  z-index: 99999;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 12px rgba(229, 169, 60, 0.8);
}

/* --- Split Door Curtain Opening Section --- */
.split-curtain-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: visibility 0s linear 1.2s;
  background-color: transparent;
}

.split-curtain-overlay.opened {
  visibility: hidden;
  pointer-events: none;
}

.curtain-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  transition: transform 1.3s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: transform;
  z-index: 10;
}

.curtain-door-left {
  left: 0;
  box-shadow: 6px 0 20px rgba(0, 0, 0, 0.25);
}

.curtain-door-right {
  right: 0;
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.25);
}

.curtain-door-left img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.curtain-door-right img {
  position: absolute;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

/* Center Tap To Open Badge */
.curtain-center-hint {
  position: absolute;
  z-index: 30;
  background: linear-gradient(135deg, #E5A93C 0%, #E85D75 100%);
  color: #FFFDF7;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  border: 2px solid #FFFDF7;
  box-shadow: 0 10px 30px rgba(74, 14, 23, 0.4), 0 0 20px rgba(229, 169, 60, 0.5);
  animation: pulseCurtainHint 1.5s infinite alternate;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

@keyframes pulseCurtainHint {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.08) translateY(-4px); }
}

.split-curtain-overlay.opened .curtain-center-hint {
  opacity: 0;
  transform: scale(0.5);
}

.split-curtain-overlay.opened .curtain-door-left {
  transform: translateX(-100%);
}

.split-curtain-overlay.opened .curtain-door-right {
  transform: translateX(100%);
}

/* --- Canvas Layer --- */
#petal-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* --- Typography & Metallic Text --- */
.font-display {
  font-family: var(--font-display);
}

.font-serif {
  font-family: var(--font-serif);
}

.font-script {
  font-family: var(--font-script);
}

.font-handwritten {
  font-family: var(--font-handwritten);
}

.text-velvet-gradient {
  background: linear-gradient(135deg, #4A0E17 0%, #E85D75 50%, #4A0E17 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gold-gradient {
  background: linear-gradient(135deg, #E5A93C 0%, #F58252 50%, #E5A93C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- SVG Animated Text Keyframes & Calligraphy --- */
.svg-animated-text {
  filter: drop-shadow(0 4px 8px rgba(232, 93, 117, 0.25));
  overflow: visible;
}

.svg-animated-text text {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: strokeDrawText 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes strokeDrawText {
  0% {
    stroke-dashoffset: 1000;
    fill-opacity: 0;
  }
  65% {
    stroke-dashoffset: 0;
    fill-opacity: 0.1;
  }
  100% {
    stroke-dashoffset: 0;
    fill-opacity: 1;
  }
}

/* --- Step Wizard Flow Architecture (Spacious & Ultra-Premium) --- */
.story-step {
  display: none;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 100%;
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
  padding: 1.25rem 1rem 3rem 1rem;
  overflow-y: auto;
  box-sizing: border-box;
}

.story-step.active {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Glass Light Ultra-Premium Panels */
.glass-light-premium {
  background: linear-gradient(135deg, rgba(255, 253, 247, 0.96) 0%, rgba(253, 240, 243, 0.95) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 2px solid rgba(229, 169, 60, 0.45);
  box-shadow: 0 25px 60px rgba(74, 14, 23, 0.12), inset 0 0 20px rgba(255, 255, 255, 0.9);
  border-radius: 32px;
  position: relative;
}

/* Hero GIF Frame Ring Glow */
.hero-gif-frame {
  position: relative;
  border-radius: 20px;
  padding: 4px;
  background: linear-gradient(135deg, #E5A93C, #E85D75, #F58252);
  box-shadow: 0 12px 30px rgba(232, 93, 117, 0.35);
  transition: transform 0.4s ease;
}

.hero-gif-frame:hover {
  transform: scale(1.05) rotate(1deg);
}

/* --- 🎁 Interactive 3D Animated Gift Surprise Box --- */
.gift-box-3d {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0.5rem auto;
  perspective: 600px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gift-box-3d:hover {
  transform: scale(1.1) rotate(3deg);
}

.gift-body {
  position: absolute;
  bottom: 0;
  left: 6px;
  width: 108px;
  height: 86px;
  background: linear-gradient(135deg, #E85D75 0%, #F58252 100%);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(232, 93, 117, 0.4), inset 0 2px 5px rgba(255, 255, 255, 0.4);
  border: 2px solid #FFFDF7;
  overflow: hidden;
}

.gift-ribbon-vertical {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  background: linear-gradient(to bottom, #E5A93C, #FFFDF7);
  box-shadow: 0 0 8px rgba(229, 169, 60, 0.5);
}

.gift-ribbon-horizontal {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 16px;
  background: linear-gradient(to right, #E5A93C, #FFFDF7);
  box-shadow: 0 0 8px rgba(229, 169, 60, 0.5);
}

.gift-lid {
  position: absolute;
  top: 12px;
  left: 0;
  width: 100px;
  height: 28px;
  background: linear-gradient(135deg, #F58252 0%, #E85D75 100%);
  border-radius: 10px;
  box-shadow: 0 5px 12px rgba(74, 14, 23, 0.2);
  border: 1.5px solid #FFFDF7;
  z-index: 20;
  transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.gift-bow {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 16px;
  background: #E5A93C;
  border-radius: 50% 50% 0 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.gift-bow::before, .gift-bow::after {
  content: '';
  position: absolute;
  top: 3px;
  width: 10px;
  height: 10px;
  background: #E5A93C;
  border-radius: 50%;
}
.gift-bow::before { left: -6px; }
.gift-bow::after { right: -6px; }

/* Opened Box State Animation */
.gift-box-3d.opened .gift-lid {
  transform: translateY(-45px) rotate(-22deg) scale(0.9);
  opacity: 0.9;
}

.gift-box-3d.opened::after {
  content: '✨🌸✨';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  animation: burstRise 0.8s ease forwards;
}

@keyframes burstRise {
  0% { transform: translate(-50%, 0) scale(0.5); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translate(-50%, -40px) scale(1.3); opacity: 0; }
}

/* --- Then vs Now (Kids Era vs 2026 Young Adults) Feature --- */
.then-now-card {
  background: linear-gradient(135deg, rgba(253, 240, 243, 0.9) 0%, rgba(255, 253, 247, 0.95) 100%);
  border: 1.5px solid rgba(229, 169, 60, 0.4);
  border-radius: 20px;
  padding: 0.75rem 1rem;
  box-shadow: 0 10px 25px rgba(232, 93, 117, 0.08);
  transition: all 0.4s ease;
}

/* Hanging Photo String Gallery & Infinite Marquee */
.string-container {
  position: relative;
  width: 100%;
}

.hanging-string {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, transparent, #E5A93C, #F58252, #E5A93C, transparent);
  box-shadow: 0 2px 8px rgba(229, 169, 60, 0.3);
  z-index: 10;
}

/* Single Row Infinite Marquee Track */
.marquee-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding-top: 18px;
  padding-bottom: 12px;
  mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
}

.marquee-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  animation: marqueeScroll 25s linear infinite;
  will-change: transform;
}

.marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.hanging-polaroid {
  background: #fff;
  padding: 8px 8px 16px 8px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(74, 14, 23, 0.08);
  border: 1px solid rgba(229, 169, 60, 0.25);
  transform-origin: top center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
}

.hanging-polaroid::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 14px;
  background: #E5A93C;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.hanging-polaroid:hover {
  transform: scale(1.05) rotate(0deg) !important;
  z-index: 30;
  box-shadow: 0 12px 25px rgba(232, 93, 117, 0.2);
}

.sway-1 { animation: sway 4s ease-in-out infinite alternate; }
.sway-2 { animation: sway 5s ease-in-out infinite alternate-reverse; }
.sway-3 { animation: sway 4.5s ease-in-out infinite alternate; }

@keyframes sway {
  0% { transform: rotate(-2deg); }
  100% { transform: rotate(2deg); }
}

/* --- Interactive Memory Lightbox Modal --- */
.memory-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(74, 14, 23, 0.45);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.memory-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.memory-modal-card {
  background: #FFFDF7;
  border: 2px solid #E5A93C;
  border-radius: 24px;
  max-width: 440px;
  width: 100%;
  padding: 1.25rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.memory-modal.open .memory-modal-card {
  transform: scale(1);
}

/* --- 3D Flip Cards (Light Theme) --- */
.flip-card {
  perspective: 1000px;
  height: 140px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.flip-card-inner.flipped {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid rgba(229, 169, 60, 0.3);
}

.flip-card-front {
  background: var(--color-pink-soft);
  box-shadow: 0 6px 18px rgba(232, 93, 117, 0.08);
}

.flip-card-back {
  background: linear-gradient(135deg, #FFFDF7 0%, #FDF0F3 100%);
  color: var(--color-velvet);
  transform: rotateY(180deg);
  box-shadow: 0 6px 18px rgba(229, 169, 60, 0.15);
  border-color: var(--color-gold);
}

/* --- 🧩 Sibling Memories Puzzle (3x3 Grid Match) --- */
.puzzle-tile {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background-image: url('../images/puzzel-memories.png');
  background-size: 300% 300%;
  cursor: grab;
  box-shadow: 0 4px 10px rgba(74, 14, 23, 0.15);
  border: 2px solid #FFFDF7;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  user-select: none;
  touch-action: none;
  position: relative;
  overflow: hidden;
}

.puzzle-tile:active {
  cursor: grabbing;
}

.puzzle-tile:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(232, 93, 117, 0.3);
  z-index: 10;
}

.puzzle-tile.dragging {
  opacity: 0.45;
  transform: scale(0.95);
}

.puzzle-tile.drag-over {
  border-color: #E5A93C !important;
  box-shadow: 0 0 0 4px #E5A93C, 0 8px 22px rgba(229, 169, 60, 0.5);
  transform: scale(1.08);
  z-index: 30;
}

.puzzle-tile.selected {
  border-color: #E85D75 !important;
  box-shadow: 0 0 0 3.5px #E85D75, 0 8px 20px rgba(232, 93, 117, 0.45);
  transform: scale(1.06);
  z-index: 20;
  animation: pulseTile 0.9s infinite alternate;
}

.puzzle-tile.correct-spot::after {
  content: '✓';
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #E5A93C;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

@keyframes pulseTile {
  0% { transform: scale(1.04); }
  100% { transform: scale(1.08); }
}



/* --- Buttons --- */
.btn-gold {
  background: linear-gradient(135deg, var(--color-saffron) 0%, var(--color-gold) 100%);
  color: #fff;
  font-weight: 700;
  padding: 0.6rem 1.6rem;
  border-radius: 9999px;
  box-shadow: 0 5px 15px rgba(229, 169, 60, 0.35);
  transition: all 0.3s ease;
  border: 1px solid #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.btn-gold:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 25px rgba(229, 169, 60, 0.5);
}

.btn-rose {
  background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-saffron) 100%);
  color: #fff;
  font-weight: 700;
  padding: 0.6rem 1.6rem;
  border-radius: 9999px;
  box-shadow: 0 5px 15px rgba(232, 93, 117, 0.35);
  transition: all 0.3s ease;
  border: 1px solid #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.btn-rose:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 25px rgba(232, 93, 117, 0.5);
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  right: 1rem;
  z-index: 999999;
  background: var(--color-velvet);
  border: 1px solid var(--color-gold);
  color: var(--color-cream);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(74, 14, 23, 0.25);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s ease;
}

.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}
