/* ==========================================================================
   MINIMALIST LUXURY BIRTHDAY WEBSITE STYLESHEET
   ========================================================================== */

/* --- Custom Variables & Theme --- */
:root {
  --bg-primary: #F6F1EB;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --text-primary: #2B2421;
  --text-secondary: #6B5F5B;
  --text-muted: #9E918C;
  --accent-rose: #D88A8E;
  --accent-blush: #F4DBD8;
  --accent-gold: #D4A373;
  --accent-burgundy: #7C2D37;
  --accent-wax: #8B2635;
  --border-subtle: rgba(216, 138, 142, 0.22);
  --border-light: rgba(43, 36, 33, 0.08);
  --shadow-sm: 0 4px 16px rgba(43, 36, 33, 0.04);
  --shadow-md: 0 12px 32px rgba(43, 36, 33, 0.08);
  --shadow-lg: 0 24px 56px rgba(43, 36, 33, 0.12);
  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-handwriting: 'Caveat', cursive, serif;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Dark Mode Theme (Romantic Twilight) --- */
[data-theme="dark"] {
  --bg-primary: #141014;
  --bg-card: rgba(26, 20, 25, 0.88);
  --bg-card-hover: rgba(36, 28, 35, 0.98);
  --text-primary: #FDF7F4;
  --text-secondary: #C8BCBA;
  --text-muted: #968684;
  --accent-rose: #E5989B;
  --accent-blush: #3D262C;
  --accent-gold: #DEB887;
  --accent-burgundy: #D86B77;
  --accent-wax: #A83242;
  --border-subtle: rgba(229, 152, 155, 0.24);
  --border-light: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.65);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body {
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
  cursor: default;
}

/* Hide default cursor on desktops to display custom cursor */
@media (pointer: fine) {
  body, a, button, input {
    cursor: none !important;
  }
}

/* --- Background Canvas --- */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* --- Content Wrapper --- */
.site-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow-x: hidden;
}

/* --- Custom Cursor --- */
.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  margin-left: -3px;
  background-color: var(--accent-rose);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transition: opacity 0.2s ease;
}

.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(216, 138, 142, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  margin-top: -17px;
  margin-left: -17px;
  transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, margin 0.3s ease;
}

.custom-cursor-ring.hovering {
  width: 52px;
  height: 52px;
  margin-top: -26px;
  margin-left: -26px;
  background-color: rgba(216, 138, 142, 0.12);
  border-color: var(--accent-rose);
}

.custom-cursor-ring.active {
  transform: scale(0.85);
  background-color: rgba(216, 138, 142, 0.25);
}

/* Cursor Background Glow */
.custom-cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 280px;
  margin-top: -140px;
  margin-left: -140px;
  background: radial-gradient(
    circle,
    rgba(231, 168, 166, 0.18) 0%,
    rgba(242, 196, 155, 0.12) 25%,
    rgba(226, 142, 149, 0.06) 50%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  filter: blur(20px);
  mix-blend-mode: screen;
  will-change: transform;
}

/* Trailing Sparkles */
.cursor-trail-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

.cursor-sparkle {
  position: fixed;
  pointer-events: none;
  user-select: none;
  animation: floatSparkle 0.95s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes floatSparkle {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(0.6);
  }
  50% {
    opacity: 0.9;
    transform: translate(calc(var(--dest-x) * 0.6), calc(var(--dest-y) * 0.6)) rotate(var(--rot)) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dest-x), var(--dest-y)) rotate(calc(var(--rot) * 2)) scale(0.3);
  }
}

/* --- Floating Header Navigation & Music Controls --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(250, 247, 242, 0.75);
  border-bottom: 1px solid rgba(216, 138, 142, 0.12);
  transition: var(--transition-smooth);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-heart {
  color: var(--accent-rose);
  font-size: 1.1rem;
  display: inline-block;
  animation: heartPulse 2.4s ease-in-out infinite;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  cursor: pointer;
  user-select: none;
}

.header-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-rose);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.theme-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.music-control-btn {
  /* Inherits .header-btn base */
  gap: 0.75rem;
}

