/* ═══════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════ */
:root {
  --bg-deep:    #0a0010;
  --bg-mid:     #120018;
  --bg-warm:    #1a0f0f;
  --bg-card:    #1c0828;
  --accent:     #d4a0a0;
  --accent-hot: #e8607a;
  --accent-glow:#ff8fa3;
  --text:       #f0e6e6;
  --text-muted: #9a8a8a;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;
  --radius:     12px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════
   COUNTDOWN OVERLAY
═══════════════════════════════════════════ */
#countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 1.2s ease;
}

#countdown-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

#countdown-overlay.hidden {
  display: none;
}

#cd-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cd-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
}

.cd-label {
  font-size: 0.78rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeUp 1s ease forwards 0.5s;
}

.cd-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 600;
  line-height: 1.05;
  color: var(--text);
  margin: 14px 0 0;
  opacity: 0;
  animation: fadeUp 1s ease forwards 0.9s;
}

.cd-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--accent);
  margin: 10px 0 48px;
  opacity: 0;
  animation: fadeUp 1s ease forwards 1.2s;
}

.cd-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2.5vw, 28px);
  opacity: 0;
  animation: fadeUp 1s ease forwards 1.5s;
}

.cd-unit {
  text-align: center;
  min-width: 70px;
}

.cd-number {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 600;
  line-height: 1;
  color: var(--accent-hot);
  text-shadow: 0 0 40px rgba(232, 96, 122, 0.35);
}

.cd-unit-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 8px;
}

.cd-sep {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--accent);
  opacity: 0.5;
  padding-bottom: 28px;
  line-height: 1;
}

.cd-date {
  margin-top: 36px;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeUp 1s ease forwards 1.8s;
}

#cd-preview-btn {
  margin-top: 32px;
  background: transparent;
  border: 1px solid rgba(212, 160, 160, 0.25);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  padding: 7px 20px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  opacity: 0;
  animation: fadeUp 1s ease forwards 2.1s;
}
#cd-preview-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ═══════════════════════════════════════════
   PAGE LOADER
═══════════════════════════════════════════ */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}
#page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}
.loader-heart {
  font-size: 3rem;
  color: var(--accent-hot);
  animation: heartbeat 1s ease-in-out infinite;
}

/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
ol, ul { list-style: none; }

/* ═══════════════════════════════════════════
   SHARED SECTION UTILITIES
═══════════════════════════════════════════ */
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 24px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 12px;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 60px;
}

/* scroll-reveal base */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--transition), transform 0.7s var(--transition);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════
   HERO
═══════════════════════════════════════════ */
#hero {
  position: relative;
  height: 100dvh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-deep);
}

#particles {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
}

.hero-label {
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeUp 1s ease forwards 0.6s;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 600;
  line-height: 1.05;
  color: var(--text);
  margin: 12px 0 8px;
  opacity: 0;
  animation: fadeUp 1s ease forwards 1s;
}

.hero-name {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 7vw, 5rem);
  font-style: italic;
  background: linear-gradient(135deg, var(--accent), var(--accent-hot));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  animation: fadeUp 1s ease forwards 1.5s;
}

.hero-sub {
  margin-top: 20px;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-muted);
  max-width: 480px;
  margin-inline: auto;
  opacity: 0;
  animation: fadeUp 1s ease forwards 2s;
}

/* Counter embedded in hero */
.hero-counter {
  margin-top: 44px;
  opacity: 0;
  animation: fadeUp 1s ease forwards 2.4s;
}

.hero-counter-label {
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.hero-counter .counter-grid {
  justify-content: center;
  gap: clamp(12px, 3vw, 40px);
}

.hero-counter .counter-number {
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--accent-hot);
  text-shadow: 0 0 30px rgba(232, 96, 122, 0.4);
}

.hero-counter .counter-label {
  color: var(--text-muted);
}

.hero-counter .counter-tagline {
  margin-top: 14px;
  font-size: 0.95rem;
}

#counter { display: none !important; }

