

@font-face {
  font-family: 'KZ Ceremonious One';
  src: url('assets/kz-ceremonious-one.woff') format('woff');
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: 'ALS Alumna Kazak';
  src: url('assets/als-alumna-kazak.woff') format('woff');
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  --ivory: #f2eadc;
  --ivory-deep: #ded0b8;
  --paper: #fbf8f0;
  --ink: #211d19;
  --muted: #746a5f;
  --gold: #987020;
  --gold-light: #c5a65e;
  --black: #141312;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --display: 'Prata', Georgia, serif;
  --sans: 'Manrope', system-ui, sans-serif;
  --ceremonious: 'KZ Ceremonious One', 'Cormorant Garamond', cursive;
  --alumna: 'ALS Alumna Kazak', 'Manrope', sans-serif;
  --scene-blend: clamp(88px, 14svh, 140px);
  color-scheme: light;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--black);
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 5px;
}

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

.scene {
  position: relative;
  isolation: isolate;
  display: grid;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  scroll-snap-align: start;
}


.kicker {
  margin: 0;
  color: var(--gold);
  font: 700 10px/1.5 var(--sans);
  letter-spacing: .24em;
  text-transform: uppercase;
}

.kicker--light {
  color: #f0db9c;
}

.reveal {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity .9s cubic-bezier(.2, .75, .2, 1), transform .9s cubic-bezier(.2, .75, .2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scene 1 — tactile stationery */
.scene--envelope {
  place-items: center;
  height: 100vh;
  height: 100lvh;
  min-height: 100vh;
  min-height: 100lvh;
  padding: 0;
  background: #ece2d0;
}

/* --- Границы первого экрана ------------------------------------------------
   Замер на живом iPhone: svh 781, dvh 781, lvh 821, сам экран 956.
   Ни одна вьюпорт-единица не достаёт до области под панелью Safari и под
   полосой home indicator — туда проступала следующая сцена.
   Поэтому сцена 1 здесь не секция документа, а ворота: position: fixed
   привязывается к initial containing block, а он при viewport-fit=cover
   покрывает физический экран целиком. Единиц высоты в этом правиле нет
   вообще — нечему отставать от экрана.
   Ворота держатся до КОНЦА открытия (invitation-opening), иначе конверт
   выпадет в поток на середине анимации. */
body:not(.invitation-opened) .scene--envelope,
body.invitation-opening .scene--envelope {
  position: fixed;
  inset: 0;
  z-index: 5;
  min-height: 0;
}

/* --- Открыть можно только нажатием -----------------------------------------
   До нажатия на конверт листать нечего: сцена 1 это ворота, а не страница.
   Без блокировки короткий свайп оставляет страницу между сценами —
   scroll-snap стоит в режиме proximity и обратно не притягивает.
   touch-action обязателен: на iOS одного overflow: hidden палец не слушается. */
html:has(body:not(.invitation-opened)) {
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

html:has(body:not(.invitation-opened)) {
  background: #ece2d0;
}

body:not(.invitation-opened) main > :not(.scene--envelope) {
  visibility: hidden;
}

.invitation-opening .scene--envelope {
  height: var(--envelope-opening-height, 100dvh);
  min-height: var(--envelope-opening-height, 100dvh);
}

.scene--envelope::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 7;
  box-shadow:
    inset 0 0 90px rgba(83, 62, 30, .12),
    inset 0 1px rgba(255, 255, 255, .78);
  pointer-events: none;
}

.scene--envelope::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  opacity: .23;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
}

.scene--envelope > .kicker {
  position: absolute;
  top: max(36px, calc(env(safe-area-inset-top) + 18px));
  left: 50%;
  z-index: 9;
  width: max-content;
  color: #77591c;
  transform: translateX(-50%);
}

.envelope {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 2200px;
  isolation: isolate;
  opacity: 0;
  transition: opacity .18s ease;
}

.envelope__base,
.envelope__front,
.envelope__layer-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.envelope__base {
  z-index: 0;
}

.envelope__inside {
  position: absolute;
  inset: 0;
  z-index: 1;
  clip-path: polygon(0 18.2%, 100% 18.2%, 50% 53.8%);
  background:
    linear-gradient(180deg, rgba(125, 92, 43, .16), rgba(255, 255, 255, .08)),
    url('assets/envelope-paper.webp') center / cover;
  box-shadow: inset 0 18px 34px rgba(78, 55, 24, .18);
  filter: sepia(.08) saturate(.68) brightness(.88);
}


.envelope__card {
  position: absolute;
  top: 15%;
  left: 50%;
  z-index: 2;
  display: grid;
  grid-template-rows: 1fr auto;
  width: min(78vw, 430px);
  height: min(62%, 580px);
  padding: 8px;
  overflow: hidden;
  opacity: 0;
  border: 1px solid rgba(130, 96, 36, .25);
  border-radius: 2px;
  background: #fffdf8;
  box-shadow:
    0 20px 38px rgba(55, 38, 15, .22),
    0 1px 0 rgba(255, 255, 255, .9) inset;
  visibility: hidden;
  transform: translate(-50%, 38%);
  transition:
    transform .74s cubic-bezier(.22, .7, .2, 1) .4s,
    opacity .16s ease .4s;
}

.envelope__card-media {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #111;
}

.envelope__card-media::after {
  content: '';
  position: absolute;
  inset: 42% 0 0;
  z-index: 1;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .72));
  pointer-events: none;
}

