/* Hallmark · genre: playful (warm) · macrostructure: Marquee Hero (страница трека: плеер = первый экран) / Conversational FAQ (главная)
 * theme: custom · vibe: «тёплая открытка, кухня, мамин голос» · paper oklch(97.5% 0.012 80) · accent oklch(54% 0.24 288) violet — цвет плеера из роликов
 * display: Literata 500–700 (opsz 24) · body: Onest 400–700 · axes: light / roman-serif / cool accent on warm paper
 * nav: wordmark only · footer: Ft2 inline single column · enrichment: Tier A CSS (кольца у кнопки ▶)
 */
@font-face { font-family: 'Literata'; src: url('fonts/literata.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }
@font-face { font-family: 'Onest'; src: url('fonts/onest.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --color-paper:       oklch(97.5% 0.012 80);
  --color-paper-2:     oklch(94.6% 0.018 80);
  --color-paper-3:     oklch(91.5% 0.022 78);
  --color-rule:        oklch(86% 0.016 78);
  --color-neutral:     oklch(62% 0.014 70);
  --color-muted:       oklch(45% 0.014 66);
  --color-ink:         oklch(22% 0.016 60);
  --color-ink-2:       oklch(30% 0.016 60);
  --color-on-ink:      oklch(97.5% 0.012 80);
  --color-accent:      oklch(54% 0.24 288);
  --color-accent-2:    oklch(47% 0.24 288);
  --color-accent-soft: oklch(93.5% 0.035 290);
  --color-on-accent:   oklch(98.5% 0.008 290);
  --color-focus:       oklch(50% 0.24 288);
  --color-ok:          oklch(48% 0.12 150);
  --color-err:         oklch(50% 0.18 28);
  --color-shadow:      oklch(35% 0.04 60 / 0.16);

  --font-display: 'Literata', Georgia, 'Times New Roman', serif;
  --font-body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --text-xs: 0.8125rem;
  --text-sm: 0.9063rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-lyric: 1.3125rem;
  --text-h2: 1.625rem;
  --text-offer: 2.125rem;
  --text-display: clamp(2.375rem, 10.5vw, 3.5rem);

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 140ms;
  --dur-mid: 260ms;

  --measure: 34rem;
  --gutter: 1.25rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-paper:       oklch(17% 0.012 70);
    --color-paper-2:     oklch(21% 0.014 70);
    --color-paper-3:     oklch(25% 0.016 70);
    --color-rule:        oklch(32% 0.014 70);
    --color-neutral:     oklch(58% 0.012 75);
    --color-muted:       oklch(74% 0.01 78);
    --color-ink:         oklch(94% 0.01 80);
    --color-ink-2:       oklch(86% 0.01 80);
    --color-on-ink:      oklch(17% 0.012 70);
    --color-accent:      oklch(66% 0.2 288);
    --color-accent-2:    oklch(72% 0.18 288);
    --color-accent-soft: oklch(28% 0.06 290);
    --color-on-accent:   oklch(15% 0.03 290);
    --color-focus:       oklch(74% 0.17 288);
    --color-ok:          oklch(72% 0.13 150);
    --color-err:         oklch(70% 0.16 28);
    --color-shadow:      oklch(5% 0.01 60 / 0.5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font: 400 var(--text-md)/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
}
img, svg { display: block; max-width: 100%; }
p { margin: 0 0 var(--space-sm); }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-style: normal; font-weight: 600; margin: 0; overflow-wrap: anywhere; min-width: 0; text-wrap: balance; }
h2 { font-size: var(--text-h2); line-height: 1.15; margin-bottom: var(--space-sm); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: 100%; max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.top { padding-top: var(--space-md); }
.mark { font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.mark span { color: var(--color-accent); }
.track-main { display: flex; flex-direction: column; }
.sec { padding-top: var(--space-2xl); }
.muted { color: var(--color-muted); }
.brand { color: var(--color-accent-2); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.brand:hover { color: var(--color-accent); }
.small { font-size: var(--text-sm); }
.xs { font-size: var(--text-xs); }

/* ── Первый экран: заголовок и плеер ─────────────────────── */
.hero { padding-top: var(--space-xl); order: 1; }
.lead { font-weight: 600; font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--space-xs); }
.hero h1 { font-size: var(--text-display); line-height: 1.04; letter-spacing: -0.015em; font-weight: 650; }
.player { display: flex; align-items: center; gap: var(--space-md); margin-top: var(--space-xl); }
.play {
  position: relative; flex: none; width: 5rem; height: 5rem; border: 0; border-radius: 50%;
  background: var(--color-accent); color: var(--color-on-accent); cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 10px 26px -10px var(--color-accent);
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.play:hover { background: var(--color-accent-2); }
.play:active { transform: scale(0.96); }
.play svg { width: 2rem; height: 2rem; fill: currentColor; stroke: none; }
.play .i-pause, .is-playing .play .i-play { display: none; }
.is-playing .play .i-pause { display: block; }
.play .i-play { margin-left: 0.2rem; }
.play::before, .play::after {
  content: ''; position: absolute; inset: -0.5rem; border-radius: 50%;
  border: 2px solid var(--color-accent); opacity: 0; pointer-events: none;
}
.is-playing .player .play::before { animation: ring 2.4s var(--ease-out) infinite; }
.is-playing .player .play::after { animation: ring 2.4s var(--ease-out) 1.2s infinite; }
@keyframes ring { from { transform: scale(0.9); opacity: 0.45; } to { transform: scale(1.35); opacity: 0; } }
.track { flex: 1; min-width: 0; }
.track-name { font-weight: 600; font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--space-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seek {
  -webkit-appearance: none; appearance: none; width: 100%; height: 1.75rem; margin: 0; background: transparent; cursor: pointer;
  --p: 0%;
}
.seek::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--color-accent) var(--p), var(--color-paper-3) var(--p)); }
.seek::-moz-range-track { height: 6px; border-radius: 3px; background: var(--color-paper-3); }
.seek::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--color-accent); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--color-accent); border: 3px solid var(--color-paper); }
.seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--color-accent); border: 3px solid var(--color-paper); }
.time { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--color-muted); font-variant-numeric: tabular-nums; }

