/* ============================================================
   styles.css — Malshi & Sadeep · Premium Upgrade
   Playfair Display + Inter · Ivory/Gold palette
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500&family=Pinyon+Script&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  --bg: #F8F5F0;
  --bg-warm: #F2EDE4;
  --secondary: #E8DCCB;
  --accent: #C6A769;
  --accent-dark: #A8894A;
  --accent-light: #DCC99A;
  --text: #2C2C2C;
  --text-mid: #5A5248;
  --text-soft: #8C7E6E;
  --text-faint: #B5A898;
  --serif: 'Playfair Display', 'Georgia', serif;
  --script: 'Pinyon Script', cursive;
  --sans: 'Inter', system-ui, sans-serif;

  /* Motion */
  --ease-elegant: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-enter: cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-exit: cubic-bezier(0.4, 0.0, 1, 1);
}

/* ── Reset ────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.8;
  overflow-x: hidden;
}

/* ── Envelope / Page-Load Screen ─────────────────────────── */

/* Full-screen overlay that shows the envelope */
#envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.9s var(--ease-exit), visibility 0.9s;
}

#envelope-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Hint text above envelope */
.env-hint {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  margin-bottom: 2.5rem;
  animation: envHintPulse 2.5s ease-in-out infinite;
  transition: opacity 0.4s;
}

.env-hint.hide {
  opacity: 0;
}

@keyframes envHintPulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* Envelope wrapper — establishes 3D perspective */
#envelope-wrap {
  width: min(380px, 88vw);
  cursor: pointer;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ──── Envelope Body ──── */
.env-body {
  position: relative;
  width: 100%;
  padding-top: 66%;
  /* ~3:2 envelope ratio */
  background: var(--secondary);
  border: 1px solid var(--accent-light);
  box-shadow:
    0 8px 40px rgba(44, 44, 44, 0.10),
    0 2px 8px rgba(44, 44, 44, 0.06);
  overflow: hidden;
  transition: box-shadow 0.3s;
  /* Front sits ABOVE the letter so the letter stays hidden until it lifts out */
  z-index: 5;
}

#envelope-wrap:hover .env-body {
  box-shadow:
    0 12px 50px rgba(44, 44, 44, 0.14),
    0 4px 12px rgba(44, 44, 44, 0.08);
}

/* Bottom triangle fold lines inside the body */
.env-body::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0;
  border-left: 50% solid transparent;
  border-right: 50% solid transparent;
  border-bottom: 46% solid var(--bg-warm);
  opacity: 0.55;
  pointer-events: none;
}

/* Left triangle */
.env-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-top: 50% solid transparent;
  border-bottom: 50% solid transparent;
  border-left: 46% solid var(--bg-warm);
  opacity: 0.45;
  pointer-events: none;
  transform-origin: left;
}

/* Wax seal / monogram center */
.env-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s, transform 0.4s;
  z-index: 5;
}

.env-seal svg {
  width: 28px;
  height: 28px;
  fill: var(--accent);
}

.env-seal.hide {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

/* ──── Envelope Flap (top triangle that opens) ──── */
.env-flap-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  /* flap covers top half */
  perspective: 900px;
  transform-origin: top;
  z-index: 10;
  pointer-events: none;
}

.env-flap {
  width: 100%;
  height: 100%;
  background: var(--secondary);
  border-left: 1px solid var(--accent-light);
  border-right: 1px solid var(--accent-light);
  border-top: 1px solid var(--accent-light);
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform 0s;
  /* JS controls this */
  will-change: transform;
  /* Triangle shape: a downward-pointing triangle */
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  /* Slightly darker than body for depth */
  filter: brightness(0.97);
}

/* ──── Inner card that rises from envelope ──── */
.env-card {
  position: absolute;
  bottom: 0;
  left: 7%;
  right: 7%;
  height: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--accent-light);
  padding: 1.5rem 1.25rem;
  text-align: center;
  /* Starts fully inside, concealed behind the opaque front (z-index 5).
     Sits ABOVE the flap once the flap is dropped behind on open. */
  transform: translateY(0);
  transition: transform 0s;
  will-change: transform;
  z-index: 3;
  box-shadow: 0 -4px 16px rgba(44, 44, 44, 0.05);
}

