/* ==========================================================================
   Luxury Arabic Wedding Invitation — إيمان & عبده (Eman & Abdo)
   Theme: Warm Champagne Beige & Rich Espresso / Mocha Brown
   ========================================================================== */

:root {
  /* Core Brown & Beige Palette */
  --beige-canvas: #f4eadc;
  --beige-warm: #ebd9c2;
  --beige-soft: #f9f3ea;
  --beige-card: rgba(250, 243, 233, 0.78);
  --beige-pill: rgba(252, 247, 240, 0.84);

  --brown-espresso: #432818;
  --brown-deep: #563520;
  --brown-mocha: #6f482c;
  --brown-bronze: #8c603e;
  --brown-latte: #a78260;
  --brown-sand: #c9ae90;
  --brown-line: rgba(111, 72, 44, 0.42);
  --brown-line-soft: rgba(140, 96, 62, 0.28);

  --desktop-bg-1: #2b1a10;
  --desktop-bg-2: #1a0f09;

  /* Typography */
  --font-ar-serif: 'Amiri', Georgia, serif;
  --font-ar-sans: 'Tajawal', system-ui, -apple-system, sans-serif;
  --font-en-serif: 'Cormorant Garamond', Georgia, serif;
  --font-en-script: 'Great Vibes', cursive;

  /* Layout */
  --shell-width: 440px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-ar-sans);
  color: var(--brown-espresso);
  background: radial-gradient(circle at 50% 25%, #3c2416 0%, var(--desktop-bg-1) 48%, var(--desktop-bg-2) 100%);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.doors-locked {
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* Soft ambient warm light behind the invitation on desktop screens */
.desktop-aura {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(560px 560px at 50% 20%, rgba(214, 174, 128, 0.16), transparent 70%),
    radial-gradient(480px 480px at 50% 85%, rgba(167, 130, 96, 0.12), transparent 70%);
  z-index: 0;
}

/* ==========================================================================
   MAIN INVITATION SHELL (Mobile full-bleed / Desktop luxury 9:16 column)
   ========================================================================== */
.invitation-shell {
  position: relative;
  width: 100%;
  max-width: var(--shell-width);
  min-height: 100dvh;
  background-color: var(--beige-canvas);
  box-shadow:
    0 0 0 1px rgba(201, 174, 144, 0.25),
    0 24px 80px rgba(0, 0, 0, 0.55);
  z-index: 1;
  isolation: isolate;
}

/* Fixed Stationery Artwork Background (botanical side vines + bottom swans) */
.stationery-bg {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-width);
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(180deg, #f6eee2 0%, #f1e5d4 52%, #ead8c1 100%);
}

.stationery-art {
  position: absolute;
  inset: 0;
  background-image: url('assets/frame-bg.jpg');
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.96;
}

/* Gentle central readability wash so dark brown text is always crisp */
.stationery-center-wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(244, 234, 220, 0) 0%,
    rgba(245, 236, 223, 0.55) 18%,
    rgba(246, 238, 226, 0.72) 50%,
    rgba(245, 236, 223, 0.55) 82%,
    rgba(244, 234, 220, 0) 100%
  );
}

/* Floating Petals Canvas */
.petals-canvas {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-width);
  height: 100dvh;
  z-index: 2;
  pointer-events: none;
}

/* ==========================================================================
   FLOATING CONTROLS (Top-Right Replay & Bottom-Left Pause/Play)
   ========================================================================== */