.envelope__card-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 44%;
  filter: grayscale(1) contrast(1.08) brightness(1);
  transform: scale(1.035);
  transition: transform .74s cubic-bezier(.22, .7, .2, 1) .4s;
}

.shared-wedding-title {
  display: block;
  width: max-content;
  max-width: 100%;
  color: #fff;
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  line-height: .83;
  letter-spacing: -.05em;
  text-align: left;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .48);
}

.shared-wedding-title--card {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 2;
  font-size: clamp(27px, 7.8vw, 38px);
}

.envelope__card-copy {
  display: flex;
  min-height: 41px;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 3px 2px;
  color: var(--gold);
}

.envelope__card-names {
  font: 400 clamp(14px, 4.6vw, 20px)/1.1 var(--display);
  letter-spacing: -.02em;
  white-space: nowrap;
}

.envelope__card-names i {
  padding: 0 2px;
  font-family: var(--serif);
  font-size: .78em;
  font-weight: 600;
}

.envelope__card-date {
  font: 700 9px/1 var(--sans);
  letter-spacing: .08em;
  white-space: nowrap;
}

.envelope__front {
  z-index: 3;
  clip-path: polygon(0 18.2%, 50% 53.8%, 100% 18.2%, 100% 100%, 0 100%);
}

.envelope__flap {
  position: absolute;
  inset: 0;
  z-index: 4;
  transform: rotateX(0deg);
  transform-origin: 50% 18.2%;
  transform-style: preserve-3d;
  transition:
    transform .64s cubic-bezier(.45, 0, .55, 1),
    z-index 0s linear .32s;
  will-change: transform;
}

.envelope__flap-face {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 100% 18.2%, 50% 53.8%, 0 18.2%);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.envelope__flap-face--outer {
  z-index: 1;
}

.envelope__flap-face--inner {
  background:
    linear-gradient(180deg, rgba(112, 79, 34, .14), rgba(255, 255, 255, .1)),
    url('assets/envelope-paper.webp') center / cover;
  filter: sepia(.08) saturate(.62) brightness(.92);
  transform: rotateX(180deg);
}

/* В WebKit backface-visibility: hidden НЕ РАБОТАЕТ внутри вложенного
   preserve-3d — свойство вычисляется, но не применяется. Изнанка клапана
   просвечивала сквозь лицо на закрытом конверте, а её rotateX(180deg)
   зеркалит и clip-path: треугольник переворачивался остриём вверх и ложился
   бледным серым пятном в нижнюю половину экрана.
   Прячем явно и возвращаем в середине поворота клапана, когда он виден
   с торца и подмену не поймать. ВНИМАНИЕ: задержка привязана к длительности
   поворота — поменяешь темп открытия, поправь и её. */