.env-card-names {
  font-family: var(--script);
  font-size: clamp(2rem, 8vw, 3rem);
  color: var(--accent-dark);
  line-height: 1.1;
}

.env-card-divider {
  width: 40px;
  height: 1px;
  background: var(--accent-light);
  margin: 0.75rem auto;
}

.env-card-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--text-soft);
  letter-spacing: 0.08em;
}

/* ── Petal canvas (full-screen, over envelope during reveal) ── */
#petal-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8999;
  opacity: 0;
  transition: opacity 0.5s;
}

#petal-canvas.show {
  opacity: 1;
}

#petal-canvas.hide {
  opacity: 0;
  transition: opacity 1.5s;
}

/* ── Fixed Navigation ─────────────────────────────────────── */
#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  background: transparent;
  transition: background 0.5s, box-shadow 0.5s, backdrop-filter 0.5s;
}

#site-nav.scrolled {
  background: rgba(248, 245, 240, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(198, 167, 105, 0.18);
}

#site-nav a {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.25s;
}

#site-nav a:hover {
  color: var(--accent-dark);
}

/* ── Music Button (top-right fixed) ──────────────────────── */
#music-btn {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  z-index: 501;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--accent-light);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s, border-color 0.25s, transform 0.2s;
  outline: none;
}

#music-btn:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
  transform: scale(1.06);
}

#music-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ── HERO ─────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 1.5rem 5rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(130% 80% at 50% 0%, rgba(220, 201, 154, 0.22), transparent 58%),
    linear-gradient(to bottom, var(--bg) 55%, var(--bg-warm));
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: var(--sans);
  font-size: clamp(0.58rem, 1.8vw, 0.7rem);
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.75rem;
}

.hero-names {
  font-family: var(--script);
  font-size: clamp(3.6rem, 13vw, 8rem);
  color: var(--accent-dark);
  line-height: 1.02;
}

.hero-amp {
  font-family: var(--script);
  font-size: clamp(2.2rem, 8vw, 5rem);
  color: var(--accent-light);
  display: block;
  line-height: 1;
}

/* Date flanked by thin gold rules */
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.9rem, 3vw, 1.5rem);
  margin-top: 2.25rem;
}

.hero-meta-line {
  display: block;
  height: 1px;
  width: clamp(28px, 12vw, 64px);
  background: linear-gradient(to right, transparent, var(--accent-light));
}

.hero-meta-line:last-child {
  background: linear-gradient(to left, transparent, var(--accent-light));
}

.hero-date {
  font-family: var(--serif);
  font-size: clamp(0.9rem, 2.6vw, 1.1rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mid);
  white-space: nowrap;
}

.hero-date sup {
  font-size: 0.55em;
  letter-spacing: 0;
}

.hero-venue {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(0.85rem, 2.2vw, 1rem);
  color: var(--text-soft);
  margin-top: 1rem;
  padding: 0 1rem;
}

/* Animated scroll cue */
.hero-scroll {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-top: clamp(2.5rem, 6vw, 3.75rem);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color 0.25s;
}

.hero-scroll:hover {
  color: var(--accent);
}

.hero-scroll-chevron {
  width: 9px;
  height: 9px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  animation: heroScrollBounce 2s var(--ease-elegant) infinite;
}

@keyframes heroScrollBounce {

  0%,
  100% {
    transform: translateY(0) rotate(45deg);
    opacity: 0.45;
  }

  50% {
    transform: translateY(5px) rotate(45deg);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll-chevron {
    animation: none;
  }
}

/* ── Ornamental Divider ───────────────────────────────────── */
.ornament {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem auto;
  max-width: 300px;
}

.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-light), transparent);
}

.ornament span {
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1;
}

/* Thin simple line */
.thin-line {
  width: 48px;
  height: 1px;
  background: var(--accent-light);
  margin: 0 auto;
}