.floating-btn {
  position: fixed;
  z-index: 30;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(111, 72, 44, 0.25);
  background: rgba(251, 245, 236, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--brown-deep);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(67, 40, 24, 0.14);
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.floating-btn:hover {
  background: var(--brown-espresso);
  color: var(--beige-soft);
  box-shadow: 0 8px 22px rgba(67, 40, 24, 0.26);
}

.floating-btn:focus-visible {
  outline: 2px solid var(--brown-espresso);
  outline-offset: 3px;
}

.floating-btn--top {
  top: 16px;
  right: max(16px, calc(50% - var(--shell-width) / 2 + 16px));
}

.floating-btn--bottom {
  bottom: 18px;
  left: max(16px, calc(50% - var(--shell-width) / 2 + 16px));
  width: 44px;
  height: 44px;
}

/* ==========================================================================
   STAGE 0: 3D DOUBLE PALACE DOORS & SWAN HEART BROOCH
   ========================================================================== */
.doors-stage {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-width);
  height: 100dvh;
  z-index: 40;
  overflow: hidden;
  transition: opacity 0.6s ease 0.9s, visibility 0s linear 1.5s;
}

.doors-stage.is-open {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.doors-perspective {
  position: absolute;
  inset: 0;
  display: flex;
  direction: ltr;
  perspective: 1500px;
  transform-style: preserve-3d;
  cursor: pointer;
}

.door-panel {
  position: relative;
  width: 50%;
  height: 100%;
  background-color: #efe2cf;
  background-image: url('assets/doors.jpg');
  background-size: 200% 100%;
  background-repeat: no-repeat;
  backface-visibility: hidden;
  will-change: transform;
  transition: transform 1.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 1.1s ease;
}

.door-panel--left {
  background-position: 0% 50%;
  transform-origin: left center;
  border-right: 1px solid rgba(111, 72, 44, 0.38);
  box-shadow: inset -6px 0 14px rgba(67, 40, 24, 0.14);
}

.door-panel--right {
  background-position: 100% 50%;
  transform-origin: right center;
  border-left: 1px solid rgba(255, 245, 232, 0.65);
  box-shadow: inset 6px 0 14px rgba(67, 40, 24, 0.14);
}

.door-seam-highlight {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    180deg,
    rgba(167, 130, 96, 0.15) 0%,
    rgba(140, 96, 62, 0.55) 50%,
    rgba(167, 130, 96, 0.15) 100%
  );
}

.door-panel--left .door-seam-highlight {
  right: 0;
}

.door-panel--right .door-seam-highlight {
  left: 0;
}

/* Open state — doors swing gracefully outward in 3D */
.doors-stage.is-opening .door-panel--left,
.doors-stage.is-open .door-panel--left {
  transform: rotateY(-82deg) translateX(-18%);
}

.doors-stage.is-opening .door-panel--right,
.doors-stage.is-open .door-panel--right {
  transform: rotateY(82deg) translateX(18%);
}

@media (prefers-reduced-motion: reduce) {
  .door-panel {
    transition: opacity 0.45s ease;
  }
  .doors-stage.is-opening .door-panel--left,
  .doors-stage.is-open .door-panel--left,
  .doors-stage.is-opening .door-panel--right,
  .doors-stage.is-open .door-panel--right {
    transform: none;
    opacity: 0;
  }
  .doors-stage {
    transition: opacity 0.45s ease, visibility 0s linear 0.45s;
  }
}

/* Center Swan Heart Brooch Trigger */
.brooch-trigger {
  position: absolute;
  top: 47%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 5;
  display: grid;
  place-items: center;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}

.brooch-trigger:hover {
  transform: translate(-50%, -50%) scale(1.045);
}

.brooch-trigger:focus-visible {
  outline: 2px solid var(--brown-espresso);
  outline-offset: 8px;
  border-radius: 50%;
}

.brooch-halo {
  position: absolute;
  width: 196px;
  height: 224px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 130, 0.42) 0%, rgba(140, 96, 62, 0.14) 52%, transparent 72%);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .brooch-halo {
    animation: broochPulse 3.2s ease-in-out infinite;
  }
}

@keyframes broochPulse {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.brooch-img {
  position: relative;
  width: 162px;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(58, 33, 17, 0.34));
  user-select: none;
  -webkit-user-drag: none;
}

