/* =========================================================
   Вера & Марк — Комо, 2027 · style.css
   tokens → base → intro / envelope → nav / menu / cursor → garden (hero, venue, portal, program) →
   dress → details → finale (reply, footer) → responsive → reduced motion / no-js
   ========================================================= */

/* ---------- 1 · tokens ---------- */
:root {
  /* бумага и стол */
  --paper: #EEE5DA;
  --paper-2: #E4D9CB;
  --table: #D9CDBA;
  --night: #133359;

  /* текст */
  --ink: #221F1A;
  --ink-muted: rgba(34, 31, 26, .6);
  --ink-faint: rgba(34, 31, 26, .38);
  --line: rgba(34, 31, 26, .16);
  --cream: #FBF7EF;
  --cream-muted: rgba(251, 247, 239, .72);
  --line-cream: rgba(251, 247, 239, .24);
  --ink-line: #2F3A2B;

  /* акценты */
  --wax: #621513;
  --wax-hi: #8C2A24;
  --wax-deep: #2A0806;
  --gold-1: #8C6B36;
  --gold-2: #D9C08A;
  --gold-3: #F4E6BE;
  --foil: linear-gradient(110deg, #8C6B36 0%, #C9A866 20%, #F4E6BE 34%, #D9C08A 46%, #8C6B36 62%, #B8955A 80%, #F0DFAE 100%);

  /* дресс-код (пипеткой, 🛠) */
  --sw-sage: #A0A790;
  --sw-olive: #46462C;
  --sw-linen: #C2AF96;
  --sw-rose: #A87F79;
  --sw-midnight: #19202F;

  /* геометрия */
  --gutter: clamp(16px, 3vw + 8px, 64px);
  --max: 1560px;
  --nav-h: 68px;
  --nav-y: 24px;
  --radius-paper: 2px;
  --radius-pill: 999px;
  --deckle: 5px;

  /* конверт и печатная зона — main.js пишет px (раздел 5) */
  --env-w: min(52vw, 820px, 93svh);
  --env-h: calc(var(--env-w) / 1.5);
  --flap-apex: .56;
  --seal-d: 128px;
  --seal-img: calc(var(--seal-d) / .733);
  --print-w: 100vw;
  --print-h: 100svh;
  --print-x: 0px;
  --print-y: 0px;

  /* тени бумаги */
  --shadow-paper: 0 1px 1px rgba(40, 30, 20, .08), 0 6px 14px -6px rgba(40, 30, 20, .18), 0 28px 60px -24px rgba(40, 30, 20, .38);
  --shadow-lift: 0 2px 2px rgba(40, 30, 20, .06), 0 18px 30px -10px rgba(40, 30, 20, .22), 0 60px 90px -30px rgba(40, 30, 20, .42);

  /* кривые */
  --ease-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-quint: cubic-bezier(.22, 1, .36, 1);
  --ease-quart: cubic-bezier(.25, 1, .5, 1);
  --ease-inout: cubic-bezier(.76, 0, .24, 1);
  --ease-paper: cubic-bezier(.6, .05, .25, 1);
  --ease-fly: cubic-bezier(.7, 0, .2, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --vh: 1vh;
  --foil-x: 50%;

  --f-display: "Cormorant", "Times New Roman", serif;
  --f-text: "Cormorant Garamond", "Times New Roman", serif;
  --f-ui: "Manrope", system-ui, -apple-system, sans-serif;

  /* типографика по брейкпоинтам (раздел 5): 320 → 390 → 768 → 1440 → 1920, между якорями — линейно */
  --kick: 10px;
  --h2v: 36px;  --h2d: 40px;  --h2f: 40px;  --cnt: 44px;
  --clk: 76px;  --cht: 30px;  --chx: 16px;
  --txt: 16px;  --itt: 28px;  --itx: 17px;
  --sw: 34vw;   --fan-s: 10deg;  --fan-r: 1.6;
}
@media (min-width: 360px) {
  :root {
    --h2v: calc(42px + 18 * (100vw - 390px) / 378);
    --h2d: calc(48px + 24 * (100vw - 390px) / 378);
    --h2f: calc(48px + 28 * (100vw - 390px) / 378);
    --cnt: calc(52px + 32 * (100vw - 390px) / 378);
    --clk: calc(92px + 48 * (100vw - 390px) / 378);
    --cht: calc(34px + 10 * (100vw - 390px) / 378);
    --chx: calc(17px + 2 * (100vw - 390px) / 378);
    --txt: calc(17px + 2 * (100vw - 390px) / 378);
    --itt: calc(30px + 8 * (100vw - 390px) / 378);
    --itx: calc(18px + 1 * (100vw - 390px) / 378);
  }
}
@media (min-width: 768px) {
  :root {
    --kick: 11px;
    --h2v: calc(60px + 12 * (100vw - 768px) / 672);
    --h2d: calc(72px + 24 * (100vw - 768px) / 672);
    --h2f: calc(76px + 28 * (100vw - 768px) / 672);
    --cnt: calc(84px + 28 * (100vw - 768px) / 672);
    --clk: calc(140px + 36 * (100vw - 768px) / 672);
    --cht: calc(44px + 8 * (100vw - 768px) / 672);
    --chx: calc(19px + 1 * (100vw - 768px) / 672);
    --txt: calc(19px + 1 * (100vw - 768px) / 672);
    --itt: calc(38px + 6 * (100vw - 768px) / 672);
    --itx: calc(19px + 1 * (100vw - 768px) / 672);
    --sw: 24vw; --fan-s: 12deg; --fan-r: 1.8;
  }
}
@media (min-width: 1200px) {
  :root { --sw: 15vw; --fan-s: 14deg; --fan-r: 2; }
}
@media (min-width: 1440px) {
  :root {
    --kick: min(12px, calc(11px + (100vw - 1440px) / 480));
    --h2v: min(88px, calc(72px + 16 * (100vw - 1440px) / 480));
    --h2d: min(120px, calc(96px + 24 * (100vw - 1440px) / 480));
    --h2f: min(132px, calc(104px + 28 * (100vw - 1440px) / 480));
    --cnt: min(136px, calc(112px + 24 * (100vw - 1440px) / 480));
    --clk: min(216px, calc(176px + 40 * (100vw - 1440px) / 480));
    --cht: min(60px, calc(52px + 8 * (100vw - 1440px) / 480));
    --chx: min(22px, calc(20px + 2 * (100vw - 1440px) / 480));
    --txt: min(22px, calc(20px + 2 * (100vw - 1440px) / 480));
    --itt: min(52px, calc(44px + 8 * (100vw - 1440px) / 480));
    --itx: min(22px, calc(20px + 2 * (100vw - 1440px) / 480));
    --sw: min(15vw, 13.5vw + 22px);
  }
}
/* nav: gutter / y / height — 320: 18/12/48 · 390: 20/16/52 · 768: 31/20/60 · 1440: 51/24/68 · 1920: 64/28/76 */
:root { --nav-y: 12px; --nav-h: 48px; }
@media (min-width: 360px)  { :root { --nav-y: 16px; --nav-h: 52px; } }
@media (min-width: 768px)  { :root { --nav-y: 20px; --nav-h: 60px; } }
@media (min-width: 1200px) { :root { --nav-y: 24px; --nav-h: 68px; } }
@media (min-width: 1800px) { :root { --nav-y: 28px; --nav-h: 76px; } }
/* short landscape (844×390) */
@media (orientation: landscape) and (max-height: 500px) {
  :root {
    --nav-y: 8px; --nav-h: 44px; --kick: 9px;
    --h2v: 36px; --h2d: 44px; --h2f: 44px; --cnt: 48px; --clk: 72px; --cht: 28px; --chx: 15px;
    --txt: 15px; --itt: 28px; --itx: 16px; --sw: 20svh; --fan-s: 12deg; --fan-r: 1.8;
  }
}

/* ---------- 2 · base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
  scrollbar-gutter: stable;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
body {
  margin: 0;
  min-height: 100svh;
  overflow-x: clip;
  color: var(--ink);
  background: var(--paper) url(media/paper.webp) 0 0 / 512px repeat;
  font-family: var(--f-text);
  font-weight: 500;
  font-size: var(--txt);
  line-height: 1.45;
  font-synthesis: none;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: none; }
p, h1, h2, h3, ol, figure { margin: 0; padding: 0; }
ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-style: italic; }
::selection { background: rgba(98, 21, 19, .18); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.paper-sheet { background: var(--paper) url(media/paper.webp) 0 0 / 512px repeat; }

.skip {
  position: fixed; z-index: 100; top: 12px; left: 12px;
  padding: 12px 18px; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--paper);
  font: 600 11px/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase;
  transform: translateY(-160%); transition: transform .4s var(--ease-expo);
}
.skip:focus-visible { transform: none; outline-color: var(--ink); }

/* type roles */
.kicker {
  font: 500 var(--kick)/1.3 var(--f-ui);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.h2 {
  font: 300 var(--h2d)/1 var(--f-display);
  letter-spacing: -.01em;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55), 0 -1px 0 rgba(0, 0, 0, .05);
  text-wrap: balance;
}
.h2 em { font-weight: 400; }
.ln { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.ln > span { display: inline-block; }

/* foil: gradient clipped to glyphs; --foil-x follows the pointer (main.js), touch — slow auto shimmer */
.foil {
  background: var(--foil);
  background-size: 300% 100%;
  background-position: var(--foil-x) 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .5)) drop-shadow(0 -.5px 0 rgba(90, 60, 20, .3));
}
@media (hover: none) {
  .foil { animation: foil-auto 7s ease-in-out infinite alternate; }
}
@keyframes foil-auto { from { background-position: 20% 0; } to { background-position: 80% 0; } }

/* underline 8.2 */
.u-link { position: relative; }
.u-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease-expo);
}
@media (hover: hover) { .u-link:hover::after { transform: scaleX(1); transform-origin: left; } }
.u-link:focus-visible::after { transform: scaleX(1); transform-origin: left; }