.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.scroll-arrow {
  display: block;
  color: var(--accent);
  font-size: 1.5rem;
  animation: bounce 2s ease-in-out infinite;
}

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(10px); }
}

/* ═══════════════════════════════════════════
   COUNTER
═══════════════════════════════════════════ */
#counter {
  background: var(--bg-mid);
  position: relative;
}

#counter::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(232,96,122,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.counter-grid {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 4vw, 60px);
  flex-wrap: wrap;
  margin: 48px 0 32px;
}

.counter-unit {
  text-align: center;
  min-width: 80px;
}

.counter-number {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  transition: transform 0.3s ease, color 0.3s ease;
}

.counter-number.flip {
  animation: flipDigit 0.35s ease;
}

.counter-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 8px;
}

.counter-tagline {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

@keyframes flipDigit {
  0%   { transform: rotateX(0deg); }
  50%  { transform: rotateX(90deg); color: var(--accent-hot); }
  100% { transform: rotateX(0deg); }
}

/* ═══════════════════════════════════════════
   TIMELINE
═══════════════════════════════════════════ */
#timeline { background: var(--bg-deep); }

.timeline-list {
  position: relative;
  padding: 20px 0;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 45%;
  margin-bottom: 60px;
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.timeline-item:nth-child(odd) {
  margin-left: 0;
  transform: translateX(-40px);
}

.timeline-item:nth-child(even) {
  margin-left: 55%;
  transform: translateX(40px);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-badge {
  position: absolute;
  top: 0;
  background: var(--accent-hot);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
}

.timeline-item:nth-child(odd) .timeline-badge  { right: -60px; }
.timeline-item:nth-child(even) .timeline-badge { left: -60px; }

.timeline-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(212, 160, 160, 0.1);
  transition: box-shadow var(--transition);
}

.timeline-card:hover {
  box-shadow: 0 8px 40px rgba(232, 96, 122, 0.15);
}

.timeline-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.timeline-text {
  padding: 20px;
}

.timeline-date {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.timeline-text p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════
   GALLERY
═══════════════════════════════════════════ */
#gallery { background: var(--bg-mid); }

.gallery-grid {
  columns: 3;
  column-gap: 16px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: auto;
  transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.03);
  box-shadow: 0 12px 40px rgba(232, 96, 122, 0.2);
}

/* ═══════════════════════════════════════════
   FLIP CARDS
═══════════════════════════════════════════ */
#reasons { background: var(--bg-deep); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.card {
  height: 180px;
  perspective: 1000px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.card.visible { opacity: 1; transform: translateY(0); }

.card-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.card-front,
.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card-front {
  background: var(--bg-card);
  border: 1px solid rgba(212, 160, 160, 0.15);
  gap: 8px;
}

.card-icon {
  font-size: 2rem;
  color: var(--accent-hot);
}

.card-num {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text-muted);
}

.card-back {
  background: linear-gradient(135deg, #2a0830, #1a0028);
  border: 1px solid rgba(232, 96, 122, 0.25);
  transform: rotateY(180deg);
  font-size: 0.88rem;
  text-align: center;
  color: var(--text);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════
   LOVE LETTER
═══════════════════════════════════════════ */
#letter { background: var(--bg-warm); }

.letter-paper {
  max-width: 680px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 160, 160, 0.12);
  border-radius: var(--radius);
  padding: clamp(32px, 6vw, 64px);
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.9;
  color: var(--text);
  position: relative;
}

.letter-salutation {
  font-style: italic;
  color: var(--accent);
  margin-bottom: 28px;
  font-size: 1.1em;
}

.letter-body p {
  margin-bottom: 20px;
}

.letter-signoff {
  margin-top: 32px;
  font-style: italic;
  color: var(--accent);
  white-space: pre-line;
}

.letter-cursor {
  display: inline-block;
  color: var(--accent-hot);
  font-weight: 400;
  animation: blink 0.7s step-end infinite;
}

.letter-cursor.hidden { display: none; }

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

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
#site-footer {
  background: var(--bg-deep);
  text-align: center;
  padding: 80px 24px 60px;
  border-top: 1px solid rgba(212, 160, 160, 0.08);
}

.footer-heart {
  width: 60px;
  height: 60px;
  fill: var(--accent-hot);
  margin: 0 auto 32px;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.15); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.1); }
  56%       { transform: scale(1); }
}

