/* ============================================================
   Asil — публичный сайт. Глубокий космос: звёзды, туманности,
   орбиты, свечение. Мобильный в первую очередь.
   Скорость: анимируем только opacity и transform (их считает
   видеокарта), без размытия фона под крупными блоками.
   ============================================================ */

:root {
  --bg-0: #03030a;
  --bg-1: #080719;
  --ink: #f5f1ff;
  --ink-soft: rgba(236, 230, 255, 0.78);
  --ink-faint: rgba(236, 230, 255, 0.44);
  --line: rgba(200, 180, 255, 0.14);
  --accent: #b69cff;
  --accent-2: #7fd4ff;
  --accent-warm: #ffb3d1;
  --heart: #ff6f9f;
  --glow: rgba(160, 130, 255, 0.45);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Атрибут hidden должен перебивать любые display-правила ниже */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg-0);
  background-color: var(--bg-0);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }

::selection { background: rgba(182, 156, 255, 0.35); color: #fff; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- фон ---------- */
#nebula-canvas,
#sky-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#nebula-canvas { z-index: -4; }
#sky-canvas { z-index: -3; }

/* оттенок неба под текущее стихотворение — меняется плавно через color */
.tint {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  color: hsl(265 75% 58%);
  background: radial-gradient(70% 55% at 50% 60%, currentColor, transparent 75%);
  opacity: 0.13;
}
.vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 45%, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
}

/* ---------- заставка ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: radial-gradient(80% 60% at 50% 50%, rgba(8, 7, 25, 0.55), rgba(3, 3, 10, 0.92));
  transition: opacity 1.1s var(--ease);
}
.gate.is-leaving { opacity: 0; pointer-events: none; }
.gate__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 40px;
  transition: transform 1.1s var(--ease);
}
.gate.is-leaving .gate__btn { transform: scale(1.6); }
.gate__star {
  font-size: 34px;
  color: #fff;
  text-shadow: 0 0 18px var(--glow), 0 0 40px var(--glow);
  animation: gatePulse 2.6s ease-in-out infinite;
}
.gate__text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.45rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.gate__note {
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
@keyframes gatePulse {
  0%, 100% { transform: scale(0.9) rotate(0deg); opacity: 0.7; }
  50% { transform: scale(1.15) rotate(45deg); opacity: 1; }
}

/* ---------- прогресс чтения ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 20;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-warm));
  box-shadow: 0 0 12px var(--glow);
}

/* ---------- плавающие кнопки ---------- */
.fab {
  position: fixed;
  z-index: 15;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(220, 205, 255, 0.22);
  background: rgba(14, 11, 36, 0.72);
  display: grid;
  place-items: center;
  transition: transform 0.3s ease, box-shadow 0.4s ease, opacity 0.8s ease;
  opacity: 0;
}
body.fabs-on .fab { opacity: 1; }
.fab:active { transform: scale(0.92); }
.fab--music {
  right: calc(env(safe-area-inset-right, 0px) + 16px);
  bottom: calc(var(--safe-b) + 16px);
}
.fab--map {
  left: calc(env(safe-area-inset-left, 0px) + 16px);
  bottom: calc(var(--safe-b) + 16px);
}
.fab--map svg {
  width: 22px;
  height: 22px;
  fill: var(--accent);
  stroke: var(--accent);
  stroke-width: 1;
  stroke-linejoin: round;
  overflow: visible;
}
.fab--map svg path { fill: none; opacity: 0.6; }
.fab--music.playing { box-shadow: 0 0 24px var(--glow); }

.music-icon {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}
.music-icon span {
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: bottom;
  transform: scaleY(0.33);
}
.fab--music.playing .music-icon span { animation: eq 0.9s ease-in-out infinite; }
.fab--music.playing .music-icon span:nth-child(2) { animation-delay: 0.15s; }
.fab--music.playing .music-icon span:nth-child(3) { animation-delay: 0.3s; }
.fab--music.playing .music-icon span:nth-child(4) { animation-delay: 0.45s; }
@keyframes eq {
  0%, 100% { transform: scaleY(0.28); }
  50% { transform: scaleY(0.9); }
}