.music-bars {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 14px;
}

.music-bars span {
  width: 2.5px;
  height: 5px;
  background-color: var(--accent-rose);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.music-control-btn.playing .music-bars span:nth-child(1) {
  animation: musicBar 0.9s ease-in-out infinite alternate;
}
.music-control-btn.playing .music-bars span:nth-child(2) {
  animation: musicBar 0.7s ease-in-out 0.2s infinite alternate;
}
.music-control-btn.playing .music-bars span:nth-child(3) {
  animation: musicBar 1.1s ease-in-out 0.4s infinite alternate;
}

@keyframes musicBar {
  0% { height: 4px; }
  100% { height: 14px; }
}

/* --- Landing Page / Hero Section --- */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem 1.5rem 5rem;
  position: relative;
}

.hero-content {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.25rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-burgundy);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.2rem;
  animation: fadeInDown 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.badge-sparkle {
  color: var(--accent-gold);
  font-size: 0.9rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3.2rem, 7.5vw, 6.2rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-name-highlight {
  display: block;
  font-weight: 500;
  font-style: italic;
  color: var(--accent-burgundy);
  background: linear-gradient(135deg, #7C2D37 20%, #D88A8E 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 620px;
  line-height: 1.75;
  margin-bottom: 2.8rem;
  animation: fadeInUp 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Call to Action Button */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 2.2rem;
  background: var(--text-primary);
  color: #FFFFFF;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(43, 36, 33, 0.15);
  transition: var(--transition-smooth);
  animation: fadeInUp 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-cta:hover {
  background: var(--accent-burgundy);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(124, 45, 55, 0.25);
}

.cta-icon {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.hero-cta:hover .cta-icon {
  transform: translateY(3px);
}

/* Scroll Indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: fadeIn 2s ease forwards;
}

.scroll-line {
  width: 1px;
  height: 35px;
  background: linear-gradient(to bottom, var(--accent-rose), transparent);
  animation: scrollDrop 2s ease-in-out infinite;
}

@keyframes scrollDrop {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* --- Milestone Counter Chip --- */
.counter-section {
  padding: 2rem 1.5rem 5rem;
  display: flex;
  justify-content: center;
}

.counter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2rem 3.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition-smooth);
  max-width: 500px;
  width: 100%;
}

.counter-card:hover {
  border-color: var(--accent-rose);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.counter-number {
  font-family: var(--font-serif);
  font-size: 3.6rem;
  font-weight: 600;
  line-height: 1;
  color: var(--accent-burgundy);
  margin-bottom: 0.5rem;
}

.counter-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

/* --- Timeline Section --- */
.timeline-section {
  padding: 5rem 1.5rem 8rem;
  max-width: 1080px;
  margin: 0 auto;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 5.5rem;
}

.section-pretitle {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-rose);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4.5vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  font-weight: 300;
}

/* Timeline Layout */
.timeline-container {
  position: relative;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--accent-rose) 10%,
    var(--accent-gold) 50%,
    var(--accent-burgundy) 90%,
    transparent 100%
  );
  opacity: 0.4;
}

.timeline-items {
  display: flex;
  flex-direction: column;
  gap: 5rem;
  position: relative;
}

.timeline-node {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-node.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-node.left {
  justify-content: flex-start;
}

.timeline-node.right {
  justify-content: flex-end;
}

/* Center Marker */
.timeline-marker {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  top: 50px;
  z-index: 2;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-dot {
  width: 10px;
  height: 10px;
  background-color: var(--accent-burgundy);
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(124, 45, 55, 0.5);
  position: relative;
  z-index: 2;
}

.marker-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent-rose);
  opacity: 0.5;
  animation: markerPing 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes markerPing {
  0% { transform: scale(0.8); opacity: 0.8; }
  75%, 100% { transform: scale(2.2); opacity: 0; }
}

/* Timeline Cards */
.timeline-card-wrapper {
  width: 45%;
}

.timeline-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  transform: rotate(var(--card-tilt, 0deg));
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
  user-select: none;
}