/* pill + wipe 8.2 */
.pill {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 26px; border-radius: var(--radius-pill);
  border: 1px solid currentColor; overflow: hidden; isolation: isolate;
  font: 600 11px/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink);
  transition: color .4s var(--ease-quint), border-color .4s var(--ease-quint);
}
.pill::before {
  content: ''; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: var(--ink); transform: translateY(101%);
  transition: transform .4s var(--ease-quint);
}
.pill > span { display: inline-flex; gap: .5em; align-items: center; }
.pill i { font-style: normal; }
@media (hover: hover) {
  .pill:hover { color: var(--paper); }
  .pill:hover::before { transform: none; }
}
.pill:focus-visible { color: var(--paper); outline-color: var(--ink); }
.pill:focus-visible::before { transform: none; }
.pill--ghost { border-color: var(--line); }

/* ---------- 3 · intro: the table and the envelope ---------- */
.intro {
  position: fixed; inset: 0; z-index: 80;
  overflow: hidden;
  touch-action: none;
}
html:not(.js) .intro, html.no-intro .intro { display: none; }
.intro__table { position: absolute; inset: 0; pointer-events: none; background: var(--table); }
html.intro .hero__print { visibility: hidden; }
html.intro:not(.from-work):not(.rm) .env[data-mode="intro"] .env__pos { opacity: 0; }
.env__tilt { transform: rotate(-2deg); }
.tbl, .tbl img { position: absolute; inset: 0; width: 100%; height: 100%; }
.tbl img { object-fit: cover; object-position: 50% 50%; }
.tbl--sharp { opacity: 0; transition: opacity .4s var(--ease-quint); }
.tbl--sharp.is-in { opacity: 1; }
html.from-work .tbl--sharp { opacity: 1; transition: none; }
.tbl--blur { opacity: 0; }
@media (orientation: portrait) {
  .tbl img, .finale__bg img { object-position: 0% 50%; }
}

/* envelope — sizes from main.js (px). pos → tilt → flip: GSAP drives each wrapper separately */
.env {
  position: absolute; left: 50%; top: 50%;
  width: var(--env-w); height: var(--env-h);
  margin: calc(var(--env-h) / -2) 0 0 calc(var(--env-w) / -2);
  pointer-events: none;
}
.env__pos, .env__tilt, .env__flip { position: absolute; inset: 0; }
.env__tilt { perspective: 1800px; }
.env__flip { transform-style: preserve-3d; }
.env__flip.is-flat { transform-style: flat; }

/* the envelope's cast shadow on the table: two ready shadows crossfade (lifted → resting), never an animated box-shadow */
.env__shade { position: absolute; inset: 0; }
.env__shade i { position: absolute; inset: 0; border-radius: var(--radius-paper); }
.env__shade-lift { box-shadow: var(--shadow-lift); opacity: 0; }
.env__shade-rest { box-shadow: var(--shadow-paper); }

.env__front, .env__back {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.env__front {
  border-radius: var(--radius-paper);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 38%, rgba(70, 50, 30, .05) 100%),
    var(--paper) url(media/paper.webp) 0 0 / 512px repeat;
  box-shadow: inset 0 0 0 .5px rgba(70, 50, 30, .16), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(70, 50, 30, .06);
}
.front__copy {
  position: absolute; left: 0; right: 0; top: 50%;
  display: flex; flex-direction: column; align-items: center;
  transform: translateY(-50%);
  text-align: center;
}
.front__title {
  font: italic 400 calc(var(--env-w) * .046 + 1px)/1 var(--f-display);
  font-size: clamp(24px, calc(var(--env-w) * .042 + 3px), 34px);
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55), 0 -1px 0 rgba(0, 0, 0, .05);
}
.front__names {
  margin-top: 14px;
  font: 500 10px/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-muted);
}
.front__load {
  position: relative; display: block; margin-top: 22px;
  width: calc(var(--env-w) * .38); height: 1px;
  background: rgba(140, 107, 54, .16);
}
.front__load i {
  position: absolute; inset: 0; background: var(--gold-2);
  transform: scaleX(0); transform-origin: left;
}
.front__title, .front__names, .front__load { opacity: 0; }

.postmark {
  position: absolute; top: 6%; right: 5%;
  width: calc(var(--env-w) * .22 * 230 / 108); height: auto;
  color: var(--ink); opacity: 0;
  mix-blend-mode: multiply;
  overflow: visible;
}
.postmark text { font: 500 7.2px var(--f-ui); letter-spacing: .12em; fill: currentColor; }
.postmark .postmark__mid { font: italic 400 15px var(--f-display); letter-spacing: 0; }
.postmark__waves { fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; }

/* back: wall (liner) → card → pocket → flap shadow → flap → seal */
.env__back {
  transform: rotateY(180deg);
  perspective: 1400px; perspective-origin: 50% 0;
}
.env__back.is-front { transform: none; }
.env__wall {
  position: absolute; inset: 1px; z-index: 1;
  background:
    linear-gradient(to bottom, rgba(34, 31, 26, .35), rgba(34, 31, 26, 0) 60%),
    url(media/liner.webp) 50% 50% / cover;
}
.env__slot { position: absolute; inset: 0; z-index: 2; }
.env__pocket {
  position: absolute; inset: 0; z-index: 3;
  background:
    linear-gradient(to bottom, rgba(70, 50, 30, .05), rgba(255, 255, 255, .08) 45%, rgba(70, 50, 30, .04)),
    var(--paper) url(media/paper.webp) 0 0 / 512px repeat;
  clip-path: var(--pocket-clip);
}
.env__seams { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.seam { fill: none; stroke-linecap: round; }
.seam--dark { stroke: rgba(40, 30, 20, .12); stroke-width: 1; }
.seam--light { stroke: rgba(255, 255, 255, .5); stroke-width: 1; }
.seam--edge { stroke: rgba(255, 255, 255, .85); stroke-width: 1.6; }
.env__inner { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.inner__ao { fill: none; stroke: rgba(30, 20, 10, .28); stroke-width: 2.4; transform: translateY(-1.4px); }
.shard__edge, .seal__crack {
  -webkit-mask: url(media/seal.webp) 0 0 / 100% 100% no-repeat;
  mask: url(media/seal.webp) 0 0 / 100% 100% no-repeat;
}
.shard__edge { position: absolute; inset: 0; width: 100%; height: 100%; }
.crumb { filter: brightness(.78) saturate(1.1); }

.env__flap-shadow {
  position: absolute; left: 0; top: 0; z-index: 4;
  width: 100%; height: calc(var(--env-h) * var(--flap-apex) + 8px);
  filter: blur(4px);
  opacity: .28;
  pointer-events: none;
  transform-origin: 50% 0;
}
.env__flap-shadow::before {
  content: ''; position: absolute; inset: 3px 0 0;
  background: rgb(40, 28, 16);
  clip-path: var(--flap-clip);
}
.env__flap {
  position: absolute; left: 0; top: 0; z-index: 5;
  width: 100%; height: calc(var(--env-h) * var(--flap-apex));
  transform-origin: 50% 0;
  transform: rotateX(var(--flap, 0deg));
  transform-style: preserve-3d;
}
.env__flap.is-under { z-index: 0; }
.flap__out, .flap__in {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  clip-path: var(--flap-clip);
}
.flap__out {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .05), rgba(0, 0, 0, 0) 30%),
    linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 50%),
    var(--paper) url(media/paper.webp) 0 0 / 512px repeat;
}
.flap__dim { position: absolute; inset: 0; background: #1E150C; opacity: var(--flap-dim, 0); }
.flap__in {
  transform: rotateY(180deg);
  background:
    linear-gradient(to top, rgba(34, 31, 26, .28), rgba(34, 31, 26, 0) 55%),
    url(media/liner.webp) 50% 0 / cover;
}

/* the card — a clone of .hero__print laid out at print-zone size and scaled into the envelope */
.card {
  position: absolute; left: 0; top: 0;
  width: var(--print-w); height: var(--print-h);
  container-type: size;
  text-align: center;
  color: var(--ink);
  transform-origin: 0 0;
  background: var(--paper) url(media/paper.webp) 0 0 / 512px repeat;
  -webkit-mask: var(--card-mask) 0 0 / 100% 100% no-repeat;
  mask: var(--card-mask) 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}
.card-shade {
  position: absolute; left: 0; top: 0;
  width: var(--print-w); height: var(--print-h);
  transform-origin: 0 0;
  border-radius: 2px;
  box-shadow: 0 2px 3px rgba(40, 30, 20, .1), 0 30px 60px -20px rgba(40, 30, 20, .35);
  pointer-events: none;
}
.card.is-flying, .card-shade.is-flying { position: fixed; z-index: 5; }

/* seal: button = the wax circle, the photo is larger (wax is 73.3% of the frame) */
.seal {
  position: absolute; z-index: 6;
  left: calc(50% - var(--seal-d) / 2);
  top: calc(var(--env-h) * var(--flap-apex) - var(--seal-d) / 2);
  width: var(--seal-d); height: var(--seal-d);
  border-radius: 50%;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  outline-offset: 6px;
}
.seal__img {
  position: absolute; left: 50%; top: 50%;
  width: var(--seal-img); height: var(--seal-img);
  margin: calc(var(--seal-img) / -2) 0 0 calc(var(--seal-img) / -2);
  filter: drop-shadow(0 1px 1px rgba(40, 10, 10, .35)) drop-shadow(0 5px 7px rgba(40, 10, 10, .22));
  transition: transform .12s var(--ease-quint), filter .12s var(--ease-quint);
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
  pointer-events: none;
}
.seal.is-breathing .seal__img { animation: seal-breathe 2.8s ease-in-out infinite; }
.seal.is-press .seal__img {
  animation: none;
  transform: scale(.96);
  filter: drop-shadow(0 .5px .5px rgba(40, 10, 10, .4)) drop-shadow(0 2px 3px rgba(40, 10, 10, .22));
}
@keyframes seal-breathe { 50% { transform: scale(1.012); } }
.seal:focus-visible { outline: 2px solid var(--ink); border-radius: 50%; }
.seal__crack {
  position: absolute; left: 50%; top: 50%;
  width: var(--seal-img); height: var(--seal-img);
  margin: calc(var(--seal-img) / -2) 0 0 calc(var(--seal-img) / -2);
  pointer-events: none;
}
.crack { fill: none; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.crack--deep { stroke: var(--wax-deep); stroke-width: 1.4px; }
.crack--hi { stroke: var(--wax-hi); stroke-width: 1.2px; transform: translate(.8px, .8px); }
.halo {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--seal-d) + 24px); height: calc(var(--seal-d) + 24px);
  margin: calc(var(--seal-d) / -2 - 12px) 0 0 calc(var(--seal-d) / -2 - 12px);
  overflow: visible; pointer-events: none; opacity: 0;
}
.halo circle { fill: none; stroke: var(--gold-2); stroke-width: 1px; }
.halo__ring { transform-origin: 50% 50%; transform: rotate(-90deg); }
.halo__glow { opacity: 0; transform-origin: 50% 50%; }
.halo.is-ready .halo__glow { animation: halo-pulse 2.8s var(--ease-quint) infinite; }
@keyframes halo-pulse { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(1.06); opacity: 0; } }