.doors-stage.is-opening .brooch-trigger,
.doors-stage.is-open .brooch-trigger {
  transform: translate(-50%, -50%) scale(1.16);
  opacity: 0;
  pointer-events: none;
}

/* Sparkle particles container on click */
.brooch-sparkles {
  position: absolute;
  top: 47%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 6;
}

.sparkle-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8ec 0%, #d4ac79 60%, transparent 100%);
  box-shadow: 0 0 10px rgba(212, 172, 121, 0.9);
  animation: sparkleBurst 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sparkleBurst {
  0% {
    transform: translate(0, 0) scale(0.3);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(1.25);
    opacity: 0;
  }
}

/* Bottom "المس البروش لفتح الدعوة" Pill */
.open-hint-pill {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: 10px 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 245, 232, 0.45);
  background: rgba(86, 53, 32, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fdf7ef;
  font-family: var(--font-ar-sans);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(43, 26, 16, 0.25);
  transition: opacity 0.4s ease, transform 0.35s ease, background-color 0.25s ease;
}

.open-hint-pill:hover {
  background: rgba(67, 40, 24, 0.82);
  transform: translateX(-50%) translateY(-2px);
}

.doors-stage.is-opening .open-hint-pill,
.doors-stage.is-open .open-hint-pill {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}

/* ==========================================================================
   MAIN INVITATION CONTENT FLOW
   ========================================================================== */
.invitation-content {
  position: relative;
  z-index: 4;
  padding: 0 42px;
}

.section {
  position: relative;
  padding: 58px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ornament-divider {
  color: var(--brown-bronze);
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

.section-eyebrow {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--brown-latte);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.en-sublabel {
  font-family: var(--font-en-serif);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--brown-bronze);
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-ar-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brown-espresso);
  margin-bottom: 28px;
  line-height: 1.35;
}

/* ==========================================================================
   SECTION 1: HERO
   ========================================================================== */
.section--hero {
  min-height: 100dvh;
  justify-content: center;
  padding-top: 72px;
  padding-bottom: 68px;
}

.hero-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease 0.35s, transform 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.35s;
}

body.invitation-revealed .hero-inner {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .hero-inner {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.en-kicker {
  font-family: var(--font-en-serif);
  font-size: 0.84rem;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.28em;
  line-height: 1.7;
  color: var(--brown-bronze);
  margin-bottom: 6px;
}

.hero-monogram-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0 12px;
}

.hero-monogram {
  height: 196px;
  width: auto;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(67, 40, 24, 0.16));
  user-select: none;
  -webkit-user-drag: none;
}

.couple-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.couple-block--inline {
  gap: 2px;
}

.couple-en {
  font-family: var(--font-en-script);
  font-size: 2.1rem;
  line-height: 1.1;
  color: var(--brown-bronze);
  text-shadow: 0 1px 0 rgba(255, 248, 238, 0.7);
}

.couple-en--paired {
  font-size: 1.48rem;
  margin-top: 0;
}

