/* ==========================================================================
   Niharika & Amol - e-invite
   One scrolling page on a fixed, animated ivory/blush/gold backdrop.
   ========================================================================== */

:root {
  --ivory:      #fdf8f2;
  --paper:      #fffdf9;
  --ink:        #3f3038;
  --ink-soft:   #6b5560;
  --ink-faint:  #8d7c85;

  --gold:       #c7a05a;
  --gold-deep:  #8c5f2a;
  --gold-soft:  #f0dcb0;

  --blush:      #e8a8bd;
  --plum:       #7b1e3c;
  --plum-soft:  #a84262;

  --line:       rgba(169, 129, 61, .3);
  --shadow-md:  0 14px 34px rgba(63, 48, 56, .1);
  --shadow-lg:  0 28px 60px rgba(63, 48, 56, .16);

  /* One family throughout. Hierarchy comes from size, weight and italics -
     never from a second typeface. */
  --font: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  --page-pad: clamp(16px, 5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(17px, 2.7vw, 19px);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: inherit; }
::selection { background: var(--gold); color: #fff; }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font); font-weight: 600; line-height: 1.15; margin: 0; }

/* ==========================================================================
   FIXED BACKDROP
   ========================================================================== */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* Own compositor layer: the drifting petals repaint inside it without
     forcing the invitation text above to repaint too. */
  transform: translateZ(0);
  /* The dawn sky and its watercolour blooms are plain CSS gradients. They used
     to be SVG ellipses behind a feGaussianBlur, which a phone GPU re-rasterises
     constantly - by far the biggest cause of scroll jank on mobile. */
  background:
    radial-gradient(58% 38% at 15% 16%, rgba(246, 204, 216, .55), transparent 70%),
    radial-gradient(54% 38% at 87% 24%, rgba(243, 211, 222, .50), transparent 70%),
    radial-gradient(58% 28% at 53% 7%,  rgba(250, 226, 230, .45), transparent 70%),
    radial-gradient(44% 30% at 25% 68%, rgba(231, 220, 236, .40), transparent 70%),
    radial-gradient(48% 32% at 80% 73%, rgba(223, 230, 242, .45), transparent 70%),
    linear-gradient(to bottom, #fffdfa 0%, #fdf6f2 34%, #fbeef0 62%, #f1ecf2 82%, #e3ecf5 100%);
}
.backdrop svg { width: 100%; height: 100%; display: block; }

/* no transition here: the parallax sets transform every frame from rAF, and a
   transition on top of that makes the compositor interpolate twice over. */
.layer { will-change: transform; }

.sparkle { transform-box: fill-box; transform-origin: center; animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.25) rotate(0deg); }
  42%      { opacity: 1; transform: scale(1) rotate(40deg); }
  68%      { opacity: .3; transform: scale(.6) rotate(70deg); }
}

.petal {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: petal-fall 15s linear infinite;
}
@keyframes petal-fall {
  0%   { transform: translate(0, -140px) rotate(0deg); opacity: 0; }
  10%  { opacity: .85; }
  82%  { opacity: .6; }
  100% { transform: translate(var(--dx, 60px), 980px) rotate(var(--spin, 540deg)); opacity: 0; }
}

/* ==========================================================================
   SHARED BITS
   ========================================================================== */
.eyebrow {
  font-family: var(--font);
  font-size: clamp(11px, 2.5vw, 13px);
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0;
}

.btn {
  --btn-bg: linear-gradient(135deg, #d7a85c, #b8863f);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  padding: .95em 2.2em;
  border: 0;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font);
  font-size: clamp(13px, 2.8vw, 15px);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.9,.3,1.3), box-shadow .25s ease, filter .25s ease;
  box-shadow: 0 10px 26px rgba(169, 129, 61, .3);
}
.btn:hover, .btn:focus-visible { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(169, 129, 61, .4); }
.btn:active { transform: translateY(-1px); }

.btn--plum {
  --btn-bg: linear-gradient(135deg, #a84262, #7b1e3c);
  box-shadow: 0 10px 26px rgba(123, 30, 60, .28);
}
.btn--plum:hover, .btn--plum:focus-visible { box-shadow: 0 16px 34px rgba(123, 30, 60, .38); }

.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--gold-deep);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn--outline:hover, .btn--outline:focus-visible { --btn-fg: #fff; background: var(--gold-deep); }

.actions-row {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin-top: clamp(20px, 4vw, 30px);
}

.divider {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: var(--gold); margin: clamp(16px, 3.5vw, 26px) 0;
}
.divider::before, .divider::after {
  content: ""; height: 1px; flex: 1 1 auto; max-width: 110px;
  background: linear-gradient(90deg, transparent, currentColor);
}
.divider::after { background: linear-gradient(270deg, transparent, currentColor); }
.divider__mark { font-size: 15px; letter-spacing: .3em; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.3,1); }
.reveal.is-visible { opacity: 1; transform: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 160%);
  z-index: 90;
  max-width: min(92vw, 420px);
  padding: 14px 20px;
  border-radius: 14px;
  background: rgba(63, 48, 56, .96);
  color: #fff;
  font-size: 16px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transition: transform .45s cubic-bezier(.2,.9,.3,1.2);
}
.toast.is-open { transform: translate(-50%, 0); }

