/* =========================================
   Vyom & Bhawana - Wedding Invite
   Aesthetic: dark, cinematic, editorial
   ========================================= */

:root {
  --bg:        #07070a;
  --bg-soft:   #0d0d12;
  --bg-card:   rgba(255, 255, 255, 0.035);
  --bg-card-h: rgba(255, 255, 255, 0.06);
  --line:      rgba(255, 255, 255, 0.08);
  --line-2:    rgba(255, 255, 255, 0.14);

  --ink:       #f5f3ee;
  --ink-soft:  #b8b4ab;
  --ink-mute:  #6f6b62;

  --gold:      #d9b878;
  --gold-soft: #e8d2a4;
  --rose:      #b56a6a;
  --plum:      #4a2542;

  --accent-grad: linear-gradient(135deg, #f5e8c9 0%, #d9b878 45%, #b56a6a 100%);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
  --radius:    20px;
  --maxw:      1100px;
  --ease:      cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { background: var(--bg); }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 300;
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

::selection { background: var(--gold); color: #000; }

/* ============ Opening card reveal ============ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}
.intro-panel {
  position: absolute;
  top: 0; bottom: 0;
  width: 51%;
  background: linear-gradient(180deg, #15131c 0%, #0a0a0e 60%, #050507 100%);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}
.intro-panel--l { left: 0; }
.intro-panel--r { right: 0; }

/* Slide states applied by JS only (no auto-firing keyframes) */
.intro-panel--l.slide-out { transform: translate3d(-101%, 0, 0); transition: transform 1.4s cubic-bezier(.76,0,.24,1); }
.intro-panel--r.slide-out { transform: translate3d( 101%, 0, 0); transition: transform 1.4s cubic-bezier(.76,0,.24,1); }

.intro-seal {
  position: absolute;
  top: 50%; left: 50%;
  width: min(240px, 60vw);
  height: min(240px, 60vw);
  text-align: center;
  z-index: 2;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #14121a 0%, #0a0a0e 70%);
  box-shadow:
    0 0 0 1px rgba(217, 184, 120, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.7),
    0 0 80px rgba(217, 184, 120, 0.12);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition:
    opacity 0.9s cubic-bezier(.22,.61,.36,1),
    transform 0.9s cubic-bezier(.22,.61,.36,1),
    filter 0.7s cubic-bezier(.76,0,.24,1);
}
.intro-seal.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.intro-seal.hide {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.4);
  filter: blur(6px);
}
.intro-seal svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 24px rgba(217, 184, 120, 0.5));
}

/* When intro is done, hide it completely (set by JS) */
.intro.done { display: none; }

/* JS handles the failsafe (4.5s setTimeout in script.js).
   The previous CSS-only failsafe (animation: intro-failsafe 0s 4.5s forwards)
   was removed because iOS 26 WebKit fires it on first composite, hiding the
   intro before the panels animate. */

/* Lock body scroll while intro plays */
body.intro-active { overflow: hidden; }

/* Hero content waits for the intro to finish, then enters */
body.intro-active .hero-inner > * { animation-play-state: paused !important; }

/* ============ Ambient gradient orbs ============ */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  will-change: transform;
}
.orb-1 {
  width: 60vmax; height: 60vmax;
  background: radial-gradient(circle, #6b3a1f 0%, transparent 60%);
  top: -25vmax; left: -20vmax;
  animation: drift1 26s ease-in-out infinite alternate;
}
.orb-2 {
  width: 55vmax; height: 55vmax;
  background: radial-gradient(circle, #2a1838 0%, transparent 60%);
  top: 30vh; right: -25vmax;
  animation: drift2 32s ease-in-out infinite alternate;
}
.orb-3 {
  width: 50vmax; height: 50vmax;
  background: radial-gradient(circle, #4a2542 0%, transparent 60%);
  bottom: -20vmax; left: 20vw;
  animation: drift3 38s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(20vmin, 15vmin) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-15vmin, 10vmin) scale(0.9); } }
@keyframes drift3 { to { transform: translate(10vmin, -20vmin) scale(1.1); } }

/* ============ Glitter / fireflies layer ============ */
.glitter {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* Quick twinkles (kept subtle, distant) */
.sparkle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow:
    0 0 4px rgba(232, 210, 164, 0.9),
    0 0 10px rgba(217, 184, 120, 0.5);
  opacity: 0;
  animation: twinkle var(--dur, 5s) ease-in-out var(--delay, 0s) infinite;
  will-change: opacity;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; }
  50%      { opacity: 0.85; }
}

