/* === Romantic Luxury Wedding Invitation === */
/* Theme: "Emerald & Gold" — re-skinned from the Crimson Classic base */

:root {
  --beige: hsl(45 40% 95%);
  --beige-deep: hsl(42 28% 86%);
  --wine: hsl(162 42% 26%);            /* emerald (kept var name for compatibility) */
  --wine-deep: hsl(162 48% 17%);
  --wine-soft: hsl(162 42% 26% / 0.7);
  --foreground: hsl(160 30% 15%);
  --muted: hsl(162 16% 36%);
  --card: hsl(45 44% 97%);
  --border: hsl(42 28% 84%);
  --primary-fg: hsl(45 50% 96%);

  --gold: hsl(40 56% 47%);
  --gold-soft: hsl(40 52% 56%);

  --gradient-wine: linear-gradient(135deg, hsl(162 48% 15%), hsl(162 40% 30%));
  --shadow-soft: 0 20px 60px -20px hsl(162 50% 18% / 0.28);
  --shadow-card: 0 10px 40px -15px hsl(162 45% 22% / 0.30);

  /* arched (cathedral-top) photo shape */
  --arch: 50% 50% 14px 14px / 26% 26% 14px 14px;

  /* shared easing for transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--beige);
  color: var(--foreground);
  font-family: 'Cormorant Garamond', serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* === Typography helpers === */
.script   { font-family: 'Great Vibes', cursive; }
.hand     { font-family: 'Parisienne', cursive; }
.italic   { font-style: italic; }
.tiny-caps {
  font-size: 11px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

/* === PRELOADER === */
.preloader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--gradient-wine);
  transition: opacity 0.7s ease;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
}
.preloader-hint {
  margin-top: 2.4rem;
  font-family: 'Playfair Display', serif;
  color: hsl(45 50% 96% / 0.72);
  font-size: 0.68rem; letter-spacing: 0.34em; text-transform: uppercase;
  animation: float 3.2s ease-in-out infinite;
}
.preloader.fading { opacity: 0; }
.preloader.hidden { display: none; }

.env-wrap {
  display: flex; flex-direction: column; align-items: center;
  transition: transform 0.85s var(--ease), opacity 0.85s var(--ease);
}