.couple-ar {
  font-family: var(--font-ar-serif);
  font-size: 3.1rem;
  font-weight: 700;
  line-height: 1.3;
  background: linear-gradient(
    180deg,
    #b68456 0%,
    #784c2b 42%,
    #472916 74%,
    #93653f 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 3px rgba(67, 40, 24, 0.16));
  letter-spacing: 0.01em;
}

.couple-ar--paired {
  font-size: 2.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.couple-amp-inline {
  font-family: var(--font-en-serif);
  font-size: 1.75rem;
  font-style: italic;
  font-weight: 500;
  color: var(--brown-bronze);
  -webkit-text-fill-color: var(--brown-bronze);
}

.hero-invite-text {
  font-size: 1.04rem;
  font-weight: 400;
  line-height: 1.95;
  color: var(--brown-deep);
  margin-top: 10px;
}

.hero-poetic-text {
  font-family: var(--font-ar-serif);
  font-size: 1.24rem;
  line-height: 2.05;
  color: var(--brown-deep);
  margin-top: 14px;
}

.scroll-cue {
  margin-top: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-size: 0.8rem;
  color: var(--brown-latte);
  transition: color 0.25s ease;
}

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

@media (prefers-reduced-motion: no-preference) {
  .scroll-cue svg {
    animation: gentleBob 2.2s ease-in-out infinite;
  }
}

@keyframes gentleBob {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.65;
  }
  50% {
    transform: translateY(5px);
    opacity: 1;
  }
}

/* ==========================================================================
   SECTION 2: QURANIC VERSE & WELCOME NOTE
   ========================================================================== */
.section--verse {
  padding-top: 38px;
  padding-bottom: 66px;
}

.quran-verse {
  font-family: var(--font-ar-serif);
  font-size: 1.32rem;
  line-height: 2.15;
  color: var(--brown-espresso);
  margin-bottom: 28px;
}

.welcome-note {
  font-size: 1rem;
  line-height: 2.2;
  color: var(--brown-mocha);
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.welcome-lead {
  font-size: 0.98rem;
  color: var(--brown-mocha);
}

.welcome-host {
  font-family: var(--font-ar-serif);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--brown-espresso);
  max-width: 264px;
  margin: 4px auto;
  line-height: 1.85;
}

.welcome-sub {
  font-size: 0.98rem;
  color: var(--brown-deep);
}

.welcome-signature {
  font-family: var(--font-ar-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--brown-deep);
  letter-spacing: 0.02em;
}

.bride-spotlight {
  font-family: var(--font-ar-serif);
  font-size: 3.35rem;
  font-weight: 700;
  line-height: 1.35;
  margin-top: -6px;
  background: linear-gradient(
    180deg,
    #b68456 0%,
    #784c2b 42%,
    #472916 74%,
    #93653f 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 6px rgba(67, 40, 24, 0.18));
}

/* ==========================================================================
   SECTION 3: REDESIGNED ROYAL HORIZONTAL CALENDAR PLAQUE
   ========================================================================== */
.royal-date-card {
  position: relative;
  width: 100%;
  max-width: 278px;
  padding: 6px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(252, 247, 239, 0.9) 0%, rgba(244, 233, 217, 0.86) 100%);
  border: 1.3px solid var(--brown-bronze);
  box-shadow:
    0 14px 34px rgba(67, 40, 24, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  margin-top: 10px;
}

.royal-date-frame {
  border-radius: 21px;
  border: 0.9px solid rgba(140, 96, 62, 0.42);
  padding: 22px 14px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.royal-date-month-top {
  font-family: var(--font-ar-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brown-deep);
  letter-spacing: 0.03em;
}

.royal-date-ribbon {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.ribbon-side {
  border-top: 1px solid rgba(140, 96, 62, 0.48);
  border-bottom: 1px solid rgba(140, 96, 62, 0.48);
  padding: 8px 2px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ribbon-label {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--brown-espresso);
  white-space: nowrap;
}

.ribbon-center {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: linear-gradient(180deg, #6b4328 0%, #432615 100%);
  border: 2px solid #d4b087;
  box-shadow:
    0 8px 18px rgba(67, 40, 24, 0.24),
    inset 0 1px 3px rgba(255, 245, 230, 0.25);
  display: grid;
  place-items: center;
}

.royal-date-day {
  font-family: var(--font-en-serif);
  font-size: 2.55rem;
  font-weight: 600;
  line-height: 1;
  color: #fdf6ec;
  transform: translateY(-2px);
}

.royal-date-year-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 2px;
}

.year-wing {
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(140, 96, 62, 0.6), transparent);
}

.royal-date-year {
  font-family: var(--font-en-serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--brown-mocha);
}

/* ==========================================================================
   SECTION 4: LIVE COUNTDOWN OVALS
   ========================================================================== */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  width: 100%;
  max-width: 274px;
}

.countdown-oval {
  background: var(--beige-pill);
  border: 1px solid rgba(140, 96, 62, 0.34);
  border-radius: 999px;
  min-height: 98px;
  padding: 20px 4px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow:
    0 8px 20px rgba(67, 40, 24, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.countdown-num {
  font-family: var(--font-en-serif);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1;
  color: var(--brown-espresso);
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: 0.72rem;
  color: var(--brown-latte);
}

/* ==========================================================================
   NOTCHED-CORNER OCTAGONAL DOUBLE-BORDER CARD (Venue, Dress Code, RSVP)
   ========================================================================== */
.notched-card {
  position: relative;
  width: 100%;
  max-width: 266px;
  padding: 5px;
  background: var(--brown-bronze);
  clip-path: polygon(
    18px 0%,
    calc(100% - 18px) 0%,
    100% 18px,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    18px 100%,
    0% calc(100% - 18px),
    0% 18px
  );
  filter: drop-shadow(0 10px 24px rgba(67, 40, 24, 0.08));
}

.notched-card::before {
  content: '';
  position: absolute;
  inset: 1.3px;
  background: var(--beige-soft);
  clip-path: polygon(
    17px 0%,
    calc(100% - 17px) 0%,
    100% 17px,
    100% calc(100% - 17px),
    calc(100% - 17px) 100%,
    17px 100%,
    0% calc(100% - 17px),
    0% 17px
  );
  z-index: 0;
}

.notched-card-inner {
  position: relative;
  z-index: 1;
  background: rgba(140, 96, 62, 0.45);
  padding: 1px;
  clip-path: polygon(
    15px 0%,
    calc(100% - 15px) 0%,
    100% 15px,
    100% calc(100% - 15px),
    calc(100% - 15px) 100%,
    15px 100%,
    0% calc(100% - 15px),
    0% 15px
  );
}

.notched-card-inner > * {
  position: relative;
  z-index: 2;
}

.notched-card-inner::before {
  content: '';
  position: absolute;
  inset: 1px;
  background: linear-gradient(180deg, rgba(252, 247, 239, 0.94) 0%, rgba(246, 236, 222, 0.92) 100%);
  clip-path: polygon(
    14px 0%,
    calc(100% - 14px) 0%,
    100% 14px,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    14px 100%,
    0% calc(100% - 14px),
    0% 14px
  );
  z-index: 1;
}

/* ==========================================================================
   SECTION 5: VENUE LOCATION
   ========================================================================== */
.venue-card-wrap {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 22px;
  margin-bottom: 22px;
}

.venue-pin-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--beige-soft);
  border: 1.3px solid var(--brown-bronze);
  color: var(--brown-espresso);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(67, 40, 24, 0.12);
}

.venue-card-body {
  padding: 40px 22px 28px;
}

.card-kicker {
  font-size: 0.78rem;
  color: var(--brown-latte);
  margin-bottom: 8px;
}

.venue-name {
  font-family: var(--font-ar-serif);
  font-size: 1.72rem;
  font-weight: 700;
  color: var(--brown-espresso);
  margin-bottom: 8px;
}

.venue-sub {
  font-size: 0.92rem;
  color: var(--brown-mocha);
}

.map-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--beige-pill);
  border: 1.2px solid rgba(111, 72, 44, 0.35);
  color: var(--brown-espresso);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(67, 40, 24, 0.08);
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.map-pill-btn:hover {
  background: var(--brown-espresso);
  border-color: var(--brown-espresso);
  color: var(--beige-soft);
  transform: translateY(-2px);
}

.map-pill-btn:focus-visible {
  outline: 2px solid var(--brown-espresso);
  outline-offset: 3px;
}

/* ==========================================================================
   SECTION 6: EVENING CHAPTERS TIMELINE
   ========================================================================== */
.section--timeline {
  padding-top: 48px;
  padding-bottom: 40px;
}

.timeline-track {
  position: relative;
  width: 100%;
  max-width: 300px;
  padding: 20px 0 38px;
}

.timeline-rail {
  position: absolute;
  top: 0;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5px;
  background: rgba(140, 96, 62, 0.24);
}

.timeline-rail-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, var(--brown-bronze) 0%, var(--brown-espresso) 100%);
  transform-origin: top center;
  transform: scaleY(0);
  transition: transform 0.14s linear;
}

