/* =========================================================
   Maktub — a filmed envelope that opens into a living painting
   ========================================================= */

:root {
  --paper: #f3ecdf;
  --paper-2: #ebe2d1;
  --card: rgba(255, 252, 246, 0.72);
  --ink: #4a3b2e;
  --ink-soft: #7a6753;
  --gold: #9a7440;
  --gold-deep: #7d5a2b;
  --gold-line: rgba(154, 116, 64, 0.32);
  --wax: #8e1b24;
  --wax-deep: #6c121a;
  --tile: #3e8582;

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --script: "Great Vibes", "Cormorant Garamond", cursive;

  /* Slow, soft easings — nothing in this style should feel snappy */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  --music-fg: #5a4532;
  --music-bg: rgba(250, 245, 236, 0.78);
  --music-line: rgba(154, 116, 64, 0.35);
}

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

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

html.is-locked,
html.is-locked body {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--paper) url("media/paper.jpg") repeat;
  background-size: 480px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

/* ---------- Language toggle + music button ---------- */

.lang {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 60;
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(250, 245, 236, 0.74);
  border: 1px solid var(--gold-line);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: opacity 1.2s var(--ease-soft);
}

.lang button {
  position: relative;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  transition: background-color 0.4s, color 0.4s;
}

.lang button::after {
  content: "";
  position: absolute;
  inset: -6px -2px;
}

.lang button[aria-pressed="true"] {
  background: var(--gold-deep);
  color: #fbf6ec;
}

body.is-intro .music--float {
  opacity: 0;
  pointer-events: none;
}

.music--float {
  transition: opacity 1.2s var(--ease-soft) 0.6s;
}

/* While the envelope is opening, the chrome steps back */
body.is-opening .lang {
  opacity: 0;
  pointer-events: none;
}

/* =========================================================
   Opening
   ========================================================= */

.intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #e9e3d6;
  cursor: pointer;
  outline: none;
  opacity: 0;
  transition: opacity 1.1s var(--ease-soft);
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.intro.is-ready {
  opacity: 1;
}

/* The envelope dissolves into the light, the painting is already behind it */
body.is-revealing .intro {
  opacity: 0;
  transition: opacity 1.9s var(--ease-soft);
  pointer-events: none;
}

.intro__fill,
.hero__fill,
.closing__fill {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(1.05);
  opacity: 0.85;
  display: none;
}

.intro__fill {
  background-image: var(--open-poster, url("media/open-poster.jpg"));
}

.intro__frame,
.hero__frame,
.closing__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.intro__video,
.hero__video,
.closing__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.intro__video {
  background: #e9e3d6 var(--open-poster, url("media/open-poster.jpg")) center / cover no-repeat;
}

/* Two soft rings breathing out of the seal: "touch me" */
.intro__pulse {
  position: absolute;
  left: var(--sx, 50%);
  top: var(--sy, 49%);
  width: calc(var(--sr, 76px) * 2);
  height: calc(var(--sr, 76px) * 2);
  margin: calc(var(--sr, 76px) * -1) 0 0 calc(var(--sr, 76px) * -1);
  pointer-events: none;
  transition: opacity 0.6s var(--ease-soft);
}

.intro__pulse i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 238, 205, 0.95);
  box-shadow: 0 0 22px rgba(255, 226, 170, 0.55), inset 0 0 18px rgba(255, 226, 170, 0.35);
  opacity: 0;
  animation: pulse 3.2s var(--ease-soft) infinite;
  animation-delay: 1.6s;
}

.intro__pulse i + i {
  animation-delay: 3.2s;
}

@keyframes pulse {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }
  18% {
    opacity: 0.85;
  }
  100% {
    transform: scale(1.75);
    opacity: 0;
  }
}

/* Pressing the seal: one warm ring answers the finger right away */
.intro.is-pressed .intro__pulse i:first-child,
body.is-opening .intro__pulse i:first-child {
  animation: press 1.1s var(--ease) forwards;
}

body.is-opening .intro__pulse i + i {
  animation: none;
  opacity: 0;
}

@keyframes press {
  0% {
    transform: scale(0.96);
    opacity: 0.9;
  }
  100% {
    transform: scale(2.3);
    opacity: 0;
    border-width: 0.5px;
  }
}

