:root {
  color-scheme: light;
  --ivory: #f7f0e6;
  --cream: #fffaf2;
  --paper: #fbf5ec;
  --sage: #8d927b;
  --sage-deep: #4f5745;
  --gold: #c1a05f;
  --gold-soft: #ead9b8;
  --ink: #302a23;
  --muted: #746d60;
  --radius: 6px;

  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-script: "Pinyon Script", "Snell Roundhand", cursive;
  --font-arabic: "Amiri", "Geeza Pro", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 250, 242, 0.9), transparent 55%),
    var(--ivory);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Soft paper texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -5;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(197, 180, 140, 0.08), transparent 40%),
    radial-gradient(circle at 82% 68%, rgba(154, 160, 126, 0.08), transparent 42%);
}

a {
  color: inherit;
}

/* Thin gold frame around the whole page, like a printed card */
.page-frame {
  position: fixed;
  inset: clamp(10px, 1.6vw, 22px);
  z-index: 20;
  pointer-events: none;
  border: 1px solid rgba(193, 160, 95, 0.4);
  border-radius: 3px;
}

.page-shell {
  overflow: clip;
}

/* ===================== HERO ===================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(64px, 12vh, 128px) clamp(24px, 6vw, 72px);
  padding-left: clamp(40px, 11vw, 220px);
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: url("assets/hero-nikah.jpg") no-repeat;
  background-size: cover;
  background-position: 72% center;
  transform: scale(1.04);
  animation: heroDrift 22s ease-in-out infinite alternate;
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(250, 244, 235, 0.78) 0%, rgba(250, 244, 235, 0.35) 32%, rgba(250, 244, 235, 0.4) 66%, rgba(247, 240, 230, 0.92) 90%, #f7f0e6 100%),
    radial-gradient(ellipse 80% 60% at 50% 46%, rgba(250, 244, 235, 0.72), transparent 75%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Botanical corners */
.corner {
  position: absolute;
  z-index: 1;
  width: clamp(96px, 16vw, 180px);
  height: clamp(96px, 16vw, 180px);
  pointer-events: none;
}

.corner-tl {
  top: clamp(14px, 2.2vw, 30px);
  left: clamp(14px, 2.2vw, 30px);
}

.corner-tr {
  top: clamp(14px, 2.2vw, 30px);
  right: clamp(14px, 2.2vw, 30px);
  transform: scaleX(-1);
}

.arabic-line {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: var(--font-arabic);
  /* The ﷽ ligature is a very wide single glyph (long kashida stroke), so keep
     the size modest — big values push it far past the text column. */
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  line-height: 1.4;
  max-width: 100%;
}

.verse-line {
  margin: 0;
  color: var(--muted);
  font-style: italic;
  font-size: clamp(0.98rem, 2.6vw, 1.18rem);
  letter-spacing: 0.02em;
}

.verse-ref {
  margin: 4px 0 0;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.ornament {
  width: clamp(96px, 22vw, 130px);
  height: 24px;
  color: var(--gold);
  margin: clamp(16px, 3vw, 26px) 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--sage-deep);
  font-size: clamp(1rem, 3vw, 1.28rem);
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  text-indent: 0.42em;
}

.names {
  margin: 0;
  color: var(--sage-deep);
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 0.95;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.names .name {
  font-size: clamp(3.4rem, 14vw, 6rem);
  /* Script glyphs have tall loops + long descenders; give them room so
     background-clip:text doesn't crop them. */
  line-height: 1.2;
  padding: 0.08em 0.12em;
  background: linear-gradient(
    105deg,
    var(--sage-deep) 0%,
    var(--sage-deep) 42%,
    var(--gold) 50%,
    var(--sage-deep) 58%,
    var(--sage-deep) 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: nameSheen 7s ease-in-out infinite;
}

.names .ampersand {
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-style: italic;
  margin: -0.15em 0;
}

.request-line {
  max-width: 30ch;
  margin: clamp(18px, 3vw, 26px) 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  line-height: 1.55;
}

.hero-date {
  margin: clamp(34px, 6vw, 56px) 0 0;
  color: var(--ink);
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  letter-spacing: 0.12em;
}

.hero-date .dot {
  color: var(--gold);
  margin: 0 10px;
}

.scroll-cue {
  position: absolute;
  bottom: clamp(24px, 5vh, 46px);
  /* Centered without transform, so the .reveal animation's transform can't
     clobber the horizontal centering. */
  left: 0;
  right: 0;
  margin-inline: auto;
  width: max-content;
  max-width: 100%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--sage-deep);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-indent: 0.3em;
  opacity: 0.85;
}

.scroll-arrow {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--gold), transparent);
  position: relative;
  animation: scrollPulse 2.4s ease-in-out infinite;
}

