/* =============================================================
   Sandra Appiah Birthday — style.css
   Stack: Pure CSS, no frameworks
   Aesthetic: Luxe maximalist celebration — deep jewel tones,
              gold accents, confetti energy, smooth motion
   ============================================================= */

/* ─────────────────────────────────────────
   0. CSS CUSTOM PROPERTIES (Design Tokens)
   ───────────────────────────────────────── */
:root {
  /* Palette */
  --color-bg:          #0d0720;   /* deep indigo-black */
  --color-bg-alt:      #130a2e;
  --color-bg-light:    #1e1040;
  --color-gold:        #f0c040;
  --color-gold-light:  #ffe07a;
  --color-rose:        #ff6fa8;
  --color-violet:      #b66dff;
  --color-teal:        #3df0c2;
  --color-white:       #fff;
  --color-offwhite:    #f0eaff;

  /* Typography */
  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'Lato', Arial, sans-serif;

  /* Spacing scale */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  4rem;
  --space-xl:  8rem;

  /* Borders & radii */
  --radius-sm:  0.5rem;
  --radius-md:  1rem;
  --radius-lg:  2rem;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast:   0.2s var(--ease-out-expo);
  --transition-medium: 0.45s var(--ease-out-expo);
  --transition-slow:   0.8s var(--ease-out-expo);

  /* Shadow */
  --shadow-glow-gold:   0 0 32px rgba(240,192,64,0.35);
  --shadow-glow-rose:   0 0 32px rgba(255,111,168,0.35);
  --shadow-card:        0 12px 48px rgba(0,0,0,0.45);
}

/* ─────────────────────────────────────────
   1. RESET & BASE
   ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--color-bg);
  color: var(--color-offwhite);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.75;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* Focus ring — accessibility */
:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}


/* ─────────────────────────────────────────
   2. SHARED SECTION HELPERS
   ───────────────────────────────────────── */
section {
  padding: var(--space-xl) var(--space-md);
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--color-gold), var(--color-rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: var(--space-xs);
}

.section-header.light h2 {
  background: linear-gradient(135deg, var(--color-teal), var(--color-violet));
  -webkit-background-clip: text;
  background-clip: text;
}

.section-sub {
  font-size: 1.1rem;
  color: rgba(240,234,255,0.7);
  letter-spacing: 0.02em;
}

/* Scroll-reveal base class (toggled by app.js) */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

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


/* ─────────────────────────────────────────
   3. HERO
   ───────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--space-lg) var(--space-md);
  background: radial-gradient(ellipse at 50% 40%,
    #1a0a40 0%,
    #0d0720 70%
  );
}

/* Fireworks canvas fills hero */
#fireworks-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Balloons ── */
.balloons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.balloon {
  position: absolute;
  font-size: clamp(1.8rem, 4vw, 3rem);
  animation: floatUp 6s ease-in-out infinite;
  opacity: 0.85;
  user-select: none;
}

.b1 { left: 5%;  bottom: -10%; animation-delay: 0s;    animation-duration: 7s; }
.b2 { left: 18%; bottom: -10%; animation-delay: 1.2s;  animation-duration: 9s; }
.b3 { left: 38%; bottom: -10%; animation-delay: 0.5s;  animation-duration: 6s; }
.b4 { left: 72%; bottom: -10%; animation-delay: 2s;    animation-duration: 8s; }
.b5 { left: 88%; bottom: -10%; animation-delay: 1.5s;  animation-duration: 7.5s; }

@keyframes floatUp {
  0%   { transform: translateY(0) rotate(-5deg);  opacity: 0; }
  10%  { opacity: 0.9; }
  80%  { opacity: 0.8; }
  100% { transform: translateY(-110vh) rotate(8deg); opacity: 0; }
}

/* ── Hero content ── */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 860px;
  padding: var(--space-md);
}

.hero-pre {
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--color-gold-light);
  margin-bottom: var(--space-sm);
  animation: fadeInDown 0.8s var(--ease-out-expo) 0.3s both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--color-white);
  text-shadow: 0 4px 40px rgba(240,192,64,0.3);
  animation: fadeInDown 1s var(--ease-out-expo) 0.5s both;
}

.name-highlight {
  display: block;
  background: linear-gradient(
    120deg,
    var(--color-gold) 0%,
    var(--color-rose) 50%,
    var(--color-violet) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation:
    fadeInDown 1s var(--ease-out-expo) 0.7s both,
    shimmer 4s linear 1.8s infinite;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: rgba(240,234,255,0.8);
  margin-top: var(--space-sm);
  animation: fadeInDown 1s var(--ease-out-expo) 0.9s both;
}

/* ── Scroll cue ── */
.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-top: var(--space-md);
  color: var(--color-gold-light);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: fadeInDown 1s var(--ease-out-expo) 1.2s both, bounce 2.5s ease-in-out 2s infinite;
  transition: color var(--transition-fast);
}