.envelope {
  position: relative;
  width: min(82vw, 360px);
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  background: linear-gradient(160deg, #f4eede 0%, #e9ddc6 100%);
  box-shadow: 0 36px 70px -24px rgba(0,0,0,0.5);
  perspective: 1100px;
  cursor: pointer;
  animation: float 5.5s ease-in-out infinite;
  transition: transform 0.85s var(--ease) 0.5s, opacity 0.85s var(--ease) 0.5s;
}
@media (min-width: 768px) { .envelope { width: 400px; } }

/* side seams */
.envelope::before, .envelope::after {
  content: ""; position: absolute; top: 0; width: 50%; height: 100%; z-index: 2;
}
.envelope::before { left: 0;  background: linear-gradient(135deg, #ece2cc 0%, transparent 62%); clip-path: polygon(0 0, 0 100%, 50% 50%); }
.envelope::after  { right: 0; background: linear-gradient(225deg, #ece2cc 0%, transparent 62%); clip-path: polygon(100% 0, 100% 100%, 50% 50%); }

/* front pocket */
.env-front {
  position: absolute; inset: 0;
  background: linear-gradient(155deg, #efe6d2 0%, #e2d4b8 100%);
  clip-path: polygon(0 20%, 50% 60%, 100% 20%, 100% 100%, 0 100%);
  border-radius: 0 0 8px 8px;
  z-index: 3;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}

/* top flap */
.env-flap {
  position: absolute; top: 0; left: 0; width: 100%; height: 64%;
  background: linear-gradient(160deg, #f0e7d3 0%, #ddcdac 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 0.7s var(--ease) 0.2s, z-index 0s linear 0.45s;
  z-index: 5;
  box-shadow: 0 4px 8px rgba(0,0,0,0.07);
}

/* wax seal */
.env-seal {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, hsl(162 38% 33%), hsl(162 50% 16%));
  border: 1px solid hsl(162 30% 22%);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35),
              inset 0 2px 6px hsl(162 40% 42% / 0.55),
              inset 0 -3px 8px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 6;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}
.seal-mono {
  font-family: 'Playfair Display', serif;
  color: var(--gold-soft);
  font-size: 1.25rem; font-weight: 600; letter-spacing: 0.02em;
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
}

/* OPEN sequence: seal vanishes -> flap lifts -> envelope zooms & fades */
.preloader.open .env-seal  { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
.preloader.open .env-flap  { transform: rotateX(176deg); z-index: 1; }
.preloader.open .envelope  { animation: none; transform: scale(1.4) translateY(-5%); opacity: 0; }
.preloader.open .env-wrap  { transform: scale(1.04); }
.preloader.open .preloader-hint { opacity: 0; transition: opacity 0.3s ease; }

/* === SCROLL HEART PATH === */
.scroll-path {
  position: fixed; inset: 0; z-index: 5;
  pointer-events: none; overflow: hidden;
  opacity: 0.6;
}
.scroll-path svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.heart-follower {
  position: absolute;
  left: 50%; top: 1%;
  transform: translate(-50%, -50%);
  transition: left 0.15s linear, top 0.15s linear;
  opacity: 0.85;
  filter: drop-shadow(0 0 10px hsl(162 42% 26% / 0.5));
  animation: heart-beat 1.6s ease-in-out infinite;
  will-change: left, top;
}

/* === MAIN LAYOUT === */
.main { position: relative; z-index: 10; }

section { padding: 5rem 1.5rem; }

/* === HERO === */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding-top: 5rem; padding-bottom: 4rem;
  position: relative;
}
.hero .small {
  color: var(--gold);
  font-size: 1.15rem;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}
.hero .huge {
  color: var(--wine);
  font-family: 'Great Vibes', cursive;
  font-size: clamp(4.5rem, 16vw, 9rem);
  line-height: 1.05;
  font-weight: 400;
}
.hero .amp {
  color: var(--gold);
  font-size: clamp(2.5rem, 7vw, 4rem);
  margin: 0.25rem 0;
}
.date-line {
  margin-top: 2.5rem;
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}
.date-line span {
  display: inline-block; width: 2.5rem; height: 1px;
  background: hsl(40 56% 47% / 0.55);
}
.hero-heart {
  position: absolute; bottom: 2rem; left: 50%;
  transform: translateX(-50%);
}

/* === GALLERY === */
.gallery-grid {
  max-width: 48rem; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (min-width: 768px) { .gallery-grid { gap: 1.5rem; } }
.gallery-grid.solo { grid-template-columns: 1fr; max-width: 23rem; }
.photo {
  aspect-ratio: 3 / 4;
  border-radius: var(--arch); overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid hsl(40 56% 47% / 0.35);
  position: relative;
  transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
}
.photo.offset { margin-top: 3rem; }
.photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.9s var(--ease);
}
.photo:hover {
  transform: translateY(-6px);
  box-shadow: 0 32px 70px -25px hsl(162 50% 18% / 0.42);
}
.photo:hover img { transform: scale(1.06); }
.photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, hsl(162 48% 15% / 0.3), transparent);
}

/* === INVITATION === */
.invitation {
  max-width: 36rem; margin: 0 auto;
  text-align: center; padding: 4rem 1.5rem;
}
.invitation .italic {
  font-size: 1.25rem;
  color: var(--wine-deep);
  line-height: 1.6;
}
@media (min-width: 768px) { .invitation .italic { font-size: 1.5rem; } }

/* === DATE === */
.date { text-align: center; }
.script.big {
  font-family: 'Great Vibes', cursive;
  color: var(--wine);
  font-size: clamp(3rem, 10vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}
.date .tiny-caps { margin-bottom: 2.5rem; }
.days {
  display: flex; justify-content: center;
  gap: 0.5rem;
}
@media (min-width: 768px) { .days { gap: 1rem; } }
.day {
  width: 3rem; height: 3rem;
  border-radius: 0.75rem;
  border: 1px solid hsl(40 56% 47% / 0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem;
  color: hsl(162 42% 26% / 0.75);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease),
              color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.day:hover {
  transform: translateY(-4px);
  background: hsl(40 56% 47% / 0.12);
  border-color: var(--gold);
  color: var(--wine);
}
.day-heart:hover { transform: translateY(-4px) scale(1.06); }
@media (min-width: 768px) {
  .day { width: 4rem; height: 4rem; font-size: 1.25rem; }
}
.day-heart { position: relative; border: none; }
.day-heart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.day-heart span {
  position: relative; z-index: 1;
  color: var(--primary-fg);
  font-weight: 500; font-size: 1.25rem;
}
@media (min-width: 768px) { .day-heart span { font-size: 1.5rem; } }

/* === TIMELINE === */
.timeline {
  max-width: 36rem; margin: 0 auto;
  display: flex; flex-direction: column;
  gap: 4rem;
}
.event { text-align: center; transition: transform 0.45s var(--ease); }
.event:hover { transform: translateY(-4px); }
.event:hover .event-title { color: var(--gold); }
@media (min-width: 768px) {
  .event.left  { text-align: left;  padding-right: 5rem; }
  .event.right { text-align: right; padding-left: 5rem; }
}
.event-time {
  font-size: 1.875rem;
  color: var(--wine);
  font-weight: 300;
  letter-spacing: 0.05em;
}
@media (min-width: 768px) { .event-time { font-size: 2.25rem; } }
.event-title {
  font-family: 'Great Vibes', cursive;
  color: hsl(162 42% 26% / 0.85);
  font-size: 2.5rem;
  margin: 0.25rem 0 0.75rem;
  transition: color 0.4s var(--ease);
}
@media (min-width: 768px) { .event-title { font-size: 3rem; } }
.event-desc {
  color: hsl(162 48% 17% / 0.72);
  font-size: 1rem;
  max-width: 24rem; margin: 0 auto;
}

/* === COUNTDOWN === */
.countdown-section { text-align: center; padding: 6rem 1.5rem; }
.countdown-section .hand {
  color: var(--gold); font-size: 1.35rem; margin-bottom: 0.5rem;
}
.countdown-section .script.big { margin-bottom: 2rem; }
.countdown {
  display: flex; justify-content: center;
  gap: 0.75rem;
}
@media (min-width: 768px) { .countdown { gap: 1.5rem; } }
.cd-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 68px; height: 80px;
  border-radius: 1rem;
  background: var(--card);
  border: 1px solid hsl(40 56% 47% / 0.35);
  box-shadow: var(--shadow-card);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}
.cd-item:hover {
  transform: translateY(-5px);
  border-color: var(--gold);
  box-shadow: 0 18px 44px -16px hsl(162 45% 22% / 0.45);
}
@media (min-width: 768px) { .cd-item { width: 100px; height: 110px; } }
.cd-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.875rem; font-weight: 300;
  color: var(--wine);
}
@media (min-width: 768px) { .cd-num { font-size: 3rem; } }
.cd-label {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--muted);
  margin-top: 0.25rem;
}

/* === WISHES & GROUP === */
.wishes, .group {
  max-width: 32rem; margin: 0 auto; text-align: center;
}
.wishes .italic, .group .italic {
  font-size: 1.125rem; line-height: 1.6;
  color: hsl(162 48% 17% / 0.8);
}
@media (min-width: 768px) {
  .wishes .italic, .group .italic { font-size: 1.25rem; }
}
.center-heart { display: flex; justify-content: center; margin-top: 2rem; }
.group .italic { margin-bottom: 2rem; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 1rem 2.5rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
              background 0.35s var(--ease), color 0.35s var(--ease), opacity 0.35s var(--ease);
  font-family: 'Cormorant Garamond', serif;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); }
.btn-filled {
  background: var(--gradient-wine);
  color: var(--primary-fg);
  box-shadow: var(--shadow-soft);
  border: 1px solid hsl(40 56% 47% / 0.5);
}
.btn-filled:hover { opacity: 0.94; box-shadow: 0 24px 50px -18px hsl(162 50% 18% / 0.5); }
.btn-outline {
  border: 1px solid var(--gold);
  color: var(--wine); background: transparent;
}
.btn-outline:hover { background: var(--wine); color: var(--primary-fg); border-color: var(--wine); box-shadow: 0 20px 44px -18px hsl(162 50% 18% / 0.4); }

/* === LOCATION === */
.location { max-width: 48rem; margin: 0 auto; text-align: center; }
.venue-card {
  border-radius: 1.5rem 1.5rem 1.25rem 1.25rem; overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid hsl(40 56% 47% / 0.35);
  position: relative; margin-bottom: 1.5rem;
  transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
}
.venue-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 32px 70px -25px hsl(162 50% 18% / 0.42);
}
.venue-card img {
  width: 100%; height: 18rem; object-fit: cover;
  transition: transform 0.9s var(--ease);
}
@media (min-width: 768px) { .venue-card img { height: 24rem; } }
.venue-card:hover img { transform: scale(1.05); }
.venue-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, hsl(162 48% 15% / 0.6), hsl(162 48% 15% / 0.1), transparent);
}
.venue-text {
  position: absolute; bottom: 1.5rem; left: 0; right: 0;
  color: var(--primary-fg);
}
.venue-text .script { font-size: 3rem; }
@media (min-width: 768px) { .venue-text .script { font-size: 3.5rem; } }
.venue-sub {
  font-size: 0.8rem; letter-spacing: 0.3em;
  text-transform: uppercase; margin-top: 0.25rem;
  color: hsl(45 50% 96% / 0.9);
}