.envelope:not(.is-open) .envelope__flap-face--inner {
  opacity: 0;
}

.envelope.is-open .envelope__flap-face--inner {
  opacity: 1;
  transition: opacity 0s linear .27s;
}

.envelope__lettering {
  position: absolute;
  top: 24%;
  left: 50%;
  z-index: 2;
  width: 92%;
  color: #8a6519;
  font: 400 clamp(24px, 7.2vw, 40px)/1.1 var(--display);
  letter-spacing: -.025em;
  text-align: center;
  white-space: nowrap;
  text-shadow:
    0 1px rgba(255, 255, 255, .92),
    0 2px 2px rgba(78, 52, 15, .17);
  transform: translate(-50%, -50%);
}

.envelope__lettering i {
  margin-inline: .12em;
  font-family: var(--serif);
  font-size: .72em;
  font-weight: 600;
}

.envelope__emblem {
  position: absolute;
  /* Клапан сходится в точку на 53.8%. На 45% его полуширина ~34px, а
     кольцам нужно 50 — нижние дуги срезало. Считано по геометрии клапана:
     полуширина = 0.5 * (53.8 - y) / 35.6 от ширины конверта. На 40% запас есть.
     Ширина в vw, чтобы пропорция держалась на любом экране. */
  top: 40%;
  left: 50%;
  z-index: 2;
  width: min(25.5vw, 108px);
  /* Штрих врезан в бумагу, а не лежит на ней: снизу от линии светлая кромка
     отвала, сверху — едва заметная тень от резца. Никакой высоты; вес
     эмблемы держит сама краска, тень только уточняет край. */
  filter:
    drop-shadow(0 .5px 0 rgba(255, 252, 243, .8))
    drop-shadow(0 -.35px .3px rgba(90, 60, 18, .2));
  transform: translate(-50%, -50%);
}

.envelope__emblem svg {
  display: block;
  width: 100%;
  overflow: visible;
}

/* Штрих резца — не обводка, а залитая лента: у stroke толщина одна на всю
   линию, а вся идея варианта в том, что она меняется по обходу. Обе кромки
   ленты посчитаны точками, поэтому фигура заливается по чётности. */
.envelope__emblem-burin {
  fill: url(#egInk);
  fill-rule: evenodd;
  stroke: none;
}

.envelope:disabled {
  cursor: wait;
}

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

.envelope.is-ready .envelope__card {
  visibility: visible;
}

.envelope.is-open .envelope__flap {
  z-index: 1;
  transform: rotateX(180deg);
}


.envelope.is-open .envelope__card {
  transform: translate(-50%, -8%);
  opacity: 1;
}

.envelope.is-open .envelope__card-photo {
  filter: grayscale(1) contrast(1.08) brightness(1);
  transform: scale(1);
}


@media (hover: hover) {
  .envelope:not(.is-open):hover .envelope__lettering {
    color: #765313;
  }
}

.envelope:not(.is-ready) ~ .open-hint {
  visibility: hidden;
}

.open-hint {
  position: absolute;
  /* Сцена выросла до 100lvh и ушла под полупрозрачную панель Safari.
     (100lvh - 100svh) — ровно её высота: на iPhone это 40px, на экране
     без панели ноль. Подсказка поднимается ровно настолько, сколько нужно. */
  bottom: calc(max(36px, env(safe-area-inset-bottom) + 20px) + (100lvh - 100svh));
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 12px;
  width: max-content;
  margin: 0;
  transform: translateX(-50%);
  color: #675f54;
  font: 600 9px/1 var(--sans);
  letter-spacing: .13em;
  text-transform: uppercase;
  transition: opacity .16s;
}

.open-hint i {
  width: 1px;
  height: 30px;
  background: linear-gradient(var(--gold), transparent);
  animation: hint 1.8s ease-in-out infinite;
}

.invitation-opened .open-hint {
  opacity: 0;
}

.invitation-opening {
  overflow: hidden;
}

.story-transition {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  pointer-events: none;
  opacity: 1;
  transition: opacity .28s cubic-bezier(.22, .72, .18, 1);
}

.story-transition__frame {
  position: fixed;
  overflow: hidden;
  border: 1px solid rgba(130, 96, 36, .2);
  border-radius: 2px;
  background: #111;
  box-shadow: 0 22px 42px rgba(30, 20, 9, .3);
  transition:
    top .82s cubic-bezier(.22, .72, .18, 1),
    left .82s cubic-bezier(.22, .72, .18, 1),
    width .82s cubic-bezier(.22, .72, .18, 1),
    height .82s cubic-bezier(.22, .72, .18, 1),
    clip-path .28s cubic-bezier(.22, .72, .18, 1),
    border-radius .6s ease,
    box-shadow .6s ease;
  will-change: top, left, width, height, clip-path;
  contain: strict;
  backface-visibility: hidden;
  transform: translateZ(0);
}


.story-transition__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 44%;
  filter: grayscale(1) contrast(1.08) brightness(1);
  transform: scale(1);
  transition:
    object-position .82s cubic-bezier(.22, .72, .18, 1),
    transform .82s cubic-bezier(.22, .72, .18, 1);
  will-change: object-position, transform;
}