/* seal halves and crumbs live on the table plane */
.intro__debris { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.shard {
  position: absolute; left: 0; top: 0;
  pointer-events: none;
  will-change: transform, filter;
}
.shard img { width: 100%; height: 100%; }
.crumb { position: absolute; left: 0; top: 0; background: url(media/seal.webp) no-repeat; pointer-events: none; }

.intro__hint {
  position: absolute; z-index: 4; left: 0; right: 0;
  top: calc(50% + var(--env-h) / 2 + 30px);
  text-align: center;
  font: 500 10px/1.3 var(--f-ui); letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0; pointer-events: none;
}
/* portrait: under the envelope lie the ribbon and the flowers — the hint goes onto the envelope's bottom flap instead
   (at .86 H the flap is .67 W wide, the line needs ≈ .55 W) */
@media (orientation: portrait) { .intro__hint { top: calc(50% + var(--env-h) * .36 - 6px); } }
.hint--touch { display: none; }
@media (hover: none) { .hint--fine { display: none; } .hint--touch { display: inline; } }
.intro__skip {
  position: absolute; z-index: 4;
  right: var(--gutter); bottom: calc(var(--gutter) * .6 + var(--safe-b));
  min-height: 44px; padding: 0 4px;
  font: 500 10px/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-faint);
  opacity: 0; pointer-events: none;
  transition: opacity .6s ease, color .3s ease;
}
.intro__skip.is-on { opacity: .6; pointer-events: auto; }
@media (hover: hover) { .intro__skip.is-on:hover { opacity: 1; color: var(--ink); } }

/* olive shadows through multiply (no isolation / transform / filter on the shared ancestors).
   On the table they lie under the paper: .intro__shadows sits between the table and the envelope,
   .finale__shadows between the table and the reply card / footer. Only the hero sheet gets them on top. */
.shadows, .finale__shadows, .intro__shadows {
  position: fixed; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
  mix-blend-mode: multiply;
  pointer-events: none;
  opacity: 0;
}
.shadows { z-index: 25; }
.intro__shadows { position: absolute; }
@media (orientation: portrait) { .shadows, .finale__shadows, .intro__shadows { object-position: 18% 30%; } }

/* ---------- 4 · nav, menu, cursor ---------- */
.nav {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  height: calc(var(--nav-h) + max(var(--nav-y), var(--safe-t)));
  padding: max(var(--nav-y), var(--safe-t)) var(--gutter) 0;
  color: var(--ink);
  pointer-events: none;
  transition: color .5s var(--ease-quint), transform .4s var(--ease-inout);
}
.nav > * { pointer-events: auto; }
/* over the busy travertine (reply section) a soft stone-coloured veil keeps the links readable */
.nav::before {
  content: ''; position: absolute; inset: 0 0 -48px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgb(217 205 186 / .94) 0%, rgb(217 205 186 / .78) 55%, rgb(217 205 186 / 0) 100%);
  opacity: 0; transition: opacity .5s var(--ease-quint);
}
.nav[data-bg="table"]::before { opacity: 1; }
.nav.is-hidden { transform: translateY(-110%); }
.nav.is-shown { transition: color .5s var(--ease-quint), transform .6s var(--ease-expo); }
.nav[data-tone="cream"] { color: var(--cream); }
html.intro .nav { visibility: hidden; opacity: 0; }
.nav__mono {
  font: italic 400 24px/1 var(--f-display);
  letter-spacing: .01em;
  padding: 10px 0;
}
.nav__links {
  position: absolute; left: 50%; top: calc(max(var(--nav-y), var(--safe-t)) + var(--nav-h) / 2);
  display: none; gap: 40px;
  transform: translate(-50%, -50%);
  font: 500 11px/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase;
}
.nav__links a { padding: 8px 0; }
.pill--nav { height: 40px; padding: 0 22px; color: inherit; }
.nav[data-tone="cream"] .pill--nav::before { background: var(--cream); }
@media (hover: hover) { .nav[data-tone="cream"] .pill--nav:hover { color: var(--ink); } }
.burger {
  display: grid; place-content: center; gap: 6px;
  width: 44px; height: 44px; margin-right: -11px;
}
.burger i { display: block; width: 22px; height: 1.5px; background: currentColor; }
@media (min-width: 1024px) {
  .nav__links { display: flex; }
  .burger { display: none; }
}
@media (max-width: 1023px) { .pill--nav { display: none; } }