.timeline-card:hover {
  transform: translateY(-8px) scale(1.015) rotate(0deg) !important;
  box-shadow: 0 20px 45px rgba(43, 36, 33, 0.12);
  border-color: var(--accent-rose);
}

.card-polaroid {
  display: flex;
  flex-direction: column;
}

.photo-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background-color: #F0EAE1;
}

.photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}

.timeline-card:hover .photo-wrapper img {
  transform: scale(1.05);
}

.photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(43, 36, 33, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timeline-card:hover .photo-overlay {
  opacity: 1;
}

.view-pill {
  padding: 0.45rem 0.95rem;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-content {
  padding: 1.25rem 0.5rem 0.5rem;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.card-date {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent-rose);
  text-transform: uppercase;
}

.card-tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  background: var(--bg-primary);
  border-radius: 999px;
  color: var(--text-secondary);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 0.65rem;
}

.card-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-weight: 300;
}

.card-location {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.loc-icon {
  color: var(--accent-gold);
}

/* --- The Letter at the End Section --- */
.letter-section {
  padding: 6rem 1.5rem 10rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 600px;
}

.envelope-stage {
  perspective: 1400px;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 3D Envelope Body */
.envelope-wrapper {
  position: relative;
  width: 100%;
  max-width: 580px;
  height: 380px;
  background: #EFE8DE;
  border-radius: 12px;
  box-shadow: var(--shadow-lg), 0 35px 70px rgba(43, 36, 33, 0.14);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), height 0.6s ease, margin 0.6s ease;
  transform-style: preserve-3d;
}

/* Top Flap */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 190px;
  background: #E5DDCE;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), z-index 0.2s ease 0.4s;
  z-index: 5;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.envelope-wrapper.flap-open .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

/* Envelope Pocket / Front Folds */
.envelope-pocket {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #FAF6F0 0%, #E9E1D4 100%);
  border-radius: 0 0 12px 12px;
  z-index: 4;
  box-shadow: inset 0 -2px 10px rgba(0,0,0,0.04);
}

.envelope-pocket-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip-path: polygon(0 0, 50% 50%, 0 100%);
  background: #F3ECE1;
  border-radius: 12px 0 0 12px;
  z-index: 3;
}

.envelope-pocket-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  clip-path: polygon(100% 0, 50% 50%, 100% 100%);
  background: #ECE4D9;
  border-radius: 0 12px 12px 0;
  z-index: 3;
}

/* Wax Seal Button */
.wax-seal {
  position: absolute;
  top: 175px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #A83242 0%, #7C2431 60%, #521620 100%);
  box-shadow: 0 8px 25px rgba(124, 36, 49, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.35), inset 0 -3px 6px rgba(0, 0, 0, 0.4);
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, opacity 0.4s ease;
}

.wax-seal:hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 12px 35px rgba(124, 36, 49, 0.55), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.seal-emblem {
  color: #F8E3E6;
  font-size: 1.6rem;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.seal-text {
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: #F8E3E6;
  text-transform: uppercase;
  margin-top: 2px;
  opacity: 0.85;
}

.seal-pulse-hint {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-burgundy);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  animation: bounceHint 2s infinite ease-in-out;
}

@keyframes bounceHint {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -6px); }
}

.wax-seal.cracking {
  animation: sealPop 0.5s forwards ease-out;
}

@keyframes sealPop {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.8; filter: blur(1px); }
  100% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; pointer-events: none; }
}

/* When envelope is opened & collapsed */
.envelope-wrapper.letter-revealed {
  opacity: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
  transform: scale(0.92) translateY(40px);
  pointer-events: none;
}

