/* ============ базовое ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --font-display: 'Cormorant', 'Georgia', serif;
  --font-script: 'Marck Script', cursive;
  --font-body: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --maxw: 640px;
  --radius: 20px;
}

/* ---- темы: три состояния неба ---- */
[data-theme="night"] {
  --bg: #0B1026;
  --bg2: #1B2440;
  --text: #F2EFE6;
  --muted: rgba(242, 239, 230, .62);
  --accent: #E8C36A;
  --accent-soft: rgba(232, 195, 106, .16);
  --card: rgba(23, 31, 58, .62);
  --line: rgba(232, 195, 106, .28);
  --shadow: 0 18px 44px rgba(0, 0, 0, .45);
}
[data-theme="sunset"] {
  --bg: #2A1220;
  --bg2: #5C2434;
  --text: #FBEEE2;
  --muted: rgba(251, 238, 226, .64);
  --accent: #EFA35F;
  --accent-soft: rgba(239, 163, 95, .16);
  --card: rgba(64, 24, 38, .58);
  --line: rgba(239, 163, 95, .3);
  --shadow: 0 18px 44px rgba(24, 6, 14, .5);
}
[data-theme="dawn"] {
  --bg: #FBF4EF;
  --bg2: #F3DCE2;
  --text: #463640;
  --muted: rgba(70, 54, 64, .78);
  --accent: #9F5570;
  --accent-soft: rgba(178, 94, 125, .12);
  --card: rgba(255, 255, 255, .82);
  --line: rgba(178, 94, 125, .28);
  --shadow: 0 16px 40px rgba(120, 70, 90, .18);
}
[data-theme="dawn"] .year-mark { opacity: .26; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* страница-подарок: ничего не выделяется и не вытягивается долгим нажатием */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior-y: none;
}

/* небо-фон и частицы лежат под контентом */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}
#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  pointer-events: none;
}

img { max-width: 100%; height: auto; display: block; -webkit-user-drag: none; }
button { font-family: inherit; cursor: pointer; }
/* убирает задержку тапа и двойное-тап-зумирование там, где есть свои жесты */
button, .shot img, .finale { touch-action: manipulation; }

/* ============ общая типографика ============ */
.eyebrow {
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
}
.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(1.9rem, 7.5vw, 2.5rem);
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
  margin-top: .5rem;
}

section { padding: clamp(4.5rem, 14vw, 7rem) 1.4rem; max-width: var(--maxw); margin: 0 auto; }

/* появление при прокрутке */
.reveal {
  opacity: 0;
  transform: translateY(26px) scale(.985);
  transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; will-change: auto; }

/* ============ замок ============ */
.lock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity .9s ease, transform .9s cubic-bezier(.4, 0, .2, 1);
}
.lock.open {
  opacity: 0;
  transform: scale(1.12);
  pointer-events: none;
}
.lock[hidden] { display: none; }
.lock-blur {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.lock-blur img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: blur(26px) saturate(1.1);
  transform: scale(1.15);
  opacity: .5;
}
.lock-blur::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 5%, var(--bg) 85%);
  opacity: .92;
}
.lock-body {
  position: relative;
  text-align: center;
  padding: 2rem 1.6rem calc(2rem + env(safe-area-inset-bottom));
  max-width: 420px;
}
.lock-icon {
  color: var(--accent);
  display: flex;
  justify-content: center;
  margin-bottom: 1.4rem;
}
.lock-icon .shackle {
  transform-origin: 32px 30px;
  transition: transform .5s cubic-bezier(.5, -0.4, .3, 1.4);
}
.lock.unlocked .shackle { transform: translateY(-9px) rotate(-24deg); }
.lock-eyebrow {
  font-size: .68rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--muted);
}
.lock-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  margin-top: .7rem;
  color: var(--text);
}
.lock-count {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 9.5vw, 3rem);
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1.15;
  margin-top: .3rem;
}
.lock-unit {
  font-size: .72rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}
