/* ───────────────────────────────────────────
   Marvin & Kruttika — wedding invitation
   ─────────────────────────────────────────── */

:root {
  --door: #efd9cf;
  --paper: #f6e9e2;
  --paper-2: #f1dfd6;
  --ink: #553632;
  --ink-2: #7d5b53;
  --ink-3: #a5847a;
  --rose: #b5776f;
  --rose-d: #8f544d;
  --gold: #b0895b;
  --line: rgba(122, 80, 70, .24);
  --serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --script: 'Pinyon Script', 'Snell Roundhand', 'Apple Chancery', cursive;
  --caps: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --seal: clamp(96px, 27cqw, 122px);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .27 0 0 0 0 .22 .2 0 0 0 -.06'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #e8d1c6;
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  display: grid;
  place-items: center;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.ambient {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 25% 15%, #f7e8e0 0, transparent 70%),
    radial-gradient(ellipse 60% 60% at 85% 95%, #ddbcae 0, transparent 70%),
    #ead4ca;
}
.ambient::after { content: ''; position: absolute; inset: 0; background-image: var(--noise); opacity: .8; }

/* ── stage (phone-sized card) ───────────────── */
.stage {
  position: relative;
  width: 100vw; height: 100vh; height: 100dvh;
  overflow: hidden;
  background: var(--paper);
  container-type: size;
  isolation: isolate;
}
@media (min-width: 620px) and (min-height: 560px) {
  .stage {
    width: min(460px, calc((100dvh - 56px) * .565));
    height: min(calc(100dvh - 56px), 900px);
    border-radius: 28px;
    box-shadow:
      0 50px 90px -40px rgba(92, 46, 36, .55),
      0 18px 40px -18px rgba(92, 46, 36, .3),
      0 0 0 1px rgba(255, 255, 255, .45) inset;
  }
}

/* ── inside the invitation ──────────────────── */
.invite {
  position: absolute; inset: 0;
  background: var(--paper);
  transform: scale(1.06);
  transition: transform 2.8s var(--ease);
}
.invite::before { content: ''; position: absolute; inset: 0; background-image: var(--noise); pointer-events: none; }
.opened .invite { transform: none; }
.frame-art {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 3; opacity: 0; transition: opacity 1s;
}
.frame-art.ready { opacity: 1; }

.scroller {
  position: absolute; inset: 0; z-index: 2;
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
  outline: none;
}
.scroller::-webkit-scrollbar { display: none; }

.panel {
  min-height: 100cqh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 16cqh max(40px, 12cqw) 14cqh;
  gap: clamp(10px, 2.1cqh, 20px);
}

/* reveal choreography */
.rv {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(6px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * 120ms + 120ms);
}
.panel.in .rv { opacity: 1; transform: none; filter: none; }

/* ── type ───────────────────────────────────── */
.eyebrow {
  font-family: var(--caps); font-weight: 400;
  font-size: clamp(9.5px, 2.75cqw, 11.5px);
  letter-spacing: .34em; text-transform: uppercase;
  color: var(--ink-3); margin: 0; padding-left: .34em;
}
.names {
  margin: 0; font-weight: 500;
  font-size: clamp(46px, 15.5cqw, 72px);
  line-height: .92; letter-spacing: .005em;
  display: flex; flex-direction: column; align-items: center;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
}
.names .amp {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: .62em; color: var(--rose); line-height: 1.1;
  margin: .04em 0 .02em;
}
.names.inline { flex-direction: row; gap: .2em; font-size: clamp(30px, 9.5cqw, 42px); align-items: baseline; }
.names.inline .amp { font-size: .8em; margin: 0; line-height: 0; }
.script-h {
  margin: 0; font-family: var(--script); font-weight: 400;
  font-size: clamp(36px, 11cqw, 50px); line-height: 1.05;
  color: var(--ink);
}
.title {
  margin: 0; font-weight: 500; letter-spacing: .03em;
  font-size: clamp(28px, 8.6cqw, 38px); line-height: 1.1; color: var(--ink);
}
.body {
  margin: 0; max-width: 29ch;
  font-size: clamp(16.5px, 4.7cqw, 19.5px); line-height: 1.55;
  color: var(--ink-2);
}
.body.small { font-size: clamp(15px, 4.2cqw, 17px); font-style: italic; }
.tagline { max-width: none; }
.date-strip {
  margin: 0; font-family: var(--caps);
  font-size: clamp(12px, 3.5cqw, 14.5px); letter-spacing: .3em; padding-left: .3em;
  color: var(--ink-2);
}
.flourish { color: var(--gold); line-height: 0; }
.flourish svg { width: clamp(130px, 42cqw, 180px); height: auto; }

/* ── panel: invitation letter ───────────────── */
.dear { margin: 0; font-size: clamp(19px, 5.4cqw, 23px); font-style: italic; color: var(--ink-2); }
.dear .guest {
  display: block; font-style: normal;
  font-family: var(--script); font-size: clamp(36px, 11.5cqw, 50px);
  color: var(--ink); line-height: 1.2; margin-top: .1em;
}
.seats {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 10px 22px 10px 12px; border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 1.5px 1.5px 0 rgba(255,255,255,.8), inset -1.5px -1.5px 0 rgba(130,80,70,.14), 3px 5px 14px -4px rgba(120,70,60,.22);
  border: 1px solid rgba(140, 90, 80, .14);
}
.seats-n {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 500; color: var(--paper);
  background: radial-gradient(circle at 35% 30%, #c99189, var(--rose-d));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.35), 0 3px 8px -2px rgba(110,55,48,.5);
}
.seats-l { text-align: left; font-family: var(--caps); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); line-height: 1.6; }
.sign { margin: 0; font-family: var(--script); font-size: clamp(26px, 7.6cqw, 32px); color: var(--rose-d); }
.sign .and { font-family: var(--serif); font-style: italic; font-size: .7em; padding: 0 .1em; }

/* ── panel: date ────────────────────────────── */
.cartouche { position: relative; width: clamp(170px, 52cqw, 215px); aspect-ratio: 200 / 250; }
.cartouche img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cart-in {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--ink);
}
.c-month { font-family: var(--caps); font-size: clamp(11px, 3.3cqw, 13px); letter-spacing: .32em; padding-left: .32em; text-transform: uppercase; color: var(--ink-2); }
.c-day { font-size: clamp(64px, 21cqw, 88px); font-weight: 500; line-height: .95; letter-spacing: .02em; text-shadow: 0 1px 0 rgba(255,255,255,.8); }
.c-year { font-family: var(--caps); font-size: clamp(12px, 3.5cqw, 14px); letter-spacing: .38em; padding-left: .38em; color: var(--ink-2); }
.c-year::before, .c-year::after { content: '·'; margin: 0 .5em; color: var(--gold); }

.pills { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pill, .chip-btn {
  font-family: var(--caps); font-size: clamp(9.5px, 2.8cqw, 11px); letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-2);
  padding: .95em 1.5em .9em 1.72em; border-radius: 999px;
  background: var(--paper);
  border: 1px solid rgba(140, 90, 80, .14);
  box-shadow: inset 1.5px 1.5px 0 rgba(255,255,255,.8), inset -1.5px -1.5px 0 rgba(130,80,70,.13), 3px 5px 12px -5px rgba(120,70,60,.25);
}
.chip-btn { display: inline-flex; align-items: center; gap: .55em; text-decoration: none; letter-spacing: .16em; padding: .85em 1.15em .8em 1.25em; transition: transform .25s var(--ease), box-shadow .25s; }
.chip-btn svg { width: 13px; height: 13px; flex: none; }
.chip-btn:active { transform: translateY(1px); box-shadow: inset 1px 1px 3px rgba(130,80,70,.2); }
.when { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.weekday {
  margin: 0; font-family: var(--caps); font-size: clamp(12px, 3.5cqw, 14px); letter-spacing: .4em; padding-left: .4em;
  text-transform: uppercase; color: var(--ink);
}
.weekday::before, .weekday::after { content: '◆'; font-size: .5em; vertical-align: .35em; color: var(--gold); margin: 0 1.1em; }
.weekday::before { margin-left: 0; }
.time-note { margin: 0; font-style: italic; font-size: clamp(16px, 4.6cqw, 18.5px); color: var(--ink-2); }
.cal { display: flex; flex-direction: column; align-items: center; gap: 9px; margin-top: 4px; }
.cal-l { font-family: var(--caps); font-size: 9px; letter-spacing: .28em; padding-left: .28em; text-transform: uppercase; color: var(--ink-3); }
.cal-btns { display: flex; gap: 8px; justify-content: center; }

/* ── panel: countdown ───────────────────────── */
.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(7px, 2.4cqw, 12px); width: min(100%, 300px); }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 4 / 5; border-radius: 14px;
  background: var(--paper);
  border: 1px solid rgba(140, 90, 80, .14);
  box-shadow: inset 1.5px 1.5px 0 rgba(255,255,255,.85), inset -1.5px -1.5px 0 rgba(130,80,70,.12), 3px 6px 14px -6px rgba(120,70,60,.3);
}
.tile b { font-weight: 500; font-size: clamp(26px, 8.6cqw, 36px); line-height: 1; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.tile span { margin-top: 6px; font-family: var(--caps); font-size: clamp(7.5px, 2.2cqw, 9px); letter-spacing: .2em; padding-left: .2em; color: var(--ink-3); text-transform: uppercase; }
.count-done { margin: 0; font-family: var(--script); font-size: clamp(30px, 9cqw, 40px); color: var(--rose-d); }

/* ── panel: venue ───────────────────────────── */
.map {
  position: relative; width: min(100%, 270px); aspect-ratio: 27 / 19;
  border-radius: 140px 140px 18px 18px; overflow: hidden;
  border: 1px solid rgba(140, 90, 80, .18);
  box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(140,90,80,.16), 4px 8px 22px -10px rgba(110,60,52,.4);
  isolation: isolate;
}
.map svg.streets { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); filter: blur(2.2px) saturate(.9); z-index: -1; }
.map::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at 50% 52%, rgba(246,233,226,.15), rgba(246,233,226,.7) 75%);
  -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
}
.map-seal { position: absolute; left: 50%; top: 46%; width: 74px; translate: -50% -50%; }
.map-seal svg { width: 100%; display: block; }
.map-tag {
  position: absolute; left: 50%; bottom: 14px; translate: -50% 0; white-space: nowrap;
  font-family: var(--caps); font-size: 9.5px; letter-spacing: .26em; padding: .7em 1.2em .65em 1.46em; border-radius: 99px;
  color: var(--ink-2); background: rgba(246, 233, 226, .9); border: 1px solid rgba(140,90,80,.16);
}
.venue-name { margin: 0; font-size: clamp(24px, 7.4cqw, 32px); font-weight: 500; color: var(--ink); line-height: 1.15; }
.venue-addr { margin: 0; font-style: italic; color: var(--ink-2); font-size: 17px; }