/* ---------- первый экран ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px 90px;
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

/* орбиты вокруг имени */
.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(118vw, 760px);
  aspect-ratio: 1;
  transform: translate(-50%, -54%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 3s 0.4s var(--ease);
}
.entered .orbit { opacity: 1; }
.orbit__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  transform: rotateX(72deg) rotateZ(0deg);
  animation: spin 46s linear infinite;
}
.orbit__ring--2 {
  inset: 14%;
  border-color: rgba(127, 212, 255, 0.1);
  animation-duration: 30s;
  animation-direction: reverse;
}
.orbit__planet {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--accent) 60%, #4b2fa8);
  box-shadow: 0 0 18px 4px var(--glow);
}
.orbit__planet--small {
  width: 6px;
  height: 6px;
  margin-left: -3px;
  top: -3px;
  background: radial-gradient(circle at 35% 35%, #fff, var(--accent-2));
  box-shadow: 0 0 12px 3px rgba(127, 212, 255, 0.5);
}
.orbit__glow {
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(150, 120, 255, 0.22), transparent 70%);
  animation: breathe 7s ease-in-out infinite;
}
@keyframes spin {
  to { transform: rotateX(72deg) rotateZ(360deg); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes fadeIn { to { opacity: 1; } }

.hero__intro {
  position: relative;
  font-weight: 300;
  letter-spacing: clamp(0.18em, 1.2vw, 0.5em);
  text-transform: lowercase;
  font-size: clamp(0.7rem, 2.8vw, 0.78rem);
  max-width: 100%;
  color: var(--ink-faint);
  margin-bottom: 1.4rem;
  opacity: 0;
}
.entered .hero__intro { animation: rise 1.6s 0.3s var(--ease) forwards; }

.hero__name {
  position: relative;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4.6rem, 25vw, 12rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
/* буквы имени — JS оборачивает каждую в .ch */
.hero__name .ch {
  display: inline-block;
  background: linear-gradient(180deg, #ffffff 10%, #d9ccff 55%, var(--accent) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(0.25em) scale(1.25);
}
.entered .hero__name .ch {
  animation: materialize 1.9s var(--ease) forwards;
  animation-delay: calc(0.6s + var(--i) * 0.16s);
}
.hero__name::after {
  content: "";
  position: absolute;
  inset: 20% -10%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(170, 140, 255, 0.3), transparent);
}
@keyframes materialize {
  to { opacity: 1; filter: blur(0); transform: none; }
}
.hero__dedication {
  position: relative;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.2rem, 4.8vw, 1.75rem);
  color: var(--ink-soft);
  margin-top: 1.4rem;
  max-width: 24ch;
  opacity: 0;
}
.entered .hero__dedication { animation: rise 1.8s 1.8s var(--ease) forwards; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.scroll-hint {
  position: absolute;
  bottom: calc(var(--safe-b) + 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-faint);
  opacity: 0;
}
.entered .scroll-hint { animation: fadeIn 1.5s 2.8s ease forwards; }
.scroll-hint__label {
  font-size: 0.66rem;
  letter-spacing: 0.4em;
  padding-left: 0.4em;
  text-transform: uppercase;
}
.scroll-hint__line {
  position: relative;
  width: 1px;
  height: 46px;
  background: linear-gradient(var(--line), transparent);
  overflow: hidden;
}
.scroll-hint__line::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 20px;
  background: linear-gradient(transparent, #fff);
  transform: translateY(-20px);
  animation: fall 2.2s ease-in-out infinite;
}
@keyframes fall {
  to { transform: translateY(50px); }
}

/* ---------- стихи ---------- */
.poems {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 12px 40px;
}

.poem {
  --hue: 265;
  position: relative;
  padding: clamp(32px, 7vw, 64px) clamp(18px, 6vw, 60px) clamp(22px, 4vw, 34px);
  border-radius: 28px;
  /* непрозрачное «стекло» без backdrop-filter — так прокрутка остаётся плавной */
  background:
    radial-gradient(120% 70% at 0% 0%, hsl(var(--hue) 70% 50% / 0.12), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01) 45%),
    rgba(10, 8, 28, 0.74);
  border: 1px solid rgba(220, 205, 255, 0.09);
  box-shadow: 0 24px 44px -24px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  /* браузер не рисует стихи далеко за экраном — важно, когда их много */
  content-visibility: auto;
  contain-intrinsic-size: auto 640px;
  /* не 0, а 0.01: глазом не видно, но браузер заранее готовит отрисовку карточки
     (пока на экране заставка) — иначе первая прокрутка на телефоне давала рывок */
  opacity: 0.01;
  transform: translateY(40px) scale(0.97);
  transition: opacity 1.1s var(--ease), transform 1.3s var(--ease);
}
.poem.is-visible { opacity: 1; transform: none; }

/* блик, следующий за курсором (на компьютере) */
.poem::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -30%), hsl(var(--hue) 90% 75% / 0.1), transparent 60%);
}
/* светящаяся кромка сверху */
.poem::after {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--hue) 90% 80% / 0.6), transparent);
}

