:root {
  --paper: #e9e4d6;
  --paper-deep: #ddd6c4;
  --ink: #6f665a;
  --ink-soft: #8c8373;
  --ink-strong: #4a433a;
  --night: #2a2622;
  --crimson: #8e1426;
  --crimson-deep: #5c0a17;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --letter-w: min(58vw, 250px);
  --serif: 'Amiri', serif;
  --script-ar: 'Aref Ruqaa', 'Amiri', serif;
  --script-en: 'Pinyon Script', cursive;
  --num: 'Cormorant Garamond', serif;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/2 var(--serif);
  text-align: center;
  -webkit-font-smoothing: antialiased;
}

body.is-sealed { overflow: hidden; background: var(--night); }

img, video { display: block; max-width: 100%; }

p { margin: 0; }

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

.intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--night);
  transition: opacity .9s ease .35s, visibility 0s linear 1.25s;
}

.intro-video, .top-video, .band video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 50% 50%, rgba(30, 26, 22, .1), rgba(30, 26, 22, .55));
}

.intro-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  padding: 0 1rem;
}

.intro-title {
  color: #f5f1e8;
  font: 400 clamp(2rem, 9vw, 2.75rem)/1.2 var(--script-en);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .45);
}

.intro-envelope {
  width: min(78vw, 330px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .45));
  animation: float 4.5s ease-in-out infinite;
  transition: transform .7s var(--ease), filter .7s ease, opacity .7s ease;
  -webkit-tap-highlight-color: transparent;
}

.intro-envelope { position: relative; }
.intro-envelope img:first-child { width: 100%; }

.intro-seal {
  position: absolute;
  left: 50%;
  top: 57%;
  width: 18%;
  translate: -50% 0;
  filter: drop-shadow(0 4px 6px rgba(60, 10, 18, .45));
}

.intro-envelope:focus-visible { outline: 1px solid #f5f1e8; outline-offset: 8px; }

.intro-hint {
  color: rgba(245, 241, 232, .85);
  font-size: .8125rem;
  animation: pulse 2.4s ease-in-out infinite;
}

.intro.is-opening { opacity: 0; visibility: hidden; }
.intro.is-opening .intro-envelope { transform: scale(1.12); filter: blur(14px); opacity: 0; animation: none; }
.intro.is-opening .intro-title, .intro.is-opening .intro-hint { opacity: 0; transition: opacity .5s ease; }

@keyframes float { 50% { translate: 0 -8px; } }
@keyframes pulse { 50% { opacity: .45; } }

.page { opacity: 0; }

.is-open .page { opacity: 1; transition: opacity 1s ease; }

.top {
  position: relative;
  height: 46svh;
  min-height: 300px;
  overflow: hidden;
  background: #3b352f url(assets/ballroom.jpg) center / cover;
}

.top::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(42, 38, 34, .35), rgba(42, 38, 34, 0) 45%, rgba(42, 38, 34, .25));
}

.top-title {
  position: absolute;
  inset: 1.75rem 0 auto;
  z-index: 1;
  min-height: 1.3em;
  margin: 0;
  color: #f7f3ea;
  font: 400 clamp(2rem, 9vw, 2.75rem)/1.3 var(--script-en);
  text-shadow: 0 2px 16px rgba(0, 0, 0, .4);
}

.type::after {
  content: '';
  display: inline-block;
  width: 1px;
  height: .9em;
  margin-left: 3px;
  background: currentColor;
  vertical-align: -.1em;
  animation: caret 1s steps(1) infinite;
}

.type.is-typed::after { animation: caret 1s steps(1) 3 forwards; }

@keyframes caret { 50% { opacity: 0; } 100% { opacity: 0; } }