/* ── panel: strictly by invitation ──────────── */
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(12px, 2.2cqh, 18px); max-width: 290px; text-align: left; }
.notes li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: center; color: var(--ink-2); font-size: clamp(15.5px, 4.4cqw, 17.5px); line-height: 1.4; }
.notes .ic {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--rose-d);
  background: var(--paper); border: 1px solid rgba(140,90,80,.15);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.85), 2px 4px 10px -4px rgba(120,70,60,.3);
}
.notes .ic svg { width: 16px; height: 16px; }

/* ── panel: RSVP ────────────────────────────── */
.p-rsvp { gap: clamp(8px, 1.6cqh, 14px); }
.by { margin: -4px 0 0; font-style: italic; color: var(--ink-3); font-size: 16px; }
.rsvp { width: min(100%, 290px); display: grid; gap: clamp(10px, 1.9cqh, 16px); }
.field { display: block; text-align: left; }
.field > span { display: block; font-family: var(--caps); font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); }
.field > span i { font-family: var(--serif); text-transform: none; letter-spacing: 0; font-size: 13px; }
.field input, .field textarea {
  display: block; width: 100%; margin-top: 2px;
  font: 400 19px/1.35 var(--serif); color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 5px 0 6px; outline: none; resize: none;
  transition: border-color .3s;
}
.field input:focus, .field textarea:focus { border-bottom-color: var(--rose); }
.field input::placeholder, .field textarea::placeholder { color: #c4a69c; font-style: italic; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice button {
  padding: .7em .4em .65em; border-radius: 14px;
  font-size: 17px; font-style: italic; color: var(--ink-2);
  background: var(--paper); border: 1px solid rgba(140, 90, 80, .16);
  box-shadow: inset 1.5px 1.5px 0 rgba(255,255,255,.85), 2px 4px 10px -5px rgba(120,70,60,.3);
  transition: background .35s, color .35s, box-shadow .35s, transform .2s;
}
.choice button:active { transform: scale(.98); }
.choice button[aria-checked='true'] {
  color: #fbefea; background: linear-gradient(160deg, #a26a62, #7a4842);
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 8px 16px -8px rgba(100,45,38,.6);
}
.guests { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.guests > span { font-family: var(--caps); font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--ink-2);
  background: var(--paper); border: 1px solid rgba(140,90,80,.16);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.85), 2px 3px 8px -4px rgba(120,70,60,.35);
}
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 34px; text-align: center; font-size: 24px; font-weight: 500; color: var(--ink); }
.form-err { margin: -4px 0 0; min-height: 0; font-style: italic; font-size: 15px; color: #a24c44; }
.form-err:empty { display: none; }
.btn {
  justify-self: center;
  display: inline-flex; align-items: center; gap: .8em;
  font-family: var(--caps); font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  color: #fbefea; border: 0; border-radius: 999px;
  padding: 1.15em 2.1em 1.1em 2.36em;
  background: linear-gradient(160deg, #9c645c, #6f413b);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 12px 22px -12px rgba(100,45,38,.75);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.btn svg { width: 15px; height: 15px; }
.btn:active { transform: translateY(1px) scale(.99); }
.thanks { display: flex; flex-direction: column; align-items: center; gap: 12px; animation: rise 1s var(--ease) both; }
.thanks .body { max-width: 26ch; }
.link-btn {
  background: none; border: 0; padding: 6px 2px;
  font-family: var(--caps); font-size: 10px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--rose-d); border-bottom: 1px solid currentColor; border-radius: 0;
}

/* ── panel: closing ─────────────────────────── */
.end-seal { width: clamp(84px, 24cqw, 104px); }
.end-seal svg { width: 100%; display: block; }

/* ── navigation chrome ──────────────────────── */
.next {
  position: absolute; z-index: 6; left: 50%; bottom: max(4.6cqh, 26px, calc(env(safe-area-inset-bottom) + 12px)); translate: -50% 0;
  display: inline-flex; align-items: center; gap: .7em;
  font-family: var(--caps); font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-2);
  padding: .95em 1.4em .9em 1.66em; border-radius: 999px;
  background: rgba(246, 233, 226, .86);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(140, 90, 80, .16);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.8), 3px 6px 14px -6px rgba(120,70,60,.3);
  opacity: 0; transition: opacity .8s ease 1.4s;
}
.opened .next { opacity: 1; }
.next svg { width: 12px; height: 12px; animation: nudge 2.2s var(--ease) infinite; transition: rotate .4s var(--ease); }
.next.up svg { rotate: 180deg; animation: none; }