/* ── Текст песни: подсветка по словам ───────────────────── */
.lyrics { order: 2; padding-top: var(--space-xl); }
.lyrics-text { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lyric); line-height: 1.45; }
.ln { margin: 0; padding: 0.1rem 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ln.gap { margin-top: var(--space-md); }
.w { transition: color var(--dur-fast) linear; }
.is-live .w { color: var(--color-neutral); }
.is-live .w.sung { color: var(--color-ink); }
.is-live .w.now { color: var(--color-accent); }
.lyrics-note { margin-top: var(--space-md); font-size: var(--text-sm); color: var(--color-muted); }

/* ── Кнопки ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: 3.25rem; padding: 0 var(--space-md); border-radius: var(--radius-md);
  font-weight: 600; font-size: var(--text-md); line-height: 1.2; text-decoration: none; white-space: nowrap;
  cursor: pointer; border: 1.5px solid var(--color-rule); background: var(--color-paper); color: var(--color-ink);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--color-paper-2); border-color: var(--color-neutral); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn.is-done { border-color: var(--color-ok); color: var(--color-ok); }
.btn-ink { background: var(--color-ink); color: var(--color-on-ink); border-color: var(--color-ink); min-height: 3.5rem; }
.btn-ink:hover { background: var(--color-ink-2); border-color: var(--color-ink-2); }
.btn-accent { background: var(--color-accent); color: var(--color-on-accent); border-color: var(--color-accent); }
.btn-accent:hover { background: var(--color-accent-2); border-color: var(--color-accent-2); }
.btn-wide { width: 100%; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }

/* ── Подари ─────────────────────────────────────────────── */
.gift { order: 3; }
.gift .share-native { margin-bottom: var(--space-xs); display: none; }
.can-share .gift .share-native { display: flex; }
.gift .hint { margin-top: var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); }
.ask { order: 3; display: none; }