.timeline-glow-bead {
  position: absolute;
  top: 0;
  left: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffaf2 10%, #d4ac79 60%, rgba(140, 96, 62, 0.4) 100%);
  box-shadow: 0 0 12px 3px rgba(212, 172, 121, 0.78);
  transform: translate(-50%, 0);
  transition: transform 0.14s linear;
}

.timeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 54px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.timeline-dot {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brown-bronze);
  box-shadow: 0 0 0 4px rgba(244, 234, 220, 0.9);
  z-index: 2;
}

/* Note: RTL grid -> column 1 is Right, column 2 is Left */
.timeline-item--left .timeline-card {
  grid-column: 2;
  text-align: right;
  padding-right: 22px;
}

.timeline-item--right .timeline-card {
  grid-column: 1;
  text-align: left;
  padding-left: 22px;
}

.timeline-chapter {
  font-family: var(--font-ar-serif);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--brown-espresso);
  margin-bottom: 4px;
}

.timeline-time {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--brown-latte);
  margin-bottom: 6px;
}

.timeline-desc {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--brown-mocha);
}

.timeline-end-pearl {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffdf9 20%, #d4b087 80%);
  border: 1px solid rgba(140, 96, 62, 0.45);
  box-shadow: 0 0 14px rgba(212, 176, 135, 0.85);
}