.dots {
  position: absolute; z-index: 6; right: max(9px, 2.6cqw); top: 50%; translate: 0 -50%;
  display: flex; flex-direction: column; gap: 9px;
  opacity: 0; transition: opacity .8s ease 1.6s;
}
.opened .dots { opacity: 1; }
.dots button {
  width: 5px; height: 5px; padding: 0; border: 0; border-radius: 99px;
  background: rgba(130, 85, 75, .28); transition: height .4s var(--ease), background .4s;
}
.dots button[aria-current='true'] { height: 18px; background: var(--rose); }
.dots button::before { content: ''; display: block; margin: -8px; width: 21px; height: 21px; }

.music {
  position: absolute; z-index: 25; top: max(16px, 2.4cqh); right: max(16px, 4cqw);
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(246, 233, 226, .82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(140, 90, 80, .18);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.8), 2px 5px 12px -5px rgba(120,70,60,.35);
  opacity: 0; pointer-events: none; transition: opacity .8s ease 1.2s;
}
.opened .music { opacity: 1; pointer-events: auto; }
.bars { display: flex; align-items: flex-end; gap: 2.5px; height: 13px; }
.bars i { display: block; width: 2.5px; height: 4px; border-radius: 2px; background: var(--rose-d); transition: height .3s; }
.music[aria-pressed='true'] .bars i { animation: eq 1.1s ease-in-out infinite; }
.music[aria-pressed='true'] .bars i:nth-child(2) { animation-delay: -.35s; }
.music[aria-pressed='true'] .bars i:nth-child(3) { animation-delay: -.7s; }