.menu { position: fixed; inset: 0; z-index: 50; }
.menu__sheet {
  position: absolute; inset: 0 0 auto;
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding: calc(max(var(--nav-y), var(--safe-t)) + var(--nav-h) + 40px) var(--gutter) calc(32px + var(--safe-b));
  background: var(--paper) url(media/paper.webp) 0 0 / 512px repeat;
  -webkit-mask: linear-gradient(#000, #000) 0 0 / 100% calc(100% - 22px) no-repeat, var(--torn-down) 0 100% / 2048px 24px repeat-x;
  mask: linear-gradient(#000, #000) 0 0 / 100% calc(100% - 22px) no-repeat, var(--torn-down) 0 100% / 2048px 24px repeat-x;
  transform: translateY(-100%);
  transition: transform .5s var(--ease-inout);
}
.menu.is-open .menu__sheet { transform: none; transition-duration: .7s; }
.menu__close {
  position: absolute; top: max(var(--nav-y), var(--safe-t)); right: calc(var(--gutter) - 11px);
  width: 44px; height: var(--nav-h); display: grid; place-content: center;
}
.menu__close i { grid-area: 1 / 1; width: 22px; height: 1.5px; background: var(--ink); transform: rotate(45deg); }
.menu__close i + i { transform: rotate(-45deg); }
.menu__links { display: flex; flex-direction: column; gap: 6px; }
.menu__links a {
  font: 300 44px/1.1 var(--f-display); letter-spacing: -.01em;
  padding: 4px 0;
  opacity: 0; transform: translateY(24px);
}
.menu.is-open .menu__links a { opacity: 1; transform: none; transition: opacity .7s var(--ease-quint), transform .7s var(--ease-quint); }
.menu.is-open .menu__links a:nth-child(2) { transition-delay: .07s; }
.menu.is-open .menu__links a:nth-child(3) { transition-delay: .14s; }
.menu.is-open .menu__links a:nth-child(4) { transition-delay: .21s; }
.menu__foot { margin-top: auto; padding-top: 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.menu__date { font: 400 20px/1 var(--f-display); letter-spacing: .08em; font-variant-numeric: lining-nums; }

.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.js .cursor { display: block; position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; }
  .cursor__ring, .cursor__dot { position: absolute; left: 0; top: 0; border-radius: 50%; }
  .cursor__ring {
    width: 26px; height: 26px; margin: -13px 0 0 -13px;
    display: grid; place-items: center;
    transition: width .45s var(--ease-expo), height .45s var(--ease-expo), margin .45s var(--ease-expo), opacity .3s ease;
  }
  .cursor__ring::before {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    padding: 1.5px;
    background: var(--foil); background-size: 300% 100%; background-position: var(--foil-x) 0;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  }
  .cursor__ring b {
    font: 500 9px/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--cream);
    opacity: 0; transition: opacity .3s ease; padding-left: .26em;
  }
  .cursor__dot { width: 4px; height: 4px; margin: -2px 0 0 -2px; background: var(--ink); transition: opacity .3s ease, background-color .3s ease; }
  .cursor[data-state="seal"] .cursor__ring { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
  .cursor[data-state="seal"] .cursor__ring b { opacity: 1; }
  .cursor[data-state="seal"] .cursor__dot { opacity: 0; }
  .cursor[data-state="link"] .cursor__ring { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  .cursor[data-state="swatch"] .cursor__ring { opacity: 0; }
  .cursor[data-state="media"] .cursor__ring::before { background: var(--cream); }
  .cursor[data-state="media"] .cursor__dot { background: var(--cream); }
  .cursor.is-off { opacity: 0; }
  html.js body, html.js a, html.js button, html.js label, html.js .seal { cursor: none; }
  html.js input[type="text"], html.js textarea { cursor: text; }
}

/* ---------- 5 · garden: hero → venue → portal → program ---------- */
main { display: block; }
.garden { position: relative; height: 1080svh; }
.garden__stage {
  position: sticky; top: 0;
  height: 100svh; overflow: hidden;
  background: var(--paper) url(media/paper.webp) 0 0 / 512px repeat;
  transform-origin: 50% 40%;
}

/* hero: the printed sheet */
.hero {
  position: absolute; inset: 0; z-index: 1;
  background: var(--paper) url(media/paper.webp) 0 0 / 512px repeat;
}
.hero__print {
  position: absolute;
  left: var(--print-x); top: var(--print-y);
  width: var(--print-w); height: var(--print-h);
  container-type: size;
  text-align: center;
  color: var(--ink);
}
/* the printed zone lays out in cq units, so the clone in the envelope is the same layout, only smaller */
.hero__print, .card {
  --names-fs: 13.9cqw;
  --names-lh: .9;
  --names-rows: 1;
  --names-c: 46%;
  --fk: clamp(9px, .5cqw + 4px, 12px);
  --fi: clamp(16px, 1.434cqw + 6px, 30px);
  --fd: max(14px, .717cqw + 8px);
  --fp: max(12px, .717cqw + 6px);
  --kick-top: 18%;
  --g1: 3.1cqw;
  --g2: 1.9cqw;
  --names-bottom: calc(var(--names-c) + var(--names-fs) * var(--names-lh) * var(--names-rows) / 2);
}
.print__kicker, .names, .print__invite, .print__date, .print__place { position: absolute; left: 0; right: 0; margin: 0; }
.print__kicker {
  top: var(--kick-top);
  font: 500 var(--fk)/1.3 var(--f-ui);
  letter-spacing: .26em; text-transform: uppercase; padding-left: .26em;
  color: var(--ink-muted);
}
.names {
  top: var(--names-c);
  display: flex; justify-content: center; align-items: baseline;
  gap: .19em;
  transform: translateY(-50%);
  font: 300 var(--names-fs)/var(--names-lh) var(--f-display);
  letter-spacing: -.02em;
  white-space: nowrap;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55), 0 -1px 0 rgba(0, 0, 0, .05);
}
.n { display: block; }
.n--amp {
  font-style: italic; font-weight: 400;
  letter-spacing: 0;
  padding: 0 .04em;
  margin: 0 -.02em;
}
.names .n--amp { text-shadow: none; }
.print__invite {
  top: calc(var(--names-bottom) + var(--g1));
  font: italic 500 var(--fi)/1.45 var(--f-text);
  color: var(--ink);
}
.print__date {
  top: calc(var(--names-bottom) + var(--g1) + var(--fi) * 1.45 + var(--g2));
  font: 400 var(--fd)/1.3 var(--f-display);
  letter-spacing: .14em; padding-left: .14em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
}
.print__place {
  top: calc(var(--names-bottom) + var(--g1) + var(--fi) * 1.45 + var(--g2) + var(--fd) * 1.3 + .5cqw);
  font: 500 var(--fp)/1.3 var(--f-text);
  color: var(--ink-muted);
}
@media (orientation: portrait) {
  .hero__print, .card {
    --names-fs: 22cqw;
    --names-lh: .86;
    --names-rows: 3;
    --names-c: 45%;
    --fk: clamp(10px, .49cqw + 8.4px, 12px);
    --fi: calc(4.136cqw + 3.8px);
    --fd: calc(1.46cqw + 9.33px);
    --fp: calc(1.217cqw + 9.1px);
    --kick-top: 14%;
    --g1: 3.6cqw;
    --g2: 2.6cqw;
  }
  .names { flex-direction: column; align-items: center; gap: 0; }
  .n--amp { margin: 0; padding: 0; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .hero__print, .card { --kick-top: 11%; --fk: 9px; --fi: 16px; --fd: 14px; --fp: 12px; }
}

/* hero UI — not printed: appears after the card lands */
.hero__ui {
  position: absolute; left: var(--gutter); right: var(--gutter);
  bottom: calc(30px + var(--safe-b));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end;
  font: 500 10px/1.3 var(--f-ui); letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0;
}
.ui__cue { justify-self: start; }
.ui__count { justify-self: end; font-variant-numeric: lining-nums; }
.ui__scroll { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-left: .26em; }
.ui__scroll i { position: relative; display: block; width: 1px; height: 32px; overflow: hidden; background: var(--line); }
.ui__scroll i::after {
  content: ''; position: absolute; inset: 0; background: var(--ink);
  transform: translateY(-100%); animation: scroll-run 2.4s var(--ease-inout) infinite;
}
@keyframes scroll-run { 0% { transform: translateY(-100%); } 55%, 100% { transform: translateY(100%); } }
@media (orientation: portrait) {
  .hero__ui {
    bottom: calc(22px + var(--safe-b));
    grid-template-columns: 1fr 1fr; grid-template-areas: "scroll scroll" "cue count"; row-gap: 22px;
    letter-spacing: .2em;
  }
  .ui__scroll { grid-area: scroll; }
  .ui__cue { grid-area: cue; }
  .ui__count { grid-area: count; }
}
@media (max-width: 359px) { .hero__ui { bottom: calc(18px + var(--safe-b)); letter-spacing: .16em; font-size: 9px; } }

/* venue: a second sheet of the same paper — the sheet itself (unscaled) sits under the media, the drawing and copy above it */
.venue__sheet {
  position: absolute; inset: 0; z-index: 2;
  background: var(--paper) url(media/paper.webp) 0 calc(var(--vh) * -100) / 512px repeat;
  transform: translate3d(0, 100svh, 0);
}
.stage__media {
  position: absolute; inset: 0; z-index: 3;
  background: var(--night);
  clip-path: inset(100% 0 0 0);
  opacity: 0;
}
.stage__media > img, .stage__media > video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
  transform: translate3d(0, var(--pshift, 0px), 0); /* main.js: the portal frames the terrace, 0 once it is full screen */
}
.stage__day, .stage__end { opacity: 0; }
.stage__grain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .05; pointer-events: none; mix-blend-mode: overlay; }
@media (min-aspect-ratio: 16/9) { .stage__media > img, .stage__media > video { object-position: 50% 42%; } }
@media (orientation: portrait) and (min-aspect-ratio: 9/16) { .stage__media > img, .stage__media > video { object-position: 50% 38%; } }
@media (orientation: landscape) and (max-height: 500px) { .stage__media > img, .stage__media > video { object-position: 50% 30%; } } /* 8 px more sky over the clock than 40% */

.portal__edge {
  position: absolute; left: 0; top: 0; z-index: 4;
  width: 0; height: 0;
  box-shadow: inset 0 2px 5px rgba(40, 30, 20, .35), inset 0 0 0 .5px rgba(40, 30, 20, .25);
  pointer-events: none; opacity: 0;
  contain: strict;
}
.venue {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 11svh;
  transform: translate3d(0, 100svh, 0);
  transform-origin: 0 0;
  pointer-events: none;
}
.venue.is-live { pointer-events: auto; }
.palace {
  position: relative;
  width: min(54vw, 980px);
  aspect-ratio: 16 / 9;
  color: var(--ink-line);
  flex: none;
}
.palace__ink {
  position: absolute; inset: 0;
  -webkit-mask-image: linear-gradient(to top, #000 calc(var(--ink, 0%) - 10%), transparent var(--ink, 0%));
  mask-image: linear-gradient(to top, #000 calc(var(--ink, 0%) - 10%), transparent var(--ink, 0%));
}
.palace__ink > svg, .palace__ink > img { width: 100%; height: 100%; }
.palace__mask {
  position: absolute; inset: 0; background: currentColor;
  -webkit-mask: url(media/palace.webp) 50% 50% / 100% 100% no-repeat;
  mask: url(media/palace.webp) 50% 50% / 100% 100% no-repeat;
}
.palace.has-water .palace__ink > svg { clip-path: inset(0 0 21% 0); }
.palace__water {
  position: absolute; left: 0; right: 0; bottom: 0; height: 21%;
  display: none;
}
.palace.has-water .palace__water { display: block; }
.palace__water.is-rippling { filter: url(#ripple); }
.palace__water i {
  position: absolute; inset: 0;
  background: var(--ink-line);
  -webkit-mask: url(media/palace.webp) 50% 100% / 100% calc(100% / .21) no-repeat;
  mask: url(media/palace.webp) 50% 100% / 100% calc(100% / .21) no-repeat;
}
.venue__text {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin-top: clamp(18px, 3svh, 36px);
  max-width: 34em;
  padding: 0 var(--gutter);
}
.venue__text .h2 { font-size: var(--h2v); margin-top: 16px; }
.venue__lead { margin-top: 18px; max-width: 29em; font-size: var(--txt); text-wrap: pretty; }
.venue__addr {
  margin-top: 16px;
  font: 500 max(11px, calc(var(--kick) + 1px))/1.3 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; padding-left: .26em;
  color: var(--ink-muted);
}
.venue__cta { display: flex; gap: 12px; margin-top: 26px; }
.v-in { opacity: 0; }

/* program: the day over the table */
.program {
  position: absolute; inset: 0; z-index: 6;
  color: var(--ink);
  pointer-events: none;
  transition: color .6s var(--ease-quint);
}
.program[data-tone="cream"] { color: var(--cream); }
.program__kicker {
  position: absolute; left: 0; right: 0; top: 9.5svh;
  text-align: center; padding-left: .26em;
  color: inherit; opacity: 0;
}
.program[data-tone="ink"] .program__kicker { color: var(--ink-muted); }
.program[data-tone="cream"] .program__kicker { color: var(--cream-muted); }
.clock {
  position: absolute; left: 50%; top: 18svh;
  display: flex; align-items: center;
  height: .72em; margin-top: -.36em;
  transform: translateX(-50%);
  font: 300 var(--clk)/1 var(--f-display);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0;
  opacity: 0;
}
.clock__d { position: relative; display: block; width: .56em; height: 1em; overflow: hidden; margin: -.14em 0; }
.clock__d .col { position: absolute; left: 0; top: 0; width: 100%; display: flex; flex-direction: column; will-change: transform; }
.clock__d i { display: block; height: 1em; font-style: normal; text-align: center; }
.clock__colon { display: block; width: .3em; text-align: center; margin-top: -.08em; transition: opacity .2s linear; }
.clock__colon.is-dim { opacity: .25; }
.program[data-tone="ink"] .clock { text-shadow: 0 1px 0 rgba(255, 255, 255, .25); }
.program[data-tone="cream"] .clock { text-shadow: 0 1px 24px rgba(10, 18, 34, .35); }
.program[data-clock="cream"] .clock { color: var(--cream); text-shadow: 0 1px 24px rgba(10, 18, 34, .35); }
.chapters { position: absolute; left: var(--gutter); right: var(--gutter); top: 39svh; }
.chapter {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  opacity: 0;
}
.chapter__time { display: none; }
.chapter__title { font: 300 var(--cht)/1 var(--f-display); letter-spacing: -.01em; }
.chapter__text { margin-top: 12px; max-width: 31em; font-size: var(--chx); line-height: 1.45; text-wrap: balance; }
.program[data-tone="ink"] .chapter { text-shadow: 0 0 18px rgba(230, 236, 242, .55); }
.program[data-tone="cream"] .chapter { text-shadow: 0 1px 18px rgba(10, 18, 34, .55); }
.rail {
  position: absolute; left: 50%; bottom: calc(6svh + var(--safe-b));
  width: 44vw; height: 44px;
  display: flex; justify-content: space-between; align-items: center;
  transform: translateX(-50%);
  opacity: 0;
}
.rail__line { position: absolute; left: 3px; right: 3px; top: 50%; height: 1px; background: currentColor; opacity: .3; }
.rail__line i { position: absolute; inset: 0; background: currentColor; transform: scaleX(0); transform-origin: left; opacity: 1; }
.rail__dot {
  position: relative; width: 44px; height: 44px; margin: 0 -18.5px;
  display: grid; place-items: center;
}
.rail__dot i {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid currentColor;
  background: var(--paper);
  transition: transform .5s var(--ease-expo), background .4s ease, border-color .4s ease;
}
.program[data-tone="cream"] .rail__dot i { background: var(--night); }
.rail__dot.is-on i { background: var(--foil); background-size: 300% 100%; background-position: var(--foil-x) 0; border-color: transparent; transform: scale(1.3); }
.rail__dot span {
  position: absolute; top: calc(50% + 14px); left: 50%; transform: translateX(-50%);
  font: 500 10px/1 var(--f-ui); letter-spacing: .1em; font-variant-numeric: lining-nums;
  opacity: .6; transition: opacity .4s ease;
}
.rail__dot.is-on span { opacity: 1; }
.program.is-live .rail { pointer-events: auto; }
.stage__shade { position: absolute; inset: 0; z-index: 7; background: #0B0A08; opacity: 0; pointer-events: none; }

/* ---------- 6 · dress code ---------- */
.torn {
  position: absolute; left: 0; right: 0; bottom: 100%; height: 24px;
  margin-bottom: -1px;
  background: var(--paper) url(media/paper.webp) 0 0 / 512px repeat;
  -webkit-mask: var(--torn-up) 0 0 / 2048px 24px repeat-x;
  mask: var(--torn-up) 0 0 / 2048px 24px repeat-x;
  filter: drop-shadow(0 -6px 10px rgba(30, 22, 14, .22)) drop-shadow(0 -1px 1px rgba(30, 22, 14, .12));
  pointer-events: none;
}
.dress {
  position: relative; z-index: 6;
  height: 200svh;
  margin-top: -100svh;
}
.dress__stage {
  position: sticky; top: 0; height: 100svh;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center;
  padding: 0 var(--gutter);
  max-width: var(--max); margin: 0 auto;
}
.dress__text { grid-column: 1 / span 6; }
/* two-line titles keep their breaks (tz 1): a line never wraps inside itself */
.h2 .ln > span { white-space: nowrap; }
.dress__text .h2 { margin-top: 18px; }
.dress__lead { margin-top: 26px; max-width: 26em; text-wrap: pretty; }
.dress__note { margin-top: 18px; font-style: italic; color: var(--ink-muted); max-width: 26em; }
.fan { grid-column: 7 / span 6; position: relative; height: 100%; }
/* desktop: «итальянского сада» (6.85em) and «Что важно знать» (6.5em) fit their half of the grid and clear the fan */
@media (min-width: 1200px) {
  .dress__text .h2, .details__list .h2 { font-size: min(var(--h2d), 6.5vw, 100px); }
  .fan__deck { left: 53%; } /* ≥ 60 px of air between «сада» and the first swatch */
}
.fan__deck { position: absolute; left: 50%; top: 46%; width: 0; height: 0; }
.swatch {
  position: absolute; left: 0; top: 0;
  width: var(--sw); height: var(--sw);
  margin: calc(var(--sw) / -2) 0 0 calc(var(--sw) / -2);
  transform-origin: 50% 50%;
  -webkit-tap-highlight-color: transparent;
  border-radius: 2px;
}
.swatch__lift {
  display: block; width: 100%; height: 100%;
  perspective: 700px;
  transition: transform .45s var(--ease-expo);
}
.swatch img {
  width: 100%; height: 100%;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  filter: drop-shadow(0 1px 1px rgba(30, 22, 14, .25)) drop-shadow(0 8px 12px rgba(30, 22, 14, .18));
  transition: transform .45s var(--ease-expo), filter .45s var(--ease-expo);
}
.swatch.is-up .swatch__lift { transform: translateY(-14px) rotate(calc(-1 * var(--a, 0deg))); }
.swatch.is-up img { filter: drop-shadow(0 2px 2px rgba(30, 22, 14, .2)) drop-shadow(0 26px 30px rgba(30, 22, 14, .3)); }
.fan__caption {
  position: absolute; left: 0; right: 0; top: calc(46% + var(--sw) * .5 + var(--sw) * var(--fan-r) * .09 + 40px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; min-height: 48px;
}
.fan__name { font: italic 500 24px/1 var(--f-text); }
.fan__hex { font: 500 10px/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-muted); }
.fan__caption > * { transition: opacity .35s ease, transform .45s var(--ease-expo); }
.fan__caption.is-swap > * { opacity: 0; transform: translateY(6px); }

/* ---------- 7 · details ---------- */
.details { position: relative; z-index: 6; padding: 20svh 0 18svh; }
.details__wrap {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
}
.details__map { grid-column: 1 / span 5; }
.details__map .map { position: sticky; top: 14svh; width: min(32vw, 100%); }
.details__list { grid-column: 7 / span 6; }
.details__list .h2 { margin-top: 18px; }
.items { margin-top: 7svh; }
.item { position: relative; display: grid; grid-template-columns: 3.2em 1fr; padding: 34px 0 38px; }
.item__rule { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); transform: scaleX(0); transform-origin: left; }
.item__num { font: italic 400 calc(var(--itt) * .62)/1.15 var(--f-display); color: var(--ink-muted); padding-top: .35em; font-variant-numeric: lining-nums; }
.item__title { font: 300 var(--itt)/1.05 var(--f-display); letter-spacing: -.01em; }
.item__body p { margin-top: 12px; font-size: var(--itx); max-width: 30em; text-wrap: pretty; }
.item__body a { white-space: nowrap; }
.item__map-slot { display: none; }
.item__num, .item__body { opacity: 0; transform: translateY(24px); }

.map { position: relative; transform: rotate(-1.5deg); }
.map__shade { position: absolute; inset: 4px; box-shadow: var(--shadow-paper); border-radius: 2px; }
.map__card {
  position: relative; aspect-ratio: 614 / 856;
  -webkit-mask: var(--map-mask) 0 0 / 100% 100% no-repeat;
  mask: var(--map-mask) 0 0 / 100% 100% no-repeat;
  background: #F4F1EA;
}
.map__card img { width: 100%; height: 100%; object-fit: cover; }
.map__route { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.route__dash { fill: none; stroke: var(--ink); stroke-width: 1.2px; stroke-dasharray: 2 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.route__draw { fill: none; stroke: #fff; stroke-width: 6; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.map.is-in .route__draw { stroke-dashoffset: 0; transition: stroke-dashoffset 1.8s var(--ease-quart) .2s; }
.pin { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.pin--mxp { --x: 18%; --y: 84%; }
.pin--villa { --x: 62.5%; --y: 53%; }
.pin i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--wax); transform: scale(0); }
.pin i::after {
  content: ''; position: absolute; left: -4px; top: -4px; width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--wax); opacity: .6;
}
.pin b { position: absolute; left: 14px; top: -14px; display: flex; flex-direction: column; gap: 4px; white-space: nowrap; font-weight: 500; opacity: 0; }
.pin--villa b { left: auto; right: 14px; text-align: right; }
.pin em { font: italic 500 16px/1 var(--f-text); color: var(--ink); }
.pin small { font: 500 9px/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-muted); }
.map.is-in .pin i { transform: scale(1); transition: transform .5s var(--ease-back); }
.map.is-in .pin--villa i { transition-delay: 1.8s; }
.map.is-in .pin i::after { animation: pin-pulse 2.4s var(--ease-quint) 2.3s infinite; }
.map.is-in .pin b { opacity: 1; transition: opacity .6s var(--ease-quint) .3s; }
.map.is-in .pin--villa b { transition-delay: 1.9s; }
@keyframes pin-pulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }

/* reveals (IO) */
.k-in { clip-path: inset(0 100% 0 0); }
.k-in.is-in { clip-path: inset(0); transition: clip-path .9s var(--ease-quart); }
.h-in .ln > span { transform: translateY(110%); }
.h-in.is-in .ln > span { transform: none; transition: transform 1.1s var(--ease-expo); }
.h-in.is-in .ln + .ln > span { transition-delay: .1s; }
.item.is-in .item__rule { transform: none; transition: transform 1.1s var(--ease-quart) var(--d, 0s); }
.item.is-in .item__num, .item.is-in .item__body { opacity: 1; transform: none; transition: opacity .9s var(--ease-quint) var(--d, 0s), transform .9s var(--ease-quint) var(--d, 0s); }

/* ---------- 8 · finale: reply on the table, footer ---------- */
.finale { position: relative; z-index: 6; clip-path: inset(0); }
.finale__bg { position: fixed; inset: 0; z-index: 0; background: var(--table); }
.finale__bg picture, .finale__bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.finale__bg img { object-fit: cover; }
.finale__shadows { position: fixed; z-index: 1; }

.reply { position: relative; z-index: 2; min-height: 100svh; padding: 16svh var(--gutter) 22svh; }
.reply__stage { position: relative; display: grid; place-items: center; }
.reply__stage > * { grid-area: 1 / 1; }
.reply__card {
  position: relative; width: 580px; max-width: 100%;
  transform-origin: 50% 50%;
}
.reply__shade { position: absolute; inset: 3px; border-radius: 2px; box-shadow: var(--shadow-paper); }
.reply__paper {
  position: relative;
  padding: 64px 64px 56px;
  background: var(--paper) url(media/paper.webp) 0 0 / 512px repeat;
  -webkit-mask: var(--reply-mask) 0 0 / 100% 100% no-repeat;
  mask: var(--reply-mask) 0 0 / 100% 100% no-repeat;
  text-align: center;
}
.reply__title { margin-top: 18px; font-size: clamp(34px, 2.4vw + 15px, 50px); } /* «Пожалуйста, ответьте» holds one line from 360 px up */
.reply__title em { display: block; }
.form { margin-top: 44px; text-align: left; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field + .field, .form__more, .form__more + .field, .field--text + .field { margin-top: 30px; }
.field__label {
  display: block; padding: 0;
  font: 500 10px/1.3 var(--f-ui); letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-muted);
  transition: color .3s ease;
}
.field__input {
  display: block; width: 100%; margin-top: 10px; padding: 6px 0 10px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--ink);
  font: 500 max(16px, var(--txt))/1.45 var(--f-text);
  outline: none;
  background-image: linear-gradient(var(--gold-1), var(--gold-1));
  background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .6s var(--ease-expo);
}
.field__input:focus { background-size: 100% 1px; }
.field--text:focus-within .field__label { color: var(--gold-1); }
.field__area { resize: none; overflow: hidden; min-height: 44px; }
.field__err { min-height: 0; margin-top: 6px; font: italic 500 15px/1.3 var(--f-text); color: var(--wax); }
.field__err:empty { display: none; }
.field.is-shake { animation: shake .36s linear; }
@keyframes shake { 16%, 50%, 84% { transform: translateX(-2px); } 33%, 67% { transform: translateX(2px); } 100% { transform: none; } }
.field--radio { display: grid; gap: 4px; }
.field--radio legend { margin-bottom: 10px; }
.choice { position: relative; display: flex; align-items: center; gap: 14px; min-height: 44px; cursor: pointer; }
.choice input, .seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.choice__box { width: 22px; height: 22px; flex: none; color: var(--ink); }
.choice__box svg { width: 100%; height: 100%; overflow: visible; }
.choice__ring { fill: none; stroke: currentColor; stroke-width: 1; opacity: .55; }
.choice__tick { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 18; stroke-dashoffset: 18; transition: stroke-dashoffset .3s var(--ease-quint); }
.choice input:checked + .choice__box .choice__tick { stroke-dashoffset: 0; }
.choice input:focus-visible + .choice__box { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 50%; }
.choice__text { font-size: max(17px, var(--txt)); }
.form__more { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .42s var(--ease-quint), opacity .42s ease; }
.form__more-in { overflow: hidden; min-height: 0; }
.form__more.is-closed { grid-template-rows: 0fr; opacity: 0; margin-top: 0; }
.field--seg { margin-top: 26px; }
.field--seg:first-child { margin-top: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.seg label { position: relative; }
.seg span {
  display: inline-flex; align-items: center; height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  font: 500 16px/1 var(--f-text);
  transition: border-color .3s ease, background-color .3s ease, color .3s ease;
  cursor: pointer;
}
.seg input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (hover: hover) { .seg label:hover input:not(:checked) + span { border-color: var(--ink-faint); } }
.btn-wax {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 56px; margin-top: 40px;
  border-radius: var(--radius-pill); overflow: hidden; isolation: isolate;
  background: var(--wax); color: var(--cream);
  font: 600 12px/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -1px 0 rgba(0, 0, 0, .25), 0 10px 20px -12px rgba(60, 10, 8, .6);
}
.btn-wax::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px;
  background: var(--foil); background-size: 300% 100%; background-position: 0% 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0; transition: opacity .4s ease, background-position 1.2s var(--ease-inout);
}
@media (hover: hover) { .btn-wax:hover::before { opacity: 1; background-position: 100% 0; } }
.btn-wax:focus-visible { outline-color: var(--ink); }
.form__nojs { margin-top: 16px; font-style: italic; text-align: center; }

.reply__sealed { position: relative; align-self: start; display: flex; flex-direction: column; align-items: center; gap: 28px; width: 100%; }
/* the thanks is a slip of the same paper laid on the table beside the sealed envelope — legible over any part of the photo.
   Paper and its shadow are pseudo-layers: the mask never clips the shadow */
.reply__thanks {
  position: relative; isolation: isolate;
  width: min(100%, 440px);
  padding: clamp(24px, 3vw + 12px, 38px) clamp(20px, 3vw + 10px, 40px) 12px;
  text-align: center; outline: none;
  rotate: -1.2deg;
}
.reply__thanks::before { content: ''; position: absolute; inset: 3px; z-index: -2; border-radius: 2px; box-shadow: var(--shadow-paper); }
.reply__thanks::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--paper) url(media/paper.webp) 0 0 / 512px repeat;
  -webkit-mask: var(--thanks-mask) 0 0 / 100% 100% no-repeat;
  mask: var(--thanks-mask) 0 0 / 100% 100% no-repeat;
}
.thanks__title {
  font: 300 clamp(32px, 1.6vw + 24px, 50px)/1.02 var(--f-display); letter-spacing: -.01em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55), 0 -1px 0 rgba(0, 0, 0, .05);
  text-wrap: balance;
}
.thanks__text { margin: 12px auto 0; font-style: italic; max-width: 22em; text-wrap: balance; }
.thanks__edit { margin-top: 10px; min-height: 44px; font: 500 10px/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; padding-left: .26em; color: var(--ink-muted); }
.env--reply { position: relative; left: auto; top: auto; margin: 0; }
.env--reply .env__back { transform: none; }
.env--reply .env__flip { transform-style: flat; }
.rcard {
  position: absolute; left: 0; top: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 11%;
  background: var(--paper) url(media/paper.webp) 0 0 / 512px repeat;
  -webkit-mask: var(--rcard-mask) 0 0 / 100% 100% no-repeat;
  mask: var(--rcard-mask) 0 0 / 100% 100% no-repeat;
  text-align: center;
}
.rcard__k { font: 500 8px/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-muted); }
.rcard__name { margin-top: 10px; font: 300 26px/1 var(--f-display); }
.rcard__line { margin-top: 6px; font: italic 500 13px/1.3 var(--f-text); color: var(--ink-muted); }
.seal--stamp { pointer-events: none; opacity: 0; }
.seal__spread {
  position: absolute; left: 50%; top: 50%; width: 100%; height: 100%;
  margin: -50% 0 0 -50%; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(98, 21, 19, .35);
  opacity: 0;
}