.story-transition__veil {
  z-index: 1;
  opacity: 0;
  transition: opacity .82s cubic-bezier(.22, .72, .18, 1);
}

.shared-wedding-title--transition {
  position: fixed;
  z-index: 3;
  margin: 0;
  opacity: 0;
  font-size: clamp(62px, 19vw, 106px);
  transform-origin: 0 0;
  transition:
    transform .82s cubic-bezier(.22, .72, .18, 1),
    opacity .28s ease .18s;
  will-change: transform, opacity;
}

.story-transition.is-unfolding .story-transition__frame {
  border-radius: 0;
  box-shadow: none;
}

.story-transition.is-unfolding .story-transition__image {
  object-position: center 50%;
  transform: scale(1.03);
}

.story-transition.is-unfolding .story-transition__veil {
  opacity: 1;
}

.story-transition.is-unfolding .shared-wedding-title--transition {
  opacity: 1;
}

.story-transition.is-complete {
  opacity: 0;
}

/* Scene 2 — portrait */
.scene--portrait {
  min-height: 100svh;
  place-items: center;
  background: #111;
  color: #fff;
}

.portrait {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  filter: grayscale(1) contrast(1.08) brightness(.84);
  transform: scale(1.03);
}

.portrait__veil {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .16), transparent 25%, transparent 50%, rgba(0, 0, 0, .78)),
    linear-gradient(90deg, rgba(0, 0, 0, .28), transparent 40%);
}

.portrait__copy {
  align-self: end;
  width: 100%;
  padding: 28px 24px max(108px, calc(env(safe-area-inset-bottom) + 80px));
  text-align: left;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .42);
}

.portrait__title-slot {
  width: min(100%, 390px);
  height: 1.66em;
  margin: 12px 0 20px;
  font-size: clamp(62px, 19vw, 106px);
  line-height: .83;
}

.shared-wedding-title--portrait {
  font-size: inherit;
}

.portrait__names {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(27px, 7.8vw, 42px);
  font-style: normal;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.035em;
}


.scene--portrait.is-opened .portrait__copy {
  opacity: 1;
  transform: translateY(0);
  transition: none;
}
.portrait__names span {
  display: inline-block;
  margin: 0 .14em;
  color: #e5c978;
  font-size: .62em;
}

.portrait__caption {
  position: absolute;
  right: 19px;
  bottom: max(28px, env(safe-area-inset-bottom));
  margin: 0;
  font: 600 8px/1 var(--sans);
  letter-spacing: .24em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  opacity: .68;
}