.petals { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 8; pointer-events: none; }

/* ── the gate (doors) ───────────────────────── */
.gate {
  position: absolute; inset: 0; z-index: 20;
  perspective: 1800px; perspective-origin: 50% 50%;
  cursor: pointer;
  background: var(--door);
  transition: background-color 0s linear 2.4s;
}
.gate.open { background-color: transparent; transition: none; }
.gate > * { transition: opacity 1.2s ease; }
.stage.loading .gate > :not(.seal-btn) { opacity: 0; }
.stage.loading .gate { cursor: progress; }
.stage.loading .seal-btn .ring { border-color: rgba(181, 119, 111, .45); }
.gate.gone { visibility: hidden; pointer-events: none; }
.door {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background: var(--door);
  transform-style: preserve-3d;
  transition: transform 2.4s cubic-bezier(.55, 0, .25, 1), opacity .4s ease;
  will-change: transform;
}
.door::before { content: ''; position: absolute; inset: 0; background-image: var(--noise); }
.door-l { left: 0; transform-origin: 0 50%; }
.door-r { right: 0; transform-origin: 100% 50%; }
.door-l::after, .door-r::after { content: ''; position: absolute; top: 0; bottom: 0; width: 6px; pointer-events: none; }
.door-l::after { right: 0; background: linear-gradient(to left, rgba(110, 62, 54, .16), transparent); }
.door-r::after { left: 0; background: linear-gradient(to right, rgba(255, 255, 255, .55), transparent); }
.door-art { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .9s ease; }
.door-art.ready { opacity: 1; }
.door-shade { position: absolute; inset: 0; opacity: 0; transition: opacity 2.5s cubic-bezier(.62, 0, .22, 1); pointer-events: none; }
.door-l .door-shade { background: linear-gradient(to right, rgba(70, 34, 28, .05), rgba(70, 34, 28, .42)); }
.door-r .door-shade { background: linear-gradient(to left, rgba(70, 34, 28, .05), rgba(70, 34, 28, .42)); }