.poem__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1.6rem;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.poem__num {
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: hsl(var(--hue) 90% 80%);
}
.poem__meta::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.poem__img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  margin-bottom: 2rem;
  display: block;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.poem__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 7.5vw, 3rem);
  line-height: 1.1;
  margin-bottom: 1.6rem;
  letter-spacing: 0.01em;
  background: linear-gradient(100deg, #fff 30%, hsl(var(--hue) 90% 86%) 70%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.poem__body {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.18rem, 4.75vw, 1.5rem);
  line-height: 1.8;
  color: var(--ink-soft);
  overflow-wrap: break-word;
}
/* строки проявляются по одной — JS задаёт --d (задержку) */
.poem__line {
  display: block;
  min-height: 1.8em;
  /* если длинная строка не влезла и перенеслась — продолжение с отступом,
     чтобы было видно, что это одна строка стиха, а не две */
  padding-left: 1.1em;
  text-indent: -1.1em;
  opacity: 0.01;
  transition: opacity 1s var(--ease) var(--d, 0s);
}
.poem__line--gap { min-height: 1.1em; }
.poem__sign {
  text-align: right;
  font-style: italic;
  color: var(--ink-faint);
  padding-right: 0.2em;
}
.is-visible .poem__line { opacity: 1; }

/* кнопки под стихом */
.poem__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1.6rem;
}
.poem__like {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.poem__like svg {
  width: 24px;
  height: 24px;
  fill: transparent;
  stroke: var(--ink-faint);
  stroke-width: 1.4;
  transition: fill 0.3s ease, stroke 0.3s ease;
}
.poem__like.is-liked svg {
  fill: var(--heart);
  stroke: var(--heart);
  filter: drop-shadow(0 0 8px rgba(255, 111, 159, 0.6));
}
.poem__like.pop svg { animation: pop 0.5s var(--ease); }
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.poem__listen {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 18px 0 14px;
  margin-right: auto;
  border-radius: 20px;
  border: 1px solid rgba(220, 205, 255, 0.18);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  overflow: hidden;
}
.poem__listen-icon {
  width: 0;
  height: 0;
  border-left: 9px solid var(--accent);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.poem__listen.is-playing .poem__listen-icon {
  width: 9px;
  height: 11px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-right: 3px solid var(--accent);
}
.poem__listen-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
}
.poem__listen-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* разделитель между стихами — маленькая звезда */
.divider {
  display: flex;
  justify-content: center;
  padding: min(9vh, 70px) 0;
  color: var(--accent);
  font-size: 14px;
  text-shadow: 0 0 12px var(--glow);
}

/* ---------- загрузка ---------- */
.loading {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 80px 0;
}
.loading__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--glow);
  animation: pulse 1.3s ease-in-out infinite;
}
.loading__dot:nth-child(2) { animation-delay: 0.2s; }
.loading__dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}
.empty-note {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink-faint);
  padding: 60px 0;
}