.foot { position: relative; z-index: 3; padding: 20svh var(--gutter) calc(28px + var(--safe-b)); text-align: center; }
.foot__in { max-width: var(--max); margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.foot__title { margin-top: 20px; font-size: min(var(--h2f), calc((100vw - 2 * var(--gutter)) / 8.3)); } /* «Двенадцатого июня,» = 8.02em on one line */
.count { display: flex; align-items: flex-start; justify-content: center; gap: .18em; margin-top: 8svh; font: 300 var(--cnt)/1 var(--f-display); font-variant-numeric: lining-nums tabular-nums; }
.count__cell { display: flex; flex-direction: column; align-items: center; }
.count__num { display: block; overflow: hidden; padding-bottom: .06em; }
.count__num > span { display: block; transform: translateY(110%); }
.count.is-in .count__num > span { transform: none; transition: transform .9s var(--ease-expo) var(--d, 0s); }
.count__lab { margin-top: 14px; font: 500 9px/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-muted); padding-left: .26em; }
.count__sep { line-height: 1; margin-top: -.04em; }
.count__done { margin-top: 8svh; font: italic 500 calc(var(--txt) * 1.4)/1.3 var(--f-text); }
.foot__cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 7svh; }
.foot__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  width: 100%; margin-top: 16svh; padding-top: 22px; border-top: 1px solid var(--line);
  font: 500 10px/1.4 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-muted);
}
.foot__mono { font: italic 400 22px/1 var(--f-display); letter-spacing: 0; text-transform: none; color: var(--ink); }
.foot__date { font-variant-numeric: lining-nums; }
.foot__credit { margin-left: auto; }
.foot__back { color: var(--ink); }