/* ── Kandyan Motif Divider ────────────────────────────────── */
.kandyan-divider {
  text-align: center;
  color: var(--accent-light);
  letter-spacing: 0.5rem;
  font-size: 1rem;
  margin: 0.5rem 0;
}

/* ── Section Layout ───────────────────────────────────────── */
.section {
  padding: 7rem 1.5rem;
}

.section-alt {
  background: var(--bg-warm);
}

.section-label {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  margin-bottom: 1rem;
}

.section-heading {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  color: var(--text);
  text-align: center;
  line-height: 1.3;
  margin-bottom: 3.5rem;
}

.section-heading em {
  font-style: italic;
  color: var(--accent-dark);
}

/* ── Invitation Card ──────────────────────────────────────── */
.invite-card {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  padding: 3.5rem 3rem;
  border: 1px solid var(--secondary);
  background: var(--bg);
}

.invite-text {
  font-family: var(--serif);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 400;
  line-height: 2.1;
  color: var(--text-mid);
}

.invite-text em {
  color: var(--accent-dark);
  font-style: italic;
}

/* ── Couple ───────────────────────────────────────────────── */
.couple-name {
  font-family: var(--script);
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  color: var(--accent-dark);
  line-height: 1.1;
}

.couple-role {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 0.5rem;
}

.couple-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2.5rem, 6vw, 5rem);
  max-width: 900px;
  margin: 0 auto;
}

/* Portrait — outer element receives the scroll parallax (via JS) */
.couple-portrait {
  position: relative;
  flex-shrink: 0;
  width: min(340px, 82vw);
  will-change: transform;
}

/* Decorative offset gold frame behind the photo */
.couple-portrait::before {
  content: '';
  position: absolute;
  inset: 16px -16px -16px 16px;
  border: 1px solid var(--accent-light);
  border-radius: 6px;
  z-index: -1;
}

/* Inner element does the gentle floating animation */
.couple-portrait-inner {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--accent-light);
  box-shadow:
    0 34px 60px -30px rgba(80, 64, 38, 0.45),
    0 8px 22px rgba(80, 64, 38, 0.10);
  animation: coupleFloat 6s ease-in-out infinite;
  will-change: transform;
}

.couple-portrait-inner img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--secondary);
}

@keyframes coupleFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

@media (prefers-reduced-motion: reduce) {
  .couple-portrait-inner { animation: none; }
}

.couple-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
  min-width: 0;
}

.couple-amp {
  font-family: var(--script);
  font-size: 2.8rem;
  line-height: 1;
  color: var(--accent-light);
}

.couple-parentage {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.8;
  margin-top: 0.75rem;
}

/* ── Wedding Party ────────────────────────────────────────── */
.party-intro {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  color: var(--text-soft);
  text-align: center;
  max-width: 540px;
  margin: -2rem auto 0;
  line-height: 1.95;
}

.party-intro em {
  color: var(--accent-dark);
}

.party-group {
  margin-top: 4rem;
}

.party-group-title {
  font-family: var(--script);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 400;
  color: var(--accent-dark);
  text-align: center;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.party-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 2.75rem 4.5rem;
  max-width: 560px;
  margin: 2.25rem auto 0;
}

.party-card {
  width: 196px;
  margin: 0;
  text-align: center;
  transition: transform 0.3s var(--ease-elegant);
}

.party-card:hover {
  transform: translateY(-4px);
}

.party-photo {
  width: 132px;
  height: 132px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--accent-light);
  box-shadow: 0 4px 18px rgba(44, 44, 44, 0.06);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.3s, border-color 0.3s;
}

.party-card:hover .party-photo {
  border-color: var(--accent);
  box-shadow: 0 8px 26px rgba(44, 44, 44, 0.10);
}

.party-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Elegant monogram placeholder shown until a real photo is added */
.party-photo[data-initial]::before {
  content: attr(data-initial);
  font-family: var(--script);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent-light);
}

.party-photo:has(img)::before {
  content: none;
}

