/* ==========================================================
   Erie Samuel & Christine Ann — burgundy velvet, gold foil,
   frosted pearl glass and blush rose, after the invitation.
   ========================================================== */

:root {
  --wine-950: #1d0409;
  --wine-900: #2b060e;
  --wine-800: #3d0a14;
  --wine-700: #56101d;
  --wine-600: #6e1626;
  --gold: #d9b676;
  --gold-light: #f6e6b8;
  --gold-deep: #b98c4c;
  --blush: #dba8ad;
  --rose: #b9697a;
  --cream: #f8eee2;

  --foil: linear-gradient(135deg, #f6e6b8 0%, #d4ad6a 30%, #f9edc9 52%, #c79a58 74%, #f3dfae 100%);

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --caps: "Cinzel", "Cormorant Garamond", serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--cream);
  background-color: var(--wine-900);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ---------- shared type ---------- */

.gold-text {
  background: var(--foil);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}

/* light travelling across the foil */
.script.gold-text, .group__title, .countdown__num, .card__time {
  background-size: 220% auto;
  animation: foil 7s linear infinite;
}

.caps, .eyebrow {
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .78rem;
  color: var(--gold-light);
  margin: 0;
}

.eyebrow { color: var(--blush); }

.script {
  font-family: var(--script);
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
  padding: .1em .15em;   /* keeps swashes from being clipped by background-clip */
}

.flourish { display: block; width: 200px; height: 17px; margin: 0 auto; }

/* ---------- page backdrop: velvet and roses, fixed behind everything ---------- */

.backdrop, .veil, .petals { position: fixed; inset: 0; pointer-events: none; }

.backdrop {
  z-index: -2;
  background: url("bg-desktop.webp") center / cover no-repeat var(--wine-800);
  animation: backdrop-drift 40s ease-in-out infinite alternate;
}

@media (max-aspect-ratio: 1 / 1) {
  .backdrop { background-image: url("bg-phone.webp"); }
}

/* darkens the backdrop once you scroll past the invitation (opacity set in script.js) */
.veil {
  z-index: -1;
  background: linear-gradient(180deg, rgba(29, 4, 9, .92), rgba(43, 6, 14, .86));
  opacity: var(--veil, 0);
}

.hero, .section, .footer { position: relative; z-index: 1; }

/* ---------- falling rose petals ---------- */

.petals { z-index: 0; overflow: hidden; }

.petal {
  position: absolute;
  top: -8vh;
  animation: petal-fall var(--dur) linear var(--delay) infinite;
}

.petal i {
  display: block;
  width: var(--size);
  height: calc(var(--size) * 1.25);
  border-radius: 100% 0 100% 0;
  background: linear-gradient(135deg, #f3ced0, #cf8f9a 70%, #b56d7d);
  box-shadow: inset -1px -1px 3px rgba(120, 40, 60, .35);
  opacity: .85;
  animation: petal-sway calc(var(--dur) / 3) ease-in-out var(--delay) infinite alternate;
}

.petal--wine i { background: linear-gradient(135deg, #9b2740, #6a1226 70%, #4a0a19); }

/* ---------- gold dust around the invitation ---------- */

.sparkles { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.sparkle {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: radial-gradient(circle, #fff6d8 0, #e9c987 40%, rgba(233, 201, 135, 0) 70%);
  opacity: 0;
  animation: twinkle var(--dur) ease-in-out var(--delay) infinite;
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(29, 4, 9, .85), rgba(29, 4, 9, 0));
  font-family: var(--caps);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.nav a { text-decoration: none; color: var(--gold-light); transition: color .25s; }
.nav a:hover, .nav a:focus-visible { color: #fff; }
.nav__mark { font-size: .95rem; letter-spacing: .12em; }
.nav__mark span { color: var(--blush); }
.nav__links { display: flex; gap: clamp(14px, 3vw, 32px); }

/* ---------- hero: the invitation card, cut out of the photo ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 76px 16px 78px;
  isolation: isolate;
}

.invitation-wrap {
  position: relative;
  display: grid;
  animation: rise 1.4s cubic-bezier(.2, .7, .2, 1) both, float 8s ease-in-out 1.4s infinite;
}

/* a slow glint of light across the card, clipped to the card's own shape */
.invitation-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-mask: url("invitation.webp") center / 100% 100% no-repeat;
  mask: url("invitation.webp") center / 100% 100% no-repeat;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 246, 222, .38) 50%, transparent 58%) no-repeat;
  background-size: 300% 100%;
  animation: glint 9s ease-in-out 2.5s infinite;
  pointer-events: none;
}

.invitation {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 600px);
  max-height: max(420px, calc(100svh - 150px));
  filter: drop-shadow(0 26px 40px rgba(10, 0, 3, .65));
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.scroll-cue {
  position: absolute;
  bottom: 22px;
  left: 50%;
  width: 24px;
  height: 40px;
  margin-left: -12px;
  border: 1px solid rgba(246, 230, 184, .6);
  border-radius: 12px;
}

.scroll-cue span {
  position: absolute;
  top: 8px; left: 50%;
  width: 3px; height: 8px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--gold-light);
  animation: cue 2s ease-in-out infinite;
}

/* ---------- sections ---------- */

.section {
  padding: clamp(64px, 11vw, 120px) 16px;
  max-width: 1040px;
  margin: 0 auto;
  text-align: center;
}

.section--tight { padding-block: clamp(48px, 8vw, 80px); }

.section__head { margin-bottom: clamp(32px, 6vw, 56px); }
.section__head .script { font-size: clamp(2.8rem, 10vw, 4.2rem); margin: 4px 0 6px; }

/* ---------- countdown ---------- */

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 620px;
  margin: 22px auto 0;
}

.countdown__cell { display: grid; gap: 6px; padding: 4px; }
.countdown__cell + .countdown__cell { border-left: 1px solid rgba(217, 182, 118, .35); }

.countdown__num {
  font-size: clamp(2.2rem, 9vw, 3.6rem);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}

.countdown__label {
  font-family: var(--caps);
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--blush);
}

.countdown--done { display: block; }

/* ---------- the day ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 28px;
}

.card, .group {
  position: relative;
  border: 1px solid rgba(217, 182, 118, .45);
  border-radius: 4px;
  background:
    radial-gradient(80% 60% at 85% 0%, rgba(222, 190, 255, .08), transparent 70%),
    linear-gradient(160deg, rgba(255, 240, 228, .1), rgba(255, 240, 228, .03)),
    rgba(52, 8, 18, .62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(10, 0, 3, .45);
  transition: transform .5s ease, box-shadow .5s ease, border-color .5s ease;
}

.card:hover { transform: translateY(-6px); border-color: rgba(246, 230, 184, .8); box-shadow: 0 28px 60px rgba(10, 0, 3, .55); }

/* inner hairline, like a foil-stamped border */
.card::before, .group::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(217, 182, 118, .22);
  border-radius: 2px;
  pointer-events: none;
}