.lock-cells {
  display: flex;
  justify-content: center;
  gap: .9rem;
  margin-top: 2.4rem;
}
.cell {
  width: 62px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  text-align: center;
  caret-color: var(--accent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
  -webkit-user-select: text;
  user-select: text;
}
.cell:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.cell.filled { border-color: var(--accent); }
.lock.unlocked .cell {
  border-color: var(--accent);
  box-shadow: 0 0 26px var(--accent-soft);
  transform: translateY(-4px);
}
.lock.wrong .lock-cells { animation: shake .5s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
.lock-hint {
  margin-top: 1.5rem;
  font-family: var(--font-script);
  font-size: 1.15rem;
  color: var(--muted);
  min-height: 1.6em;
  transition: color .3s ease;
}
.lock.wrong .lock-hint { color: var(--accent); }
/* напоминание про громкость на экране замка */
.sound-note {
  margin-top: 2.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  opacity: 0;
  animation: noteIn 1s ease 1.6s forwards;
}
@keyframes noteIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: .85; transform: none; }
}
.sound-ico { color: var(--accent); display: flex; }
.sound-ico .w { opacity: 0; animation: wave 2.4s ease-in-out infinite; }
.sound-ico .w1 { animation-delay: 2s; }
.sound-ico .w2 { animation-delay: 2.25s; }
.sound-ico .w3 { animation-delay: 2.5s; }
@keyframes wave {
  0%, 55%, 100% { opacity: 0; }
  15%, 40% { opacity: 1; }
}
.sound-text {
  font-family: var(--font-script);
  font-size: 1.1rem;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}

/* если браузер не пустил музыку — зовём коснуться экрана */
.tap-sound {
  position: fixed;
  left: 50%;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 18px));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: .92rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: tapIn .6s ease;
}
.tap-sound[hidden] { display: none; }
.tap-sound-ico {
  color: var(--accent);
  font-size: 1.1rem;
  animation: heartbeat 1.8s ease-in-out infinite;
}
@keyframes tapIn {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

body.locked { overflow: hidden; }
body.locked main, body.locked .intro, body.locked .player, body.locked .theme-toggle { visibility: hidden; }

/* ============ интро ============ */
.intro {
  min-height: 100vh;
  min-height: 100svh;
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.intro-art {
  position: relative;
  height: 56vh;
  height: 56svh;
  overflow: hidden;
}
.intro-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  animation: introZoom 20s ease-in-out infinite alternate;
}
@keyframes introZoom {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}
.intro-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, var(--bg) 98%);
}
.intro-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  text-align: center;
  padding: 1rem 1.4rem calc(2.5rem + env(safe-area-inset-bottom));
  margin-top: -3rem;
  position: relative;
  z-index: 1;
}
.intro-name {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(3.4rem, 18vw, 5.4rem);
  line-height: 1.05;
  color: var(--accent);
  text-shadow: 0 2px 30px var(--accent-soft);
}
.intro-sub { color: var(--muted); font-size: .95rem; }
.btn-start {
  margin-top: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .9rem 2.2rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .25s ease, background .25s ease;
}
.btn-start:active { transform: scale(.96); }
.btn-heart {
  color: var(--accent);
  display: inline-block;
  animation: heartbeat 1.6s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.28); }
  24% { transform: scale(1); }
  36% { transform: scale(1.18); }
  48% { transform: scale(1); }
}

/* ============ счётчик ============ */
.counter { text-align: center; }
.counter-years {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(3rem, 13vw, 4.6rem);
  line-height: 1.1;
  color: var(--accent);
  margin: .6rem 0 1.8rem;
}
.counter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .9rem .4rem 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.stat-wide { grid-column: 1 / -1; padding: 1.1rem .4rem 1.2rem; }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 5.2vw, 1.9rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.stat-num-sec { font-size: clamp(1.9rem, 9vw, 2.8rem); color: var(--accent); }
.stat-label {
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.counter-note {
  margin-top: 1.6rem;
  font-family: var(--font-script);
  font-size: 1.35rem;
  color: var(--muted);
}

/* ============ история ============ */
.story { padding-bottom: 2rem; }
.chapter {
  display: flex;
  justify-content: center;
  margin: clamp(3rem, 10vw, 4.5rem) 0 .4rem;
}
.year-mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(4.6rem, 24vw, 7.5rem);
  line-height: 1;
  color: var(--accent);
  opacity: .16;
  letter-spacing: .04em;
}
.vow {
  text-align: center;
  margin: 1rem 0 2rem;
  padding: 1.8rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.vow-date {
  font-size: .78rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--accent);
}
.vow-text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.5rem, 6.4vw, 2rem);
  margin-top: .5rem;
}
.shot {
  margin: 2.2rem auto;
  max-width: 480px;
}
.shot img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
/* особо вытянутое фото аккуратно сужаем, сохраняя пропорции */
.shot img[src$="s02.jpg"] { max-width: 78%; margin: 0 auto; }
.shot:nth-of-type(odd) img { transform: rotate(-1.1deg); }
.shot:nth-of-type(even) img { transform: rotate(1.1deg); }
.shot figcaption {
  margin-top: .8rem;
  text-align: center;
  font-family: var(--font-script);
  font-size: 1.4rem;
  color: var(--muted);
}