.party-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.3;
}

.party-role {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.4rem;
}

.party-bio {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-soft);
  margin-top: 0.65rem;
}

/* ── Order of Events (Timeline) ───────────────────────────── */
.timeline {
  list-style: none;
  max-width: 540px;
  margin: 0 auto;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 1px;
  background: linear-gradient(to bottom,
      transparent,
      var(--accent-light) 10%,
      var(--accent-light) 90%,
      transparent);
}

.timeline-item {
  position: relative;
  padding: 0 0 2.75rem 2.75rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg-warm);
  border: 1.5px solid var(--accent);
}

.timeline-marker::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-time {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.timeline-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  color: var(--text);
  line-height: 1.3;
}

.timeline-desc {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--text-soft);
  line-height: 1.7;
  margin-top: 0.4rem;
}

/* ── Seaside Dress-Code Note ──────────────────────────────── */
.dress-note {
  max-width: 460px;
  margin: 2.75rem auto 0;
  padding: 1.6rem 2rem;
  border: 1px solid var(--secondary);
  background: var(--bg);
}

.dress-note-label {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.dress-note-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.7;
}

/* ── Event Detail Cards ───────────────────────────────────── */
.detail-item {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.detail-label {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.detail-value {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
}

.detail-value small {
  display: block;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-soft);
  margin-top: 0.3rem;
  font-style: normal;
}

/* ── Countdown ────────────────────────────────────────────── */
.countdown-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.countdown-item {
  text-align: center;
  padding: 0 2rem;
}

.countdown-item+.countdown-item {
  border-left: 1px solid var(--secondary);
}

.countdown-num {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 400;
  color: var(--accent-dark);
  line-height: 1;
  display: block;
}

.countdown-label {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: block;
  margin-top: 0.6rem;
}

/* ── Traditional Section ──────────────────────────────────── */
.tradition-text {
  font-family: var(--serif);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 400;
  color: var(--text-mid);
  line-height: 2.1;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.tradition-text+.tradition-text {
  margin-top: 1.5rem;
}

.tradition-text em {
  font-style: italic;
  color: var(--accent-dark);
}

/* ── Gallery ──────────────────────────────────────────────── */
.gallery-placeholder {
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--secondary);
}

/* Auto-flowing masonry gallery (images fetched from /api/gallery) */
.gallery-masonry {
  column-count: 3;
  column-gap: 0.6rem;
  max-width: 56rem;
  margin: 2.5rem auto 0;
}

.gallery-photo {
  width: 100%;
  display: block;
  margin: 0 0 0.6rem;
  break-inside: avoid;
  background: var(--secondary);
  border-radius: 3px;
  box-shadow: 0 4px 18px rgba(44, 44, 44, 0.06);
  transition: transform 0.35s var(--ease-elegant), box-shadow 0.35s;
}

.gallery-photo:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(44, 44, 44, 0.12);
}

.gallery-empty {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-soft);
  margin-top: 2rem;
}

.gallery-photo {
  cursor: zoom-in;
}

/* ── Gallery Lightbox / Slideshow ─────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem;
  background: rgba(30, 24, 16, 0.92);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease-elegant), visibility 0.35s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-stage {
  position: relative;
  margin: 0;
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  background: var(--secondary);
  transition: opacity 0.25s var(--ease-elegant);
}

.lightbox.is-switching .lightbox-stage img {
  opacity: 0;
}

.lightbox-counter {
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(248, 245, 240, 0.72);
}

/* Controls */
.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 245, 240, 0.08);
  border: 1px solid rgba(248, 245, 240, 0.22);
  color: var(--bg);
  cursor: pointer;
  line-height: 1;
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(248, 245, 240, 0.18);
  border-color: rgba(248, 245, 240, 0.45);
}

.lightbox-close {
  top: 1.1rem;
  right: 1.1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
  font-weight: 300;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 300;
}

.lightbox-nav:hover {
  transform: translateY(-50%) scale(1.06);
}

.lightbox-prev {
  left: 1.25rem;
}