.music {
  position: absolute;
  inset-inline-start: 1rem;
  bottom: 1rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(247, 243, 234, .7);
  border-radius: 50%;
  background: rgba(42, 38, 34, .35);
  color: #f7f3ea;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.music[hidden] { display: none; }
.music svg { width: 20px; height: 20px; fill: currentColor; }
.music .icon-pause, .is-playing .music .icon-play { display: none; }
.is-playing .music .icon-pause { display: block; }

.letter {
  position: relative;
  z-index: 3;
  width: var(--letter-w);
  aspect-ratio: 3 / 4;
  margin: calc(var(--letter-w) * -.56) auto 0;
  filter: drop-shadow(0 14px 22px rgba(60, 50, 38, .28));
}

.letter-back, .letter-front { position: absolute; inset-inline: 0; width: 100%; }
.letter-back { top: 0; }
.letter-front { bottom: 0; height: 34.75%; }
.letter-front img { width: 100%; height: 100%; }

.letter-vinyl {
  position: absolute;
  left: 12%;
  top: 22%;
  width: 76%;
  translate: 0 38%;
  transition: translate 1.4s var(--ease) .9s;
}

.vinyl-disc { animation: spin 5s linear infinite; }
.vinyl-disc img { width: 100%; }

.vinyl-sheen {
  position: absolute;
  inset: 1%;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0 30deg, rgba(255, 255, 255, .22) 45deg, transparent 62deg 205deg,
    rgba(255, 255, 255, .16) 222deg, transparent 240deg);
  -webkit-mask: radial-gradient(circle, transparent 0 34%, #000 35%);
  mask: radial-gradient(circle, transparent 0 34%, #000 35%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.vinyl-label {
  position: absolute;
  inset: 33.5%;
  border-radius: 50%;
  color: #e2c78c;
  line-height: 1;
  background:
    radial-gradient(circle, #1a1412 0 5%, transparent 5.5%),
    radial-gradient(circle, transparent 0 58%, rgba(201, 163, 82, .55) 59% 61%, transparent 62%),
    radial-gradient(circle at 40% 35%, #a81d33, var(--crimson) 55%, var(--crimson-deep));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
}

.vinyl-label b, .vinyl-label small { position: absolute; inset-inline: 0; }
.vinyl-label b { top: 17%; font: 400 .75rem/1 var(--script-ar); }
.vinyl-label small { bottom: 22%; font: 400 .4375rem/1 var(--num); letter-spacing: .08em; }

.is-open .letter-vinyl { translate: 0 0; }

@keyframes spin { to { rotate: 360deg; } }

.letter-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.6;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
}

.letter-text small { font-size: .6875rem; }

.invite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2.25rem 1.5rem 3.5rem;
}

.verses { color: var(--ink); font-size: 1.0625rem; line-height: 2; }

.heading {
  color: var(--crimson);
  font: 400 2.125rem/1.6 var(--script-ar);
}

.muted { max-width: 21rem; color: var(--ink-soft); font-size: .9375rem; }

.eyebrow { color: var(--ink-soft); font-size: .8125rem; letter-spacing: .02em; }

.facts {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: .25rem 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  color: var(--ink-soft);
  max-width: 6.5rem;
  font-size: .8125rem;
  line-height: 1.5;
  text-wrap: balance;
}

.facts span[dir='ltr'] { font-family: var(--num); font-size: .9375rem; }

.facts svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-link { color: var(--ink); font-size: .875rem; text-underline-offset: 6px; }

.countdown {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  margin-top: .75rem;
  color: var(--ink-strong);
}

.countdown[hidden] { display: none; }

.countdown div { display: flex; flex-direction: column; align-items: center; min-width: 2.5rem; }

.countdown span, .countdown i {
  font: 300 2.25rem/1 var(--num);
  font-style: normal;
  font-variant-numeric: lining-nums tabular-nums;
}

.countdown i { color: var(--crimson); }

.countdown small { margin-top: .375rem; color: var(--ink-soft); font-size: .6875rem; line-height: 1; }

.band {
  position: relative;
  display: grid;
  place-items: center;
  height: min(100vw, 460px);
  overflow: hidden;
  background: #4a443d url(assets/bouquet.jpg) center / cover;
}

.band::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(42, 38, 34, .1), rgba(42, 38, 34, .45));
}

.band-quote {
  position: relative;
  z-index: 1;
  align-self: end;
  margin-bottom: 18%;
  padding: 0 1.5rem;
  color: #f7f3ea;
  font: 400 2rem/1.6 var(--script-ar);
  text-shadow: 0 2px 16px rgba(0, 0, 0, .45);
}

.rsvp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  margin: 3rem 1rem 0;
  padding: 3rem 1.5rem 2.75rem;
  overflow: hidden;
  border: 1px solid rgba(142, 20, 38, .35);
  outline: 1px solid rgba(142, 20, 38, .2);
  outline-offset: -7px;
  background: #f1ede2;
}

.rsvp > :not(.rsvp-flowers) { position: relative; z-index: 1; }

.rsvp-flowers { position: absolute; pointer-events: none; }
.rsvp-flowers--top { top: -18px; right: -14px; width: 92px; }
.rsvp-flowers--bottom { bottom: -14px; left: -16px; width: 104px; }

.rsvp .eyebrow { color: var(--crimson); font-family: var(--num); letter-spacing: .3em; }
.rsvp .heading { margin: 0; font-size: 2rem; }

.rsvp-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
  width: 100%;
  max-width: 19rem;
  margin-top: .5rem;
}

.field { display: flex; flex-direction: column; align-items: flex-start; gap: .125rem; color: var(--ink-soft); font-size: .8125rem; }

.field input {
  width: 100%;
  padding: .375rem 0;
  border: 0;
  border-bottom: 1px solid rgba(111, 102, 90, .45);
  border-radius: 0;
  background: none;
  color: var(--ink-strong);
  font: 400 1.0625rem var(--serif);
}

.field input:focus { outline: none; border-bottom-color: var(--crimson); }

.choices { display: flex; flex-direction: column; gap: .5rem; margin: 0; padding: 0; border: 0; }

.choices label { position: relative; cursor: pointer; }

.choices input { position: absolute; opacity: 0; }