/* ── Реакция ────────────────────────────────────────────── */
.react { order: 4; }
.react-row { display: flex; gap: var(--space-sm); }
.react-btn {
  width: 3.75rem; height: 3.75rem; border-radius: 50%; border: 1.5px solid var(--color-rule); background: var(--color-paper);
  font-size: 1.75rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.react-btn:hover { background: var(--color-paper-2); }
.react-btn:active { transform: scale(0.94); }
.react-btn[aria-pressed="true"] { border-color: var(--color-accent); background: var(--color-accent-soft); }
.react-thanks { margin-top: var(--space-sm); font-size: var(--text-sm); color: var(--color-muted); min-height: 1.5em; }

/* ── Мост ───────────────────────────────────────────────── */
.bridge { order: 5; }
.ideas { list-style: none; margin: var(--space-sm) 0 var(--space-md); padding: 0; }
.ideas li { position: relative; padding: var(--space-xs) 0 var(--space-xs) var(--space-lg); border-top: 1px solid var(--color-rule); }
.ideas li:last-child { border-bottom: 1px solid var(--color-rule); }
.ideas li::before { content: ''; position: absolute; left: 0.15rem; top: 1.05rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--color-accent); }

/* ── Оффер ──────────────────────────────────────────────── */
.offer-sec { order: 6; scroll-margin-top: var(--space-md); }
.offer { background: var(--color-paper-2); border-radius: var(--radius-lg); padding: var(--space-xl) var(--space-lg); }
.offer h2 { font-size: var(--text-offer); font-weight: 700; letter-spacing: -0.01em; margin-bottom: var(--space-2xs); }
.offer .sub { font-size: var(--text-lg); margin-bottom: var(--space-lg); }
.offer .btns { display: grid; gap: var(--space-xs); }
.offer .fine { margin-top: var(--space-sm); font-size: var(--text-sm); color: var(--color-muted); }
.steps { list-style: none; counter-reset: st; margin: var(--space-lg) 0 0; padding: var(--space-lg) 0 0; border-top: 1px solid var(--color-rule); }
.steps li { counter-increment: st; position: relative; padding-left: 2.5rem; margin-bottom: var(--space-sm); min-height: 1.75rem; }
.steps li::before {
  content: counter(st); position: absolute; left: 0; top: -0.05rem; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--color-accent-soft); color: var(--color-accent-2); font-weight: 700; font-size: var(--text-sm);
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}

/* ── Получатель ─────────────────────────────────────────── */
.reply { order: 7; }
.reply .btn { margin-top: var(--space-xs); }

/* режим «маме прислали»: вместо «подари» — «ответь песней», сразу после текста */
[data-mode="gift"] .gift { display: none; }
[data-mode="gift"] .reply { order: 3; }
[data-mode="example"] .gift { display: none; }
[data-mode="example"] .ask { display: block; }

/* ── Подвал ─────────────────────────────────────────────── */
.foot { margin-top: var(--space-3xl); padding: var(--space-xl) 0 calc(var(--space-3xl) + env(safe-area-inset-bottom)); border-top: 1px solid var(--color-rule); font-size: var(--text-sm); color: var(--color-muted); }
.foot p { margin-bottom: var(--space-xs); }
.foot .soc { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin-bottom: var(--space-md); }
.foot .soc a { color: var(--color-ink); font-weight: 600; text-underline-offset: 3px; }