/* ============ слайдеры ============ */
.slider { margin: 2.2rem auto 1rem; max-width: 480px; }
.slider-track {
  display: flex;
  gap: .8rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 7%;
}
.slider-track::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 86%;
  scroll-snap-align: center;
  margin: 0;
}
.slide img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 30%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.slide figcaption {
  margin-top: .7rem;
  text-align: center;
  font-family: var(--font-script);
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--muted);
}
.slider-dots {
  display: flex;
  justify-content: center;
  gap: .45rem;
  margin-top: .9rem;
}
.slider-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
  transition: background .3s ease, transform .3s ease;
}
.slider-dots .dot.active {
  background: var(--accent);
  transform: scale(1.35);
}
.slider-hint {
  text-align: center;
  margin-top: .7rem;
  font-family: var(--font-script);
  font-size: 1.15rem;
  color: var(--muted);
  animation: hintpulse 2.2s ease-in-out infinite;
}

/* ============ письмо ============ */
.letter-card {
  margin-top: 2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 6vw, 2.6rem);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.letter-p {
  font-family: var(--font-display);
  font-size: clamp(1.18rem, 4.6vw, 1.4rem);
  line-height: 1.75;
  font-weight: 500;
}
.letter-p + .letter-p { margin-top: 1.2rem; }
.letter-p:first-child {
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.4rem, 5.6vw, 1.7rem);
  color: var(--accent);
}
.letter-sign {
  margin-top: 1.8rem;
  text-align: right;
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--accent);
}
.letter-sign span, .finale-sign span {
  display: inline-block;
  animation: heartbeat 1.6s ease-in-out infinite;
}

/* ============ дочки ============ */
.daughters { text-align: center; }
.girl { margin-top: 2.8rem; }
.girl-name {
  font-family: var(--font-script);
  font-size: clamp(2.2rem, 10vw, 3rem);
  color: var(--accent);
  line-height: 1.1;
}
.girl-line { color: var(--muted); font-size: .9rem; margin-top: .2rem; }
.girl-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9rem;
  margin-top: 1.3rem;
}
.shot-small { margin: 0; }
.shot-small img { border-radius: 16px; }
.shot-small figcaption { font-size: 1.15rem; }
.girl-pair .shot-small:first-child img { transform: rotate(-1.3deg); }
.girl-pair .shot-small:last-child img { transform: rotate(1.3deg); }
.daughters-note {
  margin-top: 2.4rem;
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--accent);
}

