/* Сайт «фрази з ролика» (lead_magnet.py), версія 2 (26.10).
   Власник про v1: «дешево і занадто AI» — суцільна темна колонка тексту, дрібні сірі
   підписи, пігулки-заглушки. Тепер це інструмент, а не стаття: кожна фраза — картка з
   великим плеєром, обкладинка ролика в шапці, внизу закріплена панель з аудіо для практики.
   Кольори — з роликів (ніч, латунь); засічки лише там, де звучить фраза, як у ролику.
   Решта — FixelText (шрифт перекладів у роликах). */
@font-face { font-family: 'SourceSerif'; font-weight: 400; font-display: swap; src: url('SourceSerif-Regular.woff2') format('woff2'); }
@font-face { font-family: 'FixelText'; font-weight: 400; font-display: swap; src: url('FixelText-Regular.woff2') format('woff2'); }
@font-face { font-family: 'FixelText'; font-weight: 500; font-display: swap; src: url('FixelText-Medium.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --bg: #0C0C0D; --s1: #151517; --s2: #1E1E21; --s3: #27272B;
  --line: rgba(255, 255, 255, .07); --line2: rgba(255, 255, 255, .12);
  --ink: #EDEBE6; --ink2: #A9A69F; --ink3: #75736D;
  --brass: #CDAE6E; --brass-soft: rgba(205, 174, 110, .14); --on-brass: #17130B;
  --ok: #8DB38A; --ok-soft: rgba(141, 179, 138, .14); --bad: #D38F82; --bad-soft: rgba(211, 143, 130, .12);
  --serif: 'SourceSerif', Georgia, serif; --sans: 'FixelText', system-ui, -apple-system, sans-serif;
  --r: 12px; --gut: 16px; --dock: 76px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--sans);
       -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 8px; }
svg { display: block; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 var(--gut) calc(var(--dock) + 40px + env(safe-area-inset-bottom)); }

/* шапка */
.top { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font: 500 15px/1 var(--sans); letter-spacing: -0.01em; text-decoration: none; }
.follow { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 8px;
          background: var(--s2); font: 500 14px/1 var(--sans); text-decoration: none; }
.follow:hover { background: var(--s3); }