.scroll-arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 6px;
  height: 6px;
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  transform: translateX(-50%) rotate(45deg);
}

/* ===================== SECTIONS ===================== */
.section {
  padding: clamp(56px, 11vw, 120px) clamp(24px, 6vw, 48px);
}

.section-inner {
  width: min(100%, 640px);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-inner .ornament {
  margin-top: 0;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-indent: 0.32em;
}

h2 {
  margin: 0 0 22px;
  color: var(--sage-deep);
  font-size: clamp(2rem, 6vw, 2.9rem);
  font-weight: 500;
  line-height: 1.12;
}

.section-lead {
  max-width: 40ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.6vw, 1.22rem);
  line-height: 1.65;
}

.invitation-section {
  background:
    linear-gradient(180deg, transparent, rgba(255, 250, 242, 0.5), transparent);
}

/* Countdown */
.countdown-section {
  background:
    linear-gradient(180deg, transparent, rgba(255, 250, 242, 0.5), transparent);
}

.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 5vw, 44px);
  margin-top: 6px;
}

.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(52px, 16vw, 72px);
}

.cd-num {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 9vw, 3.8rem);
  font-weight: 500;
  line-height: 1;
  color: var(--sage-deep);
  font-variant-numeric: tabular-nums;
}

.cd-label {
  margin-top: 10px;
  color: var(--gold);
  font-size: clamp(0.62rem, 2vw, 0.74rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-indent: 0.22em;
}

.cd-done {
  margin: 6px 0 0;
  color: var(--sage-deep);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.2rem, 3.4vw, 1.6rem);
}

/* Two-event airy cards (Reception + Nikah) */
.events {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 8vw, 68px);
  margin-top: 8px;
}

.air-event {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.air-name {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-indent: 0.28em;
}

.air-day {
  margin: 0;
  font-family: var(--font-script);
  color: var(--sage-deep);
  font-size: clamp(2.6rem, 9vw, 3.6rem);
  line-height: 1.05;
}

.air-when {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.6vw, 1.15rem);
  letter-spacing: 0.04em;
}

.air-when .dot {
  color: var(--gold);
  margin: 0 8px;
}

.air-rule {
  width: 54px;
  height: 1px;
  margin: 18px 0;
  background: var(--gold);
  opacity: 0.7;
}

.venue-name {
  margin: 0 0 4px;
  color: var(--sage-deep);
  font-size: clamp(1.2rem, 3.4vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.venue-address {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.action-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border: 1px solid rgba(193, 160, 95, 0.6);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.7);
  color: var(--sage-deep);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-indent: 0.2em;
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    background-color 200ms ease,
    box-shadow 200ms ease;
}

.action-button:hover,
.action-button:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: var(--cream);
  box-shadow: 0 12px 28px rgba(71, 61, 45, 0.14);
}

.action-button-primary {
  background: var(--sage-deep);
  color: var(--cream);
  border-color: var(--sage-deep);
}

.action-button-primary:hover,
.action-button-primary:focus-visible {
  background: #3f4737;
  border-color: #3f4737;
}

.rsvp-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.rsvp-deadline {
  color: var(--gold);
  font-style: italic;
  letter-spacing: 0.02em;
}

/* Closing du'a */
.arabic-blessing {
  margin: 0 0 16px;
  color: var(--sage-deep);
  font-family: "Scheherazade New", var(--font-arabic);
  font-size: clamp(1.5rem, 5.2vw, 2.15rem);
  line-height: 1.9;
}

.closing-blessing {
  max-width: 40ch;
  margin: 0;
  color: var(--muted);
  font-style: italic;
  font-size: clamp(1.05rem, 2.6vw, 1.2rem);
  line-height: 1.65;
}

/* Footer */
.site-footer {
  padding: 40px 24px calc(40px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-top: 1px solid rgba(193, 160, 95, 0.3);
}

.footer-names {
  color: var(--sage-deep);
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 5vw, 2.1rem);
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.04em;
  line-height: 1;
}

.footer-date {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
}

.footer-names .footer-hash {
  color: var(--gold);
  font-style: normal;
  margin-right: 1px;
}

/* ===================== ANIMATIONS ===================== */
.reveal {
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  filter: blur(3px);
  transition:
    opacity 1000ms cubic-bezier(0.2, 0.65, 0.25, 1),
    transform 1000ms cubic-bezier(0.2, 0.65, 0.25, 1),
    filter 1000ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* Staggered hero entrance */
.hero .reveal {
  transition-delay: calc(var(--i, 0) * 140ms);
}

@keyframes heroDrift {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.09) translate3d(-10px, -12px, 0);
  }
}

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