/* Fireflies - warm, breathing, wandering points of light */
.firefly {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #fff4c2;
  box-shadow:
    0 0 6px rgba(255, 230, 140, 0.9),
    0 0 14px rgba(255, 200, 90, 0.7),
    0 0 28px rgba(255, 180, 60, 0.4);
  opacity: 0;
  /* Two stacked animations: slow wander + breathing glow */
  animation:
    firefly-path var(--path-dur, 22s) ease-in-out var(--delay, 0s) infinite alternate,
    firefly-glow var(--glow-dur, 3.5s) ease-in-out var(--glow-delay, 0s) infinite;
  will-change: transform, opacity;
}
.firefly.lg {
  width: 5px; height: 5px;
  background: #fff8d4;
  box-shadow:
    0 0 8px rgba(255, 240, 170, 1),
    0 0 20px rgba(255, 210, 110, 0.8),
    0 0 40px rgba(255, 180, 70, 0.45);
}
@keyframes firefly-path {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(var(--x1, 60px),  var(--y1, -40px)); }
  50%  { transform: translate(var(--x2, -30px), var(--y2, -90px)); }
  75%  { transform: translate(var(--x3, 80px),  var(--y3, -50px)); }
  100% { transform: translate(var(--x4, -50px), var(--y4, 30px)); }
}
@keyframes firefly-glow {
  0%, 100% { opacity: 0; }
  20%      { opacity: 0.95; }
  50%      { opacity: 0.3; }
  80%      { opacity: 0.85; }
}

/* ============ Falling shooting stars with trails ============ */
.stardust {
  position: fixed;
  inset: 0;
  z-index: 1;          /* behind content (which sits at z-index 2) */
  pointer-events: none;
  overflow: hidden;
}
.shooting-star {
  position: absolute;
  top: -20vh;
  left: var(--x, 50vw);
  width: 1px;
  height: var(--trail, 120px);
  /* The trail: thin gradient line, brightest at the bottom (where the head sits) */
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(243, 210, 122, 0.05) 30%,
    rgba(243, 210, 122, 0.45) 80%,
    rgba(255, 240, 190, 0.9) 100%
  );
  border-radius: 999px;
  opacity: 0;
  animation: shoot var(--dur, 4s) cubic-bezier(.55, .05, .8, .4) var(--delay, 0s) infinite;
  will-change: transform, opacity;
  filter: drop-shadow(0 0 4px rgba(243, 210, 122, 0.5));
}
/* Bright head at the leading (bottom) tip */
.shooting-star::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: var(--head, 5px);
  height: var(--head, 5px);
  border-radius: 50%;
  background: #fff5d4;
  box-shadow:
    0 0 6px #fff5d4,
    0 0 14px rgba(243, 210, 122, 0.9),
    0 0 28px rgba(217, 154, 60, 0.6);
}
@keyframes shoot {
  0%   { transform: translate3d(0, -10vh, 0); opacity: 0; }
  10%  { opacity: var(--max-op, 0.85); }
  85%  { opacity: var(--max-op, 0.85); }
  100% { transform: translate3d(0, 130vh, 0); opacity: 0; }
}

/* Subtle film grain */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ============ Scroll progress ============ */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 1px;
  width: 0%;
  background: var(--accent-grad);
  z-index: 200;
  box-shadow: 0 0 18px rgba(217, 184, 120, 0.6);
}

/* ============ Music toggle ============ */
.music-toggle {
  position: fixed;
  top: 22px; right: 22px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 9px 16px 9px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.music-toggle:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--line-2); }
.music-toggle .note { color: var(--gold); font-size: 0.95rem; line-height: 1; }
.music-toggle.playing .note { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Layout ============ */
section {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 160px 32px;
}

.eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: var(--gold);
  margin-bottom: 28px;
  font-weight: 500;
}
.section-title {
  font-family: 'Fraunces', 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 32px;
  color: var(--ink);
}
.section-title .muted { color: var(--ink-mute); font-style: italic; }

.lede {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 640px;
}