.intro__to {
  position: absolute;
  left: 0;
  right: 0;
  top: max(calc(var(--sy, 49%) - var(--sr, 76px) - 118px), calc(env(safe-area-inset-top) + 64px));
  margin: 0;
  padding: 0 24px;
  text-align: center;
  font-family: var(--script);
  font-size: clamp(34px, 9.6vw, 44px);
  line-height: 1.1;
  color: #6b4b22;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 24px rgba(255, 250, 240, 0.9);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.4s var(--ease) 0.5s, transform 1.6s var(--ease) 0.5s;
}

.intro__hint {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--sy, 49%) + var(--sr, 76px) + 30px);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #5f4527;
  text-shadow: 0 0 10px rgba(255, 251, 243, 1), 0 0 22px rgba(255, 250, 240, 0.9);
  opacity: 0;
  transition: opacity 1.4s var(--ease-soft) 1.1s;
}

.intro__hint-line {
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.intro.is-ready .intro__to {
  opacity: 1;
  transform: none;
}

.intro.is-ready .intro__hint {
  opacity: 1;
}

.intro.is-ready .intro__hint > span:nth-child(2) {
  animation: breathe 3.2s ease-in-out 2.6s infinite;
}

@keyframes breathe {
  50% {
    opacity: 0.45;
  }
}

body.is-opening .intro .intro__to,
body.is-opening .intro .intro__hint {
  opacity: 0;
  transform: none;
  transition: opacity 0.7s var(--ease-soft);
}

body.is-opening .intro__hint > span {
  animation: none;
}

/* =========================================================
   Hero — the painting comes alive, then the names are written
   ========================================================= */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #f1e9d8;
}

.hero__fill {
  background-image: url("media/amb-poster.jpg");
}

.hero__video {
  transform: scale(1.07);
  transition: transform 9s cubic-bezier(0.2, 0.6, 0.2, 1);
  will-change: transform;
}

.hero.is-in .hero__video {
  transform: none;
}

.hero__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 30% at 50% 30%, rgba(255, 251, 242, 0.62), rgba(255, 251, 242, 0) 70%),
    linear-gradient(to bottom, rgba(243, 236, 223, 0) 76%, rgba(243, 236, 223, 0.85) 93%, var(--paper) 100%);
}

.hero__text {
  position: absolute;
  left: 0;
  right: 0;
  top: max(13%, calc(env(safe-area-inset-top) + 56px));
  padding: 0 20px;
  text-align: center;
}

.hero__kicker {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #5f4527;
  text-shadow: 0 0 16px rgba(255, 250, 240, 0.95);
}

.names {
  margin: 0;
  font-weight: 400;
  line-height: 1;
}

.names__one,
.names__two {
  display: block;
  width: max-content;
  margin: 0 auto;
  padding: 0.04em 0.22em 0.12em;
  font-family: var(--script);
  font-size: clamp(56px, 17.5vw, 82px);
  line-height: 1.04;
  color: var(--gold-deep);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 30px rgba(255, 250, 238, 0.95);
}

.names__amp {
  display: block;
  margin: -0.06em 0 -0.04em;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 8vw, 36px);
  color: #8e6d43;
  text-shadow: 0 0 18px rgba(255, 250, 240, 0.95);
}

.hero__date {
  margin: 16px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: #5f4527;
  text-shadow: 0 0 10px rgba(255, 251, 243, 1), 0 0 22px rgba(255, 250, 240, 0.9);
}

.hero__date i {
  width: 4px;
  height: 4px;
  transform: rotate(45deg);
  background: var(--gold);
}