.footer-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text);
  max-width: 560px;
  margin: 0 auto 16px;
  line-height: 1.6;
}

.footer-quote cite {
  display: block;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 10px;
  letter-spacing: 0.05em;
}

.footer-credit {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-top: 48px;
}

/* ═══════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: pointer;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  cursor: default;
  box-shadow: 0 0 60px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition);
  line-height: 1;
  padding: 4px 8px;
}

.lightbox-close:hover { color: var(--text); }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .timeline-list::before { left: 16px; }

  .timeline-item {
    width: 100%;
    padding-left: 44px;
    margin-left: 0 !important;
  }

  .timeline-item:nth-child(odd) { transform: translateX(-30px); }
  .timeline-item:nth-child(even) { transform: translateX(-30px); }
  .timeline-item.visible { transform: translateX(0); }

  .timeline-item:nth-child(odd) .timeline-badge,
  .timeline-item:nth-child(even) .timeline-badge {
    left: 0; right: auto;
    top: -28px;
  }

  .gallery-grid { columns: 2; }

  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 480px) {
  .counter-grid { gap: 12px; }
  .gallery-grid { columns: 1; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .card { height: 160px; }
}

/* ═══════════════════════════════════════════
   REVEAL OVERLAY — 5-second slam sequence
═══════════════════════════════════════════ */
#reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9200;
  background: #000;
  display: none;
  overflow: hidden;
}

#reveal-overlay.active {
  display: block;
}

#fireworks-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#slam-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: clamp(9rem, 32vw, 22rem);
  font-weight: 600;
  color: #fff;
  pointer-events: none;
  opacity: 0;
  text-shadow: 0 0 80px rgba(255, 200, 200, 0.6);
}

#slam-num.slam-in {
  animation: slamIn 0.38s cubic-bezier(0.15, 0, 0.1, 1) forwards;
}

#slam-num.slam-out {
  animation: slamOut 0.28s ease-in forwards;
}

@keyframes slamIn {
  0%   { transform: scale(5);   opacity: 0; }
  45%  { opacity: 1; }
  100% { transform: scale(1);   opacity: 1; }
}

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

#slam-heart {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(6rem, 22vw, 16rem);
  color: var(--accent-hot);
  pointer-events: none;
  opacity: 0;
  text-shadow:
    0 0 10px #e8607a,
    0 0 20px #e8607a,
    0 0 40px rgba(232, 96, 122, 0.95),
    0 0 80px rgba(232, 96, 122, 0.85),
    0 0 130px rgba(232, 96, 122, 0.65),
    0 0 200px rgba(232, 96, 122, 0.45),
    0 0 300px rgba(232, 96, 122, 0.25);
  filter: drop-shadow(0 0 50px rgba(232, 96, 122, 0.9))
          drop-shadow(0 0 100px rgba(232, 96, 122, 0.5));
}

#slam-heart.slam-in {
  animation: heartSlamIn 0.55s cubic-bezier(0.15, 0, 0.1, 1) forwards;
}

@keyframes heartSlamIn {
  0%   { transform: scale(6); opacity: 0; }
  50%  { opacity: 1; }
  75%  { transform: scale(0.88); }
  100% { transform: scale(1);   opacity: 1; }
}

#shockwave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  border: 2px solid rgba(232, 96, 122, 0.9);
  pointer-events: none;
  opacity: 0;
}

#shockwave.pulse {
  animation: shockwavePulse 0.65s ease-out forwards;
}

@keyframes shockwavePulse {
  0%   { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(9);   opacity: 0; }
}

#screen-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  pointer-events: none;
  opacity: 0;
}

#screen-flash.flash {
  animation: screenFlash 0.9s ease-out forwards;
}

@keyframes screenFlash {
  0%   { opacity: 0.95; }
  100% { opacity: 0; }
}