/* === CLOSING === */
.closing { max-width: 36rem; margin: 0 auto; text-align: center; padding: 6rem 1.5rem; }
.closing-photo {
  border-radius: var(--arch); overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid hsl(40 56% 47% / 0.4);
  margin: 0 auto 2.5rem;
  max-width: 22rem;
  transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
}
.closing-photo img {
  aspect-ratio: 4/5; object-fit: cover; width: 100%;
  transition: transform 0.9s var(--ease);
}
.closing-photo:hover {
  transform: translateY(-6px);
  box-shadow: 0 32px 70px -25px hsl(162 50% 18% / 0.42);
}
.closing-photo:hover img { transform: scale(1.05); }
.closing-text {
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  line-height: 1.2;
  color: var(--wine);
}
.closing-heart { display: flex; justify-content: center; margin-top: 2rem; }

/* === FOOTER === */
.footer {
  background: var(--gradient-wine);
  padding: 4rem 1.5rem; text-align: center;
}
.footer .script {
  color: var(--primary-fg);
  font-size: clamp(3.5rem, 10vw, 4.5rem);
  line-height: 1.1;
}
.footer .script span { color: var(--gold-soft); }
.footer-date {
  color: hsl(45 50% 96% / 0.7);
  font-size: 0.75rem; letter-spacing: 0.5em;
  text-transform: uppercase; margin-top: 0.75rem;
}

