:root {
  --bg: #000;
  --ink: #f4ede4;
  --ink-2: rgba(244, 237, 228, 0.78);
  --muted: rgba(244, 237, 228, 0.56);
  --gold: #e8c07a;
  --gold-2: #f8e1ae;
  --gold-3: #b8863f;
  --rose: #f2a5c2;
  --card: rgba(7, 11, 24, 0.62);
  --line: rgba(232, 192, 122, 0.22);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: Montserrat, "Segoe UI", system-ui, -apple-system, sans-serif;
  --script-en: "Great Vibes", "Marck Script", cursive;
  --script-ru: "Marck Script", "Great Vibes", cursive;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-variant-numeric: lining-nums;   /* у Cormorant по умолчанию «старинные» цифры: 1 похожа на римскую I */
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(232, 192, 122, 0.35); }

button { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--gold-2); outline-offset: 4px; }

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* =================== Кнопки ===================
   Как этикетка на шкатулке: тонкая рамка и вторая — внутри, на 3px.
   При наведении поле заливается слева направо, текст темнеет. */
.btn {
  --frame: rgba(232, 192, 122, 0.5);
  --fill: var(--gold-2);
  --on-fill: #17110a;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 50px;
  padding: 0 calc(30px - 0.34em) 0 30px;   /* компенсируем разрядку у последней буквы */
  border: 1px solid var(--frame);
  border-radius: 1px;
  background: rgba(7, 7, 10, 0.38);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: color 0.45s var(--ease), border-color 0.45s var(--ease), transform 0.2s ease;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--fill);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s var(--ease);
}
.btn::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(232, 192, 122, 0.16);
  pointer-events: none;
  transition: inset 0.45s var(--ease), border-color 0.45s var(--ease);
}
.btn:hover { color: var(--on-fill); border-color: var(--fill); }
.btn:hover::before { transform: scaleX(1); }
.btn:hover::after { inset: 4px; border-color: rgba(23, 17, 10, 0.28); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 1px solid var(--gold-2); outline-offset: 5px; }
.btn:disabled { pointer-events: none; }
.btn svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; }
.btn__arrow { width: 26px; height: 11px; transition: transform 0.5s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(5px); }