/* ---------- 9 · responsive ---------- */
@media (orientation: portrait) {
  .garden { height: 1000svh; }
  .venue { padding-top: 12svh; }
  .palace { width: 94vw; }
  /* phones (the 9:16 clip maps 1:1 onto svh): clean sky only at 22–35% (between the garlands) and 43–52% (over the far shore,
     which is a dark band at 52–57%, olives at the edges 27–58%). A chapter of 2–3 lines only fits the upper band;
     the clock takes the lower one and stands right on the horizon */
  .program__kicker { top: 12svh; }
  .chapters { top: 22.5svh; }
  .chapter__title { font-size: min(var(--cht), 9.4vw); }
  .chapter__text { margin: 10px auto 0; max-width: 74vw; line-height: 1.38; }
  .clock { top: 47.6svh; }
  .rail { width: calc(100% - 2 * var(--gutter)); bottom: calc(5svh + var(--safe-b)); }
}
@media (orientation: portrait) and (min-width: 700px) {
  /* tablet: the clip is scaled by width (50% 38%) — top garland at 10–15%, clean 17–34%, lower garlands 35–45%, clean 45–56% */
  .palace { width: 84vw; }
  .venue { padding-top: 10svh; }
  .program__kicker { top: 6.5svh; }
  .clock { top: 26svh; }
  .chapters { top: 45.5svh; }
  .chapter__title { font-size: var(--cht); }
  .chapter__text { margin-top: 12px; max-width: 24em; line-height: 1.45; } /* olives fill the outer 20% of the clip */
  .rail { width: 70%; }
}
@media (orientation: portrait) and (max-height: 600px) {
  .chapters { top: 21svh; }
  .chapter__title { font-size: 28px; }
  .chapter__text { margin-top: 8px; font-size: 15px; }
  .venue { padding-top: 9svh; }
  .venue__text { margin-top: 12px; }
  .venue__text .h2 { margin-top: 10px; }
  .venue__lead, .venue__addr { margin-top: 10px; }
  .venue__cta { margin-top: 16px; }
}
@media (max-width: 767px) {
  .venue__cta { flex-direction: column; width: 100%; max-width: 320px; gap: 10px; }
  .venue__cta .pill { height: 44px; width: 100%; }
  .dress__stage { display: flex; flex-direction: column; justify-content: flex-start; padding-top: calc(var(--nav-h) + var(--nav-y) + 4svh); }
  .dress__lead { margin-top: 16px; font-size: 16px; }
  .dress__note { margin-top: 10px; font-size: 16px; }
  .fan { flex: 1; width: 100%; min-height: 0; }
  .fan__deck { top: 40%; }
  .details { padding: 16svh 0 12svh; }
  .details__wrap { display: block; }
  .details__map { display: none; }
  .item__map-slot { display: block; margin-top: 28px; }
  .item__map-slot .map { width: 100%; }
  .items { margin-top: 5svh; }
  .item { grid-template-columns: 2.4em 1fr; padding: 28px 0 30px; }
  .reply { padding: 14svh 16px 16svh; }
  .reply__card { width: 100%; }
  .reply__paper { padding: 48px 22px 40px; }
  .foot__bar { flex-direction: column; gap: 14px; }
  .foot__credit { margin-left: 0; }
  .count { gap: .1em; }
}
@media (min-width: 360px) and (max-width: 767px) { .reply { padding-left: 20px; padding-right: 20px; } }
@media (max-width: 359px) { .seg { gap: 6px; } .seg span { padding: 0 14px; } } /* «Рыба · Мясо · Овощи» in one row at 320 */
@media (min-width: 768px) and (max-width: 1199px) {
  .dress__stage { grid-template-columns: 1fr; align-content: center; row-gap: 4svh; }
  .dress__text, .fan { grid-column: 1; }
  .fan { height: 48svh; }
  .details__wrap { display: block; }
  .details__map { display: none; }
  .item__map-slot { display: block; margin-top: 28px; }
  .item__map-slot .map { width: 70%; }
  .reply__card { width: 560px; }
}
@media (min-width: 1800px) { .reply__card { width: 620px; } .details__map .map { width: 30vw; } }