.card { padding: 44px 28px 40px; }

.card__kicker {
  font-family: var(--caps);
  font-size: .74rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--blush);
  margin: 0;
}

.card__time { font-size: 2.6rem; line-height: 1.2; margin: 8px 0 6px; }

.card__place {
  font-family: var(--caps);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: .14em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--gold-light);
  margin: 0 auto;
  max-width: 22ch;
  text-wrap: balance;
}

.card__note { font-style: italic; color: rgba(248, 238, 226, .8); margin: 10px 0 24px; }

.btn {
  display: inline-block;
  padding: 11px 26px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-family: var(--caps);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold-light);
  transition: background .3s, color .3s;
}

.btn:hover, .btn:focus-visible { background: var(--foil); color: var(--wine-900); }

/* ---------- rsvp ---------- */

.rsvp {
  max-width: 600px;
  margin: 0 auto;
  display: grid;
  gap: 26px;
  text-align: left;
}

.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field[hidden] { display: none; }

.field__label {
  font-family: var(--caps);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--blush);
  padding: 0;
}

.field__label em { text-transform: none; letter-spacing: .04em; font-family: var(--serif); font-size: .95rem; }

.rsvp input[type="text"], .rsvp input[type="number"], .rsvp textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--cream);
  background: rgba(29, 4, 9, .45);
  border: 1px solid rgba(217, 182, 118, .45);
  border-radius: 3px;
  transition: border-color .25s, box-shadow .25s;
}