.gate.open .door { transition: transform 2.4s cubic-bezier(.55, 0, .25, 1), opacity .8s ease 1.7s; opacity: 0; }
.gate.open .door-l { transform: rotateY(82deg); }
.gate.open .door-r { transform: rotateY(-82deg); }
.gate.open .door-shade { opacity: 1; }

.seal-half {
  position: absolute; top: 50%; z-index: 2;
  width: var(--seal); height: var(--seal); margin-top: calc(var(--seal) / -2);
  transition: transform .45s cubic-bezier(.3, 1.6, .5, 1);
}
.door-l .seal-half { right: calc(var(--seal) / -2); clip-path: inset(-30% 50% -30% -30%); }
.door-r .seal-half { left: calc(var(--seal) / -2); clip-path: inset(-30% -30% -30% 50%); }
.seal-half svg { width: 100%; height: 100%; display: block; overflow: visible; animation: breathe 3.6s ease-in-out infinite; }
.gate.cracking .door-l .seal-half { transform: translateX(-4px) rotate(-3deg); }
.gate.cracking .door-r .seal-half { transform: translateX(4px) rotate(3deg); }
.gate.cracking .seal-half svg { animation: none; }

.seal-btn {
  position: absolute; z-index: 4; left: 50%; top: 50%;
  width: var(--seal); height: var(--seal); translate: -50% -50%;
  border-radius: 50%; border: 0; background: transparent; padding: 0;
}
.seal-btn:focus-visible { outline: 2px solid var(--rose-d); outline-offset: 10px; }
.seal-btn .ring {
  position: absolute; inset: -8px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .85);
  animation: halo 2.6s ease-out infinite;
}
.seal-btn .ring + .ring { animation-delay: 1.3s; }
.gate.cracking .seal-btn { visibility: hidden; }