/* ---------- счётчик «вместе уже» ---------- */
.together {
  text-align: center;
  padding: 60px 24px 20px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
}
.together.is-visible { opacity: 1; transform: none; }
.together__label {
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  padding-left: 0.4em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.together__days {
  font-family: var(--serif);
  font-size: clamp(4rem, 20vw, 7rem);
  line-height: 1.1;
  margin: 0.3rem 0;
  background: linear-gradient(180deg, #fff 20%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: lining-nums;
}
.together__days small {
  display: block;
  font-size: 1.4rem;
  font-style: italic;
  margin-top: -0.4rem;
}
.together__detail {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- финал: созвездие ---------- */
.finale {
  position: relative;
  text-align: center;
  padding: 60px 24px calc(var(--safe-b) + 100px);
}
.constellation {
  display: block;
  width: min(78vw, 320px);
  margin: 0 auto 10px;
  overflow: visible;
}
.c-dust { fill: rgba(255, 255, 255, 0.5); opacity: 0; transition: opacity 2s ease calc(var(--i) * 0.05s); }
/* свечение звезды — второй круг побольше, без filter (filter в SVG пересчитывается каждый кадр) */
.c-glow { fill: rgba(190, 170, 255, 0.28); }
.c-star {
  fill: #fff;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  transition: opacity 0.6s ease calc(0.3s + var(--i) * 0.12s), transform 0.8s var(--ease) calc(0.3s + var(--i) * 0.12s);
}
.c-line {
  stroke: rgba(200, 180, 255, 0.55);
  stroke-width: 0.6;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.6s ease calc(2s + var(--i) * 0.14s);
}
.finale.is-on .c-dust { opacity: 1; }
.finale.is-on .c-star { opacity: 1; transform: none; }
.finale.is-on .c-line { stroke-dashoffset: 0; }
.finale.is-on .constellation { animation: heartbeat 2.4s ease-in-out 4.4s infinite; will-change: transform; }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.04); }
  24% { transform: scale(1); }
  36% { transform: scale(1.03); }
}
.finale__name,
.finale__note,
.secret-btn,
.wish-hint {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease);
}
.finale.is-on .finale__name { opacity: 1; transform: none; transition-delay: 4.2s; }
.finale.is-on .finale__note { opacity: 1; transform: none; transition-delay: 4.6s; }
.finale.is-on .secret-btn { opacity: 1; transform: none; transition-delay: 5.2s; }
.finale.is-on .wish-hint { opacity: 1; transform: none; transition-delay: 5.8s; }
.finale__name {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 12vw, 4rem);
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff 20%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.finale__note,
.wish-hint { text-shadow: 0 0 12px #03030a, 0 0 4px #03030a; }
.finale__note {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  margin-top: 0.4rem;
}
.secret-btn {
  margin-top: 2.2rem;
  padding: 12px 22px;
  border-radius: 24px;
  border: 1px solid rgba(220, 205, 255, 0.22);
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  box-shadow: 0 0 30px -8px var(--glow);
}
.wish-hint {
  margin-top: 2.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: rgba(236, 230, 255, 0.3);
}

/* ---------- карта звёзд ---------- */
.map {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  /* полупрозрачно: за созвездием видна живая 3D-галактика */
  background: radial-gradient(120% 80% at 50% 30%, rgba(14, 10, 40, 0.5), rgba(3, 3, 10, 0.78));
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.map.is-open { opacity: 1; transform: none; }
.map__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px 10px 24px;
}
.map__title {
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.map__close,
.secret__close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--ink-soft);
}
.map__scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--safe-b) + 30px);
}
.map__sky { position: relative; margin: 0 8px; }
.map__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.map__lines polyline {
  fill: none;
  stroke: rgba(200, 180, 255, 0.22);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.map.is-open .map__lines polyline { transition: stroke-dashoffset 2.2s ease 0.2s; stroke-dashoffset: 0; }
.map__star {
  --s: 1;
  position: absolute;
  width: max-content;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  transform: translate(-22px, -50%);
  opacity: 0;
  transition: opacity 0.5s ease calc(0.1s + min(var(--i), 12) * 0.05s);
}
.map.is-open .map__star { opacity: 1; }
.map__star--left { flex-direction: row-reverse; transform: translate(calc(-100% + 22px), -50%); }
.map__dot {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}
.map__dot::before {
  content: "";
  width: calc(7px * var(--s));
  height: calc(7px * var(--s));
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 2px hsl(var(--hue) 90% 70% / 0.7);
  opacity: 0.55;
}
.map__star.is-seen .map__dot::before { opacity: 1; box-shadow: 0 0 16px 5px hsl(var(--hue) 90% 70% / 0.8); }
.map__label {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.2;
  color: var(--ink-soft);
  /* ширина карты = экран минус поля 8px; оставляем место под точку и отступ */
  max-width: min(320px, calc((100vw - 16px) * var(--room) / 100 - 46px));
  text-align: left;
}
.map__star--left .map__label { text-align: right; }
.map__label b {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  color: hsl(var(--hue) 90% 80%);
}
.map__star.is-liked .map__label b::after { content: " ♥"; color: var(--heart); }

/* ---------- тайное послание ---------- */
.secret {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 3, 10, 0.85);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.secret.is-open { opacity: 1; }
.secret__card {
  position: relative;
  width: min(100%, 460px);
  max-height: 86vh;
  overflow-y: auto;
  padding: 44px 28px 34px;
  border-radius: 28px;
  text-align: center;
  background: radial-gradient(120% 80% at 50% 0%, rgba(120, 90, 255, 0.18), transparent 60%), #0b0920;
  border: 1px solid rgba(220, 205, 255, 0.14);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 60px -20px var(--glow);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.5s var(--ease);
}
.secret.is-open .secret__card { transform: none; }
.secret__close { position: absolute; top: 8px; right: 8px; }
.secret__lock { font-size: 28px; color: var(--accent); text-shadow: 0 0 16px var(--glow); }
.secret__title { font-family: var(--serif); font-size: 1.9rem; margin-top: 8px; }
.secret__hint,
.secret__text { color: var(--ink-faint); margin-top: 10px; line-height: 1.6; font-size: 0.92rem; }
.secret__form { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.secret__form input {
  font: inherit;
  font-size: 16px; /* меньше 16px — iPhone приближает страницу */
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(220, 205, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  text-align: center;
  outline: none;
}
.secret__form input:focus { border-color: var(--accent); }
.secret__form button {
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #7b5cff, #b69cff);
  color: #fff;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.secret__error { color: var(--accent-warm); margin-top: 12px; font-size: 0.9rem; }
.shake { animation: shake 0.45s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.secret__message {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-top: 14px;
}

/* ---------- уведомление ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 84px);
  z-index: 60;
  padding: 12px 22px;
  border-radius: 22px;
  background: rgba(20, 16, 48, 0.92);
  border: 1px solid rgba(220, 205, 255, 0.2);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  white-space: nowrap;
  box-shadow: 0 0 30px -6px var(--glow);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.4s ease, transform 0.4s var(--ease);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- искры ---------- */
.spark {
  position: fixed;
  z-index: 30;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  pointer-events: none;
  background: #fff;
  box-shadow: 0 0 8px 2px var(--glow);
  animation: spark 0.9s var(--ease) forwards;
}
.spark--heart {
  width: auto;
  height: auto;
  margin: -0.6em 0 0 -0.4em;
  background: none;
  box-shadow: none;
  color: var(--heart);
  font-size: 12px;
  animation-duration: 1.1s;
}
@keyframes spark {
  to { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* ---------- компьютер: можно чуть богаче ---------- */
@media (hover: hover) and (pointer: fine) {
  .fab { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .fab:hover { box-shadow: 0 0 20px var(--glow); }
  .poem__like:hover svg { stroke: var(--heart); }
  .map__star:hover .map__label { color: #fff; }
  .poems { padding-top: 40px; }
}

/* ---------- меньше движения по запросу системы ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .poem, .poem__line, .together { opacity: 1; transform: none; }
}

/* ---------- режим 3D-галактики (WebGL) ---------- */
/* галактика заменяет орбиты; имя рисуется частицами, буквы в HTML остаются для чтения с экрана */
.gl .orbit { display: none; }
.name-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.gl-name .hero__name .ch {
  opacity: 0 !important;
  animation: none !important;
  transform: none;
  filter: none;
}
/* туманность сама красится под стих и сама делает виньетку — лишние полноэкранные слои убираем */
.gl .tint,
.gl .vignette { display: none; }
.gl .gate { background: radial-gradient(60% 45% at 50% 50%, transparent, rgba(3, 3, 10, 0.75)); }
.gl .gate__star { opacity: 0.35; }

/* ============================================================
   Личные разделы: приветствие, «новое», письмо, причины, ответ
   ============================================================ */

/* свечение зари/заката для простого фона (в режиме галактики его рисует туманность) */
.sunglow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0;
}
.gl .sunglow { display: none; }

/* приветствие на заставке */
.gate__greet {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 8vw, 2.6rem);
  line-height: 1.15;
  color: var(--ink);
  text-shadow: 0 0 24px rgba(180, 150, 255, 0.35);
  margin-bottom: -4px;
  animation: rise 1.6s 0.2s var(--ease) both;
}
.gate__sub {
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #ffc98f;
  text-shadow: 0 0 14px rgba(255, 170, 80, 0.5);
  animation: rise 1.6s 0.6s var(--ease) both;
}
[data-daytime="рассвет"] .gate__sub { color: #ffb3c4; text-shadow: 0 0 14px rgba(255, 140, 160, 0.5); }
[data-daytime="сумерки"] .gate__sub { color: #e0b0ff; text-shadow: 0 0 14px rgba(200, 120, 255, 0.5); }

/* «✦ новое стихотворение» на первом экране */
.hero__new {
  position: relative;
  margin-top: 1.6rem;
  padding: 10px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 200, 140, 0.35);
  background: rgba(40, 24, 50, 0.55);
  color: #ffd9a8;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  box-shadow: 0 0 26px -6px rgba(255, 180, 100, 0.55);
  opacity: 0;
}
.entered .hero__new { animation: rise 1.6s 2.6s var(--ease) forwards, newPulse 3s 4.2s ease-in-out infinite; }
@keyframes newPulse {
  0%, 100% { box-shadow: 0 0 22px -8px rgba(255, 180, 100, 0.45); }
  50% { box-shadow: 0 0 34px -4px rgba(255, 180, 100, 0.75); }
}

/* пометка «новое» на карточке */
.poem__new {
  order: 3;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: #2a1530;
  background: linear-gradient(90deg, #ffd29a, #ffb3d1);
  box-shadow: 0 0 14px rgba(255, 190, 140, 0.55);
  transition: opacity 1.2s ease;
}
.poem__new.is-read { opacity: 0; }
.poem__meta:has(.poem__new)::after { order: 2; }

/* новая звезда на карте — с пульсирующим кольцом */
.map__dot { position: relative; }
.map__star.is-new .map__dot::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 140, 0.8);
  animation: ring 2.2s ease-out infinite;
}
.map__star.is-new .map__label b::after { content: " · новое"; color: #ffd29a; }
@keyframes ring {
  from { transform: scale(0.4); opacity: 1; }
  to { transform: scale(1.6); opacity: 0; }
}

/* ---------- письмо ---------- */
.letter {
  max-width: 640px;
  margin: 0 auto;
  padding: 70px 26px 30px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease);
}
.letter.is-on { opacity: 1; transform: none; }
.letter__label,
.reasons__label {
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  padding-left: 0.4em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 2rem;
}
.letter__label::before,
.letter__label::after {
  content: "✦";
  margin: 0 14px;
  color: var(--accent);
  letter-spacing: 0;
}
.letter__text {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  text-shadow: 0 0 18px rgba(3, 3, 10, 0.9);
  min-height: 3em;
}
.letter__caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.letter__sign,
.letter__reply {
  opacity: 0;
  transition: opacity 1.4s ease 0.4s;
}
.letter.is-done .letter__sign,
.letter.is-done .letter__reply { opacity: 1; }
.letter__sign {
  text-align: right;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink-soft);
  margin-top: 1.4rem;
}
.letter__reply {
  display: block;
  margin: 2.6rem auto 0;
  padding: 13px 28px;
  border-radius: 26px;
  border: 1px solid rgba(220, 205, 255, 0.28);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  box-shadow: 0 0 30px -8px var(--glow);
}

/* ---------- звёзды-причины ---------- */
.reasons {
  max-width: 700px;
  margin: 0 auto;
  padding: 70px 16px 20px;
  text-align: center;
}
.reasons__sky {
  position: relative;
  height: clamp(300px, 58vh, 480px);
  margin: 0 8px;
}
.reason-star {
  position: absolute;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  display: grid;
  place-items: center;
}
.reason-star::before {
  content: "";
  width: calc(6px * var(--s));
  height: calc(6px * var(--s));
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 2px rgba(190, 170, 255, 0.7);
  opacity: 0.75;
  transition: transform 0.5s var(--ease), box-shadow 0.5s ease, opacity 0.5s ease;
}
.reasons.is-on .reason-star:not(.is-open)::before {
  animation: twinkleStar var(--tw) ease-in-out var(--dl) infinite;
}
@keyframes twinkleStar {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}
.reason-star.is-open::before {
  background: #ffe1b8;
  box-shadow: 0 0 12px 3px rgba(255, 190, 130, 0.65);
  opacity: 1;
}
.reason-star.is-current::before {
  transform: scale(1.9);
  box-shadow: 0 0 22px 7px rgba(255, 190, 130, 0.8);
}
.reasons__text {
  min-height: 4.6em;
  max-width: 30ch;
  margin: 1.2rem auto 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.3rem, 5.4vw, 1.7rem);
  line-height: 1.45;
  color: var(--ink);
  text-shadow: 0 0 18px rgba(3, 3, 10, 0.9);
  opacity: 0;
}
.reasons__text.show { animation: rise 1s var(--ease) forwards; }
.reasons__count {
  margin-top: 0.6rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- кнопки в финале и форма ответа ---------- */
.finale__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 2.2rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease);
}
.finale.is-on .finale__actions { opacity: 1; transform: none; transition-delay: 5.2s; }
.finale__actions .secret-btn { margin-top: 0; opacity: 1; transform: none; }
.reply__form textarea {
  font: inherit;
  font-family: var(--serif);
  font-size: 18px; /* не меньше 16px — иначе iPhone приближает страницу */
  line-height: 1.5;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(220, 205, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  resize: vertical;
  min-height: 140px;
  outline: none;
}
.reply__form textarea:focus { border-color: var(--accent); }
.reply__count { font-size: 0.75rem; color: var(--ink-faint); text-align: right; margin: -4px 4px 0; }
.reply__form button:disabled { opacity: 0.6; }

/* ============================================================
   Галактика стихов: портал на главной, окно чтения, вспышка
   ============================================================ */

/* ---------- портал ---------- */
.portal-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 50px 16px 10px;
}
.portal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 26px 20px 30px;
  border-radius: 28px;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(90% 70% at 50% 35%, rgba(130, 90, 255, 0.22), transparent 70%),
    rgba(10, 8, 28, 0.78);
  border: 1px solid rgba(200, 180, 255, 0.2);
  box-shadow: 0 0 50px -14px rgba(150, 120, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: portalGlow 4s ease-in-out infinite;
  transition: transform 0.4s var(--ease);
}
.portal:active { transform: scale(0.97); }
/* световой блик, медленно проходящий по порталу */
.portal::after {
  content: "";
  position: absolute;
  inset: -50% -20%;
  background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, 0.07) 50%, transparent 60%);
  transform: translateX(-60%);
  animation: sheen 6s ease-in-out 1.5s infinite;
  pointer-events: none;
}
@keyframes sheen { 0% { transform: translateX(-60%); } 40%, 100% { transform: translateX(60%); } }
@keyframes portalGlow {
  0%, 100% { box-shadow: 0 0 44px -16px rgba(150, 120, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07); }
  50% { box-shadow: 0 0 64px -10px rgba(150, 120, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.07); }
}
.portal__sky {
  width: 100%;
  max-width: 420px;
  height: auto;
  margin-bottom: 10px;
  overflow: visible;
}
.portal__sky .pd { fill: rgba(255, 255, 255, 0.55); animation: twinkle 3.5s ease-in-out var(--d) infinite; }
.portal__sky .pl {
  fill: none;
  stroke: rgba(200, 180, 255, 0.35);
  stroke-width: 0.8;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: drawLine 3s ease 0.5s forwards;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.portal__sky .ps {
  fill: #fff;
  filter: drop-shadow(0 0 3px rgba(190, 170, 255, 0.9));
  transform-box: fill-box;
  transform-origin: center;
  animation: starPop 0.8s var(--ease) var(--d) both;
}
.portal__sky .ps--hot { fill: #ffe1b8; filter: drop-shadow(0 0 5px rgba(255, 190, 130, 0.95)); }
@keyframes starPop { from { transform: scale(0); opacity: 0; } to { transform: none; opacity: 1; } }
.portal__title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 8vw, 2.5rem);
  line-height: 1.1;
  background: linear-gradient(180deg, #fff 20%, var(--accent) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.portal__count {
  margin-top: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.portal__go {
  margin-top: 18px;
  padding: 11px 26px;
  border-radius: 24px;
  border: 1px solid rgba(220, 205, 255, 0.3);
  font-size: 0.75rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(150, 120, 255, 0.12);
}

/* ---------- вспышка света при переходе ---------- */
.flash {
  position: fixed;
  z-index: 60;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, #fff 0%, rgba(220, 205, 255, 0.85) 25%, rgba(160, 130, 255, 0.35) 55%, transparent 72%);
  opacity: 0;
  transform: scale(0);
}
.flash.go { animation: flashGo 0.75s cubic-bezier(0.2, 0.6, 0.3, 1) forwards; }
@keyframes flashGo {
  0% { opacity: 0; transform: scale(0.2); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: scale(48); }
}

/* ---------- галактика (бывшая карта звёзд) ---------- */
.map__title span { color: var(--accent); letter-spacing: 0.1em; }

/* ---------- окно чтения ---------- */
.reader {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: flex;
  flex-direction: column;
  background: rgba(3, 3, 10, 0.72);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.reader.is-open { opacity: 1; }
.reader__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 10px 8px 12px;
  background: linear-gradient(rgba(3, 3, 10, 0.9), rgba(3, 3, 10, 0));
}
.reader__back {
  padding: 10px 12px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.reader__pos {
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.reader__close {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  color: var(--ink-soft);
}
.reader__scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px 12px calc(env(safe-area-inset-bottom, 0px) + 30px);
}
.reader__stage {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  display: grid;
}
/* оба стиха (уходящий и прилетающий) — в одной ячейке, друг над другом */
.reader__stage > .poem {
  grid-area: 1 / 1;
  content-visibility: visible;
  transition: opacity 0.45s var(--ease), transform 0.5s var(--ease);
}
.reader__stage > .poem.in-right { opacity: 0; transform: translateX(60px) scale(0.96); }
.reader__stage > .poem.in-left { opacity: 0; transform: translateX(-60px) scale(0.96); }
.reader__stage > .poem.out-left { opacity: 0 !important; transform: translateX(-60px) scale(0.96) !important; pointer-events: none; }
.reader__stage > .poem.out-right { opacity: 0 !important; transform: translateX(60px) scale(0.96) !important; pointer-events: none; }
.reader__nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 760px;
  margin: 22px auto 0;
}
.reader__step {
  flex: 1;
  padding: 14px 10px;
  border-radius: 20px;
  border: 1px solid rgba(220, 205, 255, 0.18);
  background: rgba(14, 11, 36, 0.6);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.reader__step:disabled { opacity: 0.25; }
.reader__hint {
  margin-top: 16px;
  text-align: center;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(236, 230, 255, 0.28);
}
@media (hover: hover) and (pointer: fine) {
  .reader__hint { display: none; }
  .portal:hover { transform: translateY(-3px); }
}

/* пока открыт стих — подписи галактики прячем, чтобы не просвечивали сквозь карточку */
body.reading .map__head,
body.reading .map__scroll { visibility: hidden; }
.map__label { text-shadow: 0 0 10px rgba(3, 3, 10, 0.95), 0 0 3px rgba(3, 3, 10, 0.9); }
.reader { background: rgba(3, 3, 10, 0.5); }

/* пока открыты галактика, стих или окно ответа — страница под ними скрыта
   (видна только живая галактика); прокрутка при этом не сбрасывается */
body.no-scroll > :is(header, main, section, footer, .progress, .fab) { visibility: hidden; }

/* новый стих ждёт её реакции: сердечко мягко пульсирует, рядом — подсказка */
.poem__like.is-asking svg {
  stroke: var(--heart);
  animation: askPulse 1.8s ease-in-out infinite;
}
@keyframes askPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255, 111, 159, 0)); }
  50% { transform: scale(1.18); filter: drop-shadow(0 0 8px rgba(255, 111, 159, 0.8)); }
}
.poem__ask {
  margin-left: auto;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: #ffb3d1;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 1s ease, transform 1s var(--ease);
}
.poem__ask.show { opacity: 1; transform: none; }
.poem__ask.is-read { opacity: 0; }

/* пока заставка на экране — страница под ней не прокручивается */
body.gate-lock { overflow: hidden; touch-action: none; }

/* окно желания: вторая, тихая кнопка */
.wish__silent {
  padding: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