/* Главная кнопка: поле уже залито */
.btn--gold { --on-fill: #17110a; color: var(--on-fill); border-color: #f1d8a6; }
.btn--gold::before { transform: scaleX(1); background: #ecd09c; }
.btn--gold::after { border-color: rgba(23, 17, 10, 0.26); }
.btn--gold:hover::before { background: #f7e5bf; }

.btn--ghost { --frame: rgba(244, 237, 228, 0.34); }

/* «Нет» — тише остальных, но такой же настоящий ответ */
.btn--no { --frame: rgba(244, 237, 228, 0.2); --fill: rgba(244, 237, 228, 0.82); color: var(--muted); }
.btn--no::after { border-color: rgba(244, 237, 228, 0.08); }

/* Рубильник: кольцо с огоньком города внутри — нажать и погасить */
.power {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-indent: 0.42em;               /* разрядка не смещает подпись вбок */
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.power__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(232, 192, 122, 0.55);
  border-radius: 50%;
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease);
}
.power__ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(232, 192, 122, 0.18);
  border-radius: 50%;
  transition: inset 0.5s var(--ease), border-color 0.5s var(--ease);
}
.power__light {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffd9a0;
  box-shadow: 0 0 6px 1px rgba(255, 190, 110, 0.9), 0 0 22px 4px rgba(255, 160, 70, 0.28);
  animation: lamp 3.2s ease-in-out infinite;
  transition: background 0.6s ease, box-shadow 0.6s ease, transform 0.6s var(--ease);
}
.power .btn__label { opacity: 0.82; transition: opacity 0.4s ease; }
.power:hover .power__ring { border-color: var(--gold-2); transform: scale(1.04); }
.power:hover .power__ring::before { inset: 9px; border-color: rgba(232, 192, 122, 0.4); }
.power:hover .power__light { transform: scale(1.35); }
.power:hover .btn__label { opacity: 1; }
.power:active .power__ring { transform: scale(0.95); transition-duration: 0.15s; }
.power:focus-visible { outline: none; }
.power:focus-visible .power__ring { outline: 1px solid var(--gold-2); outline-offset: 5px; }
/* после нажатия огонёк гаснет вместе с городом */
.power:disabled { pointer-events: none; }
.power:disabled .power__light { animation: none; background: #3a2c1c; box-shadow: none; transform: scale(0.8); }
.power:disabled .power__ring { border-color: rgba(232, 192, 122, 0.22); }
@keyframes lamp { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* =================== Экран города =================== */
.city-ui { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: calc(9vh + var(--safe-t)) calc(24px + var(--safe-r)) calc(7vh + var(--safe-b)) calc(24px + var(--safe-l));
  visibility: hidden;
  transition: visibility 0s 1.2s;
}
.stage.is-in { visibility: visible; transition: none; }
.stage__top, .stage__bottom { max-width: 760px; }
.stage__title, .stage__text, .stage__bottom {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(6px);
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease), filter 1.2s var(--ease);
}
.stage.is-in .stage__title { opacity: 1; transform: none; filter: none; }
.stage.is-in .stage__text { opacity: 1; transform: none; filter: none; transition-delay: 0.5s; }
.stage.is-in .stage__bottom { opacity: 1; transform: none; filter: none; transition-delay: 1.1s; pointer-events: auto; }
#after .stage__bottom { pointer-events: none; }
#after.is-in.is-ready .stage__bottom { opacity: 1; pointer-events: auto; transition-delay: 0s; }
#after.is-in:not(.is-ready) .stage__bottom { opacity: 0; transform: translateY(14px); }

.stage__title {
  margin: 0 0 12px;
  white-space: pre-line;
  font-weight: 300;
  font-size: clamp(27px, 4.4vw, 52px);
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.8);
}
.stage__text {
  margin: 0;
  font-style: italic;
  font-size: clamp(19px, 2.4vw, 27px);
  color: var(--ink-2);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.9);
}
.stage__text--accent {
  background: linear-gradient(90deg, var(--gold-2), var(--gold), var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

/* =================== Экран шара =================== */
.story {
  position: fixed;
  inset: 0;
  z-index: 4;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  touch-action: pan-y;
  scrollbar-width: none;
  opacity: 0;
  transition: opacity 1.6s ease 0.8s;
}
.story::-webkit-scrollbar { display: none; }
.story.is-paging { scroll-snap-type: none; }
.globe-ready .story { opacity: 1; }

/* Телефон / узкий экран: шар сверху, текст снизу */
.block {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: calc(48dvh) calc(16px + var(--safe-r)) calc(4dvh + var(--safe-b)) calc(16px + var(--safe-l));
  scroll-snap-align: start;
  scroll-snap-stop: always;   /* свайпом нельзя пролететь несколько блоков */
}
.block__inner {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 22px 26px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(10, 16, 34, 0.55), rgba(5, 8, 20, 0.72));
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  will-change: opacity;
}
.block--hero .block__inner, .block--question .block__inner { text-align: center; }

/* Широкий экран: блоки чередуются слева/справа, шар переезжает на свободную сторону */
@media (min-aspect-ratio: 21/20) and (min-width: 640px) {
  .block {
    align-items: center;
    padding: 10vh calc(4vw + var(--safe-r)) 10vh calc(4vw + var(--safe-l));
  }
  .block__inner {
    width: min(46vw, 580px);
    max-width: none;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .side-left .block__inner { margin: 0 auto 0 max(2vw, calc(25vw - min(23vw, 290px))); }
  .side-right .block__inner { margin: 0 max(2vw, calc(25vw - min(23vw, 290px))) 0 auto; }
}

/* Наш знак: белое сердце и золотая бесконечность, рисуются одной линией */
.emblem { display: inline-block; line-height: 0; }
.emblem svg { width: 100%; height: auto; overflow: visible; }
.emblem path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.emblem__heart { stroke: #fbf5ea; stroke-width: var(--em-w, 1.4px); }
.emblem__inf { stroke: var(--gold); stroke-width: calc(var(--em-w, 1.4px) * 0.9); }
.emblem--hero { width: 92px; margin: 0 auto 20px; display: block; }
.emblem--end { width: 52px; }
.emblem--loader { width: 120px; --em-w: 1.6px; }
.emblem--gate { width: 84px; --em-w: 1.3px; }
/* появление: сначала сердце, потом сквозь него проходит бесконечность */
.block:not(.is-in) .emblem path, .story-end:not(.is-in) .emblem path { stroke-dashoffset: 1; }
.block.is-in .emblem__heart, .story-end.is-in .emblem__heart { animation: em-draw 2.2s var(--ease) both; }
.block.is-in .emblem__inf, .story-end.is-in .emblem__inf { animation: em-draw 2.6s var(--ease) 0.7s both; }
.emblem--gate .emblem__heart { animation: em-draw 2.2s var(--ease) 0.3s both; }
.emblem--gate .emblem__inf { animation: em-draw 2.6s var(--ease) 1s both; }
@keyframes em-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
/* загрузка: спокойно рисуется сердце, потом сквозь него — бесконечность; готовый знак мягко светится */
.emblem--loader path { stroke-dashoffset: 1; }
.loader.is-running .emblem--loader .emblem__heart { animation: em-draw 2.6s cubic-bezier(0.45, 0, 0.25, 1) 0.3s forwards; }
.loader.is-running .emblem--loader .emblem__inf { animation: em-draw 2.8s cubic-bezier(0.45, 0, 0.25, 1) 1.9s forwards; }
.loader.is-running .emblem--loader svg { animation: em-glow 1.6s ease 4.6s forwards; }
/* совет про наушники — под знаком, пока он рисуется */
.loader__inner { display: flex; flex-direction: column; align-items: center; gap: 34px; padding: 0 16px; text-align: center; }
.loader__tip { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 0; font-style: italic; font-size: clamp(19px, 1.8vw, 23px); line-height: 1.5; color: rgba(250, 244, 235, 0.88); opacity: 0; }
.loader.is-running .loader__tip { animation: tip-in 1.4s ease 1.2s forwards; }
.loader__must { font-style: normal; font-weight: 500; font-size: 1.12em; letter-spacing: 0.01em; color: var(--gold-2); }
/* =================== PIN: вход только для неё =================== */
.pin {
  position: fixed; inset: 0; z-index: 35;
  display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(120% 90% at 50% 30%, #121a30 0%, #05070f 55%, #000 100%);
  transition: opacity 1.1s ease, visibility 0s 1.1s;
}
.pin[hidden] { display: none; }
.pin.is-open { opacity: 0; visibility: hidden; }
.pin__inner { display: flex; flex-direction: column; align-items: center; text-align: center; animation: gate-in 1.4s ease both; }
.emblem--pin { width: 104px; --em-w: 1.7px; margin-bottom: 26px; }
.emblem--pin path { stroke-dasharray: none; }
.pin__kicker { margin: 0 0 10px; font-family: var(--sans); font-size: 10.5px; font-weight: 500; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold); }
.pin__title { margin: 0 0 30px; font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; color: var(--ink); }
.pin__dots { display: flex; gap: 18px; margin-bottom: 16px; }
.pin__dots i { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(232, 192, 122, 0.7); transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease; }
.pin__dots i.is-on { background: var(--gold-2); box-shadow: 0 0 12px rgba(255, 210, 140, 0.7); transform: scale(1.06); }
.pin__dots.is-wrong { animation: pin-shake 0.5s ease; }
.pin__dots.is-wrong i { border-color: #e98a96; background: transparent; box-shadow: none; }
.pin__dots.is-right i { background: #fff3da; box-shadow: 0 0 18px rgba(255, 220, 160, 0.95); }
.pin__hint { margin: 0 0 26px; min-height: 1.5em; font-style: italic; font-size: clamp(17px, 1.5vw, 19px); color: rgba(244, 237, 228, 0.62); transition: color 0.3s ease; }
.pin__hint.is-wrong { color: #f0a7b0; }
.pin__pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 22px; }
.pin__pad button {
  width: 72px; height: 72px; border-radius: 50%;
  border: 1px solid rgba(232, 192, 122, 0.32); background: rgba(10, 13, 24, 0.5);
  color: var(--ink); font: 300 28px/1 var(--serif); font-variant-numeric: lining-nums; cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.12s ease, color 0.25s ease;
}
.pin__pad button:hover { border-color: var(--gold); background: rgba(232, 192, 122, 0.08); }
.pin__pad button:active { transform: scale(0.94); background: rgba(232, 192, 122, 0.18); }
.pin__pad button:focus-visible { outline: 1px solid var(--gold-2); outline-offset: 4px; }
.pin__pad .pin__del { border-color: transparent; background: none; }
.pin__del svg { width: 26px; height: 26px; fill: none; stroke: rgba(244, 237, 228, 0.7); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
@keyframes pin-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }

.loader__go { min-width: 190px; opacity: 0; transform: translateY(8px); transition: opacity 1s ease, transform 1s ease; }
.loader__go.is-in { opacity: 1; transform: none; }
.loader__phones { width: 30px; height: 30px; fill: none; stroke: var(--gold); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
@keyframes tip-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes em-glow { to { filter: drop-shadow(0 0 6px rgba(255, 220, 160, 0.45)); } }

/* Появление содержимого */
.r {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
}
.block.is-in .r { opacity: 1; transform: none; }
.block.is-in .r:nth-child(2) { transition-delay: 0.1s; }
.block.is-in .r:nth-child(3) { transition-delay: 0.2s; }
.block.is-in .r:nth-child(4) { transition-delay: 0.3s; }
.block.is-in .r:nth-child(5) { transition-delay: 0.4s; }
.block.is-in .r:nth-child(n + 6) { transition-delay: 0.5s; }

/* Типографика блоков */
.kicker {
  margin: 0 0 14px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
}
.title {
  margin: 0 0 18px;
  font-weight: 400;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.08;
  letter-spacing: 0.005em;
}
.title--xl { font-weight: 300; font-size: clamp(44px, 7vw, 96px); margin-bottom: 4px; }
.title--lg { font-size: clamp(32px, 4.8vw, 62px); }
.script {
  margin: 0 0 14px;
  font-family: var(--script-ru);
  font-size: clamp(40px, 5.2vw, 70px);
  line-height: 1.2;
  background: linear-gradient(100deg, var(--gold-2), var(--gold) 40%, #f7cfa0 70%, var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 0 0.15em;
}
.lead {
  margin: 0 0 8px;
  font-style: italic;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.45;
  color: var(--ink-2);
}
.para {
  margin: 0 0 14px;
  white-space: pre-line;   /* переносы строк из конфига сохраняются */
  font-size: clamp(18.5px, 1.65vw, 22px);
  line-height: 1.6;
  color: var(--ink-2);
}
.para:last-child { margin-bottom: 0; }

.scroll-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-hint i {
  position: relative;
  width: 1px;
  height: 40px;
  background: linear-gradient(rgba(232, 192, 122, 0.45), rgba(232, 192, 122, 0));
}
.scroll-hint i::after {
  content: "";
  position: absolute;
  left: -1.5px;
  top: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-2);
  box-shadow: 0 0 6px rgba(248, 225, 174, 0.8);
  animation: spark-down 2.6s var(--ease) infinite;
}
@keyframes spark-down { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(38px); opacity: 0; } }

/* Цитата */
.quote-mark { font-size: 110px; line-height: 0.6; height: 44px; color: var(--gold); opacity: 0.85; }
.quote {
  margin: 0 0 18px;
  white-space: pre-line;   /* строки диалога — каждая с новой строки */
  font-style: italic;
  font-weight: 400;
  font-size: clamp(25px, 3.1vw, 40px);
  line-height: 1.3;
}
.quote-author {
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Фото-полароиды */
.polaroid {
  margin: 0;
  padding: 10px 10px 0;
  background: #f7f2e8;
  border-radius: 3px;
  box-shadow: 0 25px 50px -18px rgba(0, 0, 0, 0.85), 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: rotate(var(--tilt, 0deg));
}
.block.is-in .polaroid.r { transform: rotate(var(--tilt, 0deg)); }
.polaroid__img { aspect-ratio: 4 / 5; overflow: hidden; background: #1a1418; }
.polaroid__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.polaroid__img.is-empty {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #3a2533, #1b1a2e 60%, #2b2120);
}
.polaroid__ph {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(248, 225, 174, 0.7);
  text-align: center;
  padding: 10px;
}
.polaroid__cap {
  font-family: var(--script-ru);
  font-size: 21px;
  color: #3b2d28;
  text-align: center;
  padding: 10px 6px 12px;
  line-height: 1.1;
}
.polaroid--single { width: min(64vw, 300px, 27dvh); margin: 6px auto; }
.polaroid--wide { width: min(100%, 440px); margin: 26px auto 4px; }

/* Видео под спойлером */
.spoiler { width: min(100%, 460px); margin: 26px auto 4px; }
.spoiler__frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0d0f17; border: 1px solid rgba(232, 192, 122, 0.35); }
.spoiler__frame.is-empty { display: grid; place-items: center; border-style: dashed; }
.spoiler__frame video { width: 100%; height: 100%; display: block; object-fit: cover; filter: blur(18px) brightness(0.55); transform: scale(1.08); transition: filter 0.9s var(--ease), transform 0.9s var(--ease); }
.spoiler.is-open .spoiler__frame video { filter: none; transform: none; object-fit: contain; background: #000; }
.spoiler__cover {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border: 0; background: radial-gradient(closest-side, rgba(5, 6, 12, 0.35), rgba(5, 6, 12, 0.6)); color: var(--gold-2); cursor: pointer;
  transition: opacity 0.6s ease;
}
.spoiler__cover svg { width: 62px; height: 62px; fill: none; stroke: currentColor; stroke-width: 1.1; transition: transform 0.4s var(--ease); }
.spoiler__cover svg path { fill: currentColor; stroke: none; }
.spoiler__cover:hover svg { transform: scale(1.08); }
.spoiler__cover:focus-visible { outline: 1px solid var(--gold-2); outline-offset: -6px; }
.spoiler__hint { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase; }
.spoiler.is-open .spoiler__cover { opacity: 0; pointer-events: none; }
.spoiler__cap { margin: 12px 0 0; text-align: center; font-family: var(--script-ru); font-size: clamp(22px, 2vw, 28px); color: var(--gold-2); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75), 0 0 24px rgba(0, 0, 0, 0.72); }
.polaroid--wide .polaroid__img { aspect-ratio: 687 / 545; }
@media (min-aspect-ratio: 21/20) and (min-width: 640px) { .polaroid--single { width: min(30vw, 360px, 52vh); } }
.block--photo .block__inner { background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  width: min(100%, 31dvh);
  margin: 0 auto;
}
@media (min-aspect-ratio: 21/20) and (min-width: 640px) { .gallery { width: min(100%, 62vh); } }
.gallery .polaroid { padding: 6px 6px 0; }
.gallery .polaroid__img { aspect-ratio: 1; }
.gallery .polaroid__cap { font-size: 17px; padding: 6px 4px 8px; }
.gallery .polaroid__ph { font-size: 8px; }

/* Счётчик */
.counter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 18px;
}
.counter__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.02);
}
.counter__num {
  font-size: clamp(28px, 4.2vw, 54px);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--gold-2);
}
.counter__label {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Таймлайн */
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 4px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(var(--gold), rgba(232, 192, 122, 0.1));
}
.timeline__item { position: relative; padding: 0 0 18px 26px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -4px; top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(232, 192, 122, 0.15), 0 0 14px rgba(232, 192, 122, 0.6);
}
.timeline__date {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}
.timeline__title { margin: 4px 0 2px; font-weight: 500; font-size: 23px; line-height: 1.2; }
.timeline__text { margin: 0; font-size: 18px; line-height: 1.45; color: var(--ink-2); }

/* Обещания */
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.promise { display: flex; gap: 14px; align-items: flex-start; font-size: clamp(19px, 1.7vw, 23px); line-height: 1.4; }
.promise__icon { flex: none; width: 18px; height: 18px; margin-top: 6px; color: var(--gold); }
.promise__icon svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.float-heart svg { width: 100%; height: 100%; fill: currentColor; display: block; }

/* Вопрос */
.answer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}
.answer .btn { min-width: 124px; }
.answer.is-gone { opacity: 0 !important; transform: translateY(-10px) !important; pointer-events: none; height: 0; margin: 0; overflow: hidden; transition: opacity 0.5s, transform 0.5s; }
.reply { opacity: 0; transform: translateY(14px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.reply.is-in { opacity: 1; transform: none; }
.reply__text {
  margin: 18px 0 0;
  font-style: italic;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.25;
  background: linear-gradient(100deg, var(--gold-2), #ffc2d4 50%, var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.reply__tg { margin-top: 20px; }

/* Её сообщение */
.msg { margin: 30px auto 0; max-width: 460px; display: flex; flex-direction: column; align-items: stretch; gap: 12px; text-align: left; }
.msg__prompt { margin: 0; font-style: italic; font-size: clamp(18px, 1.6vw, 21px); color: rgba(250, 244, 235, 0.92); text-align: center; }
.msg__note { margin: -4px 0 4px; text-align: center; font-style: italic; font-size: clamp(16px, 1.35vw, 18px); line-height: 1.45; color: rgba(244, 237, 228, 0.66); }
.msg__input {
  width: 100%;
  min-height: 110px;
  padding: 14px 16px;
  resize: vertical;
  border: 1px solid rgba(232, 192, 122, 0.4);
  border-radius: 1px;
  background: rgba(4, 6, 14, 0.55);
  color: var(--ink);
  font: 400 19px/1.5 var(--serif);
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.msg__input::placeholder { color: rgba(244, 237, 228, 0.42); font-style: italic; }
.msg__input:focus { border-color: var(--gold); background: rgba(4, 6, 14, 0.72); }
.msg__send { align-self: center; min-width: 170px; }
.msg__status { margin: 0; min-height: 1.4em; text-align: center; font-family: var(--sans); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-2); }

/* Финал */
.story-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8vh 16px calc(9vh + var(--safe-b));
  scroll-snap-align: end;
}
.sign { margin: 0; max-width: 620px; text-align: center; font-family: var(--script-ru); font-size: clamp(26px, 2.6vw, 34px); line-height: 1.3; color: var(--gold-2); }
.link-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  padding: 10px 2px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.4s;
}
.link-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.7s var(--ease); }
.link-btn span::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 6px;
  background: currentColor;
  transform: scaleX(0.18);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.link-btn:hover { color: var(--gold-2); }
.link-btn:hover svg { transform: rotate(-200deg); }
.link-btn:hover span::after { transform: scaleX(1); }

/* Навигация: засечки, как деления на шкале */
.dots {
  position: fixed;
  z-index: 6;
  right: calc(18px + var(--safe-r));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.dot {
  width: 30px;
  height: 16px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.dot::before {
  content: "";
  width: 9px;
  height: 1px;
  background: rgba(244, 237, 228, 0.42);
  transition: width 0.5s var(--ease), background 0.4s;
}
.dot:hover::before { width: 15px; background: var(--gold-2); }
.dot.is-active::before { width: 26px; background: var(--gold); }
.dot:focus-visible { outline-offset: 1px; }
@media (max-aspect-ratio: 21/20), (max-width: 639px) {
  .dots { top: calc(16px + var(--safe-t)); transform: none; right: auto; left: 50%; translate: -50% 0; flex-direction: row; align-items: flex-end; gap: 0; }
  .dot { width: 16px; height: 26px; align-items: flex-end; justify-content: center; }
  .dot::before { width: 1px; height: 9px; transition: height 0.5s var(--ease), background 0.4s; }
  .dot:hover::before { width: 1px; height: 13px; }
  .dot.is-active::before { width: 1px; height: 20px; }
}

/* Подсказка: строка между двумя волосяными линиями, без плашки */
.hint {
  position: fixed;
  z-index: 6;
  left: 50%;
  top: calc(56px + var(--safe-t));
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s;
}
.hint::before, .hint::after { content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.hint::after { transform: scaleX(-1); }
.hint.is-in { opacity: 1; }
@media (min-aspect-ratio: 21/20) and (min-width: 640px) {
  .hint { left: 75%; top: 4.5vh; }
}

/* Кнопка музыки: двойное тонкое кольцо, нарисованная нота, эквалайзер из штрихов */
.music-btn {
  position: fixed;
  z-index: 7;
  top: calc(16px + var(--safe-t));
  right: calc(16px + var(--safe-r));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(232, 192, 122, 0.45);
  background: rgba(6, 7, 12, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--gold-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: border-color 0.4s, color 0.4s, transform 0.2s;
}
.music-btn::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid rgba(232, 192, 122, 0.14);
  transition: inset 0.45s var(--ease), border-color 0.45s;
}
.music-btn:hover { border-color: var(--gold-2); }
.music-btn:hover::after { inset: 4px; border-color: rgba(232, 192, 122, 0.3); }
.music-btn:active { transform: scale(0.96); }
.music-btn .note { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; }
.music-btn .note__off { stroke: rgba(248, 225, 174, 0.55); }
.music-btn .eq { display: none; gap: 2.5px; align-items: center; height: 15px; }
.music-btn .eq i { width: 1.4px; height: 100%; background: currentColor; border-radius: 1px; animation: eq 1.1s ease-in-out infinite; }
.music-btn .eq i:nth-child(2) { animation-delay: -0.35s; }
.music-btn .eq i:nth-child(3) { animation-delay: -0.7s; }
.music-btn .eq i:nth-child(4) { animation-delay: -0.2s; }
.music-btn .eq i:nth-child(5) { animation-delay: -0.55s; }
.music-btn.is-playing .eq { display: flex; }
.music-btn.is-playing .note { display: none; }
@keyframes eq { 0%, 100% { transform: scaleY(0.28); } 50% { transform: scaleY(1); } }
.music-btn__tip {
  position: absolute;
  right: 56px;
  top: 50%;
  translate: 0 -50%;
  white-space: nowrap;
  padding: 10px 14px;
  border: 1px solid rgba(232, 192, 122, 0.4);
  background: rgba(8, 8, 12, 0.86);
  color: var(--gold-2);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition: opacity 0.5s, transform 0.5s var(--ease);
}
.music-btn.is-nudge { animation: ring 2.4s ease-out infinite; }
.music-btn.is-nudge .music-btn__tip { opacity: 1; transform: none; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(248, 225, 174, 0.35); } 80%, 100% { box-shadow: 0 0 0 14px rgba(248, 225, 174, 0); } }

/* YouTube-плеер: спрятан за сценой, показывается только если браузер заблокировал звук */

/* Сердечки */
.hearts { position: fixed; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.float-heart {
  position: absolute;
  left: var(--x);
  bottom: -50px;
  width: var(--size);
  height: var(--size);
  opacity: 0;
  filter: drop-shadow(0 0 8px currentColor);
  animation: rise var(--dur) var(--ease) var(--delay) forwards;
}
@keyframes rise {
  0% { transform: translate(0, 0) rotate(0) scale(0.6); opacity: 0; }
  12% { opacity: 1; }
  80% { opacity: 0.9; }
  100% { transform: translate(var(--drift), -115vh) rotate(var(--rot)) scale(1); opacity: 0; }
}

/* Затемнение между сценами */
.veil { position: fixed; inset: 0; z-index: 9; background: #000; opacity: 0; pointer-events: none; transition: opacity 1.2s ease; }
.veil.is-on { opacity: 1; }

/* Загрузка */
.loader {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: #000;
  transition: opacity 1.4s ease, visibility 0s 1.4s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.fallback {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000;
  text-align: center;
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink-2);
}
.fallback[hidden] { display: none; }

/* Ответ «нет»: страница медленно теряет цвет */
html { transition: filter 4s ease 0.4s; }
html.is-sad { filter: grayscale(1) brightness(0.88) contrast(1.05); }
.btn--no { opacity: 0.75; }

/* Телефон: только просьба открыть на компьютере */
.is-mobile-gate #gl, .is-mobile-gate .city-ui, .is-mobile-gate .hint { display: none; }
.desktop-only {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--safe-t, 0px)) 24px calc(24px + var(--safe-b, 0px));
  background: radial-gradient(120% 80% at 50% 38%, #10172b 0%, #05070f 55%, #000 100%);
  text-align: center;
}
.desktop-only[hidden] { display: none; }
.desktop-only__card { max-width: min(340px, 100%); animation: gate-in 1.6s ease both; }
.desktop-only__title {
  margin: 22px 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.1;
  color: var(--ink);
}
.desktop-only__text {
  margin: 0 0 32px;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-2);
}
@keyframes gate-in { from { opacity: 0; transform: translateY(10px); } }

/* =================== Читаемость: текст поверх луны, озера и города =================== */
.para, .lead, .timeline__text, .promise, .quote, .reply__text { color: rgba(250, 244, 235, 0.95); }
.para { font-weight: 500; font-size: clamp(19.5px, 1.75vw, 23.5px); line-height: 1.62; }
.lead { font-weight: 500; white-space: pre-line; }
.timeline__text { font-weight: 500; }
.title, .para, .lead, .quote, .quote-author, .timeline__title, .timeline__text, .timeline__date,
.promise, .kicker, .reply__text, .counter__num, .counter__label, .scroll-hint, .sign {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75), 0 0 24px rgba(0, 0, 0, 0.72);
}
.scroll-hint { max-width: 300px; font-size: 10.5px; line-height: 1.7; text-align: center; color: rgba(250, 244, 235, 0.8); }
/* широкий экран: под текстом — мягкая тёмная подложка, чтобы луна и снег не спорили с буквами */
@media (min-aspect-ratio: 21/20) and (min-width: 640px) {
  .block__inner { position: relative; isolation: isolate; }
  .block__inner::before {
    content: "";
    position: absolute;
    inset: -4% -8%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(closest-side, rgba(2, 4, 12, 0.5), rgba(2, 4, 12, 0.25) 60%, transparent);
  }
}
/* заставка города: длинная фраза — аккуратнее и шире */
#intro .stage__top { max-width: 940px; }
#intro .stage__title { font-size: clamp(24px, 3.1vw, 40px); line-height: 1.22; font-weight: 400; }
#intro .stage__text { color: rgba(250, 244, 235, 0.9); }

@media (prefers-reduced-motion: reduce) {
  .r, .stage__title, .stage__text, .stage__bottom { transition-duration: 0.01s !important; }
  .power__light, .music-btn.is-nudge, .scroll-hint i::after { animation: none; }
  .emblem path { animation: none !important; stroke-dashoffset: 0 !important; }
  .emblem--loader path { animation: none !important; stroke-dashoffset: 0 !important; }
  .loader__tip { animation: none; opacity: 1; }
}
