/* ==========================================================================
   Дмитрий & Виктория — свадебное приглашение
   Макет: 781 × 7776 pt. Все элементы макета позиционируются в «единицах макета»
   (--u = ширина колонки / 781), поэтому пропорции сохраняются на любом экране.
   ========================================================================== */

@font-face {
  font-family: "Foglihten No06";
  src: url("../fonts/FoglihtenNo06.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: block;
  /* одинаковые вертикальные метрики во всех браузерах (как hhea в Safari) */
  ascent-override: 93.4%;
  descent-override: 25.7%;
  line-gap-override: 0%;
}

:root {
  --cream: #ebd0b9;
  --wine: #310908;
  --ink: #300003;
  --outer: #1d0403;
  --paper: #efeae4;
  --error: #8f1d1d;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--outer);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--outer);
  color: var(--cream);
  font-family: "Foglihten No06", "Times New Roman", serif;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures contextual;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  text-transform: uppercase; /* весь текст приглашения — капсом */
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Колонка приглашения ---- */
.page {
  width: min(100%, 520px);
  margin: 0 auto;
  background: var(--wine);
  container-type: inline-size;
  --u: calc(100cqw / 781);
  box-shadow: 0 0 60px rgba(0, 0, 0, .55);
}
@supports not (width: 1cqw) {
  .page { --u: calc(min(100vw, 520px) / 781); }
}

/* ---- Холст макета ---- */
.canvas {
  position: relative;
  height: calc(var(--ch, 7776) * var(--u));
  overflow: hidden;
  isolation: isolate;
  background: var(--wine);
}
.sec { display: contents; }

.L, .blk, .clip, .maplink {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  margin: 0;
}
img.L { display: block; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.base { z-index: 0; }

.clip { overflow: hidden; background: var(--wine); }
.vid {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  object-fit: cover;
  display: block;
  pointer-events: none;
  background: var(--wine);
}
/* прячем системные кнопки воспроизведения (iOS «Энергосбережение») */
video::-webkit-media-controls,
video::-webkit-media-controls-start-playback-button,
video::-webkit-media-controls-panel { display: none !important; -webkit-appearance: none; }

.blend-burn { mix-blend-mode: color-burn; }
.blend-mul  { mix-blend-mode: multiply; }

/* ---- Текст макета ---- */
.blk { font-weight: 400; font-size: 0; }
.ln {
  position: absolute;
  left: calc(var(--x) * var(--u));
  /* --y — базовая линия строки в макете; --bl — положение базовой линии в строке (уточняется в main.js) */
  top: calc((var(--y) - var(--bl, .8385) * var(--s)) * var(--u));
  font-size: calc(var(--s) * var(--u));
  line-height: 1;
  white-space: nowrap;
  color: var(--cream);
  /* --x — центр строки в макете (весь текст макета выровнен по центру) */
  transform: translateX(-50%);
}
.heart { display: inline-block; width: .82em; height: .75em; margin-left: .05em; vertical-align: 0; }

/* «КАРТА»: линии с ромбами под словом (из макета), с минимальной толщиной, чтобы были видны на любом экране */
.mapdeco {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  display: block;
  pointer-events: none;
}
.mapdeco::before, .mapdeco::after { content: ""; position: absolute; top: 50%; background: var(--cream); }
.mapdeco::before { left: calc(4 * var(--u)); right: 0; height: max(1px, calc(1.3 * var(--u))); transform: translateY(-50%); }
.mapdeco::after {
  left: calc(4 * var(--u));
  width: max(3.5px, calc(4.2 * var(--u)));
  height: max(3.5px, calc(4.2 * var(--u)));
  transform: translate(-50%, -50%) rotate(45deg);
}
.mapdeco.r { transform: scaleX(-1); }
#letter .ln { color: var(--wine); }
#gift .ln { color: var(--ink); }
#program .ln { color: #e9d4c3; }
/* текст программы повёрнут вместе с карточкой (2,77°) вокруг того же центра */
.blk.rot { transform-origin: calc(var(--ox) * var(--u)) calc(var(--oy) * var(--u)); transform: rotate(-2.7677deg); }
.plate { background: #310908; }
.deco { pointer-events: none; }
#letter .ln .heart { color: #8c1414; }

.maplink {
  z-index: 5;
  display: block;
  border-radius: 4px;
  outline-offset: 2px;
}
.maplink:focus-visible { outline: 1px solid var(--cream); }

/* ---- Анимации появления ---- */
html.js .rv { opacity: 0; transition: opacity 1.4s cubic-bezier(.25, .6, .3, 1); }
html.js .rv.in { opacity: 1; }
html.js .rv-soft { transition-duration: 1.8s; }
html.js .rv-line { clip-path: inset(0 50% 0 50%); transition: opacity .6s ease, clip-path 1.6s cubic-bezier(.3, .7, .2, 1); }
html.js .rv-line.in { clip-path: inset(0 0 0 0); }
html.js .rv-d1 { transition-delay: .35s; }
html.js .rv-d2 { transition-delay: .7s; }
html.js .rv-d3 { transition-delay: 1.1s; }

/* лёгкое «дыхание» золотых декоративных элементов */
@keyframes glint { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }
.glint.in { animation: glint 5.5s ease-in-out 2s infinite; }

@media (prefers-reduced-motion: reduce) {
  html.js .rv, html.js .rv-line { opacity: 1; clip-path: none; transition: none; }
  .glint.in { animation: none; }
}

/* ==========================================================================
   RSVP — в стилистике карточки «The Evening Program»
   ========================================================================== */
.rsvp {
  position: relative;
  z-index: 1;
  padding: calc(150 * var(--u)) calc(50.5 * var(--u)) calc(170 * var(--u));
  text-align: center;
  background: var(--wine);
}
.rsvp-band {
  position: absolute;
  left: 0;
  top: calc(-40 * var(--u));
  width: 100%;
  height: calc(288 * var(--u));
  pointer-events: none;
}
.rsvp-title, .rsvp-sub, .rsvp-text { position: relative; margin: 0; font-weight: 400; }
.rsvp-title { display: block; }
.rsvp-title .t1 { display: block; font-size: calc(71 * var(--u)); line-height: 1; }
.rsvp-title .t2 { display: block; font-size: calc(41 * var(--u)); line-height: 1; }
.rsvp-title .orn { margin: calc(14 * var(--u)) 0 calc(12 * var(--u)); }
.orn-cream { color: var(--cream); }
.orn-cream b { background: none; position: relative; }
.orn-cream b::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: max(3.5px, calc(5 * var(--u)));
  height: max(3.5px, calc(5 * var(--u)));
  background: var(--cream);
  transform: translate(-50%, -50%) rotate(45deg);
}
.rsvp-sub {
  margin-top: calc(34 * var(--u));
  font-size: max(12px, calc(26 * var(--u)));
  line-height: 1.1;
}
.rsvp-text {
  margin: calc(24 * var(--u)) auto 0;
  max-width: calc(520 * var(--u));
  font-size: max(11px, calc(22 * var(--u)));
  line-height: 1.05;
}
.rsvp-sub + .rsvp-text { margin-top: calc(36 * var(--u)); }

/* ---- Карточка анкеты: «билет» как The Evening Program в новом макете ----
   чёрная подложка, вогнутые углы, боковые вырезы, тонкая кремовая рамка.
   Контуры — из макета (assets/js/main.js строит их под высоту формы). */
.card {
  position: relative;
  margin: calc(70 * var(--u)) auto 0;
  width: calc(577 * var(--u));
  min-height: calc(825 * var(--u));
  --ink: #e9d4c3;          /* текст и линии на чёрном */
  --error: #f2a493;
  color: var(--ink);
}
.ticket {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.ticket .t-out { fill: #000; }
.ticket .t-in { fill: none; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
@supports not (vector-effect: non-scaling-stroke) { .ticket .t-in { stroke-width: 1.4; } }

/* ---- Форма ---- */
.form, .thanks {
  position: relative;
  padding: calc(105 * var(--u)) calc(70 * var(--u)) calc(230 * var(--u));
  text-align: center;
}
.fld { margin: 0; padding: 0; border: 0; min-width: 0; }
.lbl {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 12px;
  font-size: max(14px, calc(24 * var(--u)));
  line-height: 1.15;
  color: var(--ink);
  text-align: center;
}
.inp {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 4px 6px;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 16px/1.2 "Foglihten No06", "Times New Roman", serif;
  text-align: center;
  text-transform: uppercase;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .3s ease, background-color .3s ease;
}
.inp:focus { outline: none; background: rgba(233, 212, 195, .07); }
.inp[aria-invalid="true"] { border-bottom-color: var(--error); }

.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 7px 4px;
  font-size: max(14px, calc(21 * var(--u)));
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
  user-select: none;
}
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.mark {
  position: relative;
  flex: none;
  width: 11px;
  height: 11px;
  margin: 0 3px;
  border: 1.5px solid var(--ink);
  transform: rotate(45deg);
  transition: background-color .25s ease;
}
.mark::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--ink);
  transform: scale(0);
  transition: transform .25s ease;
}
.opt input:checked + .mark::after { transform: scale(1); }
.opt input:focus-visible + .mark { outline: 1.5px solid var(--ink); outline-offset: 3px; }
#drinksSet.muted .opt { opacity: .45; }

.err {
  min-height: 1.3em;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.3;
  color: var(--error);
}

.orn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(14 * var(--u));
  margin: calc(26 * var(--u)) 0 calc(34 * var(--u));
}
.orn i { width: calc(60 * var(--u)); height: max(1px, calc(1.33 * var(--u))); background: currentColor; }
.orn b { position: relative; width: calc(10 * var(--u)); height: calc(17.5 * var(--u)); }
.orn b::before { content: ""; position: absolute; left: 50%; top: 50%; width: max(3.5px, calc(5 * var(--u))); height: max(3.5px, calc(5 * var(--u))); background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }

.btn {
  position: relative;
  display: block;
  width: 100%;
  margin: calc(30 * var(--u)) 0 0;
  padding: 16px 12px 14px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: #000;
  font: max(15px, calc(24 * var(--u)))/1.1 "Foglihten No06", "Times New Roman", serif;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: inset 0 0 0 4px var(--ink), inset 0 0 0 5px #000;
  transition: opacity .3s ease, box-shadow .3s ease;
  touch-action: manipulation;
}
.btn:hover { box-shadow: inset 0 0 0 4px var(--ink), inset 0 0 0 5px #000, 0 0 18px rgba(233, 212, 195, .18); }
.btn:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.btn[disabled] { opacity: .65; cursor: progress; }

.status {
  min-height: 1.3em;
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
}
.status.is-error { color: var(--error); }

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

.thanks {
  outline: none;
  min-height: calc(700 * var(--u));
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.thanks[hidden] { display: none; }
.thanks-title {
  margin: calc(60 * var(--u)) 0 0;
  font-size: calc(46 * var(--u));
  line-height: 1.05;
}
.thanks-sign {
  margin: 0 0 calc(60 * var(--u));
  font-size: max(14px, calc(26 * var(--u)));
  line-height: 1.3;
}
html.js .thanks { animation: fadeIn 1.4s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   THE EVENING PROGRAM — карточка вылетает слева и встаёт на место макета
   ========================================================================== */
.flyin {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  will-change: transform;
}
html.js .flyin {
  transform: translate3d(calc(-760 * var(--u)), 0, 0);
  opacity: 0;
  transition: transform 1.6s cubic-bezier(.16, 1, .3, 1), opacity .7s ease;
}
html.js .flyin.in { transform: translate3d(0, 0, 0); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html.js .flyin { transform: none; opacity: 1; transition: none; }
}

/* ==========================================================================
   RSVP — пошаговый квиз внутри «билета»
   ========================================================================== */
.quiz {
  position: relative;
  padding: calc(110 * var(--u)) calc(64 * var(--u)) calc(235 * var(--u));
  text-align: center;
}
.steps {
  position: relative;
  transition: height .55s cubic-bezier(.3, .7, .2, 1);
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(420 * var(--u));
  justify-content: center;
  outline: none;
}
.step[hidden] { display: none; }
.step.is-leaving { position: absolute; left: 0; right: 0; top: 0; }
html.js .step.anim-in { animation: stepIn .7s cubic-bezier(.25, .7, .25, 1) both; }
html.js .step.anim-in.back { animation-name: stepInBack; }
html.js .step.is-leaving { animation: stepOut .38s ease both; }
@keyframes stepIn { from { opacity: 0; transform: translateX(calc(26 * var(--u))); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes stepInBack { from { opacity: 0; transform: translateX(calc(-26 * var(--u))); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes stepOut { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  html.js .step.anim-in, html.js .step.is-leaving { animation: none; }
  .steps { transition: none; }
}

.q-num {
  margin: 0 0 calc(10 * var(--u));
  font-size: max(14px, calc(26 * var(--u)));
  line-height: 1;
  letter-spacing: .12em;
  opacity: .8;
}
.q-title {
  display: block;
  margin: 0;
  padding: 0;
  font-size: max(19px, calc(40 * var(--u)));
  line-height: 1.12;
  color: var(--ink);
  text-align: center;
  width: 100%;
}
.q-title-2 { margin-top: calc(14 * var(--u)); }
.step .orn { margin: calc(26 * var(--u)) 0 calc(30 * var(--u)); }
.step .fld { width: 100%; }
.step .fld legend { margin-bottom: 0; }
.step .inp { max-width: calc(400 * var(--u)); min-width: 0; }
.inp::placeholder { color: var(--ink); opacity: .45; text-transform: uppercase; }
.step .err { text-align: center; }
.q-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: calc(400 * var(--u));
  margin-top: calc(26 * var(--u));
}
.q-actions .btn { margin: 0; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  padding: 12px 12px 10px;
  font-size: max(13px, calc(20 * var(--u)));
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink), 0 0 14px rgba(233, 212, 195, .15); }
.step-final .q-title { font-size: max(20px, calc(42 * var(--u))); }

.fly-sentinel { pointer-events: none; visibility: hidden; }

/* ---- RSVP по макету орр.pdf ---- */
.rsvp { padding-top: calc(60 * var(--u)); }
.rsvp-art { position: relative; height: calc(var(--ah) * var(--u)); }
.blk-free { margin: 0; font-weight: 400; }
.rsvp-art .ln { color: #e9d4c3; }
.fill-btn {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  transform: translate(-50%, -50%);
  padding: 4px 18px 3px;
  border: 1px solid #e9d4c3;
  background: transparent;
  color: #e9d4c3;
  font: max(13px, calc(28 * var(--u)))/1.1 "Foglihten No06", "Times New Roman", serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px #300003, inset 0 0 0 3px rgba(233, 212, 195, .55);
  transition: background-color .3s ease, color .3s ease;
}
.fill-btn::after { content: ""; position: absolute; inset: -12px -8px; }
.fill-btn:hover, .fill-btn:focus-visible { background: #e9d4c3; color: #300003; outline: none; }
.card[hidden] { display: none; }
html.js .card.opening { animation: fadeIn .8s ease both; }
.allergy-more { width: 100%; display: flex; justify-content: center; margin-top: 14px; }
.allergy-more[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ==========================================================================
   v6 — правки: рамка RSVP по центру, анкета во всплывающем окне,
   открывашка с занавесом, единая система появления текста
   ========================================================================== */

/* ---- RSVP: рамка строго по центру (секция больше не сдвигает холст внутренними отступами) ---- */
.rsvp { padding-left: 0; padding-right: 0; padding-bottom: calc(120 * var(--u)); }
.rsvp-art { width: 100%; margin: 0 auto; }
.fill-btn { white-space: nowrap; }

/* ---- Единая система анимаций текста ---- */
/* блоки текста не исчезают целиком — строки проявляются по очереди снизу вверх */
html.js .blk.rv, html.js .blk-free.rv { opacity: 1; }
html.js .rv .ln {
  opacity: 0;
  translate: 0 calc(16 * var(--u));
  transition:
    opacity 1s cubic-bezier(.25, .6, .3, 1) calc(var(--d, 0ms) + var(--i, 0) * 110ms),
    translate 1.25s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0ms) + var(--i, 0) * 110ms);
}
/* крупные заголовки — чуть больше движения и лёгкое «наведение резкости» */
html.js h1.rv .ln, html.js h2.rv .ln {
  translate: 0 calc(28 * var(--u));
  filter: blur(5px);
  transition:
    opacity 1.2s cubic-bezier(.25, .6, .3, 1) calc(var(--d, 0ms) + var(--i, 0) * 160ms),
    translate 1.5s cubic-bezier(.16, 1, .3, 1) calc(var(--d, 0ms) + var(--i, 0) * 160ms),
    filter 1.2s ease calc(var(--d, 0ms) + var(--i, 0) * 160ms);
}
html.js .rv.in .ln { opacity: 1; translate: 0 0; filter: none; }
/* изображения и декор: мягкое проявление с той же задержкой */
html.js img.rv, html.js .mapdeco.rv, html.js .fill-btn.rv { transition-delay: var(--d, 0ms); }
html.js .fill-btn.rv { opacity: 0; transition: opacity 1s ease var(--d, 0ms), background-color .3s ease, color .3s ease; }
html.js .fill-btn.rv.in { opacity: 1; }
/* имена и дата: последовательно после открытия штор */
html.js .rv-d1 { --d: 500ms; transition-delay: 500ms; }
html.js .rv-d2 { --d: 950ms; transition-delay: 950ms; }
html.js .rv-d3 { --d: 1500ms; transition-delay: 1500ms; }
/* текст программы проявляется после выезда карточки */
html.js .fly-text .ln { --d: 0ms; }
@media (prefers-reduced-motion: reduce) {
  html.js .rv .ln { opacity: 1; translate: none; filter: none; transition: none; }
  html.js .fill-btn.rv { opacity: 1; transition: none; }
}

/* ---- Открывашка: закрытый занавес + кнопка, затем шторы разъезжаются, открывая страницу ---- */
html.opening, html.opening body { overflow: hidden; height: 100%; }
.opener {
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow: hidden;
  background: transparent;
  touch-action: none;
  transition: opacity .9s ease;
}
.opener.is-fading { opacity: 0; pointer-events: none; }
.opener-poster, .opener-canvas, .opener-fallback {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: max(100vw, calc(100vh * 720 / 1278));
  height: max(100vh, calc(100vw * 1278 / 720));
  pointer-events: none;
}
@supports (height: 100svh) {
  .opener-poster, .opener-canvas, .opener-fallback {
    width: max(100vw, calc(100lvh * 720 / 1278));
    height: max(100lvh, calc(100vw * 1278 / 720));
  }
}
.opener-poster { object-fit: cover; z-index: 2; }
.opener-poster.is-hidden { visibility: hidden; }
.opener-canvas { z-index: 1; }
.opener-fallback { z-index: 1; overflow: hidden; display: none; }
.opener-fallback video { position: absolute; left: 0; top: 0; width: 200%; height: 100%; object-fit: fill; }
.opener.no-webgl .opener-fallback { display: block; }
.opener.no-webgl .opener-canvas { display: none; }
/* без JS заставка не мешает */
html:not(.js) .opener { display: none; }

.open-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  translate: -50% -50%;
  padding: 18px 30px 16px;
  border: 1px solid rgba(235, 208, 185, .85);
  background: rgba(30, 3, 3, .62);
  color: #ebd0b9;
  font: clamp(15px, 4.4vw, 21px)/1.15 "Foglihten No06", "Times New Roman", serif;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  box-shadow: inset 0 0 0 4px rgba(30, 3, 3, .62), inset 0 0 0 5px rgba(235, 208, 185, .5), 0 0 40px rgba(0, 0, 0, .45);
  animation: btnIn 1.1s cubic-bezier(.25, .6, .3, 1) .35s both;
  transition: opacity .5s ease, background-color .3s ease;
}
.open-btn .d {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  background: #ebd0b9;
  rotate: 45deg;
  translate: 0 -50%;
}
.open-btn .d1 { left: -4px; }
.open-btn .d2 { right: -4px; }
.open-btn:hover { background: rgba(48, 0, 3, .78); }
.open-btn:focus-visible { outline: 1px solid #ebd0b9; outline-offset: 5px; }
.open-btn.is-gone { animation: none; opacity: 0; pointer-events: none; }
@keyframes btnIn { from { opacity: 0; translate: -50% calc(-50% + 10px); } to { opacity: 1; translate: -50% -50%; } }

/* ---- Анкета во всплывающем окне ---- */
html.modal-open body { overflow: hidden; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 1, 1, .74);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .45s ease;
}
.modal-panel {
  position: relative;
  opacity: 0;
  scale: .94;
  transition: opacity .5s cubic-bezier(.25, .6, .3, 1), scale .6s cubic-bezier(.2, .8, .2, 1);
}
.modal.is-open .modal-backdrop { opacity: 1; }
.modal.is-open .modal-panel { opacity: 1; scale: 1; }

/* рамка из «рамка.pdf»: 1158.6 × 802.1, на вертикальном экране поворачивается на 90°, пропорции сохраняются */
.qframe {
  --ratio: 1.4444;
  --fw: min(94vw, 720px, calc(88vh * var(--ratio)));
  --fh: calc(var(--fw) / var(--ratio));
  position: relative;
  width: var(--fw);
  height: var(--fh);
  background: #300003;
  color: #e9d4c3;
  --ink: #e9d4c3;
  --error: #f2a493;
  container-type: inline-size;
}
.qframe-art {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--fw);
  height: var(--fh);
  translate: -50% -50%;
  pointer-events: none;
  user-select: none;
}
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .qframe {
    --fw: min(94vw, 480px, calc(86vh / var(--ratio)));
    --fh: calc(var(--fw) * var(--ratio));
  }
  @supports (height: 100svh) { .qframe { --fw: min(94vw, 480px, calc(86svh / var(--ratio))); } }
  .qframe-art { width: var(--fh); height: var(--fw); rotate: 90deg; }
}
/* содержимое — внутри овала (вписанный прямоугольник ≈ 0.66 × 0.66) */
.quiz {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 64%;
  height: 66%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden auto;
  scrollbar-width: none;
}
.quiz::-webkit-scrollbar { display: none; }
.qframe .steps { width: 100%; margin: auto 0; }
.qframe .step { min-height: 0; }
.qframe .q-title { font-size: clamp(16px, 5.6cqw, 30px); line-height: 1.12; }
.qframe .q-title-2 { margin-top: .45em; }
.qframe .step .orn { margin: clamp(10px, 3cqw, 18px) 0 clamp(10px, 3.4cqw, 20px); }
.qframe .orn i { width: clamp(28px, 8cqw, 52px); height: 1px; }
.qframe .orn b { width: 10px; height: 14px; }
.qframe .orn b::before { width: 5px; height: 5px; }
.qframe .opts { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.qframe .opt { font-size: clamp(15px, 4.4cqw, 22px); padding: 5px 4px; }
.qframe .inp { font-size: 16px; max-width: 100%; }
.qframe .allergy-more { margin-top: 8px; }
.qframe .err { min-height: 1.1em; margin-top: 4px; font-size: 12px; }
.qframe .status { margin-top: 8px; font-size: 12px; min-height: 0; }
.qframe .q-actions { max-width: 100%; margin-top: clamp(8px, 2.6cqw, 16px); gap: 8px; }
.qframe .btn {
  padding: 11px 10px 9px;
  font-size: clamp(14px, 4cqw, 19px);
  color: #300003;
  box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 4px #300003;
}
.qframe .btn-ghost { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1px var(--ink); font-size: clamp(13px, 3.5cqw, 17px); }
.qframe .step-final .q-title { font-size: clamp(17px, 6cqw, 32px); }
.modal-close {
  position: absolute;
  z-index: 3;
  right: -4px;
  top: -44px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(233, 212, 195, .7);
  background: rgba(48, 0, 3, .85);
  color: #e9d4c3;
  font: 26px/1 "Times New Roman", serif;
  cursor: pointer;
}
.modal-close:focus-visible { outline: 1px solid #e9d4c3; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal-panel { transition: none; }
}
#hero p.rv:not(.rv-hero) { --d: 1700ms; }

/* ==========================================================================
   v7 — читаемая карточка программы, поле аллергии, интервалы в анкете
   ========================================================================== */
/* карточка программы: контуры из макета (SVG), живой текст крупнее и с интервалами */
.pcard {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  rotate: -2.7677deg;
  color: #e9d4c3;
  text-align: center;
}
.pcard-bg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pcard-bg .o { fill: #000; }
.pcard-bg .i { fill: none; stroke: #e9d4c3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pcard-in { position: relative; display: flex; flex-direction: column; align-items: center; }
.pg { display: block; height: calc(var(--lh) * var(--u)); width: 100%; position: relative; }
.pl {
  display: block;
  font-size: calc(var(--fs) * var(--u));
  line-height: calc(var(--lh) * var(--u));
  height: calc(var(--lh) * var(--u));
  white-space: nowrap;
}
.pl-title { letter-spacing: 0; }
.pl-event { display: flex; align-items: center; justify-content: center; gap: calc(16 * var(--u)); }
.pdash { display: inline-block; width: calc(64 * var(--u)); height: max(1px, calc(1.4 * var(--u))); background: currentColor; }
.pd b {
  position: absolute; left: 50%; top: 50%;
  width: max(5px, calc(9 * var(--u))); height: max(5px, calc(9 * var(--u)));
  background: #e9d4c3; translate: -50% -50%; rotate: 45deg;
}
/* появление строк карточки — та же система, что у остального текста */
html.js .pcard .rv { opacity: 0; translate: 0 calc(14 * var(--u)); transition: opacity 1s cubic-bezier(.25, .6, .3, 1) calc(var(--i, 0) * 90ms), translate 1.2s cubic-bezier(.2, .7, .2, 1) calc(var(--i, 0) * 90ms); }
html.js .pcard .rv.in { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) { html.js .pcard .rv { opacity: 1; translate: none; transition: none; } }

/* анкета: больше воздуха между строками */
.qframe .q-title { line-height: 1.3; }
.qframe .opt { line-height: 1.35; padding: 7px 4px; }
.qframe .opts { gap: 4px; }
/* поле аллергии: плавное раскрытие без скачка */
.allergy-more {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  width: 100%;
  margin-top: 0;
  transition: grid-template-rows .5s cubic-bezier(.3, .7, .2, 1), opacity .45s ease, margin-top .5s ease;
}
.allergy-more.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: 10px; }
.allergy-inner { overflow: hidden; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.allergy-hint {
  display: block;
  font-size: clamp(12px, 3.3cqw, 16px);
  line-height: 1.45;
  text-align: center;
  opacity: .92;
}
.allergy-more .inp { width: 100%; }
@media (prefers-reduced-motion: reduce) { .allergy-more { transition: none; } }

/* кнопки анкеты в один ряд: «Назад» слева, основное действие справа — всё помещается в овал */
.qframe .q-actions { flex-direction: row-reverse; align-items: stretch; }
.qframe .q-actions .btn { flex: 1 1 0; min-width: 0; padding: 11px 6px 9px; font-size: clamp(13px, 3.7cqw, 18px); letter-spacing: .02em; }
.qframe .q-actions .btn-ghost { font-size: clamp(12px, 3.3cqw, 16px); }

/* ==========================================================================
   v8 — десктоп: шире колонка + театральная сцена по бокам (на телефоне без изменений)
   ========================================================================== */
:root { --colw: 520px; }
.page { width: min(100%, var(--colw)); position: relative; z-index: 1; }
@supports not (width: 1cqw) { .page { --u: calc(min(100vw, var(--colw)) / 781); } }
@media (min-width: 900px) {
  :root { --colw: 600px; }
  /* занавес из заставки по бокам, приглушённый, неподвижный */
  html::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
      linear-gradient(90deg, rgba(14, 1, 1, .78) 0%, rgba(14, 1, 1, .45) 30%, rgba(14, 1, 1, .45) 70%, rgba(14, 1, 1, .78) 100%),
      url("../../assets/video/curtain-poster.jpg") center top / auto 100% repeat-x;
    pointer-events: none;
  }
  /* ар-деко рамка вдоль колонки: двойные линии и ромбы */
  html::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    left: 50%;
    width: calc(var(--colw) + 44px);
    translate: -50% 0;
    z-index: 0;
    pointer-events: none;
    border-left: 3px double rgba(235, 208, 185, .45);
    border-right: 3px double rgba(235, 208, 185, .45);
    background:
      linear-gradient(45deg, transparent 46%, rgba(235, 208, 185, .55) 46% 54%, transparent 54%) left -6px top 50% / 12px 12px no-repeat,
      linear-gradient(45deg, transparent 46%, rgba(235, 208, 185, .55) 46% 54%, transparent 54%) right -6px top 50% / 12px 12px no-repeat;
  }
  html, body { background: #120202; }
  .page { box-shadow: 0 0 80px rgba(0, 0, 0, .7), 0 0 0 1px rgba(235, 208, 185, .12); }
}
@media (min-width: 1300px) { :root { --colw: 640px; } }

/* ==========================================================================
   v9 — текстура мятой бумаги поверх всего приглашения (не заставки), режим Color Burn
   ========================================================================== */
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: url("../img/paper-overlay.webp?v=13") center top / 100% auto repeat-y;
  mix-blend-mode: color-burn;
}

/* v10 — та же текстура бумаги на окне анкеты (рамка и вопросы), режим Color Burn */
.qframe { isolation: isolate; }
.qframe::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: url("../img/paper-overlay.webp?v=13") center / cover no-repeat;
  mix-blend-mode: color-burn;
}

/* v11 — карточка программы: готовая картинка, наклон как раньше; текстура со страницы убрана */
.pcard-img { rotate: -2.7677deg; }
.page::after { content: none; display: none; }

/* ==========================================================================
   v12 — листалка образов под дресс-кодом (свайп по горизонтали)
   ========================================================================== */
.lookbook {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  margin: 0;
  z-index: 2;
}
.lb-track {
  display: flex;
  width: 100%;
  height: calc(var(--ih) * var(--u));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  outline: none;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: center; scroll-snap-stop: always; }
.lb-slide img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.lb-arrow {
  position: absolute;
  top: calc(var(--ih) / 2 * var(--u));
  translate: 0 -50%;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(235, 208, 185, .75);
  border-radius: 50%;
  background: rgba(48, 0, 3, .62);
  color: #ebd0b9;
  font: 26px/1 "Times New Roman", serif;
  cursor: pointer;
  transition: opacity .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.lb-arrow span { position: relative; top: -2px; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-arrow[disabled] { opacity: 0; pointer-events: none; }
.lb-dots {
  position: absolute;
  left: 50%;
  bottom: calc(14 * var(--u));
  translate: -50% 0;
  display: flex;
  gap: 18px;
}
.lb-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid #ebd0b9;
  background: transparent;
  rotate: 45deg;
  cursor: pointer;
  transition: background-color .3s ease;
}
.lb-dot::after { content: ""; position: absolute; inset: -10px; }
.lb-dot { position: relative; }
.lb-dot.is-on { background: #ebd0b9; }
@media (prefers-reduced-motion: reduce) { .lb-track { scroll-behavior: auto; } }

/* v17: образы друг под другом, без листалки */
.lb-stack .lb-track {
  flex-direction: column;
  gap: calc(var(--lg) * var(--u));
  height: auto;
  overflow: visible;
  scroll-snap-type: none;
}
.lb-stack .lb-slide { flex: none; width: 100%; height: calc(var(--ih) * var(--u)); }

/* v13: картинки образов открываются крупно */
.lb-slide { position: relative; cursor: zoom-in; outline: none; }
html.zoom-open, html.zoom-open body { overflow: hidden; }
.zoom {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(22, 0, 2, .95);
  opacity: 0;
  transition: opacity .28s ease;
  overscroll-behavior: contain;
}
.zoom[hidden] { display: none; }
.zoom.is-open { opacity: 1; }
.zoom-pan {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.zoom-pan::-webkit-scrollbar { display: none; }
.zoom-img {
  margin: auto;
  flex: none;
  max-width: none;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  transform: scale(.94);
  transition: transform .28s ease;
}
.zoom.is-open .zoom-img { transform: none; }
.zoom.is-zoomed .zoom-img { cursor: zoom-out; }
.zoom-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(235, 208, 185, .75);
  border-radius: 50%;
  background: rgba(48, 0, 3, .7);
  color: #ebd0b9;
  font: 30px/1 "Times New Roman", serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.zoom-close span { position: relative; top: -2px; }
.zoom .lb-arrow { top: 50%; }
.zoom-prev { left: 10px; }
.zoom-next { right: 10px; }
.zoom.is-zoomed .lb-arrow, .zoom.is-zoomed .zoom-hint { opacity: 0; pointer-events: none; }
.zoom-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(18px, env(safe-area-inset-bottom));
  margin: 0;
  padding: 0 16px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
  color: rgba(235, 208, 185, .8);
  pointer-events: none;
  transition: opacity .3s ease;
}
@media (prefers-reduced-motion: reduce) { .zoom, .zoom-img { transition: none; } }