/* ============================================================
   Wedding invitation — aubergine & gold theme

   Every colour comes from the tokens below. To re-theme the whole invitation,
   change these eight values; nothing else hardcodes a theme colour.
   ============================================================ */

:root {
  --plum-dark:   #39304B;   /* deep sections: countdown, thank you, intro */
  --plum:        #574A72;   /* buttons, emblems */
  --lilac:       #8678A3;   /* soft accents */
  --gold:        #C5A059;   /* the accent throughout */
  --gold-light:  #E8D7B0;
  --gold-dark:   #967533;
  --ivory:       #FAF8FC;   /* page background */
  --cream:       #F3EFF7;   /* banded sections */
  --ink:         #2A2633;   /* body text */
  --shadow-soft: 0 18px 45px rgba(42, 34, 56, .16);
}

body {
  background: var(--ivory);
  color: var(--ink);
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, .serif { font-family: 'Cormorant Garamond', serif; }
.script { font-family: 'Great Vibes', cursive; }

.text-gold       { color: var(--gold) !important; }
.text-gold-light { color: var(--gold-light) !important; }
.text-gold-dark  { color: var(--gold-dark) !important; }
.text-plum-dark { color: var(--plum-dark) !important; }
.bg-plum        { background: var(--plum) !important; }
.bg-plum-dark   { background: var(--plum-dark) !important; }
.bg-cream        { background: var(--cream) !important; }
.border-gold     { border-color: var(--gold) !important; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .7rem;
  font-weight: 600;
}

.rule {
  width: 120px; height: 1px; margin-inline: auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.max-w-4xl { max-width: 880px; }
.max-w-6xl { max-width: 1180px; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .3, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ============================================================
   Envelope intro
   ============================================================ */
body.is-locked { overflow: hidden; }

#intro {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 42%, #5A4B78 0%, #3E3458 55%, #2B2440 100%);
  transition: opacity .9s ease, visibility .9s ease;
}
#intro::before,
#intro::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  border: 1px solid rgba(197, 160, 89, .22);
  border-radius: 50%; transform: translate(-50%, -50%);
}
#intro::before { width: 560px; height: 560px; }
#intro::after  { width: 760px; height: 760px; }
#intro.is-open { opacity: 0; visibility: hidden; }

.intro-kicker {
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: .32em;
  font-size: .64rem;
  margin-bottom: 2.2rem;
}
.intro-date {
  color: rgba(232, 215, 176, .75);
  text-transform: uppercase;
  letter-spacing: .3em;
  font-size: .64rem;
  margin-top: 2.4rem;
}

.envelope-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  perspective: 1400px;
}
.envelope {
  position: relative; display: block;
  width: min(340px, 78vw); aspect-ratio: 1.55 / 1;
  animation: float 5.5s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.env-back, .env-front, .env-flap, .env-letter {
  position: absolute; inset: 0; border-radius: 8px;
}
.env-back  { background: linear-gradient(145deg, #e3cf9f, #c9ad76); }
.env-front {
  background: linear-gradient(160deg, #f0dfb6 0%, #dcc48d 55%, #cdb176 100%);
  box-shadow: var(--shadow-soft);
  z-index: 3;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.env-front::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(42deg, transparent 49.4%, rgba(150, 117, 51, .35) 50%, transparent 50.6%),
    linear-gradient(-42deg, transparent 49.4%, rgba(150, 117, 51, .35) 50%, transparent 50.6%);
}
.env-flap {
  z-index: 4;
  background: linear-gradient(180deg, #e9d5a8, #d3b87f);
  clip-path: polygon(0 0, 100% 0, 50% 62%);
  transform-origin: top center;
  transition: transform .9s cubic-bezier(.6, -.3, .3, 1.3);
}
.env-letter {
  z-index: 2;
  inset: auto 8% 12% 8%; height: 84%;
  background: var(--ivory);
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .35rem; padding: 1rem; text-align: center;
  color: var(--plum-dark);
  transition: transform 1s cubic-bezier(.2, .8, .3, 1), opacity .5s ease;
}
.env-letter small { font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-dark); }
.env-letter .initials { font-family: 'Cormorant Garamond', serif; font-size: 2rem; color: var(--plum-dark); }

.env-seal {
  position: absolute; z-index: 5;
  left: 50%; top: 43%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #e8d4a3, #b4913f);
  color: #fff; font-size: 1.1rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
  transition: opacity .4s ease, transform .5s ease;
}
.env-label {
  position: absolute; z-index: 6; inset: auto 0 8% 0;
  display: flex; flex-direction: column; align-items: center; gap: .45rem;
  padding-inline: 8%;
}
.env-names {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.25rem, 5vw, 1.85rem);
  color: #332B45;
  line-height: 1.12;
  max-width: 100%;
  text-wrap: balance;
}
/* long names (placeholders, double-barrelled names) step down a size */
.env-names.is-long { font-size: clamp(.95rem, 3.4vw, 1.3rem); }

@media (max-width: 480px) {
  .env-names { font-size: 1.45rem; }
  .env-names.is-long { font-size: 1.05rem; }
  .env-seal { width: 44px; height: 44px; font-size: .95rem; }
}
.env-cta {
  font-size: .58rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold-dark); font-weight: 600;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

.envelope-btn:hover .env-flap { transform: rotateX(-18deg); }
.envelope.is-opening .env-flap { transform: rotateX(-180deg); z-index: 1; }
.envelope.is-opening .env-seal { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
.envelope.is-opening .env-letter { transform: translateY(-58%) scale(1.04); z-index: 6; }
.envelope.is-opening .env-label { opacity: 0; transition: opacity .3s ease; }

/* ============================================================
   Hero
   ============================================================ */
#hero {
  min-height: 100svh;
  background-size: cover;
  /* A portrait-shaped photo crops hard on a wide screen. Sitting high keeps the
     couple below the headline rather than behind it. */
  background-position: center 16%;
  background-repeat: no-repeat;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
#hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(42, 34, 58, .72) 0%, rgba(42, 34, 58, .55) 45%, rgba(32, 26, 45, .88) 100%);
}
#hero > .container { position: relative; z-index: 2; }

.monogram {
  width: 96px; height: 96px; border-radius: 50%;
  border: 1px solid rgba(232, 215, 176, .55);
  display: flex; align-items: center; justify-content: center;
  white-space: nowrap;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem; letter-spacing: .1em;
  color: var(--gold-light);
  animation: emblem 4s ease-in-out infinite;
}
@keyframes emblem {
  0%, 100% { box-shadow: 0 0 0 0 rgba(197, 160, 89, .35); }
  50%      { box-shadow: 0 0 0 14px rgba(197, 160, 89, 0); }
}

.gold-text {
  background: linear-gradient(100deg, #e8d7b0 10%, #c5a059 40%, #fff6dd 55%, #c5a059 70%, #e8d7b0 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.bounce { animation: bounce 2.2s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

.shimmer { position: relative; overflow: hidden; }
.shimmer::after {
  content: ''; position: absolute; top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  animation: shimmer 3.6s ease-in-out infinite;
}
@keyframes shimmer { 0% { left: -120%; } 60%, 100% { left: 140%; } }

/* ============================================================
   Countdown
   ============================================================ */
.timer-box {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(197, 160, 89, .35);
  border-radius: 14px;
  padding: 1.1rem .5rem;
  backdrop-filter: blur(4px);
}

/* ============================================================
   Couple
   ============================================================ */
#couple { padding: 5.5rem 1rem; position: relative; overflow: hidden; }
#couple::before, #couple::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5;
}
#couple::before { width: 340px; height: 340px; background: rgba(197, 160, 89, .22); top: -60px; left: -80px; }
#couple::after  { width: 380px; height: 380px; background: rgba(134, 120, 163, .28); bottom: -90px; right: -90px; }
#couple > * { position: relative; z-index: 1; }

.couple-story { max-width: 720px; margin-inline: auto; color: #5C5569; line-height: 1.85; }

.photo-frame {
  position: relative; border-radius: 180px 180px 16px 16px;
  overflow: hidden; aspect-ratio: 3 / 4;
  border: 1px solid rgba(197, 160, 89, .5);
  box-shadow: var(--shadow-soft);
  background: var(--cream);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s ease; }
.photo-frame:hover img { transform: scale(1.05); }

.person-role {
  text-transform: uppercase; letter-spacing: .25em;
  font-size: .64rem; font-weight: 600; color: var(--gold-dark);
}
.person-name { font-size: clamp(1.6rem, 4vw, 2.3rem); color: var(--plum-dark); margin: .2rem 0 0; }

.amp-emblem {
  width: 76px; height: 76px; border-radius: 50%; margin-inline: auto;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #fff, var(--cream));
  border: 1px solid rgba(197, 160, 89, .6);
  box-shadow: var(--shadow-soft);
  font-family: 'Great Vibes', cursive; font-size: 2.1rem; color: var(--gold-dark);
  animation: emblem 4s ease-in-out infinite;
}

/* ============================================================
   Venues
   ============================================================ */
.venue-card {
  background: #fff;
  border: 1px solid rgba(197, 160, 89, .35);
  border-radius: 20px;
  padding: 2.4rem 1.6rem 1.8rem;
  text-align: center;
  box-shadow: var(--shadow-soft);
  position: relative;
  height: 100%;
}
.venue-emblem {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--plum); color: var(--gold-light);
  border: 1px solid rgba(197, 160, 89, .6);
}
.venue-chapter {
  display: block; text-transform: uppercase; letter-spacing: .28em;
  font-size: .62rem; color: var(--gold-dark); font-weight: 600;
}
.venue-title { font-size: 2rem; color: var(--plum-dark); margin: .25rem 0 .1rem; }
.venue-time {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.6rem; color: var(--gold-dark); line-height: 1;
}
.venue-time small { font-size: .9rem; letter-spacing: .1em; margin-left: .15rem; }
.venue-time.is-text { font-size: 1.1rem; font-style: italic; }

.venue-details { list-style: none; padding: 0; margin: 1.4rem 0; text-align: left; }
.venue-details li { display: flex; gap: .8rem; align-items: flex-start; padding: .6rem 0; border-top: 1px dashed rgba(197, 160, 89, .35); }
.venue-details li i { color: var(--gold-dark); margin-top: .35rem; width: 18px; text-align: center; }
.venue-details small { display: block; text-transform: uppercase; letter-spacing: .16em; font-size: .58rem; color: var(--gold-dark); }
.venue-details span { color: #4C4558; font-size: .92rem; }

.venue-actions { display: grid; gap: .6rem; }
.venue-route { text-align: center; padding: 1.6rem 0; color: var(--gold-dark); }
.venue-route .line { display: block; font-size: 1.1rem; margin: .4rem 0; }
.venue-route em { font-style: italic; font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; }

/* dropdown must sit above neighbouring cards */
.venue-card .dropdown { position: static; }
.venue-card .dropdown-menu { z-index: 1080; }

/* ============================================================
   Scatter gallery
   ============================================================ */
#gallery { padding: 5rem 1rem 3rem; background: var(--cream); border-block: 1px solid rgba(197, 160, 89, .3); }

.scatter-board {
  position: relative;
  max-width: 1120px; margin: 2.5rem auto 0;
  height: 620px;          /* fallback; main.js sets this from the photo count */
}
.polaroid {
  position: absolute;
  width: 210px;
  background: #fff;
  padding: 10px 10px 34px;
  border-radius: 4px;
  box-shadow: 0 14px 34px rgba(42, 34, 56, .24);
  cursor: pointer;
  opacity: 0;
  transition: opacity .7s ease, transform .9s cubic-bezier(.2, .8, .3, 1), box-shadow .3s ease;
  transform: translate(-50%, -50%) scale(.6) rotate(0deg);
}
.polaroid.is-in { opacity: 1; }
.polaroid:hover, .polaroid:focus-visible {
  box-shadow: 0 22px 48px rgba(42, 34, 56, .34);
  z-index: 40 !important;
}
.polaroid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--cream); }
.polaroid figcaption {
  font-family: 'Cormorant Garamond', serif;
  font-size: .82rem; font-style: italic; color: #5C5569;
  text-align: center; padding-top: .5rem;
}

@media (max-width: 767px) {
  .polaroid { width: 43vw; max-width: 190px; padding: 8px 8px 28px; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1900;
  background: rgba(26, 21, 36, .94);
  display: none; place-items: center;
  padding: 2rem 1rem;
}
.lightbox.is-open { display: grid; }
.lightbox img { max-width: min(92vw, 820px); max-height: 76vh; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); }
.lightbox-caption {
  color: var(--gold-light); font-family: 'Cormorant Garamond', serif;
  font-style: italic; text-align: center; margin-top: 1rem;
}
.lb-btn {
  position: absolute; border: 1px solid rgba(197, 160, 89, .5);
  background: rgba(0, 0, 0, .35); color: var(--gold-light);
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
}
.lb-close { top: 1.4rem; right: 1.4rem; }
.lb-prev  { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 1.2rem; top: 50%; transform: translateY(-50%); }

/* ============================================================
   Thank you / footer / audio
   ============================================================ */
.glass-dark {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(197, 160, 89, .35);
  border-radius: 18px;
  backdrop-filter: blur(6px);
}

#audioToggle {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 1500;
  display: none; align-items: center; gap: .5rem;
  background: var(--plum-dark); color: var(--gold-light);
  border: 1px solid rgba(197, 160, 89, .6);
  border-radius: 999px; padding: .55rem 1rem;
  font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  box-shadow: var(--shadow-soft); cursor: pointer;
}
#audioToggle.is-available { display: inline-flex; }

/* ---------- Floating petals ---------- */
#petals { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.petal {
  position: absolute; top: -40px;
  color: rgba(197, 160, 89, .45);
  animation: fall linear infinite;
}
@keyframes fall {
  0%   { transform: translateY(-40px) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(104vh) rotate(420deg); opacity: 0; }
}