/* Scene 3 — family letter */
.scene--letter,
.scene--calendar,
.scene--location {
  margin-top: calc(-1 * var(--scene-blend));
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--scene-blend));
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--scene-blend));
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Preserve each scene's usable height while it overlaps the scene above. */

.scene--letter {
  place-items: center;
  min-height: calc(106svh + var(--scene-blend));
  padding: calc(80px + var(--scene-blend)) 15px 80px;
  background:
    radial-gradient(circle at 80% 18%, rgba(193, 155, 75, .14), transparent 24%),
    linear-gradient(155deg, #fdfaf3, #efe5d5);
}


.letter {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  text-align: center;
  color: #3f403f;
}


.letter h2 {
  margin: 0 0 30px;
  font: 900 clamp(46px, 12.82vw, 50px)/1.26 var(--ceremonious);
  letter-spacing: 0;
}

.letter > p {
  max-width: 36ch;
  margin: 0 auto 16px;
  font: 900 clamp(20px, 5.13vw, 22px)/1.25 var(--alumna);
  letter-spacing: 0;
  -webkit-text-stroke: .3px currentColor;
}

.letter__signature {
  display: grid;
  gap: 2px;
  margin-top: 36px;
  color: #3f403f;
}

.letter__signature span {
  color: inherit;
  font: 800 clamp(19px, 5.13vw, 20px)/1.25 var(--alumna);
  letter-spacing: 0;
}

.letter__signature strong {
  color: inherit;
  font: 800 clamp(24px, 6.41vw, 25px)/1.25 var(--alumna);
  letter-spacing: 0;
}

/* Scene 4 — calendar */
.scene--calendar {
  align-content: center;
  justify-items: center;
  gap: 34px;
  min-height: calc(100svh + var(--scene-blend));
  padding: calc(70px + var(--scene-blend)) 22px 70px;
  background: #f8f4ea;
  text-align: center;
}


.calendar-intro h2 {
  margin: 10px 0 4px;
  font-family: var(--display);
  font-size: clamp(38px, 10vw, 58px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.035em;
}

.calendar-intro > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font: 700 10px/1 var(--sans);
  letter-spacing: .25em;
  text-transform: uppercase;
}

.calendar {
  width: min(100%, 440px);
  padding: 26px 18px 22px;
  border-top: 1px solid rgba(152, 112, 32, .55);
  border-bottom: 1px solid rgba(152, 112, 32, .55);
}

.calendar__header,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: center;
  row-gap: 12px;
}

.calendar__header {
  margin-bottom: 15px;
  color: var(--muted);
  font: 700 9px/1 var(--sans);
  text-transform: uppercase;
}

.calendar__day {
  position: relative;
  display: grid;
  height: 31px;
  place-items: center;
  font: 600 16px/1 var(--serif);
}

.calendar__day--selected {
  z-index: 1;
  color: #fff;
  font-weight: 700;
}

.calendar__day-number {
  position: relative;
  z-index: 1;
}

.calendar__heart {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
  transform: translate(-50%, -48%);
}

.calendar__heart::before {
  content: '♥';
}

.calendar-note {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-style: italic;
}

.calendar-note span {
  color: var(--ink);
  font-weight: 700;
}

/* Scene 5 — place and separate confirmation */
.scene--location {
  grid-template-rows: minmax(calc(100svh + var(--scene-blend)), auto) auto auto;
  min-height: calc(100svh + var(--scene-blend));
  place-items: stretch;
  padding: 0;
  background: #111;
  color: #fff;
}

.location__photo {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: -3;
  width: 100%;
  height: calc(100svh + var(--scene-blend));
  object-fit: cover;
  object-position: center;
  filter: grayscale(.1) saturate(.72) brightness(.6);
}

.location__shade {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: -2;
  height: calc(100svh + var(--scene-blend));
  background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .68));
}