.rsvp textarea { resize: vertical; min-height: 96px; }

.rsvp input:focus-visible, .rsvp textarea:focus-visible {
  outline: none;
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(217, 182, 118, .25);
}

.choice { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.choice legend { grid-column: 1 / -1; margin-bottom: 8px; }
.choice label { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }

.choice span {
  display: block;
  padding: 13px 10px;
  text-align: center;
  font-style: italic;
  border: 1px solid rgba(217, 182, 118, .45);
  border-radius: 3px;
  transition: background .3s, color .3s, border-color .3s;
}

.choice input:checked + span { background: var(--foil); color: var(--wine-900); border-color: transparent; font-weight: 600; }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(217, 182, 118, .35); }

.rsvp__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn--solid {
  justify-self: center;
  padding: 14px 40px;
  font-size: .74rem;
  background: var(--foil);
  color: var(--wine-900);
  border-color: transparent;
  cursor: pointer;
  transition: filter .3s, transform .3s;
}

.btn--solid:hover, .btn--solid:focus-visible { filter: brightness(1.1); transform: translateY(-2px); }
.btn--solid:disabled { opacity: .6; cursor: wait; transform: none; }

.rsvp__status { margin: -8px 0 0; min-height: 1.6em; text-align: center; font-style: italic; color: var(--gold-light); }
.rsvp__status.is-error { color: #ffb4b4; }

/* sending: the fields hush, the button shimmers and shows a spinner */
.rsvp { transition: height .6s cubic-bezier(.2, .7, .2, 1); }
.rsvp > * { transition: opacity .4s ease, transform .4s ease, filter .4s ease; }
.rsvp.is-sending .field { opacity: .45; pointer-events: none; }
.rsvp.is-sending .btn--solid {
  opacity: 1;
  color: transparent;
  position: relative;
  background-size: 220% auto;
  animation: foil 1.4s linear infinite;
}
.rsvp.is-sending .btn--solid::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(43, 6, 14, .25);
  border-top-color: var(--wine-900);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.rsvp.is-sending .rsvp__status { animation: breathe 1.4s ease-in-out infinite; }

/* leaving: the whole form lifts and fades before the thank-you arrives */
.rsvp.is-leaving > * { opacity: 0; transform: translateY(-14px); filter: blur(3px); }

.rsvp__thanks { position: relative; text-align: center; padding: 12px 0; }
.rsvp__thanks > * { animation: thanks-in .9s cubic-bezier(.2, .7, .2, 1) both; }
.rsvp__thanks .script { animation: thanks-in .9s cubic-bezier(.2, .7, .2, 1) .55s both, foil 7s linear infinite; }
.rsvp__thanks .rsvp__note { animation-delay: .85s; }

.rsvp__heart {
  display: block;
  width: 58px;
  margin: 0 auto 6px;
  overflow: visible;
  animation: heart-beat 1.6s ease-in-out 1.5s 2 both;
}
.rsvp__heart path {
  fill: rgba(217, 182, 118, 0);
  stroke: var(--gold-light);
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: heart-draw 1.1s ease-in-out .15s forwards, heart-fill .7s ease 1.1s forwards;
}

.rsvp__burst { position: absolute; top: 40px; left: 50%; width: 0; height: 0; animation: none; }
.bit {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: radial-gradient(circle, #fff6d8 0, #e9c987 55%, #c79a58 100%);
  opacity: 0;
  animation: burst 1.5s cubic-bezier(.15, .7, .3, 1) calc(1s + var(--delay)) both;
}
.bit--petal {
  width: calc(var(--size) * 1.3);
  height: calc(var(--size) * 1.7);
  border-radius: 100% 0 100% 0;
  background: linear-gradient(135deg, #f3ced0, #cf8f9a 70%, #b56d7d);
}

.rsvp__thanks .script { font-size: clamp(2.4rem, 8vw, 3.2rem); }
.rsvp__thanks p { margin: 6px 0 0; }

@media (max-width: 420px) { .choice { grid-template-columns: 1fr; } }

/* ---------- entourage ---------- */

.entourage { display: grid; gap: 28px; }

.group { padding: clamp(34px, 6vw, 52px) clamp(18px, 5vw, 48px); }

.group__title {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(2rem, 7vw, 2.7rem);
  line-height: 1.2;
  margin: 0 0 18px;
  padding: 0 .2em;
}

.group__cols {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), 1fr);
  gap: 26px clamp(14px, 4vw, 40px);
  align-items: start;
}

.role {
  font-family: var(--caps);
  font-weight: 400;
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--blush);
  margin: 0 0 10px;
  text-wrap: balance;
}