.lightbox-next {
  right: 1.25rem;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 3rem 0.5rem;
  }

  .lightbox-nav {
    width: 42px;
    height: 42px;
    font-size: 1.6rem;
  }

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }

  .lightbox-stage img {
    max-height: 76vh;
  }
}

/* ── A Note from the Couple ───────────────────────────────── */
.note-card {
  position: relative;
  max-width: 640px;
  margin: 2.5rem auto 0;
  padding: 3.25rem 3rem 3rem;
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFAF6 100%);
  border: 1px solid var(--secondary);
  border-radius: 6px;
  box-shadow:
    0 30px 60px -34px rgba(80, 64, 38, 0.30),
    0 2px 10px rgba(80, 64, 38, 0.05);
}

.note-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.note-quote {
  display: block;
  font-family: var(--script);
  font-size: 4rem;
  line-height: 0.5;
  color: var(--accent-light);
  margin-bottom: 0.75rem;
}

.note-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.95;
  color: var(--text-mid);
}

.note-signoff {
  margin-top: 1.85rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.note-signature {
  margin-top: 0.35rem;
  font-family: var(--script);
  font-size: 2.5rem;
  color: var(--accent-dark);
  line-height: 1.2;
}

/* ── Location / Venue Map ─────────────────────────────────── */
.venue-card {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--secondary);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 30px 60px -34px rgba(80, 64, 38, 0.30),
    0 2px 10px rgba(80, 64, 38, 0.05);
}

.venue-map {
  position: relative;
  width: 100%;
  /* Responsive height: comfortable on desktop, generous on mobile */
  height: clamp(340px, 46vh, 480px);
  background: var(--secondary);
}

.venue-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  filter: saturate(0.78) sepia(0.06);
}

.venue-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 1.85rem;
  text-align: left;
  border-top: 1px solid var(--secondary);
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFAF6 100%);
}

.venue-info-text {
  min-width: 0;
}

.venue-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--accent-dark);
  line-height: 1.25;
}

.venue-address {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  margin-top: 0.3rem;
}

.venue-btn {
  flex-shrink: 0;
}

/* ── RSVP Section ─────────────────────────────────────────── */
.rsvp-deadline {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--text-soft);
  margin-bottom: 2.75rem;
}

/* Framed reply card */
.rsvp-card {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 3.25rem 3.25rem 3rem;
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFAF6 100%);
  border: 1px solid var(--secondary);
  border-radius: 5px;
  box-shadow:
    0 30px 60px -34px rgba(80, 64, 38, 0.30),
    0 2px 10px rgba(80, 64, 38, 0.05);
}

/* Gold accent rule centered at the top edge of the card */
.rsvp-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.rsvp-form {
  width: 100%;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.75rem;
}

.form-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 0.6rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.9rem 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--secondary);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.3s;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-bottom-color: var(--accent);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23A8894A' stroke-width='1.2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.25rem center;
  padding-right: 1.5rem;
  cursor: pointer;
}

.form-textarea {
  resize: none;
  min-height: 90px;
}

/* Selectable attendance cards (replaces plain radio buttons) */
.attend-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.attend-option {
  display: block;
  position: relative;
  cursor: pointer;
}

.attend-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.attend-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 1rem 0.85rem;
  border: 1px solid var(--secondary);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-mid);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.3;
  transition: border-color 0.25s, background 0.25s, color 0.25s, box-shadow 0.25s;
}

.attend-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1px solid var(--accent-light);
  background: transparent;
  color: transparent;
  font-style: normal;
  font-size: 0.62rem;
  line-height: 1;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.attend-option:hover .attend-card {
  border-color: var(--accent-light);
}