/* перший екран: обкладинка ролика + назва */
.hero { display: grid; grid-template-columns: 84px 1fr; gap: 16px; align-items: end; padding: 20px 0 8px; }
.cover { width: 84px; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: var(--s1);
         box-shadow: 0 0 0 1px var(--line2), 0 12px 32px rgba(0, 0, 0, .45); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.facts { margin: 0; font-size: 14px; color: var(--ink2); line-height: 1.6; }
.facts b { display: block; color: var(--brass); font-weight: 500; }
h1 { font: 500 34px/1.08 var(--sans); letter-spacing: -0.025em; margin: 24px 0 0; text-wrap: balance; }
.sub { font-size: 17px; color: var(--ink2); margin: 10px 0 0; max-width: 34ch; }
.hero h1, .hero .sub { grid-column: 1 / -1; }
.hero h1 { margin-top: 8px; }

/* одна хореографія при відкритті: шапка по черзі, далі картки проявляються, коли до них доходиш.
   Лише з JS (.js на <html>) — без нього все видно одразу. */
.js .rv { opacity: 0; transform: translateY(14px); transition: opacity .7s cubic-bezier(.3, .7, .2, 1), transform .7s cubic-bezier(.3, .7, .2, 1);
          transition-delay: var(--d, 0s); }
.js .rv.in { opacity: 1; transform: none; }

/* фраза */
.list { display: grid; gap: 12px; margin-top: 28px; }
.phrase { background: var(--s1); border-radius: var(--r); padding: 20px 20px 22px; box-shadow: inset 0 0 0 1px var(--line);
          scroll-margin-top: 16px; transition: box-shadow .3s; }
.phrase.live { box-shadow: inset 0 0 0 1px rgba(205, 174, 110, .45); }
.idx { margin: 0 0 10px; font: 500 13px/1 var(--sans); color: var(--ink3); }
.ph { margin: 0; font: inherit; }
.say { all: unset; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.line { display: block; font: 400 28px/1.22 var(--serif); color: var(--ink3); text-wrap: balance; }
.w { transition: color .18s ease-out; }
.w.k { color: var(--ink); }
.say.fading .w { transition: color .6s ease; }
.say.playing .w { color: #45443F; }
.say.playing .w.k { color: rgba(205, 174, 110, .3); }
.say.playing .w.on { color: var(--ink2); }
.say.playing .w.k.on { color: var(--brass); }

.ctrl { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.play { all: unset; cursor: pointer; flex: none; width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; position: relative;
        background: var(--brass); color: var(--on-brass); transition: transform .15s, background .2s; }
.play:hover { background: #D8BB80; }
.play.on::after { content: ''; position: absolute; inset: -4px; border-radius: 13px; border: 1.5px solid var(--brass);
                  animation: ring 1.4s ease-out infinite; }
@keyframes ring { from { opacity: .7; transform: scale(.94); } to { opacity: 0; transform: scale(1.18); } }
.play:active { transform: scale(.94); }
.play svg { width: 18px; height: 18px; fill: currentColor; }
.play .ic-pause, .play.on .ic-play { display: none; }
.play.on .ic-pause { display: block; }
.ctrl .hint { font-size: 14px; color: var(--ink2); line-height: 1.3; }
.speed { margin-left: auto; display: inline-flex; position: relative; padding: 3px; border-radius: 8px; background: var(--s2); }
.speed::before { content: ''; position: absolute; top: 3px; left: 3px; width: 50px; height: 38px; border-radius: 6px; background: var(--s3);
                 transition: transform .28s cubic-bezier(.3, .7, .2, 1); }
.phrase[data-rate="0.7"] .speed::before { transform: translateX(50px); }
.speed button { all: unset; cursor: pointer; position: relative; width: 50px; height: 38px; border-radius: 6px; text-align: center;
                font: 500 14px/38px var(--sans); color: var(--ink2); transition: color .2s; }
.speed button[aria-pressed="true"] { color: var(--ink); }

.mean { font-size: 17px; margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.lbl { font: 500 13px/1.3 var(--sans); color: var(--ink3); margin: 20px 0 8px; }
.ex { list-style: none; margin: 0; padding: 0; }
.ex li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.ex li:last-child { border-bottom: 0; padding-bottom: 0; }
.alts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.alts li { padding: 7px 11px; border-radius: 6px; background: var(--s2); font-size: 15px; line-height: 1.35; }
.note { margin: 20px 0 0; padding: 14px 16px; border-radius: 8px; background: var(--brass-soft); font-size: 15px; line-height: 1.5; }
.note b { display: block; font-weight: 500; color: var(--brass); margin-bottom: 2px; }

/* тест */
.quiz { margin-top: 44px; }
h2 { font: 500 24px/1.2 var(--sans); letter-spacing: -0.02em; margin: 0; }
.quiz > .sub { font-size: 15px; margin-top: 6px; }
.bar { display: grid; grid-auto-flow: column; gap: 4px; margin: 18px 0 12px; }
.bar i { height: 4px; border-radius: 1px; background: var(--s3); overflow: hidden; }
.bar i::after { content: ''; display: block; height: 100%; transform: scaleX(0); transform-origin: left;
                transition: transform .45s cubic-bezier(.3, .7, .2, 1); }
.bar i.ok::after { background: var(--ok); transform: none; }
.bar i.no::after { background: var(--bad); transform: none; }
.card, .result { background: var(--s1); border-radius: var(--r); padding: 20px; box-shadow: inset 0 0 0 1px var(--line);
                 animation: cardin .4s cubic-bezier(.3, .7, .2, 1); }
@keyframes cardin { from { opacity: 0; transform: translateX(18px); } }
.qn { margin: 0; font: 500 13px/1 var(--sans); color: var(--ink3); }
.qs { font: 400 23px/1.4 var(--serif); margin: 14px 0 20px; }
.slot { display: inline-block; min-width: 4em; border-bottom: 2px solid var(--ink3); margin: 0 3px; text-align: center; line-height: 1.15; }
.slot.ok { color: var(--ok); border-color: var(--ok); animation: pop .35s ease-out; }
.opts { display: grid; gap: 8px; }
.opt { all: unset; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border-radius: 8px;
       background: var(--s2); font-size: 17px; transition: background .2s, color .2s, box-shadow .2s, transform .12s; }
.opt:active { transform: scale(.98); }
.opt::before { content: attr(data-k); flex: none; width: 28px; height: 28px; border-radius: 5px; display: grid; place-items: center;
               background: var(--s3); font: 500 13px/1 var(--sans); color: var(--ink2); }
.opt:hover { background: var(--s3); }
.opt.ok { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.opt.ok::before { content: '✓'; background: var(--ok); color: var(--bg); animation: pop .35s ease-out; }
.opt.no { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); animation: shake .32s; }
.opt.no::before { content: '✕'; background: var(--bad); color: var(--bg); }
.opts.done .opt:not(.ok):not(.no) { opacity: .35; }
.opts.done .opt { pointer-events: none; }
.fb { min-height: 1.4em; margin: 14px 0 0; font-size: 15px; color: var(--ink2); }
.next, .again, .cta { all: unset; cursor: pointer; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
                      width: 100%; min-height: 50px; margin-top: 12px; border-radius: 8px; background: var(--brass); color: var(--on-brass);
                      font: 500 16px/1 var(--sans); text-decoration: none; }
.next[hidden], .card[hidden], .result[hidden] { display: none; }
.score { margin: 0; font: 500 56px/1 var(--sans); letter-spacing: -0.03em; }
.score .of { font-size: 24px; color: var(--ink3); margin-left: 6px; }
.verdict { font-size: 17px; margin: 12px 0 4px; color: var(--ink2); }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.1); } 100% { transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* кінець */
.end { margin-top: 44px; padding: 24px 20px; border-radius: var(--r); background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); }
.end p { margin: 0; font: 500 20px/1.3 var(--sans); letter-spacing: -0.01em; }
.end .sub { font: 400 15px/1.5 var(--sans); margin-top: 6px; }
.more { display: block; margin-top: 16px; text-align: center; font-size: 15px; color: var(--ink2); }

/* панель знизу: аудіо для практики + PDF */
.dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom));
        width: calc(100% - 20px); max-width: 620px; height: var(--dock); z-index: 10;
        display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 14px; overflow: hidden;
        animation: dockin .6s .5s cubic-bezier(.3, .7, .2, 1) both;
        background: rgba(30, 30, 33, .86); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
        box-shadow: inset 0 0 0 1px var(--line2), 0 16px 40px rgba(0, 0, 0, .5); }
.dock .play { width: 44px; height: 44px; }
@keyframes dockin { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
.dock .play svg { width: 16px; height: 16px; }
.dmeta { min-width: 0; flex: 1; line-height: 1.3; }
.dmeta b { display: block; font-weight: 500; font-size: 15px; }
.dmeta span { display: block; font-size: 13px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dpdf { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 8px;
        background: var(--s3); font: 500 14px/1 var(--sans); text-decoration: none; }
.dpdf svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.dbar i { display: block; height: 100%; width: 0; background: var(--brass); transition: width .25s linear; }

/* бібліотека */
.lib { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 10px; }
.lib a { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: 12px;
         background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; }
.lib a:hover { box-shadow: inset 0 0 0 1px var(--line2); }
.lib .thumb { width: 64px; aspect-ratio: 9 / 16; border-radius: 5px; overflow: hidden; background: var(--s2); }
.lib .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib .meta { display: block; font-size: 13px; color: var(--ink3); }
.lib .title { display: block; font: 500 18px/1.25 var(--sans); letter-spacing: -0.01em; margin: 2px 0 6px; }
.lib .phs { display: block; font-size: 14px; color: var(--ink2); line-height: 1.45; }
.lib .soon { color: var(--brass); }
.wrap.libw { padding-bottom: 48px; }

@media (min-width: 720px) {
  :root { --gut: 32px; }
  body { font-size: 18px; }
  .wrap { max-width: 720px; }
  .top { height: 76px; }
  .hero { grid-template-columns: 148px 1fr; gap: 28px; padding-top: 32px; }
  .cover { width: 148px; border-radius: 8px; }
  h1 { font-size: 52px; }
  .hero { align-items: start; grid-template-rows: auto auto 1fr; }
  .hero .cover { grid-row: 1 / 4; }
  .hero .facts { grid-column: 2; grid-row: 1; padding-top: 6px; }
  .hero h1 { grid-column: 2; grid-row: 2; margin-top: 14px; }
  .hero .sub { grid-column: 2; grid-row: 3; font-size: 19px; }
  .list { gap: 16px; margin-top: 40px; }
  .phrase { padding: 32px 36px 34px; }
  .line { font-size: 38px; }
  .mean { font-size: 18px; }
  .qs { font-size: 28px; }
  .card, .result { padding: 28px 32px; }
  .opts { grid-template-columns: repeat(3, 1fr); }
  .next, .again, .cta { width: auto; display: inline-flex; padding: 0 28px; }
  .end { padding: 32px 36px; }
  .lib a { grid-template-columns: 84px 1fr; gap: 20px; padding: 14px 20px 14px 14px; }
  .lib .thumb { width: 84px; }
  .lib .title { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .rv { opacity: 1; transform: none; }
}