/* ============ финал ============ */
.finale {
  min-height: 96vh;
  min-height: 96svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: none;
}
.finale-stage { max-width: var(--maxw); }
.finale-phrase {
  font-family: var(--font-display);
  font-style: italic;
  font-synthesis: none;
  font-weight: 500;
  font-size: clamp(2rem, 9vw, 3.2rem);
  line-height: 1.2;
  min-height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  filter: blur(10px);
  transform: scale(.96);
  transition: opacity .45s ease, filter .45s ease, transform .45s ease;
  will-change: opacity, filter, transform;
}
.finale-phrase.show { opacity: 1; filter: blur(0); transform: scale(1); }
.finale-phrase.final {
  color: var(--text);
  font-weight: 600;
}
.finale-name,
.finale-sign,
.finale-dates,
.finale-hint,
.finale-ps {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .9s ease, transform .9s ease;
}
.finale.settled .finale-name,
.finale.settled .finale-sign,
.finale.settled .finale-dates,
.finale.settled .finale-hint,
.finale.settled .finale-ps { opacity: 1; transform: none; }
.finale.settled .finale-ps { opacity: .75; }
.finale-name {
  font-family: var(--font-script);
  font-size: clamp(3.2rem, 16vw, 4.8rem);
  color: var(--accent);
  line-height: 1.1;
  margin-top: .4rem;
  transition-delay: .5s;
}
.finale-sign {
  margin-top: 1.6rem;
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--muted);
  transition-delay: 1s;
}
.finale-dates {
  margin-top: .5rem;
  font-size: .8rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
  transition-delay: 1.4s;
}
.finale-hint {
  margin-top: 2.6rem;
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  transition-delay: 2.2s;
}
@keyframes hintpulse {
  0%, 100% { opacity: .35; }
  50% { opacity: .9; }
}
.finale.settled .finale-hint { animation: hintpulse 2.4s ease-in-out 3.5s infinite; }
.finale-ps {
  margin-top: 3rem;
  font-family: var(--font-script);
  font-size: 1.15rem;
  color: var(--muted);
  transition-delay: 3.2s;
}

/* ============ плеер ============ */
.player {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  align-items: flex-end;
  gap: .6rem;
  flex-direction: row-reverse;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.player.on { opacity: 1; pointer-events: auto; transform: none; }
.player-disc {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.disc-ring {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0 25%, transparent 25% 50%, var(--accent) 50% 75%, transparent 75%);
  opacity: .8;
  -webkit-mask: radial-gradient(circle, transparent 58%, black 60%);
  mask: radial-gradient(circle, transparent 58%, black 60%);
}
.player.playing .disc-ring { animation: spin 3.2s linear infinite; }
.player:not(.playing) .disc-ring {
  background: conic-gradient(var(--accent) 0 100%);
  opacity: .35;
}
@keyframes spin { to { transform: rotate(360deg); } }
.disc-note { color: var(--accent); font-size: 1.25rem; }
.player-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: .8rem 1rem;
  width: 210px;
  display: none;
}
.player.open .player-panel { display: block; }
.player-title {
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-artist { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.player-bar {
  margin-top: .55rem;
  height: 4px;
  border-radius: 2px;
  background: var(--accent-soft);
  overflow: hidden;
}
.player-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
}
.player-controls {
  margin-top: .5rem;
  display: flex;
  justify-content: center;
  gap: .7rem;
}
.pbtn {
  border: none;
  background: none;
  color: var(--text);
  font-size: 1rem;
  padding: .6rem .8rem;
  border-radius: 10px;
}
.pbtn-play {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  min-width: 52px;
}

/* ============ большое сердце (двойной тап по фото) ============ */
.big-heart {
  position: fixed;
  transform: translate(-50%, -50%);
  z-index: 45;
  pointer-events: none;
  font-size: 5.5rem;
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-soft), 0 4px 20px rgba(0, 0, 0, .25);
  animation: heartPop .9s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes heartPop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  35% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
  60% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -62%) scale(1.05); opacity: 0; }
}

/* ============ переключатель темы ============ */
.theme-toggle {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--accent);
  font-size: 1.05rem;
  opacity: .55;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity .3s ease;
}
.theme-toggle:active { opacity: 1; }
.theme-toggle.attn { animation: togglepulse 1s ease-in-out 3; }
@keyframes togglepulse {
  0%, 100% { transform: scale(1); opacity: .55; }
  50% { transform: scale(1.25); opacity: 1; }
}

/* ============ десктоп ============ */
@media (min-width: 700px) {
  body { font-size: 17px; }
  .intro-art { height: 60vh; }
  .shot:hover img { transform: rotate(0) scale(1.015); transition: transform .4s ease; }
}

/* ============ бережный режим ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn-heart, .player.playing .disc-ring, .finale-hint, .intro-art img,
  .letter-sign span, .finale-sign span, .theme-toggle.attn,
  .sound-ico .w, .tap-sound-ico { animation: none; }
  .sound-note { opacity: .85; animation: none; }
  .sound-ico .w { opacity: 1; }
  .finale-phrase { transition: none; }
  .finale-name, .finale-sign, .finale-dates, .finale-hint, .finale-ps { transition: none; }
}