/* ============ Hero ============ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  z-index: 2;
  /* overflow stays visible so parallax-shifted RSVP button doesn't get clipped */
}
.hero-inner {
  max-width: 1000px;
  position: relative;
  z-index: 2;
  transform: translateY(var(--hero-shift, 0));
  will-change: transform, opacity;
}
.kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5em;
  color: var(--gold);
  margin-bottom: 40px;
  font-weight: 500;
  opacity: 1;
  animation: rise 1.1s var(--ease) 0.2s both;
}
.names {
  font-family: 'Fraunces', 'Cormorant Garamond', serif;
  font-weight: 200;
  font-style: normal;
  font-size: clamp(3.8rem, 13vw, 10rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.15em;
  color: var(--gold-soft);
}
.names .word {
  display: inline-block;
  color: var(--gold-soft);
  background: var(--accent-grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 1;
  animation: rise 1.4s var(--ease) both;
}
.names .word:nth-of-type(1) { animation-delay: 0.4s; }
.names .word:nth-of-type(2) { animation-delay: 0.8s; }
.names .amp {
  font-style: italic;
  font-weight: 200;
  font-size: 0.55em;
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  opacity: 1;
  animation: amp 1.2s var(--ease) 0.65s both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes amp {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

.tagline {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  color: var(--ink-soft);
  margin-bottom: 14px;
  opacity: 1;
  animation: rise 1s var(--ease) 1.2s both;
}
.when {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  color: var(--ink-mute);
  margin-bottom: 56px;
  font-weight: 400;
  opacity: 1;
  animation: rise 1s var(--ease) 1.4s both;
}

/* ============ Countdown ============ */
.countdown {
  display: flex;
  justify-content: center;
  gap: 1px;
  margin-bottom: 56px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  opacity: 1;
  animation: rise 1s var(--ease) 1.6s both;
}
.countdown > div {
  background: rgba(8, 8, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 22px 14px 18px;
  flex: 1;
  min-width: 0;
}
.countdown strong {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.countdown span {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--ink-mute);
  margin-top: 10px;
  font-weight: 400;
}

/* ============ Buttons ============ */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--ink);
  color: #0a0a0e;
  opacity: 1;
  animation: rise 1s var(--ease) 1.8s both;
}
.btn-primary:hover {
  background: var(--gold);
  color: #0a0a0e;
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(217, 184, 120, 0.3);
}
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
  margin-top: 24px;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--ink-soft);
  transform: translateY(-2px);
}

/* Scroll cue (thin animated line) */
.scroll-cue {
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--ink-mute));
  overflow: hidden;
}
.scroll-cue span {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 30%;
  background: var(--gold);
  animation: trickle 2s ease-in-out infinite;
}
@keyframes trickle {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(330%); }
}

/* ============ Story ============ */
.story {
  text-align: left;
  display: grid;
  gap: 8px;
  padding-bottom: 60px;
}
.events { padding-top: 60px; padding-bottom: 60px; }

/* ============ Timeline ============ */
.timeline {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}
.event-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 40px;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), transform 0.5s var(--ease);
  will-change: transform;
}
.event-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(217, 184, 120, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.event-card:hover {
  background: var(--bg-card-h);
  border-color: var(--line-2);
}
.event-card:hover::before { opacity: 1; }

.event-card.headline {
  border-color: rgba(217, 184, 120, 0.25);
  background: linear-gradient(135deg, rgba(217, 184, 120, 0.06), rgba(74, 37, 66, 0.08));
}

.event-date {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-right: 1px solid var(--line);
  padding-right: 24px;
}
.event-date .day {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: 4.2rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.05em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.event-date .mon {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--ink-mute);
  margin-top: 8px;
  font-weight: 500;
}

.event-body h3 {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--ink);
  margin: 6px 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.event-time {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--gold);
  font-weight: 500;
}
.event-tag {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  color: var(--ink-soft);
  margin-bottom: 14px;
  font-size: 1.1rem;
}
.event-body p { color: var(--ink-soft); margin-bottom: 10px; font-size: 0.95rem; }
.dress {
  font-size: 0.85rem !important;
  color: var(--ink-mute) !important;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.dress span {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-right: 12px;
  font-weight: 500;
}

/* Inline time pill (Wedding card) */
.time-pill {
  display: inline-block;
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  border: 1px solid rgba(217, 184, 120, 0.3);
  background: rgba(217, 184, 120, 0.06);
  padding: 2px 10px;
  border-radius: 999px;
  margin: 0 6px 0 0;
  vertical-align: 1px;
}

/* Stacked time list (Wedding card) */
.time-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.time-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
}
.time-list .time-pill {
  flex-shrink: 0;
  margin: 0;
  min-width: 56px;
  text-align: center;
}