/* ==========================================================================
   SECTION 7: DRESS CODE
   ========================================================================== */
.dresscode-body {
  padding: 28px 20px;
}

.color-swatches {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow:
    0 4px 12px rgba(67, 40, 24, 0.16),
    inset 0 2px 4px rgba(255, 255, 255, 0.25);
}

.swatch--brown {
  background: radial-gradient(circle at 32% 30%, #6f482c 0%, #4a2d1a 68%, #361f10 100%);
  border: 2px solid rgba(255, 248, 238, 0.9);
}

.swatch--beige {
  background: radial-gradient(circle at 32% 30%, #fbf5eb 0%, #e7d3b7 72%, #d5bb97 100%);
  border: 1.5px solid rgba(140, 96, 62, 0.48);
}

.dresscode-colors {
  font-family: var(--font-ar-serif);
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--brown-espresso);
  margin-bottom: 12px;
}

.dresscode-note {
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--brown-mocha);
}

/* ==========================================================================
   SECTION 8: RSVP FORM
   ========================================================================== */
.rsvp-body {
  padding: 26px 20px;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.rsvp-label {
  font-size: 0.8rem;
  color: var(--brown-latte);
  margin-bottom: 7px;
  text-align: center;
}

.rsvp-input,
.rsvp-textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(140, 96, 62, 0.28);
  background: rgba(255, 252, 247, 0.86);
  color: var(--brown-espresso);
  font-family: var(--font-ar-sans);
  font-size: 0.92rem;
  padding: 12px 16px;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.rsvp-textarea {
  resize: vertical;
  min-height: 82px;
  line-height: 1.6;
}

.rsvp-input::placeholder,
.rsvp-textarea::placeholder {
  color: var(--brown-latte);
  opacity: 0.85;
}

.rsvp-input:focus,
.rsvp-textarea:focus {
  outline: none;
  border-color: var(--brown-mocha);
  background: #fffdf9;
  box-shadow: 0 0 0 3px rgba(140, 96, 62, 0.14);
}

.attendance-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.attendance-btn {
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(140, 96, 62, 0.34);
  background: rgba(255, 252, 247, 0.82);
  color: var(--brown-deep);
  font-family: var(--font-ar-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.attendance-btn:hover {
  border-color: var(--brown-espresso);
}

.attendance-btn.is-selected {
  background: var(--brown-espresso);
  border-color: var(--brown-espresso);
  color: var(--beige-soft);
  box-shadow: 0 6px 14px rgba(67, 40, 24, 0.2);
}

.rsvp-error {
  font-size: 0.82rem;
  color: #8f2d1f;
  text-align: center;
}

.rsvp-submit-btn {
  margin-top: 4px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1.2px solid var(--brown-mocha);
  background: linear-gradient(180deg, #684228 0%, #4b2d1a 100%);
  color: #fdf7ef;
  font-family: var(--font-ar-sans);
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(67, 40, 24, 0.2);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.rsvp-submit-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(67, 40, 24, 0.28);
}

.rsvp-submit-btn:focus-visible,
.attendance-btn:focus-visible,
.rsvp-edit-btn:focus-visible {
  outline: 2px solid var(--brown-espresso);
  outline-offset: 2px;
}

/* RSVP Confirmation Card */
.rsvp-success {
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.rsvp-success-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brown-espresso);
  color: var(--beige-warm);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}

.rsvp-success-title {
  font-family: var(--font-ar-serif);
  font-size: 1.35rem;
  color: var(--brown-espresso);
}

.rsvp-success-msg {
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--brown-mocha);
}

.rsvp-edit-btn {
  margin-top: 6px;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid rgba(111, 72, 44, 0.42);
  background: transparent;
  color: var(--brown-deep);
  font-family: var(--font-ar-sans);
  font-size: 0.84rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.rsvp-edit-btn:hover {
  background: var(--brown-espresso);
  color: var(--beige-soft);
}

/* ==========================================================================
   SECTION 8: IMPORTANT VENUE NOTES
   ========================================================================== */
.section--notes {
  padding-top: 24px;
  padding-bottom: 34px;
}

.notes-card-body {
  padding: 22px 18px;
}

.venue-notes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.venue-note-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--brown-espresso);
}

.note-bullet {
  font-size: 0.72rem;
  color: var(--brown-bronze);
  flex-shrink: 0;
}

.venue-note-divider {
  width: 64px;
  height: 1px;
  background: rgba(140, 96, 62, 0.28);
}

/* ==========================================================================
   SECTION 9: CLOSING FAREWELL
   ========================================================================== */
.section--closing {
  padding-top: 32px;
  padding-bottom: 120px;
}

.closing-poem {
  font-size: 0.96rem;
  line-height: 2.15;
  color: var(--brown-mocha);
  margin-bottom: 24px;
}

.closing-signature {
  font-family: var(--font-ar-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brown-espresso);
  margin-bottom: 10px;
}

.closing-date {
  font-size: 0.82rem;
  color: var(--brown-latte);
  letter-spacing: 0.04em;
}

.footer-credit {
  margin-top: 26px;
  font-family: var(--font-en-serif);
  font-size: 0.88rem;
  font-style: italic;
  letter-spacing: 0.1em;
  color: var(--brown-bronze);
  opacity: 0.88;
}

/* ==========================================================================
   SCROLL-DRIVEN REVEAL ANIMATIONS (Modern CSS + IntersectionObserver Fallback)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes revealRise {
      from {
        opacity: 0;
        transform: translateY(28px) scale(0.97);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .reveal-item {
      animation: revealRise auto ease-out both;
      animation-timeline: view();
      animation-range: entry 0% entry 36%;
    }
  }
}

/* Fallback class controlled by JS IntersectionObserver only when CSS view() is unsupported */
.js-reveal-fallback .reveal-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-reveal-fallback .reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Small viewport refinements */
@media (max-width: 390px) {
  .invitation-content {
    padding: 0 32px;
  }

  .couple-ar {
    font-size: 2.95rem;
  }

  .countdown-oval {
    padding: 15px 4px 13px;
  }

  .countdown-num {
    font-size: 1.45rem;
  }
}