.people { list-style: none; margin: 0; padding: 0; }

.people li, .pairs span {
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.3;
  padding: 5px 0;
  text-wrap: balance;
}

/* husband | wife rows */
.pairs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(14px, 4vw, 40px);
  max-width: 720px;
  margin: 0 auto;
}

.pairs span:nth-child(odd) { text-align: right; }
.pairs span:nth-child(even) { text-align: left; }
.pairs span:nth-child(n + 3) { border-top: 1px solid rgba(217, 182, 118, .14); }

/* ---------- footer ---------- */

.footer {
  text-align: center;
  padding: 56px 16px 64px;
  border-top: 1px solid rgba(217, 182, 118, .25);
  background: rgba(29, 4, 9, .5);
}

.footer__monogram { width: 124px; height: auto; margin: 0 auto 6px; -webkit-user-drag: none; user-select: none; }
.footer__names { font-size: 2.6rem; }

/* ---------- motion ---------- */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform .9s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* cards and headings rise in one after another */
.cards .reveal:nth-child(2) { transition-delay: .18s; }
.section__head .flourish { transform: scaleX(0); transition: transform 1.2s cubic-bezier(.2, .7, .2, 1) .35s; }
.section__head.is-in .flourish { transform: scaleX(1); }
.countdown__num.tick { animation: foil 7s linear infinite, tick .5s ease; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: .45; } }
@keyframes thanks-in { from { opacity: 0; transform: translateY(18px); } }
@keyframes heart-draw { to { stroke-dashoffset: 0; } }
@keyframes heart-fill { to { fill: rgba(217, 182, 118, .9); } }
@keyframes heart-beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.14); } 55% { transform: scale(.97); } }
@keyframes burst {
  0% { opacity: 0; transform: translate(0, 0) scale(.3) rotate(0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 40px)) scale(1) rotate(var(--spin)); }
}
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(.4deg); } }
@keyframes glint { 0%, 55% { background-position: 150% 0; } 85%, 100% { background-position: -50% 0; } }
@keyframes foil { to { background-position: -220% center; } }
@keyframes tick { from { transform: translateY(-.18em); opacity: .4; } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: .95; transform: scale(1); } }
@keyframes petal-fall { to { transform: translateY(118vh); } }
@keyframes petal-sway {
  from { transform: translateX(calc(var(--sway) * -1)) rotate3d(1, 1, 0, -50deg) rotate(-30deg); }
  to { transform: translateX(var(--sway)) rotate3d(1, 1, 0, 70deg) rotate(150deg); }
}
@keyframes backdrop-drift { from { transform: scale(1); } to { transform: scale(1.06); } }

@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(12px); opacity: 0; } }

@media (max-width: 560px) {
  .nav__mark { display: none; }
  .nav { justify-content: center; }
  .group__cols[style*="--cols:3"] { grid-template-columns: 1fr; }
  .people li, .pairs span { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .invitation-wrap, .invitation-wrap::after, .scroll-cue span, .backdrop, .gold-text, .countdown__num.tick { animation: none; }
  .petals, .sparkles { display: none; }
  .rsvp, .rsvp > *, .rsvp__thanks > *, .rsvp__heart, .rsvp__heart path, .rsvp.is-sending .btn--solid, .rsvp.is-sending .rsvp__status { animation: none; transition: none; }
  .rsvp__heart path { stroke-dashoffset: 0; fill: rgba(217, 182, 118, .9); }
  .section__head .flourish { transform: none; transition: none; }
  .card { transition: none; }
}