/* Add-to-calendar button */
.cal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 9px 16px 9px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  position: relative;
}
.cal-btn:hover {
  color: var(--gold-soft);
  border-color: rgba(217, 184, 120, 0.5);
  background: rgba(217, 184, 120, 0.08);
  transform: translateY(-1px);
}
.cal-ico {
  width: 14px; height: 14px;
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  position: relative;
  flex-shrink: 0;
}
.cal-ico::before,
.cal-ico::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 1.5px; height: 4px;
  background: currentColor;
  border-radius: 1px;
}
.cal-ico::before { left: 3px; }
.cal-ico::after  { right: 3px; }

/* Calendar chooser popover */
.cal-popover {
  position: fixed;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: rgba(15, 15, 20, 0.98);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  z-index: 9999;
  min-width: 200px;
  animation: pop-in 0.2s var(--ease);
}
.cal-popover button {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.cal-popover button:hover {
  background: rgba(217, 184, 120, 0.1);
  color: var(--gold-soft);
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ Venue ============ */
.venue { display: grid; gap: 8px; }
.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-top: 32px;
  filter: grayscale(0.6) contrast(1.05) brightness(0.85);
  transition: filter 0.6s var(--ease);
}
.map-wrap:hover { filter: grayscale(0) contrast(1) brightness(0.95); }
.map-wrap iframe {
  width: 100%;
  height: 420px;
  border: 0;
  display: block;
}

/* ============ RSVP ============ */
.rsvp { max-width: 760px; }
.rsvp-sub {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.15rem;
  margin-bottom: 40px;
}
.rsvp-form {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--line);
  padding: 44px;
  border-radius: var(--radius);
  display: grid;
  gap: 24px;
}
.rsvp-form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.rsvp-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--ink-mute);
  font-weight: 500;
}
.rsvp-form input,
.rsvp-form select,
.rsvp-form textarea {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 300;
  letter-spacing: normal;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.3);
  text-transform: none;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.rsvp-form input::placeholder,
.rsvp-form textarea::placeholder { color: var(--ink-mute); }
.rsvp-form input:focus,
.rsvp-form select:focus,
.rsvp-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.45);
}
.rsvp-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%23b8b4ab' stroke-width='1.5' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}
.rsvp-form select option { background: #111; color: var(--ink); }
.rsvp-form fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 22px 14px;
  display: grid;
  gap: 4px;
}
.rsvp-form legend {
  padding: 0 10px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--gold);
  font-weight: 500;
}
.rsvp-form .check {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 300;
  cursor: pointer;
}
.rsvp-form .check input {
  width: 16px; height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}