.gate-copy {
  position: absolute; left: 0; right: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none;
  transition: opacity .6s ease, transform .8s var(--ease);
}
.gate-copy.top { top: 0; height: calc(50% - var(--seal) * .5 - 70px); padding-top: 12cqh; }
.gate-copy.bottom { bottom: 0; height: calc(50% - var(--seal) * .5 - 70px); padding-bottom: 11cqh; gap: 10px; }
.gate.cracking .gate-copy { opacity: 0; transform: translateY(-8px); }
.gate.cracking .gate-copy.bottom { transform: translateY(8px); }
.g-eyebrow { margin: 0 0 6px; font-family: var(--caps); font-size: clamp(8.5px, 2.5cqw, 10.5px); letter-spacing: .32em; padding-left: .32em; text-transform: uppercase; color: var(--ink-2); }
.g-names {
  margin: 0; font-weight: 500; font-size: clamp(30px, 9.2cqw, 42px); line-height: 1.05; color: var(--ink);
  text-shadow: 0 0 18px var(--door), 0 0 8px var(--door), 0 1px 0 rgba(255,255,255,.7);
}
.g-names i { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--rose-d); font-size: .82em; padding: 0 .02em; }
.g-date { margin: 8px 0 0; font-family: var(--caps); font-size: clamp(10px, 3cqw, 12.5px); letter-spacing: .34em; padding-left: .34em; color: var(--ink-2); text-shadow: 0 0 10px var(--door); }
.g-for { margin: 0; font-style: italic; font-size: clamp(15px, 4.4cqw, 18px); color: var(--ink-2); text-shadow: 0 0 12px var(--door), 0 0 6px var(--door); }
.g-for b { display: block; font-family: var(--script); font-style: normal; font-weight: 400; font-size: 1.85em; line-height: 1.2; color: var(--ink); }
.g-hint {
  margin: 0; font-family: var(--caps); font-size: clamp(8.5px, 2.5cqw, 10px); letter-spacing: .34em; padding-left: .34em; text-transform: uppercase;
  color: var(--ink-2);
  background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink) 45%, var(--ink-3) 60%) 0 0 / 260% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 3.4s linear infinite;
}

.bloom {
  position: absolute; inset: 0; z-index: 19; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 50%, rgba(255, 251, 248, .95), rgba(255, 246, 241, .4) 45%, transparent 75%);
}
.opened .bloom { animation: bloom 2.8s ease-out both; }

/* ── short screens (small phones, browser bars showing) ── */
@container (max-height: 660px) {
  .panel { gap: 9px; padding-top: 14.5cqh; padding-bottom: 13cqh; }
  .names { font-size: clamp(42px, 13cqw, 56px); }
  .script-h { font-size: clamp(32px, 9.5cqw, 40px); }
  .cartouche { width: 148px; }
  .c-day { font-size: 56px; }
  .map { width: 220px; }
  .count { width: min(100%, 270px); }
  .rsvp { gap: 9px; }
  .field input, .field textarea { font-size: 17px; padding: 3px 0 4px; }
  .choice button { font-size: 16px; padding: .55em .3em .5em; }
  .notes { gap: 10px; }
  .notes li { font-size: 15.5px; }
  .end-seal { width: 76px; }
}

/* ── keyframes ──────────────────────────────── */
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes halo { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes shimmer { to { background-position: -260% 0; } }
@keyframes bloom { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@keyframes nudge { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(2px); } }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 13px; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .door, .gate.open .door { transition: opacity .8s ease; }
  .gate.open .door-l, .gate.open .door-r { transform: none; }
  .invite { transform: none; transition: none; }
  .rv { transform: none; filter: none; transition: opacity .6s ease; }
  .seal-half svg, .seal-btn .ring, .g-hint, .next svg { animation: none; }
  .opened .bloom { animation: none; }
}

/* private-link lock */
.gate.locked .seal-btn { cursor: default; }
.gate.locked .g-hint { animation: none; -webkit-text-fill-color: currentColor; background: none; }