.scroll-cue:hover { color: var(--color-white); }

.scroll-icon {
  font-size: 1.4rem;
  line-height: 1;
}

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

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

/* Decorative star-dust overlay on hero */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 80% 20%, rgba(240,192,64,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 80%, rgba(255,111,168,0.5) 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}


/* ─────────────────────────────────────────
   4. GALLERY
   ───────────────────────────────────────── */
#gallery {
  background: var(--color-bg-alt);
}

/* Decorative top wave */
#gallery::before {
  content: '';
  display: block;
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  height: 80px;
  background: var(--color-bg);
  clip-path: ellipse(55% 100% at 50% 0%);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-card);

  /* Aspect ratio 4:3 */
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-medium);
}

/* Caption overlay */
.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(transparent, rgba(13,7,32,0.9));
  color: var(--color-white);
  font-size: 0.9rem;
  font-style: italic;
  transform: translateY(100%);
  transition: transform var(--transition-medium);
}

.gallery-item:hover img,
.gallery-item:focus-within img {
  transform: scale(1.08);
}

.gallery-item:hover figcaption,
.gallery-item:focus-within figcaption {
  transform: translateY(0);
}

/* Gold ring on hover */
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--color-gold);
  border-radius: var(--radius-md);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.gallery-item:hover::after,
.gallery-item:focus-within::after {
  opacity: 1;
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(7, 2, 20, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.lightbox[hidden] { display: none; }

.lightbox-figure {
  max-width: 90vw;
  max-height: 85dvh;
  text-align: center;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 75dvh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-glow-gold);
}

.lightbox-figure figcaption {
  margin-top: 0.75rem;
  color: var(--color-gold-light);
  font-style: italic;
  font-size: 1rem;
}

/* Lightbox controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(240,192,64,0.15);
  border: 2px solid var(--color-gold);
  color: var(--color-gold);
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--color-gold);
  color: var(--color-bg);
  transform: scale(1.1);
}

.lightbox-close { top: 1.5rem; right: 1.5rem; }
.lightbox-prev  { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 1.5rem; top: 50%; transform: translateY(-50%); }

.lightbox-prev:hover { transform: translateY(-50%) scale(1.1); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.1); }


/* ─────────────────────────────────────────
   5. LETTER
   ───────────────────────────────────────── */
#letter {
  background: linear-gradient(160deg, #1a0840 0%, #0d0720 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.letter-envelope {
  font-size: clamp(3rem, 8vw, 5rem);
  animation: envelopeBounce 3s ease-in-out infinite;
  margin-bottom: var(--space-sm);
}

@keyframes envelopeBounce {
  0%, 100% { transform: rotate(-5deg) scale(1);   }
  50%       { transform: rotate(5deg)  scale(1.05); }
}

.letter-card {
  background: linear-gradient(145deg, #fff9f0 0%, #fff 100%);
  color: #1a1030;
  border-radius: var(--radius-lg);
  max-width: 780px;
  width: 100%;
  padding: clamp(2rem, 5vw, 4rem);
  box-shadow:
    var(--shadow-card),
    0 0 0 6px rgba(240,192,64,0.25),
    0 0 60px rgba(240,192,64,0.12);
  position: relative;
  overflow: hidden;
}

/* Subtle patterned background on the letter */
.letter-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f0c040' fill-opacity='0.04'%3E%3Ccircle cx='20' cy='20' r='2'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.letter-header {
  text-align: center;
  margin-bottom: var(--space-md);
  border-bottom: 2px dashed rgba(240,192,64,0.4);
  padding-bottom: var(--space-md);
}

.letter-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  font-style: italic;
  color: #4a2080;
  margin-bottom: 0.4rem;
}

.letter-date {
  font-size: 0.9rem;
  color: #9070c0;
  letter-spacing: 0.05em;
}

.letter-body p {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.9;
  margin-bottom: var(--space-sm);
  color: #2a1a4a;
}

.letter-salutation {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.6rem) !important;
  font-style: italic;
  color: #4a2080 !important;
  margin-bottom: var(--space-sm) !important;
}

.letter-sign-off {
  margin-top: var(--space-md) !important;
  font-family: var(--font-display);
  font-style: italic;
  color: #4a2080 !important;
  font-size: clamp(1rem, 2.5vw, 1.25rem) !important;
}

/* Confetti / emoji strip at bottom of letter */
.letter-confetti {
  margin-top: var(--space-md);
  text-align: center;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  letter-spacing: 0.3em;
  animation: confettiWave 4s ease-in-out infinite;
}