.rsvp-form button { justify-self: start; margin-top: 8px; }
.rsvp-status {
  text-align: left;
  font-size: 0.85rem;
  min-height: 1.2em;
  font-weight: 400;
  letter-spacing: 0.05em;
}
.rsvp-status.success { color: var(--gold-soft); }
.rsvp-status.error   { color: #e88080; }

/* ============ Footer ============ */
.footer {
  text-align: center;
  padding: 50px 24px 50px;
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.signoff {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.hashtag {
  font-size: 0.7rem;
  color: var(--ink-mute);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.tiny { font-size: 0.7rem; color: var(--ink-mute); opacity: 0.7; letter-spacing: 0.15em; }

/* ============ Reveal animations ============ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-left  { transform: translateX(-50px); }
.reveal-right { transform: translateX(50px); }
.reveal-zoom  { transform: scale(0.92); }
.reveal-left.visible,
.reveal-right.visible,
.reveal-zoom.visible { transform: none; }

.event-card { transition-delay: calc(var(--i, 0) * 100ms); }

/* Reduced motion: only tone down the most intense decorations, keep the page lively */
@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  .shooting-star, .sparkle, .firefly { animation: none; opacity: 0.3; }
}

/* ============ Mobile ============ */
@media (max-width: 760px) {
  section { padding: 100px 22px; }
  .hero { padding: 100px 22px 60px; }
  .event-card {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px;
  }
  .event-date {
    flex-direction: row;
    align-items: baseline;
    gap: 14px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 16px;
  }
  .event-date .day { font-size: 2.6rem; }
  .event-date .mon { margin-top: 0; }
  .rsvp-form { padding: 28px; }
  .rsvp-form .row { grid-template-columns: 1fr; }
  .countdown > div { padding: 16px 8px 14px; }
  .music-toggle { top: 14px; right: 14px; padding: 8px 14px; font-size: 0.72rem; }
}

/* ============ Chat widget ============ */
.chat-toggle {
  position: fixed;
  bottom: 22px; right: 22px;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d9b878 0%, #b56a6a 100%);
  color: #0a0a0e;
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(217,184,120,0.3);
  z-index: 900;
  display: grid;
  place-items: center;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.chat-toggle:hover { transform: scale(1.06); box-shadow: 0 12px 32px rgba(217,184,120,0.4); }
.chat-toggle.hidden { transform: scale(0); pointer-events: none; }

.chat-panel {
  position: fixed;
  bottom: 22px; right: 22px;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 80px));
  background: rgba(15, 15, 20, 0.96);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
  z-index: 901;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.chat-header strong {
  display: block;
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1rem;
}
.chat-sub {
  font-size: 0.7rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.chat-close {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  transition: color 0.2s var(--ease);
}
.chat-close:hover { color: var(--gold); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-msg p { margin: 0; }
.chat-msg--host {
  align-self: flex-start;
  background: rgba(255,255,255,0.05);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.chat-msg--guest {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(217,184,120,0.18), rgba(181,106,106,0.18));
  color: var(--ink);
  border: 1px solid rgba(217,184,120,0.25);
  border-bottom-right-radius: 4px;
}
.chat-msg--system {
  align-self: center;
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-style: italic;
  background: transparent;
  padding: 4px 8px;
}

.chat-form {
  padding: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.chat-form input,
.chat-form textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 10px 12px;
  resize: none;
  transition: border-color 0.2s var(--ease);
}
.chat-form input:focus,
.chat-form textarea:focus {
  outline: none;
  border-color: rgba(217,184,120,0.5);
}
.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.chat-input-row textarea {
  flex: 1;
  max-height: 100px;
}
.chat-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #d9b878 0%, #b56a6a 100%);
  color: #0a0a0e;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}
.chat-send:hover { transform: scale(1.06); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 540px) {
  .chat-panel {
    bottom: 10px; right: 10px;
    width: calc(100vw - 20px);
    height: min(64vh, 460px);
    border-radius: 14px;
  }
  .chat-toggle { bottom: 12px; right: 12px; width: 44px; height: 44px; }
  .chat-toggle svg { width: 20px; height: 20px; }
  .chat-header { padding: 10px 14px; }
  .chat-header strong { font-size: 0.92rem; }
  .chat-sub { font-size: 0.62rem; }
  .chat-close { font-size: 1.3rem; }
  .chat-messages { padding: 12px; gap: 8px; }
  .chat-msg { font-size: 0.8rem; padding: 8px 12px; border-radius: 12px; max-width: 88%; }
  .chat-msg--system { font-size: 0.66rem; }
  .chat-form { padding: 10px; gap: 6px; }
  .chat-form input,
  .chat-form textarea {
    /* 16px prevents iOS Safari from zooming the page on focus */
    font-size: 16px;
    padding: 8px 10px;
    border-radius: 9px;
  }
  .chat-input-row textarea { max-height: 70px; }
  .chat-send { width: 34px; height: 34px; }
  .chat-send svg { width: 14px; height: 14px; }
}

/* ============ Venue + RSVP side-by-side layout ============ */
.venue-rsvp-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 60px;
  align-items: start;
  padding: 60px 32px 60px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.venue-rsvp-grid > .venue,
.venue-rsvp-grid > .rsvp {
  padding: 0;
  max-width: none;
}
.venue-rsvp-grid .map-wrap iframe { height: 220px; }
.venue-rsvp-grid .section-title { font-size: 2rem; }
.venue-rsvp-grid .venue-sub { font-size: 1.3rem; }
@media (max-width: 980px) {
  .venue-rsvp-grid {
    grid-template-columns: 1fr;
    gap: 80px;
    padding: 100px 22px;
  }
  .venue-rsvp-grid .map-wrap iframe { height: 320px; }
}

/* Stay sub-block under venue */
.venue-stay { margin-top: 36px; }
.venue-sub {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 1.6rem;
  margin: 4px 0 16px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Easter egg: hidden afterparty reveal on Sangeet card */
.secret-party {
  margin-top: 22px;
  padding: 18px 18px 16px;
  border: 1px dashed rgba(217, 184, 120, 0.4);
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 0%, rgba(217,184,120,0.12), transparent 60%),
    radial-gradient(circle at 90% 100%, rgba(181,106,106,0.12), transparent 60%),
    rgba(15, 15, 20, 0.55);
  position: relative;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  overflow: hidden;
}
.secret-party.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.secret-seal {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 1rem;
  color: var(--gold);
  opacity: 0.7;
  animation: secret-twinkle 2.4s ease-in-out infinite;
}
@keyframes secret-twinkle {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.2); }
}
.secret-title {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--gold);
  margin: 0 0 6px;
}
.secret-body {
  margin: 0 0 8px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
}
.secret-meta {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-style: italic;
}

/* Tap feedback while hunting for the egg */
.event-card.tap-pulse {
  transition: transform 0.15s var(--ease);
}
.event-card.egg-warm {
  box-shadow: 0 0 0 1px rgba(217, 184, 120, 0.18), 0 18px 40px rgba(0,0,0,0.35);
}
.event-card.egg-hot {
  box-shadow: 0 0 0 1px rgba(217, 184, 120, 0.45), 0 0 32px rgba(217, 184, 120, 0.18);
}

/* Story portrait + two-column layout */
.story-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: start;
}
.story-text {
  display: grid;
  gap: 8px;
}
.story-portrait {
  position: relative;
  display: grid;
  place-items: center;
  padding: 12px;
  isolation: isolate;
  /* Nudge image up & toward the right edge of the column */
  margin-top: -40px;
  justify-self: end;
}
.story-portrait img {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
  animation: portrait-float 7s ease-in-out infinite;
  /* Soft oval mask to hide any baked-in checkerboard / stray pixels */
  -webkit-mask-image: radial-gradient(ellipse 68% 88% at 50% 50%, #000 78%, rgba(0,0,0,0.9) 88%, transparent 98%);
          mask-image: radial-gradient(ellipse 68% 88% at 50% 50%, #000 78%, rgba(0,0,0,0.9) 88%, transparent 98%);
}
.portrait-glow {
  position: absolute;
  inset: 6%;
  z-index: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 55%, rgba(217, 184, 120, 0.28), rgba(217, 184, 120, 0) 60%),
    radial-gradient(circle at 50% 50%, rgba(181, 106, 106, 0.18), rgba(181, 106, 106, 0) 65%);
  filter: blur(28px);
  animation: portrait-glow-pulse 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes portrait-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes portrait-glow-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.06); }
}