.cue {
  position: absolute;
  left: 50%;
  bottom: max(26px, calc(env(safe-area-inset-bottom) + 14px));
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px 11px 20px;
  border-radius: 999px;
  border: 1px solid rgba(125, 90, 43, 0.4);
  background: rgba(250, 245, 235, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px -12px rgba(74, 52, 28, 0.55);
  white-space: nowrap;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #4e3820;
}

.cue__arrow {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: nudge 2.2s ease-in-out infinite;
}

@keyframes nudge {
  0%,
  100% {
    transform: translateY(-1px);
  }
  50% {
    transform: translateY(3px);
  }
}

/* after it appears, the pill bobs gently so the eye finds it */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Hero entrance — slow and staggered. Nothing shows until the envelope has opened. */
.hero [data-h] {
  opacity: 0;
}

.hero.is-in .hero__kicker {
  animation: spread 2.2s var(--ease) 0.3s both;
}

.hero.is-in .names__one {
  animation: ink 2.1s var(--ease-soft) 0.7s both;
}

.hero.is-in .names__amp {
  animation: rise 1.6s var(--ease) 1.7s both;
}

.hero.is-in .names__two {
  animation: ink 2.1s var(--ease-soft) 1.95s both;
}

.hero.is-in .hero__date {
  animation: rise 1.8s var(--ease) 3.1s both;
}

.hero.is-in .cue {
  animation:
    fade 1.6s var(--ease-soft) 4s both,
    float 3s ease-in-out 5.6s infinite;
}

/* Names appear as if written: a feathered mask sweeps left → right */
.names__one,
.names__two {
  -webkit-mask-image: linear-gradient(100deg, #000 42%, transparent 58%);
  mask-image: linear-gradient(100deg, #000 42%, transparent 58%);
  -webkit-mask-size: 280% 100%;
  mask-size: 280% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
}

@keyframes ink {
  0% {
    opacity: 1;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
    filter: blur(1.5px);
  }
  70% {
    filter: blur(0);
  }
  100% {
    opacity: 1;
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
    filter: blur(0);
  }
}

@keyframes spread {
  from {
    opacity: 0;
    letter-spacing: 0.62em;
  }
  to {
    opacity: 1;
    letter-spacing: 0.34em;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* =========================================================
   Sections
   ========================================================= */

.page {
  position: relative;
  overflow-x: hidden; /* the corner flowers hang off the edges */
  overflow-x: clip;
}

.section {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 76px 26px 70px;
  text-align: center;
}

.head {
  margin-bottom: 30px;
}

.title {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(46px, 13vw, 58px);
  line-height: 1.1;
  color: var(--gold-deep);
}

.divider {
  width: 210px;
  margin: 2px auto 0;
  opacity: 0.95;
}

.label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Watercolor flowers in the corners (transparent WebP) */
.flora {
  position: absolute;
  top: -6px;
  width: min(48vw, 250px);
  pointer-events: none;
  transform-origin: 0 0;
  animation: sway 11s ease-in-out infinite alternate;
  z-index: 0;
}

.flora--tl {
  left: -26px;
}

.flora--tr {
  right: -26px;
  transform-origin: 100% 0;
  scale: -1 1;
}

@keyframes sway {
  from {
    rotate: -1.2deg;
  }
  to {
    rotate: 1.4deg;
  }
}

.section > *:not(.flora) {
  position: relative;
  z-index: 1;
}

/* Scroll reveals: long and soft */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.3s var(--ease), transform 1.5s var(--ease);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Invitation ---------- */

.invite {
  padding-top: 150px;
}

.invite__greet {
  margin: 0 0 18px;
  font-family: var(--script);
  font-size: clamp(36px, 10.5vw, 46px);
  line-height: 1.15;
  color: var(--gold-deep);
}

.invite__text {
  margin: 0 auto 26px;
  max-width: 30ch;
  font-size: 21px;
  line-height: 1.6;
}

.parents {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 28px 0 30px;
}

/* One family invites: a single centred column */
.parents.parents--one {
  grid-template-columns: minmax(0, 300px);
  justify-content: center;
}

.parents__names {
  display: block;
  margin-top: 8px;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.35;
}

.invite__quote {
  margin: 0;
  font-style: italic;
  font-size: 22px;
  color: var(--ink-soft);
}

.invite__quote::before,
.invite__quote::after {
  content: "—";
  margin: 0 10px;
  color: var(--gold);
  font-style: normal;
}

/* ---------- Date ---------- */

.bigdate {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.bigdate__side {
  padding: 10px 0;
  border-top: 1px solid var(--gold-line);
  border-bottom: 1px solid var(--gold-line);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.bigdate__day {
  font-size: 92px;
  font-weight: 400;
  line-height: 0.95;
  color: var(--gold-deep);
}

.bigdate__time {
  margin: 12px 0 34px;
  font-style: italic;
  font-size: 21px;
  color: var(--ink-soft);
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 6px;
  max-width: 340px;
  margin: 0 auto 40px;
  font-size: 18px;
}

.cal__wd {
  padding-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.cal__d {
  position: relative;
  display: grid;
  place-items: center;
  height: 40px;
  color: var(--ink);
}

.cal__d.is-day {
  color: #fbf3e6;
  font-weight: 600;
}

.cal__d.is-day::before {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 38% 32%, #b8343b, var(--wax) 55%, var(--wax-deep));
  box-shadow: 0 3px 8px rgba(108, 18, 26, 0.3), inset 0 -2px 4px rgba(0, 0, 0, 0.18);
}

.cal__d.is-day::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(232, 196, 140, 0.7);
}

.cal__d span {
  position: relative;
  z-index: 1;
}

.cd {
  margin: 0 auto 30px;
}

.cd__label {
  margin: 0 0 14px;
  font-family: var(--script);
  font-size: 34px;
  line-height: 1;
  color: var(--gold-deep);
}

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

.cd__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-left: 1px solid var(--gold-line);
}

.cd__cell:first-child {
  border-left: 0;
}

.cd__num {
  font-size: 40px;
  font-weight: 400;
  line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
}

.cd__unit {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cd__past {
  display: none;
  margin: 0;
  font-size: 24px;
}

.cd.is-past .cd__row {
  display: none;
}

.cd.is-past .cd__past {
  display: block;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid rgba(125, 90, 43, 0.45);
  background: rgba(255, 252, 246, 0.5);
  color: var(--gold-deep);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.5s var(--ease), background-color 0.5s, box-shadow 0.5s;
}

.btn:active {
  transform: scale(0.97);
}

.btn--solid {
  border-color: transparent;
  background: linear-gradient(180deg, #9f2630, var(--wax) 60%, var(--wax-deep));
  color: #fbf3e6;
  box-shadow: 0 8px 20px -10px rgba(108, 18, 26, 0.7);
}

.btn--wide {
  width: 100%;
}

.btn__ico {
  display: inline-grid;
  width: 18px;
  height: 18px;
}

.btn__ico svg {
  width: 100%;
  height: 100%;
}

/* ---------- Program ---------- */

.program {
  padding-top: 120px;
}

.timeline {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 400px;
  text-align: left;
}

.tl {
  position: relative;
  display: grid;
  grid-template-columns: 64px 44px 1fr;
  align-items: start;
  padding-bottom: 26px;
}

/* the thread that ties the day together */
.tl::before {
  content: "";
  position: absolute;
  left: 85px;
  top: 44px;
  bottom: 2px;
  width: 1px;
  background: linear-gradient(var(--gold-line), rgba(154, 116, 64, 0.12));
}

.tl:last-child::before {
  display: none;
}

.tl__time {
  padding-top: 7px;
  font-size: 21px;
  font-weight: 600;
  color: var(--gold-deep);
  font-variant-numeric: lining-nums;
}

.tl__ico {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: rgba(255, 252, 246, 0.85);
  color: var(--gold);
}

.tl__ico svg {
  width: 22px;
  height: 22px;
}

.tl__body {
  padding: 6px 0 0 14px;
}

.tl__title {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
}

.tl__note {
  margin-top: 3px;
  font-size: 16.5px;
  font-style: italic;
  line-height: 1.4;
  color: var(--ink-soft);
}

/* ---------- Venue ---------- */

.venue__art {
  width: min(100%, 420px);
  margin: -6px auto 10px;
}

.venue__name {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
}

.venue__hall {
  margin: 4px 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

.venue__addr {
  margin: 0 auto 26px;
  max-width: 32ch;
  font-size: 19px;
}

.venue__mark {
  font-style: italic;
  color: var(--ink-soft);
}

.mapcard {
  position: relative;
  padding: 6px;
  border-radius: 24px;
  border: 1px solid var(--gold-line);
  background: rgba(255, 252, 246, 0.6);
  box-shadow: 0 18px 40px -26px rgba(74, 59, 46, 0.45);
}

.map {
  position: relative;
  height: 280px;
  border-radius: 18px;
  overflow: hidden;
  background: #efe7d9;
}

.map__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
}

.map .maplibregl-ctrl-attrib {
  font-family: system-ui, sans-serif;
  font-size: 10px;
}

.pin {
  display: grid;
  justify-items: center;
}

.pin svg {
  width: 42px;
  height: 54px;
  filter: drop-shadow(0 6px 6px rgba(74, 20, 24, 0.35));
}

.venue__btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.venue__btns .btn {
  flex: 1 1 200px;
}

/* ---------- Toʻyona ---------- */

.gifts {
  padding-top: 130px;
}

.gifts__note {
  margin: 0 auto 26px;
  max-width: 32ch;
  font-size: 19px;
  color: var(--ink-soft);
}

.cards {
  display: flex;
  gap: 14px;
  margin: 0 -26px;
  padding: 6px 26px 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.cards::-webkit-scrollbar {
  display: none;
}

.gift {
  flex: 0 0 min(86%, 340px);
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.gift__owner {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.ccard {
  position: relative;
  width: 100%;
  aspect-ratio: 1.586;
  padding: 20px 22px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fbf3e6;
  text-align: left;
  box-shadow: 0 18px 34px -18px rgba(40, 24, 12, 0.55);
}

/* a faint gold sheen and the pattern of a tile, so cards belong to the invitation */
.ccard::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 0%, rgba(255, 232, 190, 0.35), transparent 55%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 14px);
  pointer-events: none;
}

.ccard--uzcard {
  background: linear-gradient(135deg, #2f6f6c, #1d4a49);
}

.ccard--humo {
  background: linear-gradient(135deg, #4a3a5e, #2b2238);
}

.ccard--visa {
  background: linear-gradient(135deg, #8e1b24, #561017);
}

.ccard > * {
  position: relative;
}

.ccard__top,
.ccard__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ccard__chip {
  width: 38px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f1d9a6, #b8914f);
}

.ccard__sys {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ccard__num {
  font-size: clamp(21px, 6.4vw, 25px);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.ccard__holder {
  font-family: system-ui, sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.12em;
}

.ccard__bank {
  font-size: 14px;
  font-style: italic;
  opacity: 0.85;
}

.copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: rgba(255, 252, 246, 0.6);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold-deep);
}

.copy.is-copied {
  background: var(--gold-deep);
  color: #fbf3e6;
}

.cards__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.cards__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-line);
  transition: background-color 0.4s, transform 0.4s;
}

.cards__dots span.is-on {
  background: var(--gold);
  transform: scale(1.3);
}

/* ---------- RSVP ---------- */

.rsvp__by {
  margin: 10px 0 0;
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
}

.reply {
  position: relative;
  padding: 26px 22px 24px;
  border-radius: 22px;
  border: 1px solid var(--gold-line);
  background: var(--card);
  box-shadow: 0 24px 50px -32px rgba(74, 59, 46, 0.5);
  text-align: left;
}

.form {
  display: grid;
  gap: 20px;
  transition: opacity 0.8s var(--ease-soft), transform 0.9s var(--ease);
}

.field {
  display: grid;
  gap: 8px;
}

.field--row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.field__label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.field input[type="text"],
.field textarea {
  width: 100%;
  padding: 8px 2px 10px;
  border: 0;
  border-bottom: 1px solid var(--gold-line);
  border-radius: 0;
  background: transparent;
  font-size: 20px;
  outline: none;
  resize: none;
  transition: border-color 0.4s;
}

.field input[type="text"]:focus,
.field textarea:focus {
  border-bottom-color: var(--gold-deep);
}

.field ::placeholder {
  color: rgba(122, 103, 83, 0.55);
  font-style: italic;
}

.choice {
  display: grid;
  gap: 8px;
}

.choice label {
  position: relative;
}

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

.choice span {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--gold-line);
  font-size: 19px;
  transition: background-color 0.4s, border-color 0.4s, color 0.4s;
}

.choice span::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  transition: background-color 0.4s, box-shadow 0.4s;
}

.choice input:checked + span {
  border-color: rgba(125, 90, 43, 0.6);
  background: rgba(154, 116, 64, 0.08);
}

.choice input:checked + span::before {
  background: var(--wax);
  border-color: var(--wax);
  box-shadow: inset 0 0 0 3px #fbf6ec;
}

.choice input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
}

.stepper button {
  width: 44px;
  height: 44px;
  font-size: 22px;
  color: var(--gold-deep);
}

.stepper input {
  width: 34px;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  -moz-appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.sent {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}

.sent > * {
  opacity: 0;
}

.sent__seal {
  width: 120px;
}

.sent__title {
  margin: 10px 0 4px;
  font-family: var(--script);
  font-size: 46px;
  line-height: 1.1;
  color: var(--gold-deep);
}

.sent__text {
  margin: 0;
  max-width: 26ch;
  font-size: 19px;
  color: var(--ink-soft);
}

.reply.is-sent .form {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
}

/* the couple's seal is pressed onto the reply */
.reply.is-sent .sent__seal {
  animation: stamp 1s cubic-bezier(0.3, 0.7, 0.25, 1.15) 0.5s both;
}

.reply.is-sent .sent__title {
  animation: rise 1.3s var(--ease) 1.3s both;
}

.reply.is-sent .sent__text {
  animation: rise 1.3s var(--ease) 1.6s both;
}

@keyframes stamp {
  0% {
    opacity: 0;
    transform: scale(1.9) rotate(-8deg);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.tg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  min-height: 44px;
  font-size: 18px;
  font-style: italic;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-underline-offset: 5px;
}

.tg--solo {
  margin-top: 26px;
}

/* =========================================================
   Closing
   ========================================================= */

.closing {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  margin-top: 30px;
  overflow: hidden;
}

.closing__fill {
  background-image: url("media/close-poster.jpg");
}

.closing__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, var(--paper) 0%, rgba(243, 236, 223, 0.75) 9%, rgba(243, 236, 223, 0) 26%),
    linear-gradient(to top, var(--paper) 0%, rgba(243, 236, 223, 0) 14%);
}

.closing__text {
  position: absolute;
  left: 0;
  right: 0;
  top: 12%;
  padding: 0 20px;
  text-align: center;
}

.closing__wait {
  margin: 0;
  font-family: var(--script);
  font-size: clamp(50px, 15vw, 66px);
  line-height: 1.1;
  color: #6e4a24;
  text-shadow: 0 0 26px rgba(255, 244, 226, 0.95);
}

.closing__names {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #5d4126;
  text-shadow: 0 0 16px rgba(255, 244, 226, 0.95);
  transition-delay: 0.25s;
}

.closing__amp {
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
}

/* ---------- Footer ---------- */

.footer {
  max-width: 560px;
  margin: 0 auto;
  padding: 30px 26px calc(56px + env(safe-area-inset-bottom));
  text-align: center;
}

.footer__seal {
  width: 92px;
  margin: 0 auto 26px;
}

.footer__sign {
  margin: 0 0 6px;
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
}

.footer__tag {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold);
}

/* =========================================================
   Wide screens: the invitation stays a tall card in the middle,
   the painting blurs out to fill the sides
   ========================================================= */

@media (min-aspect-ratio: 3/4) {
  .intro__fill,
  .hero__fill,
  .closing__fill {
    display: block;
  }

  .intro__frame,
  .hero__frame,
  .closing__frame {
    left: 50%;
    right: auto;
    width: min(100vw, 56.25vh);
    transform: translateX(-50%);
    box-shadow: 0 0 80px rgba(60, 40, 20, 0.25);
  }

  /* the column sits above the edge fades, which only soften the blurred sides;
     the column keeps its own fades (hero__veil / closing__veil) */
  .hero__frame,
  .closing__frame {
    width: min(100vw, 56.25svh);
    z-index: 1;
  }

  .hero::after,
  .closing::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 18%;
    pointer-events: none;
  }

  .hero::after {
    bottom: 0;
    background: linear-gradient(to bottom, rgba(243, 236, 223, 0), var(--paper));
  }

  .closing::after {
    top: 0;
    background: linear-gradient(to top, rgba(243, 236, 223, 0), var(--paper));
  }

  .names__one,
  .names__two {
    font-size: min(82px, 8.6vh);
  }
}

/* Short phones (iPhone SE and similar): pull the names up a little */
@media (max-height: 700px) and (max-aspect-ratio: 3/4) {
  .hero__text {
    top: max(9%, calc(env(safe-area-inset-top) + 50px));
  }

  .names__one,
  .names__two {
    font-size: clamp(50px, 15vw, 64px);
  }

  .intro__to {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flora,
  .cue,
  .cue__arrow,
  .intro__pulse i {
    animation: none !important;
  }

  .hero.is-in [data-h] {
    animation: fade 1.2s ease both !important;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .hero__video {
    transform: none;
    transition: none;
  }

  [data-reveal] {
    transform: none;
  }
}