@keyframes confettiWave {
  0%, 100% { letter-spacing: 0.3em; }
  50%       { letter-spacing: 0.5em; }
}


/* ─────────────────────────────────────────
   6. VIDEO
   ───────────────────────────────────────── */
#video {
  background: var(--color-bg-alt);
}

.video-wrapper {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow:
    var(--shadow-card),
    0 0 60px rgba(182,109,255,0.25);

  /* 16:9 responsive ratio */
  padding-top: 56.25%;
  height: 0;
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-md);
  transition: box-shadow var(--transition-medium);
}

.video-wrapper:hover {
  box-shadow:
    var(--shadow-card),
    0 0 80px rgba(182,109,255,0.5);
}


/* ─────────────────────────────────────────
   7. FUN FACTS — FLIP CARDS
   ───────────────────────────────────────── */
#fun-facts {
  background: linear-gradient(170deg, #0d0720 0%, #1a0540 100%);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* 3D flip card setup */
.flip-card {
  perspective: 1000px;
  height: 220px;
  cursor: pointer;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.65s var(--ease-out-expo);
  transform-style: preserve-3d;
}

/* Flip on hover OR keyboard focus OR .flipped class (set by JS) */
.flip-card:hover .flip-inner,
.flip-card:focus .flip-inner,
.flip-card.flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-front {
  background: linear-gradient(145deg, #1e0d44, #2a1060);
  border: 2px solid rgba(240,192,64,0.3);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast);
}

.flip-card:hover .flip-front {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-glow-gold);
}

.flip-front p {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-gold-light);
}

.card-emoji {
  font-size: 2.6rem;
  line-height: 1;
  animation: pulse 3s ease-in-out infinite;
}

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

.flip-back {
  background: linear-gradient(145deg, var(--color-rose), var(--color-violet));
  transform: rotateY(180deg);
}

.flip-back p {
  color: var(--color-white);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
}


/* ─────────────────────────────────────────
   8. COUNTDOWN
   ───────────────────────────────────────── */
#countdown {
  background: radial-gradient(ellipse at 50% 50%, #1a0840 0%, #0d0720 80%);
  text-align: center;
}

.counter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: var(--space-md) auto;
  max-width: 700px;
}

.counter-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(240,192,64,0.3);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  min-width: 120px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.counter-box:hover {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-glow-gold);
}

.counter-num {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  transition: transform 0.15s ease;
}

.counter-num.bump {
  transform: scale(1.15);
}

.counter-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(240,234,255,0.6);
}

.counter-message {
  color: var(--color-rose);
  font-size: 1.1rem;
  font-style: italic;
  margin-top: var(--space-sm);
}


/* ─────────────────────────────────────────
   9. FOOTER
   ───────────────────────────────────────── */
#footer {
  background: var(--color-bg);
  padding: var(--space-lg) var(--space-md) 0;
  text-align: center;
  border-top: 2px solid rgba(240,192,64,0.15);
}

.footer-inner {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: var(--space-lg);
}

.footer-wish {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  font-style: italic;
  font-weight: 700;
  color: var(--color-gold-light);
  line-height: 1.4;
  margin-bottom: var(--space-sm);
}

.footer-hearts {
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  margin-bottom: var(--space-sm);
  animation: heartbeat 2.5s ease-in-out infinite;
}

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

.footer-credit {
  font-size: 0.85rem;
  color: rgba(240,234,255,0.4);
  letter-spacing: 0.05em;
}

/* ── Ticker ribbon ── */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  background: linear-gradient(90deg, var(--color-rose), var(--color-violet), var(--color-teal), var(--color-gold), var(--color-rose));
  background-size: 300% 100%;
  animation: gradientShift 8s linear infinite;
  padding: 0.75rem 0;
  margin-top: var(--space-md);
}

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

.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: tickerScroll 25s linear infinite;
}

.ticker-track span {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--color-bg);
  padding: 0 0.5rem;
}

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


/* ─────────────────────────────────────────
   10. UTILITIES & ANIMATIONS
   ───────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Sparkling star cursor trail (cosmetic) */
.star-trail {
  position: fixed;
  pointer-events: none;
  z-index: 99998;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gold);
  transform: translate(-50%, -50%);
  animation: starFade 0.6s ease forwards;
}

@keyframes starFade {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
}


/* ─────────────────────────────────────────
   11. RESPONSIVE OVERRIDES
   ───────────────────────────────────────── */
@media (max-width: 600px) {
  section {
    padding: var(--space-lg) var(--space-sm);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

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

  .flip-card {
    height: 180px;
  }

  .counter-box {
    min-width: 90px;
    padding: 1rem 1.2rem;
  }

  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
}

@media (max-width: 380px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

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