.location-card {
  grid-row: 1;
  place-self: center;
  width: min(88vw, 460px);
  padding: 58px 30px 52px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: rgba(10, 10, 9, .86);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
  text-align: center;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.location-card h2 {
  margin: 12px 0 16px;
  font-family: var(--display);
  font-size: clamp(36px, 10vw, 56px);
  font-weight: 400;
  line-height: .96;
  letter-spacing: -.035em;
}

.location-card h2 span {
  color: #f2d486;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
}

.location-card__place {
  max-width: 270px;
  margin: 0 auto;
  color: #e8e4dd;
  font: 600 13px/1.5 var(--sans);
}

.location-card__time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 24px auto;
}

.location-card__time strong {
  color: #f2d486;
  font-family: var(--display);
  font-size: 39px;
  font-weight: 400;
  line-height: 1;
}

.location-card__time span {
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, .32);
  font: 600 10px/1.4 var(--sans);
  text-align: left;
}

.map-link {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 21px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  color: #fff;
  font: 700 12px/1 var(--sans);
  text-decoration: none;
  transition: background .25s, color .25s;
}

.map-link:hover {
  background: #fff;
  color: #111;
}

.map-link svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.6;
}

.rsvp-panel {
  position: relative;
  z-index: 1;
  grid-row: 2;
  width: 100%;
  padding: 82px 24px 48px;
  background:
    linear-gradient(rgba(251, 248, 240, .94), rgba(242, 234, 220, .96)),
    url('assets/envelope-paper.webp') center / cover;
  color: var(--ink);
  text-align: center;
}

.rsvp-panel::before {
  content: '';
  position: absolute;
  top: 42px;
  left: 50%;
  width: 72px;
  height: 1px;
  background: var(--gold-light);
  transform: translateX(-50%);
}

.rsvp-note {
  max-width: 520px;
  margin: 12px auto 0;
  color: var(--ink);
  font: 400 clamp(31px, 8vw, 46px)/1.06 var(--display);
  letter-spacing: -.035em;
}

.rsvp-form {
  display: grid;
  width: min(100%, 420px);
  gap: 12px;
  margin: 34px auto 0;
  color: var(--ink);
  font-family: var(--sans);
  text-align: left;
}

.rsvp-form__name-field span,
.rsvp-form__choices legend {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.rsvp-form__name {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid #b9ac96;
  border-radius: 2px;
  outline: none;
  background: rgba(255, 255, 255, .62);
  color: var(--ink);
  font: 600 16px/1 var(--sans);
}

.rsvp-form__name:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(152, 112, 32, .18);
}

.rsvp-form__choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 0;
  margin: 3px 0 0;
  padding: 0;
  border: 0;
}

.rsvp-form__choices legend {
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 7px;
  padding: 0;
}

.rsvp-form__choices label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.rsvp-form__choices input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.rsvp-form__choices span {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid #b9ac96;
  border-radius: 2px;
  background: rgba(255, 255, 255, .34);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  transition: border-color .2s, background .2s, color .2s;
}

.rsvp-form__choices input:checked + span {
  border-color: var(--black);
  background: var(--black);
  color: #f6e7bd;
}

.rsvp-form__choices input:focus-visible + span {
  outline: 3px solid rgba(152, 112, 32, .25);
  outline-offset: 2px;
}

.rsvp-form__choices input:disabled + span,
.rsvp-form__name:disabled {
  cursor: wait;
  opacity: .62;
}

.rsvp-form__names {
  display: grid;
  gap: 12px;
}

.rsvp-form__name-field {
  display: grid;
  gap: 8px;
}

.rsvp-form__name-field[hidden] {
  display: none;
}

.rsvp-form__submit {
  min-height: 50px;
  margin-top: 3px;
  padding: 0 20px;
  border: 1px solid var(--black);
  border-radius: 2px;
  background: var(--black);
  color: #f6e7bd;
  cursor: pointer;
  font: 700 13px/1 var(--sans);
  letter-spacing: .02em;
}

.rsvp-form__submit:disabled {
  cursor: wait;
  opacity: .7;
}