.attend-option input:checked + .attend-card {
  border-color: var(--accent);
  background: rgba(198, 167, 105, 0.10);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.attend-option input:checked + .attend-card .attend-mark {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

.attend-option input:focus-visible + .attend-card {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Primary Button ───────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2.8rem;
  background: var(--accent-dark);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s, transform 0.2s;
  outline: none;
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.25s var(--ease-elegant);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

/* RSVP submit — full width within the card for a balanced form feel */
.rsvp-submit-row {
  margin-top: 2.5rem;
  text-align: center;
}

.rsvp-submit-row .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 1rem 2.8rem;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2.2rem;
  background: transparent;
  color: var(--accent-dark);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid var(--accent-light);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(198, 167, 105, 0.04);
}

/* ── RSVP Success ─────────────────────────────────────────── */
#rsvp-success {
  display: none;
  text-align: center;
  padding: 1.5rem 0.5rem;
}

#rsvp-success.show {
  display: block;
}

.success-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.success-heading {
  font-family: var(--script);
  font-size: 3rem;
  color: var(--accent-dark);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.success-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-soft);
}

/* ── Closing ──────────────────────────────────────────────── */
.closing-script {
  font-family: var(--script);
  font-size: clamp(2.2rem, 7vw, 4rem);
  color: var(--accent-dark);
  line-height: 1.3;
}

/* ── Scroll Reveal ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s var(--ease-enter), transform 0.85s var(--ease-enter);
}

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

.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.35s;
}

/* ── Keyframes ────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes subtleFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile First Overrides
════════════════════════════════════════════════════════════ */