/* short landscape: palace left, copy right; everything by height */
@media (orientation: landscape) and (max-height: 500px) {
  .garden { height: 900svh; }
  .venue { flex-direction: row; justify-content: center; align-items: center; gap: 4vw; padding: 6svh var(--gutter) 0; }
  .palace { width: 46vw; }
  .venue__text { align-items: flex-start; text-align: left; margin-top: 0; padding: 0; max-width: 40vw; }
  .venue__lead { margin-top: 10px; }
  .venue__addr { margin-top: 10px; padding-left: 0; }
  .venue__cta { margin-top: 16px; }
  .venue__cta .pill { height: 40px; padding: 0 18px; }
  /* the clock clears the first garland; the chapter sits over the mountains, the foot of which darkens at dusk */
  .program__kicker { top: 5%; }
  .clock { top: 17%; }
  .chapters { top: 39%; }
  .chapter__text { margin-top: 4px; }
  .program[data-tone="ink"] .chapter__text { text-shadow: 0 0 2px rgba(236, 240, 244, .7), 0 0 14px rgba(236, 240, 244, .8); }
  .program[data-tone="cream"] .chapter__text { text-shadow: 0 0 2px rgba(10, 18, 34, .6), 0 1px 14px rgba(10, 18, 34, .7); }
  .rail { width: 60vw; bottom: 5%; }
  /* text left, fan right — overrides the tablet / phone stacks above */
  .dress__stage {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 16px;
    align-content: normal; align-items: center; row-gap: 0; padding-top: 0;
  }
  .dress__text { grid-column: 1 / span 6; }
  .fan { grid-column: 7 / span 6; height: 100%; }
  .fan__deck { top: 50%; }
  .dress__lead { margin-top: 12px; font-size: 15px; }
  .dress__note { display: none; }
  .fan__caption { display: none; }
  .details__map { display: none; }
  .details__list { grid-column: 1 / -1; }
  .item__map-slot { display: block; margin-top: 20px; }
  .item__map-slot .map { width: 50%; }
  .reply__card { width: 520px; }
  .reply__paper { padding: 40px 40px 36px; }
  .reply__sealed { flex-direction: row; justify-content: center; align-items: center; gap: 4vw; }
  .reply__thanks { width: min(38vw, 340px); }
}