/* ── Мини-плеер внизу ───────────────────────────────────── */
.mini {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--color-paper); border-top: 1px solid var(--color-rule); box-shadow: 0 -10px 30px -18px var(--color-shadow);
  padding: var(--space-xs) var(--gutter) calc(var(--space-xs) + env(safe-area-inset-bottom));
  transform: translateY(110%); transition: transform var(--dur-mid) var(--ease-out);
}
.mini.is-on { transform: none; }
.mini-in { max-width: var(--measure); margin: 0 auto; display: flex; align-items: center; gap: var(--space-sm); }
.mini .play { width: 2.75rem; height: 2.75rem; box-shadow: none; }
.mini .play svg { width: 1.25rem; height: 1.25rem; }
.mini-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.mini-time { font-size: var(--text-xs); color: var(--color-muted); font-variant-numeric: tabular-nums; }
.mini-bar { position: absolute; left: 0; top: -1px; height: 2px; width: 100%; background: var(--color-accent); transform-origin: left; transform: scaleX(var(--k, 0)); }

/* ── Главная ────────────────────────────────────────────── */
.home-hero { padding-top: var(--space-2xl); }
.home-hero h1 { font-size: var(--text-display); line-height: 1.04; letter-spacing: -0.015em; font-weight: 650; }
.home-hero .intro { font-size: var(--text-lg); margin-top: var(--space-md); }
.find { margin-top: var(--space-xl); background: var(--color-paper-2); border-radius: var(--radius-lg); padding: var(--space-lg); }
.find label { display: block; font-weight: 600; margin-bottom: var(--space-xs); }
.find-row { display: flex; gap: var(--space-xs); }
.find input {
  flex: 1; min-width: 0; height: 3.25rem; border-radius: var(--radius-md); border: 1.5px solid var(--color-rule);
  background: var(--color-paper); color: var(--color-ink); padding: 0 var(--space-md);
  font: 600 var(--text-lg)/1 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase;
}
.find input::placeholder { color: var(--color-neutral); letter-spacing: 0.04em; text-transform: none; font-weight: 400; }
.find input[aria-invalid="true"] { border-color: var(--color-err); }
.find-msg { min-height: 1.4em; margin: var(--space-xs) 0 0; font-size: var(--text-sm); color: var(--color-muted); }
.find-msg.is-err { color: var(--color-err); }
.examples { display: grid; gap: var(--space-sm); margin-top: var(--space-md); }
.ex { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); border: 1.5px solid var(--color-rule); border-radius: var(--radius-lg); }
.ex .play { width: 3.5rem; height: 3.5rem; box-shadow: none; }
.ex .play svg { width: 1.5rem; height: 1.5rem; }
.ex.is-playing .play .i-play { display: none; }
.ex.is-playing .play .i-pause { display: block; }
.ex-body { min-width: 0; }
.ex-title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); line-height: 1.2; }
.ex-note { font-size: var(--text-sm); color: var(--color-muted); margin: var(--space-2xs) 0 0; }
.ex-note a { color: var(--color-accent-2); font-weight: 600; text-underline-offset: 3px; white-space: nowrap; }
.how { list-style: none; counter-reset: st; margin: var(--space-md) 0 0; padding: 0; }
.how li { counter-increment: st; position: relative; padding-left: 2.5rem; margin-bottom: var(--space-md); }
.how li::before {
  content: counter(st); position: absolute; left: 0; top: 0; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--color-accent-soft); color: var(--color-accent-2); font-weight: 700; font-size: var(--text-sm); display: grid; place-items: center;
}
.how b { display: block; }
.faq details { border-top: 1px solid var(--color-rule); }
.faq details:last-child { border-bottom: 1px solid var(--color-rule); }
.faq summary { list-style: none; cursor: pointer; padding: var(--space-md) 2rem var(--space-md) 0; position: relative; font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); line-height: 1.25; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); font-family: var(--font-body); font-weight: 400; font-size: 1.5rem; color: var(--color-accent); }
.faq details[open] summary::after { content: '−'; }
.faq .ans { padding-bottom: var(--space-md); color: var(--color-ink-2); }

@media (min-width: 40rem) {
  :root { --gutter: 2rem; }
  .sec { padding-top: var(--space-3xl); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