/* === MUSIC TOGGLE === */
.music-toggle {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 60;
  width: 46px; height: 46px; border-radius: 9999px;
  border: 1px solid hsl(40 56% 47% / 0.6);
  background: var(--gradient-wine); color: var(--primary-fg);
  display: none; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-card);
  opacity: 0; transition: transform 0.25s ease, opacity 0.5s ease;
}
.music-toggle.show { display: inline-flex; opacity: 1; }
.music-toggle:hover { transform: scale(1.08); }
.music-toggle .ico-off { display: none; }
.music-toggle.muted .ico-on { display: none; }
.music-toggle.muted .ico-off { display: inline; }

/* === STAGGERED ENTRANCE (countdown + day pills) === */
.days .day, .countdown .cd-item { opacity: 0; }
.days.is-visible .day, .countdown.is-visible .cd-item {
  opacity: 1;
  animation: rise-in 0.6s var(--ease) backwards;
}
.days.is-visible .day:nth-child(1),  .countdown.is-visible .cd-item:nth-child(1) { animation-delay: 0.05s; }
.days.is-visible .day:nth-child(2),  .countdown.is-visible .cd-item:nth-child(2) { animation-delay: 0.12s; }
.days.is-visible .day:nth-child(3),  .countdown.is-visible .cd-item:nth-child(3) { animation-delay: 0.19s; }
.days.is-visible .day:nth-child(4),  .countdown.is-visible .cd-item:nth-child(4) { animation-delay: 0.26s; }
.days.is-visible .day:nth-child(5) { animation-delay: 0.33s; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === ANIMATIONS === */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  filter: blur(5px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
  will-change: opacity, transform, filter;
}
.reveal.is-visible {
  opacity: 1; transform: translateY(0); filter: blur(0);
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .heart-beat, .float, .hero-heart.float, .preloader-hint { animation: none !important; }
  * { scroll-behavior: auto !important; }
  .photo:hover, .venue-card:hover, .closing-photo:hover,
  .cd-item:hover, .day:hover, .event:hover, .btn:hover { transform: none; }
  .days .day, .countdown .cd-item { opacity: 1 !important; animation: none !important; }
}

.heart-beat { animation: heart-beat 1.6s ease-in-out infinite; transform-origin: center; }
.float      { animation: float 5s ease-in-out infinite; }

@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  25%      { transform: scale(1.15); }
  50%      { transform: scale(0.95); }
  75%      { transform: scale(1.1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.hero-heart.float { animation: float-x 5s ease-in-out infinite; }
@keyframes float-x {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-12px); }
}