/* ── Small screens (≤ 640px) ──────────────────────────────── */
@media (max-width: 640px) {

  /* Sections */
  .section {
    padding: 4rem 1.25rem;
  }

  .section-heading {
    margin-bottom: 2rem;
  }

  /* ── Envelope ── */
  #envelope-wrap {
    width: min(320px, 92vw);
  }

  .env-hint {
    font-size: 0.8rem;
    margin-bottom: 1.75rem;
  }

  .env-card-names {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  /* ── Navigation ── */
  #site-nav {
    gap: 0;
    padding: 0.75rem 0.5rem;
    justify-content: space-around;
  }

  #site-nav a {
    font-size: 0.58rem;
    letter-spacing: 0.14em;
  }

  /* Hide "Traditions" and "Contact" on tiny screens to avoid overflow */
  @media (max-width: 380px) {

    #site-nav a[href="#wedding-party"],
    #site-nav a[href="#schedule"],
    #site-nav a[href="#contact"] {
      display: none;
    }
  }

  /* Music btn: move down a touch so it doesn't clash with nav */
  #music-btn {
    top: 0.75rem;
    right: 0.75rem;
  }

  /* ── Hero ── */
  #hero {
    padding: 7rem 1.25rem 4rem;
  }

  .hero-names {
    font-size: clamp(3.2rem, 14vw, 5rem);
  }

  .hero-amp {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .hero-eyebrow {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    margin-bottom: 1.25rem;
  }

  .hero-date {
    margin-top: 1.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
  }

  /* ── Invitation Card ── */
  .invite-card {
    padding: 2rem 1.25rem;
    /* Remove side margins so it fills the screen edge-to-edge with padding */
    margin-left: 0;
    margin-right: 0;
  }

  .invite-text {
    font-size: 0.95rem;
    line-height: 1.95;
  }

  /* ── Couple Section ── */
  /* The flex row separator (the ✦ + lines) needs to become horizontal on mobile */
  .couple-layout {
    flex-direction: column;
    gap: 2.75rem;
  }

  .couple-portrait {
    width: min(280px, 78vw);
  }

  /* Turn the vertical divider into a horizontal ornament */
  #couple .couple-separator {
    flex-direction: row !important;
    width: 100%;
    justify-content: center;
    padding-top: 0 !important;
  }

  /* Flip the 1px vertical lines into short horizontal lines */
  #couple .couple-separator .thin-line {
    width: 48px !important;
    height: 1px !important;
    background: var(--secondary) !important;
  }

  .couple-name {
    font-size: clamp(2.4rem, 12vw, 3.5rem);
  }

  /* ── Wedding Party ── */
  .party-intro {
    margin-top: -1rem;
    font-size: 0.92rem;
    line-height: 1.85;
  }

  .party-group {
    margin-top: 3rem;
  }

  .party-grid {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2.5rem;
    max-width: 340px;
  }

  .party-card {
    width: 100%;
    max-width: 320px;
  }

  .party-photo {
    width: 150px;
    height: 150px;
    margin-bottom: 1rem;
  }

  .party-photo[data-initial]::before {
    font-size: 2.1rem;
  }

  .party-name {
    font-size: 0.98rem;
  }

  .party-bio {
    font-size: 0.78rem;
  }

  /* ── Timeline ── */
  .timeline {
    max-width: 100%;
  }

  .timeline-item {
    padding-left: 2.25rem;
    padding-bottom: 2.25rem;
  }

  /* ── Event Details grid ──
     On mobile the 3-column grid stacks.
     Tailwind's divide-y handles the separators correctly,
     but we need to remove the md:divide-x borders. */
  #event-details .grid {
    border: 1px solid var(--secondary);
  }

  .detail-item {
    padding: 1.75rem 1.25rem;
  }

  .detail-value {
    font-size: 1.1rem;
  }

  /* ── Traditional ── */
  .tradition-text {
    font-size: 0.92rem;
    line-height: 1.9;
  }

  /* ── Countdown ──
     On mobile: remove left-border dividers (they look wrong when wrapping)
     and show as a 2×2 grid instead */
  .countdown-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: 320px;
    margin: 0 auto;
    border: 1px solid var(--secondary);
  }

  .countdown-item {
    padding: 1.5rem 1rem;
    border: none;
    border-left: none !important;
    /* override the + sibling rule */
  }

  /* Re-add thin internal grid lines */
  .countdown-item:nth-child(1),
  .countdown-item:nth-child(2) {
    border-bottom: 1px solid var(--secondary);
  }

  .countdown-item:nth-child(1),
  .countdown-item:nth-child(3) {
    border-right: 1px solid var(--secondary);
  }

  .countdown-num {
    font-size: clamp(2.4rem, 10vw, 3.5rem);
  }

  /* ── Gallery ── */
  .gallery-masonry {
    column-count: 2;
    column-gap: 0.5rem;
  }

  .gallery-photo {
    margin-bottom: 0.5rem;
  }

  /* ── A Note from the Couple ── */
  .note-card {
    padding: 2.25rem 1.5rem 2rem;
  }

  .note-text {
    font-size: 0.95rem;
    line-height: 1.85;
  }

  .note-signature {
    font-size: 2.1rem;
  }

  /* ── Location / Venue map ── */
  .venue-map {
    height: clamp(300px, 52vh, 380px);
  }

  .venue-info {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 1.1rem;
    padding: 1.4rem 1.25rem;
  }

  .venue-btn {
    width: 100%;
    justify-content: center;
  }

  /* ── RSVP ── */
  .rsvp-form {
    max-width: 100%;
  }

  .rsvp-card {
    padding: 2.25rem 1.5rem 2rem;
  }

  .attend-group {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .btn-primary {
    padding: 0.85rem 2rem;
    width: 100%;
    justify-content: center;
  }

  /* ── Contact ── */
  #contact .flex {
    flex-direction: column !important;
    border: 1px solid var(--secondary);
  }

  #contact .detail-item+.detail-item {
    border-top: 1px solid var(--secondary);
  }

  /* ── Closing ── */
  .closing-script {
    font-size: clamp(1.8rem, 9vw, 2.8rem);
  }
}

/* ── Medium screens (641px–768px) ────────────────────────── */
@media (min-width: 641px) and (max-width: 768px) {
  .section {
    padding: 5.5rem 2rem;
  }

  /* Couple: still row but tighter */
  #couple .flex {
    gap: 2.5rem !important;
  }

  .couple-name {
    font-size: clamp(2.5rem, 7vw, 3.5rem);
  }

  /* Countdown: 2×2 on mid-size tablets */
  .countdown-wrap {
    max-width: 480px;
    margin: 0 auto;
  }

  .countdown-item {
    padding: 0 1.5rem;
  }
}