/* Gold sheen sweeping across the couple names */
@keyframes nameSheen {
  0%,
  100% {
    background-position: 140% 0;
  }
  50% {
    background-position: -40% 0;
  }
}

/* Leaf dividers breathe gently */
.ornament {
  animation: ornFloat 5.5s ease-in-out infinite;
}

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

/* Countdown digit pop on change */
.cd-num.pop {
  animation: cdPop 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes cdPop {
  0% {
    transform: scale(1);
  }
  32% {
    transform: scale(1.16);
    color: var(--gold);
  }
  100% {
    transform: scale(1);
  }
}

/* Soft pulsing glow to draw the eye to the RSVP button */
.rsvp-section .action-button {
  animation: rsvpGlow 3.2s ease-in-out infinite;
}

@keyframes rsvpGlow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(193, 160, 95, 0);
  }
  50% {
    box-shadow: 0 10px 30px rgba(193, 160, 95, 0.34);
  }
}

/* ===================== FALLING PETALS ===================== */
.petals {
  position: fixed;
  inset: 0;
  z-index: 15;
  overflow: hidden;
  pointer-events: none;
}

.petal {
  position: absolute;
  top: -12vh;
  will-change: transform;
  animation: petalFall linear infinite;
}

.petal-sway {
  display: block;
  animation: petalSway ease-in-out infinite alternate;
}

.petal-shape {
  display: block;
  width: var(--size, 16px);
  height: calc(var(--size, 16px) * 0.82);
  background: radial-gradient(
    circle at 32% 28%,
    var(--c1, #ffffff),
    var(--c2, #efd9bf) 72%
  );
  border-radius: 150% 0 150% 0;
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.55);
  opacity: var(--op, 0.7);
  animation: petalSpin linear infinite;
}

@keyframes petalFall {
  from {
    transform: translateY(-12vh);
  }
  to {
    transform: translateY(114vh);
  }
}

@keyframes petalSway {
  from {
    transform: translateX(calc(var(--sway, 30px) * -1));
  }
  to {
    transform: translateX(var(--sway, 30px));
  }
}

@keyframes petalSpin {
  from {
    transform: rotateZ(0deg) rotateY(0deg);
  }
  to {
    transform: rotateZ(360deg) rotateY(360deg);
  }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 560px) {
  body {
    font-size: 1.06rem;
  }

  .hero {
    align-items: center;
    padding: clamp(72px, 12vh, 110px) clamp(20px, 6vw, 40px);
  }

  .hero-media {
    background-position: 66% 30%;
  }

  /* Stronger ivory wash on mobile so centered text sits cleanly over the
     couple (who become a soft backdrop) instead of colliding with them. */
  .hero-veil {
    background:
      radial-gradient(ellipse 92% 52% at 50% 42%, rgba(250, 244, 235, 0.7), transparent 82%),
      linear-gradient(180deg, rgba(250, 244, 235, 0.92) 0%, rgba(250, 244, 235, 0.76) 34%, rgba(250, 244, 235, 0.76) 60%, rgba(247, 240, 230, 0.97) 90%, #f7f0e6 100%);
  }

  .corner {
    width: 88px;
    height: 88px;
    opacity: 0.9;
  }

  /* Keep the big script names from overflowing / getting clipped */
  .names .name {
    font-size: clamp(2.9rem, 15vw, 4.4rem);
    padding: 0.08em 0.16em;
  }

  /* Section padding a touch tighter so content isn't cramped */
  .section {
    padding: clamp(48px, 10vw, 80px) clamp(20px, 6vw, 40px);
  }

  /* Countdown must fit narrow screens without overflowing */
  .countdown {
    gap: clamp(8px, 3.5vw, 20px);
  }

  .cd-unit {
    min-width: 0;
    flex: 1 1 0;
  }

  .cd-num {
    font-size: clamp(1.9rem, 12vw, 3rem);
  }

  .cd-label {
    letter-spacing: 0.12em;
    text-indent: 0.12em;
  }

  /* Longer footer date shouldn't feel stretched */
  .footer-date {
    letter-spacing: 0.18em;
    text-indent: 0.18em;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .cd-num {
    font-size: 1.7rem;
  }

  .cd-label {
    font-size: 0.58rem;
    letter-spacing: 0.08em;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .petals {
    display: none;
  }
}