.choices span {
  display: block;
  padding: .5rem 1rem;
  border: 1px solid rgba(111, 102, 90, .35);
  border-radius: 999px;
  color: var(--ink);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.choices input:checked + span { border-color: var(--crimson); background: var(--crimson); color: #f7f3ea; }
.choices input:focus-visible + span { outline: 1px solid var(--crimson); outline-offset: 3px; }

.guests { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: .875rem; }
.guests[hidden] { display: none; }

.stepper { display: flex; align-items: center; gap: .875rem; }

.stepper button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(142, 20, 38, .45);
  border-radius: 50%;
  background: none;
  color: var(--crimson);
  font: 400 1.25rem/1 var(--num);
  cursor: pointer;
}

.stepper output { min-width: 1.5rem; color: var(--ink-strong); font: 400 1.5rem/1 var(--num); font-variant-numeric: lining-nums; }

.rsvp-btn {
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(var(--crimson), var(--crimson-deep));
  color: #f7f3ea;
  font: 400 1rem var(--serif);
  cursor: pointer;
  box-shadow: 0 12px 24px -12px rgba(92, 10, 23, .6);
  transition: transform .2s var(--ease);
}

.rsvp-btn:active { transform: scale(.98); }
.rsvp-btn:disabled { opacity: .7; cursor: default; }

.rsvp-done { padding: 1.5rem 0 .5rem; color: var(--crimson); font: 400 1.375rem/1.9 var(--script-ar); text-wrap: balance; }

.rsvp-note { min-height: 1.5em; color: var(--crimson); font-size: .875rem; line-height: 1.6; }

.snap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3.5rem 1.5rem;
  border-bottom: 1px solid rgba(111, 102, 90, .18);
}

.snap .heading { font-size: 1.875rem; }

.phone {
  display: block;
  width: 168px;
  margin: .5rem 0;
  padding: 7px;
  border-radius: 30px;
  background: linear-gradient(145deg, #f6f2e9, #cfc6b3);
  box-shadow: 0 0 0 1px rgba(111, 102, 90, .25), 0 26px 44px -22px rgba(60, 50, 38, .55);
  transition: transform .4s var(--ease);
}

.phone:hover, .phone:focus-visible { transform: translateY(-4px) rotate(-1deg); }
.phone:focus-visible { outline: 1px solid var(--ink); outline-offset: 6px; }

.phone-screen {
  position: relative;
  display: block;
  aspect-ratio: 1284 / 2283;
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(60% 40% at 50% 46%, #6b4a3c 0%, #2a1712 60%, #120a08 100%);
}

.phone-face {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 46%;
  aspect-ratio: 3 / 4;
  margin-left: -23%;
  border-radius: 50% 50% 46% 46%;
  background: radial-gradient(circle at 50% 40%, #c79a7c, #8a5f47 70%);
  box-shadow: 0 70px 0 18px #5b1420;
  opacity: .75;
}

.phone-screen img { position: absolute; inset: 0; width: 100%; height: 100%; }

.phone-shutter {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  margin: -50px auto 20px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}

.snap-btn, .dock {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  border-radius: 999px;
  font-family: var(--serif);
  text-decoration: none;
  transition: transform .2s var(--ease);
}

.snap-btn {
  min-height: 52px;
  padding: 0 .4375rem 0 1.375rem;
  background: linear-gradient(var(--crimson), var(--crimson-deep));
  color: #f7f3ea;
  font-size: 1rem;
  box-shadow: 0 12px 24px -12px rgba(42, 38, 34, .6);
}

.snap-btn:active, .dock:active { transform: scale(.97); }

.snap-ghost {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fffc00;
}

.snap-ghost svg { width: 22px; height: 22px; fill: #fff; stroke: #111; stroke-width: 1.2; }

.dock {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 10;
  translate: -50% 0;
  min-height: 46px;
  padding: 0 .375rem 0 1.125rem;
  background: rgba(247, 243, 234, .9);
  color: var(--ink-strong);
  font-size: .9375rem;
  box-shadow: 0 0 0 1px rgba(111, 102, 90, .25), 0 10px 26px -10px rgba(42, 38, 34, .5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dock[hidden] { display: none; }
.dock .snap-ghost { width: 34px; height: 34px; }

.closing-flowers {
  position: absolute;
  bottom: 0;
  left: 0;
  width: min(36vw, 150px);
  pointer-events: none;
}

.closing {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 3.5rem 1.5rem 7rem;
}

.closing-script { margin-top: .75rem; color: var(--ink); font: 400 1.75rem/1.3 var(--script-en); }

[data-reveal] { opacity: 0; translate: 0 24px; transition: opacity 1s ease, translate 1s var(--ease); }
[data-reveal].is-in { opacity: 1; translate: 0 0; }

@media (min-width: 520px) {
  body.is-open { background: #d8d1bf; }
  .page { max-width: 440px; margin: 0 auto; background: var(--paper); box-shadow: 0 0 60px rgba(60, 50, 38, .2); }
  .dock { bottom: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; transition-delay: 0s !important; }
}