.rsvp-form__feedback {
  min-height: 2.6em;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.rsvp-form__feedback[data-state="success"] {
  color: #765719;
}

.rsvp-form__feedback[data-state="error"] {
  color: #9b2d22;
}


/* Floating audio control */
.music-control {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  z-index: 20;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  background: rgba(18, 17, 15, .78);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
  color: #fff;
  font: 700 9px/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.music-control[hidden] {
  display: none;
}

.music-control__bars {
  display: flex;
  height: 14px;
  align-items: end;
  gap: 2px;
}

.music-control__bars i {
  width: 2px;
  height: 6px;
  background: #e2c474;
  transform-origin: bottom;
}

.music-control[aria-pressed='true'] .music-control__bars i {
  animation: bars .75s ease-in-out infinite alternate;
}

.music-control[aria-pressed='true'] .music-control__bars i:nth-child(2) {
  animation-delay: -.35s;
}

.music-control[aria-pressed='true'] .music-control__bars i:nth-child(3) {
  animation-delay: -.6s;
}

.noscript {
  position: fixed;
  inset: auto 12px 12px;
  z-index: 30;
  margin: 0;
  padding: 12px;
  background: #fff;
  color: #111;
  font: 600 12px/1.4 var(--sans);
  text-align: center;
}

@keyframes hint {
  0%, 100% { opacity: .3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(7px); }
}

@keyframes bars {
  from { transform: scaleY(.42); }
  to { transform: scaleY(1.25); }
}

@media (min-width: 700px) {

  .portrait__copy {
    width: min(100%, 900px);
    padding-right: 9vw;
    padding-left: 9vw;
  }

  .portrait__title-slot {
    width: min(100%, 540px);
  }

  .letter > p {
    line-height: 1.45;
  }

  .location-card {
    padding: 70px 50px 58px;
  }
}

@media (min-width: 900px) {
  .kicker {
    font-size: 12px;
  }

  .story-transition.is-unfolding .story-transition__image,
  .portrait {
    /* The source is a phone crop. Preserve the original desktop treatment:
       fill the viewport and keep the couple around the visual center. */
    object-position: center 42%;
    transform: scale(1.01);
  }

  .letter {
    width: min(100%, 760px);
  }

  .letter h2 {
    font-size: 64px;
  }

  .letter > p {
    max-width: 38ch;
    font-size: 27px;
  }

  .letter__signature span {
    font-size: 23px;
  }

  .letter__signature strong {
    font-size: 30px;
  }

  .calendar-intro h2 {
    font-size: 68px;
  }

  .calendar {
    width: min(100%, 520px);
    padding: 32px 22px 28px;
  }

  .calendar__header,
  .calendar__grid {
    row-gap: 15px;
  }

  .calendar__header {
    font-size: 10px;
  }

  .calendar__day {
    height: 37px;
    font-size: 18px;
  }

  .calendar__heart {
    font-size: 48px;
  }

  .calendar-note {
    font-size: 21px;
  }

  .location-card {
    width: min(88vw, 520px);
    padding: 72px 54px 62px;
  }

  .location-card h2 {
    font-size: 62px;
  }

  .location-card__place {
    font-size: 15px;
  }

  .location-card__time strong {
    font-size: 46px;
  }

  .location-card__time span {
    font-size: 11px;
  }

  .map-link {
    min-height: 50px;
    font-size: 13px;
  }

  .rsvp-note {
    font-size: 52px;
  }

  .rsvp-form {
    width: min(100%, 480px);
  }
}

@media (max-width: 370px), (max-height: 700px) {

  .letter h2 {
    margin-bottom: 18px;
  }

  .letter > p {
    margin-bottom: 10px;
    font-size: 20px;
  }

  .letter__signature {
    margin-top: 22px;
  }

  .scene--calendar {
    gap: 22px;
    padding-block: 52px;
  }

  .location-card {
    width: min(94vw, 420px);
    padding: 38px 24px 34px;
  }

  .location-card__time {
    margin-block: 17px;
  }

  .rsvp-panel {
    padding: 68px 20px 34px;
  }

  .rsvp-panel::before {
    top: 32px;
  }

  .rsvp-note {
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