/* ---------- 10 · states ---------- */
html.intro main { visibility: visible; }
html.intro body { overflow: hidden; }
html.is-open .hero__ui { transition: none; }

/* no JS: everything in the flow, the intro is hidden (above) */
html:not(.js) .garden { height: auto; }
html:not(.js) .garden__stage { position: relative; height: auto; overflow: visible; }
html:not(.js) .hero { position: relative; height: 100svh; }
html:not(.js) .hero__print { --print-w: 100vw; --print-h: 100svh; }
html:not(.js) .venue, html:not(.js) .venue__sheet, html:not(.js) .program { position: relative; transform: none; }
html:not(.js) .venue { padding-bottom: 12svh; }
html:not(.js) .v-in, html:not(.js) .hero__ui { opacity: 1; }
/* the vector palace is fetched by main.js — without it, the same drawing as a webp mask */
html:not(.js) .palace__ink {
  background: currentColor;
  -webkit-mask: url(media/palace.webp) 50% 50% / 100% 100% no-repeat;
  mask: url(media/palace.webp) 50% 50% / 100% 100% no-repeat;
}
html:not(.js) .stage__media { display: none; }
html:not(.js) .program { padding: 12svh var(--gutter); color: var(--ink); }
html:not(.js) .program__kicker { position: static; opacity: 1; margin-bottom: 44px; }
html:not(.js) .clock, html:not(.js) .rail { display: none; }
html:not(.js) .burger { display: none; }
html:not(.js) .pill--nav { display: inline-flex; }
/* the fan, opened (R = 1.6 · side, ±14° / ±28°) */
html:not(.js) .swatch:nth-child(1) { transform: translate(calc(var(--sw) * -.751), calc(var(--sw) * .187)) rotate(-28deg); }
html:not(.js) .swatch:nth-child(2) { transform: translate(calc(var(--sw) * -.387), calc(var(--sw) * .048)) rotate(-14deg); }
html:not(.js) .swatch:nth-child(4) { transform: translate(calc(var(--sw) * .387), calc(var(--sw) * .048)) rotate(14deg); }
html:not(.js) .swatch:nth-child(5) { transform: translate(calc(var(--sw) * .751), calc(var(--sw) * .187)) rotate(28deg); }
html:not(.js) .swatch:nth-child(3) { z-index: 3; }
html:not(.js) .swatch:nth-child(2), html:not(.js) .swatch:nth-child(4) { z-index: 2; }
html:not(.js) .chapters, html:not(.js) .chapter { position: relative; top: auto; opacity: 1; }
html:not(.js) .chapter { margin-bottom: 40px; }
html:not(.js) .chapter__time { display: block; font: 500 11px/1 var(--f-ui); letter-spacing: .26em; margin-bottom: 10px; }
html:not(.js) .dress { margin-top: 0; height: auto; }
html:not(.js) .dress__stage { position: relative; height: auto; min-height: 100svh; }
html:not(.js) .fan { min-height: 60svh; }
html:not(.js) .k-in { clip-path: none; }
html:not(.js) .h-in .ln > span, html:not(.js) .count__num > span { transform: none; }
html:not(.js) .item__rule, html:not(.js) .item__num, html:not(.js) .item__body { transform: none; opacity: 1; }
html:not(.js) .map__card, html:not(.js) .reply__paper { -webkit-mask: none; mask: none; }
html:not(.js) .shadows, html:not(.js) .finale__shadows, html:not(.js) .intro__shadows { display: none; }

/* reduced motion: static, fully readable; the story is a stack */
html.rm .garden { height: auto; }
html.rm .garden__stage { position: relative; height: auto; overflow: visible; background: none; }
html.rm .hero { position: relative; height: 100svh; }
html.rm .venue__sheet { display: none; }
html.rm .venue { position: relative; transform: none; padding-bottom: 12svh; pointer-events: auto; }
html.rm .v-in { opacity: 1; }
html.rm .palace__ink { -webkit-mask: none; mask: none; }
html.rm .stage__media { display: none; }
html.rm .portal__edge { display: none; }
html.rm .palace__still {
  position: absolute; object-fit: cover; object-position: 50% 62%;
  border-radius: 50% 50% 0 0 / 24.6% 24.6% 0 0;
  box-shadow: inset 0 2px 5px rgba(40, 30, 20, .35);
}
html.rm .program {
  position: relative; inset: auto; min-height: 0;
  display: grid; grid-template-columns: 1fr; gap: 40px;
  padding: 12svh var(--gutter);
  color: var(--ink);
}
html.rm .program__kicker { position: static; opacity: 1; }
html.rm .clock, html.rm .rail, html.rm .stage__shade { display: none; }
html.rm .program__still { width: 100%; max-width: 980px; margin: 0 auto; aspect-ratio: 16 / 9; object-fit: cover; }
html.rm .chapters { position: static; display: grid; gap: 36px; max-width: 40em; margin: 0 auto; }
html.rm .chapter { position: static; opacity: 1; }
html.rm .chapter__time { display: block; font: 500 11px/1 var(--f-ui); letter-spacing: .26em; margin-bottom: 10px; color: var(--ink-muted); }
html.rm .dress { margin-top: 0; height: auto; }
html.rm .dress__stage { position: relative; height: auto; min-height: 100svh; padding-top: 14svh; padding-bottom: 14svh; }
html.rm .fan { min-height: 60svh; }
html.rm .k-in { clip-path: none; }
html.rm .h-in .ln > span, html.rm .count__num > span { transform: none; }
html.rm .item__rule, html.rm .item__num, html.rm .item__body { transform: none; opacity: 1; }
html.rm .shadows, html.rm .intro__shadows { opacity: .32; }
html.rm .finale__shadows { display: none; } /* the fixed .shadows poster already lies over the finale — two would multiply twice */
html.rm .hero__ui { opacity: 1; }
html.rm .ui__scroll i::after, html.rm .seal__img, html.rm .foil { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 11 · morph from the portfolio ---------- */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
html.vt-names::view-transition-group(*) { animation-duration: .9s; animation-timing-function: cubic-bezier(.7, 0, .2, 1); }
html.vt-names::view-transition-old(root) { z-index: 1; animation: vt-out .5s cubic-bezier(.4, 0, .2, 1) .05s both, vt-exhale-old 1.2s var(--ease-expo) .2s both; }
html.vt-names::view-transition-new(root) { animation: vt-exhale 1.2s var(--ease-expo) .2s both; }
@media (orientation: portrait) {
  html.vt-names::view-transition-old(root) { animation: vt-out .5s ease both; }
  html.vt-names::view-transition-new(root) { animation: none; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-exhale { from { transform: scale(var(--vt-s, 1)); } }
@keyframes vt-exhale-old { to { transform: scale(calc(1 / var(--vt-s, 1))); } }