/* ==========================================================================
   HERO
   ========================================================================== */
.page { position: relative; z-index: 1; }

.hero {
  width: min(100%, 880px);
  margin: 0 auto;
  min-height: 100svh;
  padding: clamp(40px, 8vh, 80px) var(--page-pad) clamp(28px, 6vh, 56px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.hero__top { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero__bottom { display: flex; flex-direction: column; align-items: center; gap: 18px; }

.hero__names {
  font-family: var(--font);
  font-size: clamp(40px, 12vw, 112px);
  letter-spacing: .04em;
  line-height: 1;
  margin: 8px 0 0;
  background: linear-gradient(175deg, #d7a85c 6%, #b8863f 40%, #8c5f2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 18px rgba(169, 129, 61, .22));
}
.hero__amp {
  display: block;
  font-family: var(--font);
  font-size: clamp(30px, 7.5vw, 62px);
  font-style: italic;
  font-weight: 400;
  color: var(--plum);
  -webkit-text-fill-color: var(--plum);
  line-height: 1.15;
}
.hero__caption {
  font-family: var(--font);
  font-size: clamp(16px, 4.1vw, 24px);
  font-style: italic;
  color: var(--ink-soft);
  margin: 16px auto 0;
  max-width: 32ch;
  text-wrap: balance;
}
.hero__date {
  display: inline-flex; align-items: center; gap: .7em; flex-wrap: wrap; justify-content: center;
  margin-top: 16px;
  font-size: clamp(10px, 2.9vw, 13px);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hero__date b { color: var(--gold-deep); font-weight: 600; }

.hero__scroll {
  font-size: 11px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase;
  color: var(--ink-faint);
  display: inline-flex; flex-direction: column-reverse; align-items: center; gap: 8px;
}
.hero__scroll i {
  width: 1px; height: 30px;
  background: linear-gradient(to bottom, transparent, var(--gold-deep));
  animation: pulse-line 2.4s ease-in-out infinite;
}
@keyframes pulse-line { 0%,100% { opacity: .2; transform: scaleY(.55); } 50% { opacity: 1; transform: scaleY(1); } }

/* the A&N monogram crest */
.crest {
  position: relative;
  /* the svh term keeps the crest from pushing the RSVP button off a short screen */
  width: min(clamp(200px, 56vw, 374px), 42svh);
  aspect-ratio: 1;
  margin: clamp(4px, 2vw, 14px) auto;
  display: grid;
  place-items: center;
}
.crest__halo {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.95) 38%, rgba(250,226,230,.55) 64%, transparent 73%);
}
.crest__ring {
  position: absolute;
  inset: -5%;
  color: var(--gold);
  opacity: .8;
}
.crest img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
}

/* ==========================================================================
   SECTIONS + PANELS
   ========================================================================== */
.section {
  width: 100%;
  padding: clamp(28px, 7vh, 64px) var(--page-pad);
  display: flex;
  justify-content: center;
  scroll-margin-top: 20px;
}

.panel {
  position: relative;
  width: min(100%, 720px);
  padding: clamp(30px, 6.5vw, 62px) clamp(22px, 5.5vw, 56px);
  /* Opaque enough to read over the backdrop without backdrop-filter, which
     forces the phone to re-blur the whole page behind every panel on scroll. */
  background: rgba(255, 253, 249, .95);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--gold);
  inset: 10px;
  border-radius: 4px;
  opacity: .45;
}
.panel::after { inset: 16px; opacity: .18; }

.panel__title {
  font-family: var(--font);
  font-size: clamp(32px, 8.5vw, 56px);
  color: var(--ink);
  margin: 10px 0 4px;
  letter-spacing: .03em;
}
.panel__caption {
  font-family: var(--font);
  font-style: italic;
  font-size: clamp(16px, 4vw, 22px);
  color: var(--ink-soft);
  max-width: 34ch;
  margin: 8px auto 0;
  text-wrap: balance;
}
.panel__line {
  font-size: clamp(13px, 3.2vw, 15px);
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 14px auto 0;
}

/* the DJ night takes the same paper, in a deeper plum key */
.panel--party { background: rgba(255, 250, 251, .9); }
.panel--party::before, .panel--party::after { border-color: var(--plum-soft); }
.panel--party .eyebrow { color: var(--plum); }
.panel--party .panel__title {
  background: linear-gradient(120deg, #a84262, #7b1e3c 55%, #c7648a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.panel--party .detail { border-color: rgba(123, 30, 60, .2); }
.panel--party .detail__label { color: var(--plum); }

/* ------------------------------------------------------------ detail tiles */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: clamp(12px, 3vw, 22px);
  margin: clamp(18px, 4vw, 28px) 0 0;
}
.detail {
  padding: 18px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(169, 129, 61, .2);
}
.detail__label { font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-deep); }
.detail__value { font-family: var(--font); font-size: clamp(18px, 4.6vw, 23px); margin-top: 6px; color: var(--ink); }
.detail__note { font-size: 15px; color: var(--ink-soft); margin-top: 4px; }
.detail__note a { color: var(--gold-deep); text-decoration-color: var(--line); text-underline-offset: 3px; }

/* --------------------------------------------------------------- countdown */
.countdown { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(8px, 2.4vw, 16px); margin-top: clamp(18px, 4vw, 26px); }
.countdown__unit {
  min-width: clamp(64px, 17vw, 88px);
  padding: 13px 6px;
  border-radius: 12px;
  background: linear-gradient(160deg, #b8863f, #8c5f2a);
  color: #fff;
  box-shadow: 0 10px 24px rgba(140, 95, 42, .22);
}
.countdown__num { font-family: var(--font); font-size: clamp(22px, 6vw, 31px); line-height: 1.1; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.countdown__lbl { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .78; margin-top: 4px; }

/* ------------------------------------------------------------- dj flourish */
.equalizer { display: flex; align-items: flex-end; justify-content: center; gap: 5px; height: 40px; margin-top: 24px; }
.equalizer i { width: 5px; border-radius: 3px; background: linear-gradient(to top, var(--plum), var(--blush)); animation: eq 1.1s ease-in-out infinite; }
@keyframes eq { 0%,100% { height: 16%; } 50% { height: 100%; } }

.vibe-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 24px 0 0; list-style: none; padding: 0; }
.vibe-list li {
  padding: 8px 18px; border-radius: 999px; font-size: 15px;
  border: 1px solid rgba(123, 30, 60, .2);
  background: rgba(255, 255, 255, .6);
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------- venue */
.venue__qr {
  display: inline-block;
  margin: clamp(18px, 4vw, 26px) auto clamp(10px, 2vw, 14px);
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(63, 48, 56, .1);
}
.venue__qr img {
  display: block;
  width: clamp(148px, 42vw, 196px);
  height: auto;
  /* keep the QR modules crisp instead of blurred by smooth upscaling */
  image-rendering: pixelated;
}
.venue__hint {
  font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-deep); margin: 0;
}

/* ==========================================================================
   RSVP
   ========================================================================== */
.panel--rsvp { text-align: center; }
.panel--rsvp form { text-align: left; margin-top: clamp(20px, 4vw, 28px); }

.field { margin-bottom: 18px; }
.field > label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 8px;
}
.field__optional { opacity: .6; letter-spacing: .1em; }

.field input[type="text"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font);
  font-size: 17px; /* stays above 16px so iOS does not zoom on focus */
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 104px; }
.field input::placeholder, .field textarea::placeholder { color: #b9a9b0; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(199, 160, 90, .22);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #c2405a; }

.field__error { font-size: 15px; color: #c2405a; margin: 6px 0 0; }
.field__error:empty { margin: 0; }

/* honeypot - off-screen but reachable by bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.rsvp__submit { width: 100%; margin-top: 6px; }
.rsvp__submit[aria-busy="true"] { opacity: .75; pointer-events: none; }

.rsvp__status { margin: 14px 0 0; font-size: 16px; text-align: center; }
.rsvp__status[data-state="error"] { color: #c2405a; }
.rsvp__status[data-state="ok"] { color: #2f7d52; }

.rsvp__done { padding: 10px 0 4px; }
.rsvp__done h3 { font-size: clamp(24px, 6vw, 34px); color: var(--gold-deep); margin-bottom: 10px; }
.rsvp__done p { color: var(--ink-soft); margin: 0 auto; max-width: 40ch; }

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.foot {
  text-align: center;
  font-size: 14px;
  letter-spacing: .1em;
  color: var(--ink-faint);
  padding: 0 var(--page-pad) clamp(34px, 7vh, 64px);
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .sparkle { opacity: .85; }
}