@media (max-width: 860px) {
  .story-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .story-text { justify-items: center; }
  .story-portrait img { max-width: 320px; }
}
@media (prefers-reduced-motion: reduce) {
  .story-portrait img,
  .portrait-glow { animation: none; }
}

/* Chat nudge bubble - appears after a few seconds prompting RSVP */
.chat-nudge {
  position: fixed;
  bottom: 88px;
  right: 22px;
  max-width: 260px;
  padding: 12px 36px 12px 14px;
  background: rgba(20, 18, 26, 0.96);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(217, 184, 120, 0.35);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(217, 184, 120, 0.1);
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.45;
  z-index: 899;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  cursor: pointer;
}
.chat-nudge::after {
  content: '';
  position: absolute;
  right: 22px;
  bottom: -7px;
  width: 14px; height: 14px;
  background: inherit;
  border-right: 1px solid rgba(217, 184, 120, 0.35);
  border-bottom: 1px solid rgba(217, 184, 120, 0.35);
  transform: rotate(45deg);
}
.chat-nudge.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.chat-nudge p { margin: 0; }
.chat-nudge-close {
  position: absolute;
  top: 4px; right: 6px;
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.chat-nudge-close:hover { color: var(--gold); }
@media (max-width: 540px) {
  .chat-nudge { bottom: 70px; right: 12px; max-width: calc(100vw - 80px); }
}