/* The Letter Paper Sheet */
.letter-sheet {
  display: none;
  width: 100%;
  max-width: 680px;
  background: #FCFAF6;
  border-radius: 12px;
  padding: 4rem 3.5rem;
  box-shadow: 0 25px 70px rgba(43, 36, 33, 0.16);
  border: 1px solid rgba(216, 138, 142, 0.2);
  opacity: 0;
  transform: translateY(30px) scale(0.96);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

/* When letter is unfolded */
.letter-sheet.unfolded {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Letter Stationery Typography */
.letter-paper-texture {
  position: relative;
}

.letter-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(216, 138, 142, 0.2);
  padding-bottom: 1.2rem;
  margin-bottom: 2.2rem;
}

.letter-date {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.letter-monogram {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--accent-rose);
}

.letter-salutation {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1.8rem;
}

.letter-body {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-primary);
  font-weight: 300;
}

.letter-paragraph {
  margin-bottom: 1.6rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.letter-paragraph.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.letter-footer {
  margin-top: 3.2rem;
  padding-top: 2rem;
  border-top: 1px dashed rgba(216, 138, 142, 0.25);
}

.letter-closing {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 0.4rem;
}

.letter-author {
  font-family: var(--font-handwriting);
  font-size: 2.4rem;
  color: var(--accent-burgundy);
  line-height: 1.2;
}

.letter-ps {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
}

/* Letter Action Buttons */
.letter-actions {
  margin-top: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.wish-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  background: linear-gradient(135deg, #D4A373 0%, #C46D77 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 22px rgba(196, 109, 119, 0.35);
  transition: var(--transition-smooth);
}

.wish-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(196, 109, 119, 0.45);
}

.reseal-btn {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-light);
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.reseal-btn:hover {
  border-color: var(--accent-rose);
  color: var(--accent-burgundy);
  background: #FFFFFF;
}

/* --- Lightbox Modal --- */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 15, 14, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox-container {
  position: relative;
  z-index: 10;
  max-width: 820px;
  width: 90%;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  transform: scale(0.92);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-modal.active .lightbox-container {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.lightbox-close:hover {
  transform: scale(1.1);
  background: #FFFFFF;
}

.lightbox-media {
  max-height: 60vh;
  overflow: hidden;
  background-color: #000000;
}

.lightbox-media img {
  width: 100%;
  height: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  padding: 1.75rem 2rem;
}

.lightbox-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-rose);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.3rem;
}

.lightbox-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.lightbox-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.footer-love {
  color: var(--accent-rose);
  display: inline-block;
  margin: 0 0.25rem;
}

/* --- Keyframe Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive Adaptations --- */
@media (max-width: 840px) {
  .site-header {
    padding: 1.2rem 1.5rem;
  }

  .timeline-container::before {
    left: 24px;
  }

  .timeline-node {
    justify-content: flex-start !important;
    padding-left: 55px;
  }

  .timeline-marker {
    left: 24px;
    top: 30px;
  }

  .timeline-card-wrapper {
    width: 100%;
  }

  .envelope-wrapper {
    height: 320px;
  }

  .envelope-flap {
    height: 160px;
  }

  .wax-seal {
    top: 150px;
    width: 66px;
    height: 66px;
  }

  .letter-sheet {
    padding: 2.4rem 1.6rem;
  }

  .letter-salutation {
    font-size: 1.5rem;
  }

  .counter-card {
    padding: 1.5rem 2rem;
  }

  .counter-number {
    font-size: 2.8rem;
  }
}

/* ==========================================================================
   DARK THEME COMPONENT STYLES & OVERRIDES (Romantic Twilight Mode)
   ========================================================================== */
[data-theme="dark"] .site-header {
  background: rgba(20, 16, 20, 0.85);
  border-bottom: 1px solid rgba(229, 152, 155, 0.15);
}

[data-theme="dark"] .hero-badge {
  background: rgba(34, 26, 32, 0.85);
  border-color: rgba(229, 152, 155, 0.25);
  color: var(--accent-rose);
}

[data-theme="dark"] .hero-name-highlight {
  background: linear-gradient(135deg, #F8A5AC 20%, #E29578 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .hero-cta {
  background: linear-gradient(135deg, #E5989B 0%, #D4A373 100%);
  color: #141014;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(229, 152, 155, 0.28);
}

[data-theme="dark"] .hero-cta:hover {
  background: linear-gradient(135deg, #F2A8AC 0%, #E0B085 100%);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(229, 152, 155, 0.42);
}

[data-theme="dark"] .counter-card {
  background: rgba(28, 21, 26, 0.85);
  border-color: rgba(229, 152, 155, 0.22);
}

[data-theme="dark"] .counter-number {
  color: var(--accent-rose);
  text-shadow: 0 0 25px rgba(229, 152, 155, 0.35);
}

[data-theme="dark"] .timeline-card {
  background: #1C151A;
  border-color: rgba(229, 152, 155, 0.16);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .timeline-card:hover {
  border-color: var(--accent-rose);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7), 0 0 28px rgba(229, 152, 155, 0.18);
}

[data-theme="dark"] .photo-wrapper {
  background-color: #271E24;
}

[data-theme="dark"] .card-tag {
  background: #281D24;
  color: var(--accent-rose);
}

[data-theme="dark"] .view-pill {
  background: rgba(28, 21, 26, 0.95);
  color: var(--text-primary);
  border: 1px solid rgba(229, 152, 155, 0.28);
}

[data-theme="dark"] .marker-dot {
  background-color: var(--accent-rose);
  border-color: #141014;
  box-shadow: 0 0 12px rgba(229, 152, 155, 0.8);
}

[data-theme="dark"] .envelope-wrapper {
  background: #251B21;
  box-shadow: var(--shadow-lg), 0 35px 70px rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .envelope-flap {
  background: #2D2027;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .envelope-pocket {
  background: linear-gradient(180deg, #2B1E25 0%, #1D141A 100%);
  box-shadow: inset 0 -2px 10px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .envelope-pocket-left {
  background: #241920;
}

[data-theme="dark"] .envelope-pocket-right {
  background: #21161D;
}

[data-theme="dark"] .seal-pulse-hint {
  background: rgba(38, 28, 34, 0.95);
  color: var(--text-primary);
  border-color: rgba(229, 152, 155, 0.35);
}

[data-theme="dark"] .letter-sheet {
  background: #1C151B;
  border-color: rgba(229, 152, 155, 0.25);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75), 0 0 35px rgba(229, 152, 155, 0.09);
}

[data-theme="dark"] .reseal-btn {
  background: rgba(34, 25, 31, 0.8);
  border-color: rgba(229, 152, 155, 0.2);
  color: var(--text-secondary);
}

[data-theme="dark"] .reseal-btn:hover {
  background: #2C1F28;
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

[data-theme="dark"] .lightbox-container {
  background: #1C151B;
  border: 1px solid rgba(229, 152, 155, 0.25);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 45px rgba(229, 152, 155, 0.12);
}

[data-theme="dark"] .lightbox-close {
  background: rgba(38, 28, 34, 0.9);
  color: var(--text-primary);
  border: 1px solid rgba(229, 152, 155, 0.25);
}

[data-theme="dark"] .lightbox-close:hover {
  background: #3A2A35;
}

[data-theme="dark"] .custom-cursor-glow {
  background: radial-gradient(
    circle,
    rgba(229, 152, 155, 0.24) 0%,
    rgba(222, 184, 135, 0.16) 30%,
    rgba(216, 107, 119, 0.08) 55%,
    transparent 70%
  );
}

@media (max-width: 540px) {
  .site-header {
    padding: 1rem 1.2rem;
  }
  .theme-toggle-btn #theme-label,
  .music-control-btn #music-label {
    display: none;
  }
  .header-btn {
    padding: 0.5rem 0.75rem;
  }
}

