/* songspeak.app: как пометки в учебнике — оригинал чёрными чернилами, перевод синими, нужное — жёлтым маркером.
   Яркая вещь одна — маркер. Заголовки — Bricolage Grotesque (OFL, fonts/), текст — системный шрифт, как в расширении. */
@font-face {
  font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 600 800; font-display: swap;
  src: url(/fonts/bricolage-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --paper: #fcfcfd; --ink: #1d2130; --muted: #5d6475; --rule: #e3e6ee; --blue: #2a40c4; --hl: #ffe45c;
  --panel: #ffffff;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15171c; --ink: #e8eaf0; --muted: #9ba2b2; --rule: #333947; --blue: #a3b0ff; --hl: #6b5a12;
    --panel: #1c1f26;
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.015em; }

.deck, main, footer > div { max-width: 72rem; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.deck nav { display: flex; align-items: center; gap: 22px; padding-top: 18px; padding-bottom: 18px; font-size: 15px; }
.deck a { color: var(--muted); text-decoration: none; }
.deck a:hover, .deck a[aria-current] { color: var(--ink); }
.deck .home { display: inline-flex; align-items: center; gap: 9px; margin-right: auto; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 19px; }
.deck .home img { width: 26px; height: 26px; }

/* первый экран: слева заголовок, справа снимок — Songspeak в боковой панели рядом с плеером */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 600px); gap: 56px; align-items: center; padding: 40px 0 0; }
h1 { max-width: 14ch; margin: 0; font-size: clamp(40px, 4.9vw, 66px); line-height: 1.02; }
.lead { max-width: 34rem; margin: 24px 0 0; color: var(--muted); font-size: 20px; line-height: 1.55; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 28px 0 0; }
.soon { padding: 11px 18px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 700; }
.free { color: var(--muted); }
.works { max-width: 30rem; margin: 20px 0 0; color: var(--muted); font-size: 15px; }
.hero-shot { margin: 0; }
.hero-shot figcaption { margin-top: 12px; color: var(--muted); font-size: 14px; text-align: center; }
.browser { border: 1px solid var(--rule); border-radius: 14px; background: var(--panel); box-shadow: 0 24px 60px rgb(20 25 40 / .14); overflow: hidden; }
.b-bar { display: flex; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--rule); }
.b-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); }
.b-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
.player-page { display: flex; flex-direction: column; justify-content: center; padding: 26px; }
.cover { display: flex; align-items: flex-end; aspect-ratio: 1; padding: 14px; border-radius: 10px; color: #fff; font-family: var(--display); font-size: 21px; line-height: 1.05;
  background: radial-gradient(circle at 70% 32%, #ffe45c 0 12%, transparent 12.5%), linear-gradient(180deg, #2f5fd0 0%, #86aef4 68%, #f2c46d 100%); }
.pp-title { margin: 14px 0 0; font-weight: 700; line-height: 1.3; }
.pp-artist { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.3; }
.pp-bar { height: 4px; margin-top: 12px; overflow: hidden; border-radius: 2px; background: var(--rule); }
.pp-bar span { display: block; height: 100%; background: var(--ink); transform: scaleX(.14); transform-origin: left; }
.pp-keys { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.pp-keys i { width: 24px; height: 24px; border: 1px solid var(--rule); border-radius: 50%; }
.pp-keys i.big { width: 36px; height: 36px; border: 0; background: var(--ink); }
/* столбики «музыка играет» — высоту задаёт hero.js */
.eq { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 16px; }
.eq i { flex: 1; height: 100%; border-radius: 2px 2px 0 0; background: var(--ink); opacity: .78; transform: scaleY(.3); transform-origin: bottom; }

/* живая панель — как ext/lyrics.css; размеры в em от ширины панели: 16px при 400px, как у настоящей */
.pl { --p-paper: #fcfcfd; --p-ink: #1f2430; --p-muted: #646b7a; --p-rule: #e2e5ec; --p-marker: #fff1a8; --p-marker-soft: #fff7d1; --p-key: #ffd95a;
  --p-tip-bg: #262b36; --p-tip-ink: #f4f5f8; --p-tip-soft: #b7bdca; --p-tip-mark: #6b5a12;
  position: relative; aspect-ratio: 4 / 7; overflow: hidden; border-left: 1px solid var(--rule); background: var(--p-paper); color: var(--p-ink); container-type: inline-size; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pl { --p-paper: #16181d; --p-ink: #e6e8ee; --p-muted: #9aa1b0; --p-rule: #3a404d; --p-marker: #5a4c14; --p-marker-soft: #2a2614; --p-key: #f0cf55;
    --p-tip-bg: #eef0f4; --p-tip-ink: #1f2430; --p-tip-soft: #5d6474; --p-tip-mark: #ffe27a; }
}
.pl::after { content: ''; position: absolute; right: 0; bottom: 0; left: 0; height: 56px; background: linear-gradient(transparent, var(--p-paper)); pointer-events: none; }
.pl img { display: block; width: 100%; height: auto; }
.pl-in { font: 4cqw/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.pl p { margin: 0; }
.pl svg { width: 1.125em; height: 1.125em; fill: currentColor; }
.pl-top { padding: .625em 1em .5em; border-bottom: 1px solid var(--p-rule); }
.pl-head { display: flex; align-items: center; gap: .5em; }
.pl-song { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.3; }
.pl-song span { color: var(--p-muted); font-size: .875em; }
.pl-btn { flex: none; padding: .15em .6em; border: 1px solid var(--p-rule); border-radius: 1em; font-size: .8125em; }
.pl-now { height: 3.8em; margin-top: .5em; padding: .5em .75em; overflow: hidden; border-radius: .625em; background: var(--p-marker-soft); white-space: nowrap; }
.pl-now .o { overflow: hidden; font-size: 1.0625em; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; }
.pl-now .t { overflow: hidden; margin-top: .14em; color: var(--p-muted); font-size: .90625em; text-overflow: ellipsis; }
.pl-now .t.in { animation: pl-in .45s ease-out; }
@keyframes pl-in { from { opacity: 0; transform: translateY(.3em); } }
.pl-player { display: flex; align-items: center; gap: .5em; margin-top: .5em; }
.pl-player .k { flex: none; display: grid; place-items: center; width: 2.125em; height: 2.125em; border: 1px solid var(--p-rule); border-radius: 50%; }
.pl-player .play { flex: none; display: grid; place-items: center; width: 2.857em; height: 2.857em; border-radius: 50%; background: var(--p-key); color: #1f2430; font-size: .875em; }
.pl-player .gear { margin-left: auto; }
.pl-player .hold { min-width: 0; overflow: hidden; padding: .23em .6em; border-radius: .77em; background: var(--p-marker-soft); font-size: .8125em; white-space: nowrap; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.pl-player .hold.show { opacity: 1; }
.pl-lines { margin: 0; padding: .857em .762em; list-style: none; font-size: 1.3125em; line-height: 1.45; transition: opacity .4s; }
.pl-lines.reset { opacity: 0; }
.pl-lines li { position: relative; margin: 0 -.286em .286em; padding: .095em 1.9em .095em .286em; border-radius: .286em; transition: background-color .2s, color .2s; }
.pl-lines li.past { color: var(--p-muted); }
.pl-lines li.on { background: var(--p-marker); color: var(--p-ink); }
.pl-lines li.hov { background: var(--p-rule); }
.pl-lines .tri { position: absolute; top: .19em; right: .19em; display: grid; place-items: center; width: 1.43em; height: 1.43em; border-radius: 50%; background: var(--p-paper); color: var(--p-muted); opacity: 0; }
.pl-lines .tri svg { width: .857em; height: .857em; }
.pl-lines li.hov .tri { opacity: 1; }
.pl .w.hov { text-decoration: underline dotted; text-decoration-thickness: .1em; text-underline-offset: .24em; }
.pl-tip { position: absolute; z-index: 3; max-width: 21.4em; padding: .57em .79em; border-radius: .64em; background: var(--p-tip-bg); color: var(--p-tip-ink); font-size: .875em; line-height: 1.4; box-shadow: 0 .4em 1.3em rgb(0 0 0 / .2); opacity: 0; transition: opacity .15s; }
.pl-tip.show { opacity: 1; }
.pl-tip .wd b { margin-right: .57em; font-size: 1.143em; }
.pl-tip .ltr { margin-top: .43em; padding-top: .43em; border-top: 1px solid var(--p-tip-soft); color: var(--p-tip-soft); }
.pl-tip mark { padding: 0 .14em; border-radius: .21em; background: var(--p-tip-mark); color: var(--p-tip-ink); }
.cursor { position: absolute; top: 0; left: 0; z-index: 4; width: 22px; height: 22px; fill: #fff; stroke: #1f2430; stroke-width: 1.4; stroke-linejoin: round; pointer-events: none;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / .3)); opacity: 0; transition: transform .9s cubic-bezier(.45, .05, .25, 1), opacity .25s; }
.cursor.on { opacity: 1; }

.stage { margin: 72px 0 0; padding: 40px 0 36px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.big { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(30px, 5.4vw, 64px); line-height: 1.18; letter-spacing: -0.01em; }
.big .w { border-radius: 6px; cursor: pointer; transition: background-color .12s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.big .w:hover, .big .w.on { background: var(--hl); }
.trans { min-height: 1.4em; margin: 18px 0 0; color: var(--blue); font-size: clamp(20px, 2.8vw, 32px); line-height: 1.35; }
.trans mark, .pair mark { padding: 0 3px; border-radius: 4px; background: var(--hl); color: inherit; }
.pair { min-height: 1.6em; margin: 14px 0 0; color: var(--muted); font-size: 16px; }
.pair b { color: var(--ink); }
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 26px; }
.langs { display: flex; flex-wrap: wrap; gap: 8px; }
.langs button, .steps button { padding: 7px 14px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; font-size: 15px; }
.langs button:hover, .steps button:hover { border-color: var(--muted); }
.langs button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.steps { display: flex; gap: 8px; }
.steps button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; }
.steps svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.note { max-width: 44rem; margin: 22px 0 0; color: var(--muted); font-size: 14px; }

/* снимки расширения: три панели в ряд и вкладка во всю ширину */
h2 { margin: 0 0 14px; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; }
.gallery-wrap { padding: 88px 0 80px; }
.intro { max-width: 40rem; margin: 0 0 36px; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.gallery figure, .wide { margin: 0; }
.gallery img, .wide img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); box-shadow: 0 10px 30px rgb(20 25 40 / .08); }
.gallery figcaption, .wide figcaption { max-width: 40rem; margin-top: 14px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.gallery figcaption b, .wide figcaption b { color: var(--ink); }
.wide { margin-top: 48px; }

/* как это работает — по шагам */
.how { padding: 72px 0; border-top: 1px solid var(--rule); }
.how ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; margin: 28px 0 0; padding: 0; list-style: none; counter-reset: step; }
.how li { counter-increment: step; color: var(--muted); }
.how li::before { content: counter(step); display: block; margin-bottom: 10px; font-family: var(--display); font-weight: 800; font-size: 56px; line-height: 1; color: var(--ink); }
.how li b { color: var(--ink); }

/* темы под поиск: заголовок слева, текст справа */
.topics article { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr); gap: 16px 56px; padding: 48px 0; border-top: 1px solid var(--rule); }
.topics h2 { grid-row: span 4; }
.topics p { margin: 0 0 14px; }
.langlist { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 6px 0 0; font-size: 15px; }
.langlist dt { font-weight: 700; }
.langlist dd { margin: 0; color: var(--muted); }

.faq { padding: 56px 0 80px; border-top: 1px solid var(--rule); }
.faq h2 { margin-bottom: 20px; }
.faq details { max-width: 48rem; border-bottom: 1px solid var(--rule); }
.faq summary { padding: 16px 0; font-weight: 700; cursor: pointer; }
.faq details p { margin: 0 0 18px; color: var(--muted); }

/* политика и лицензии */
.doc { max-width: 46rem; padding-top: 16px; padding-bottom: 64px; }
.doc h1 { max-width: none; font-size: clamp(32px, 5vw, 44px); line-height: 1.1; }
.doc h2 { margin: 36px 0 8px; font-size: 24px; }
.doc .meta { color: var(--muted); font-size: 15px; }
.doc li { margin: 6px 0; }

footer { border-top: 1px solid var(--rule); }
footer > div { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 24px; padding-bottom: 32px; font-size: 15px; }
footer a { color: var(--muted); }

@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero-shot { width: 100%; max-width: 600px; margin: 0 auto; }
  .topics article { grid-template-columns: minmax(0, 1fr); }
  .topics h2 { grid-row: auto; }
}
@media (max-width: 720px) {
  .deck .nav-extra { display: none; }
  .hero { padding-top: 24px; }
  .lead { font-size: 18px; }
  .soon { padding: 10px 16px; font-size: 15px; }
  .stage { margin-top: 56px; padding-top: 32px; }
  .controls { flex-wrap: nowrap; gap: 10px; }
  .langs { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; margin-left: -20px; padding: 2px 24px 2px 20px; overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 28px), transparent); }
  .langs::-webkit-scrollbar { display: none; }
  .langs button { flex: none; }
  .langlist { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .langlist dd + dt { margin-top: 12px; }
  .gallery-wrap { padding: 64px 0 56px; }
  .gallery { display: flex; gap: 16px; margin: 0 -20px; padding: 0 20px 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: thin; }
  .gallery figure { flex: 0 0 78%; scroll-snap-align: start; }
  .wide { margin-top: 36px; }
  .how { padding: 56px 0; }
  .how ol { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .how li::before { font-size: 44px; }
  .topics article { padding: 40px 0; }
}
/* телефон: плеер — полоса над панелью (обложка, песня, столбики), панель ниже */
@media (max-width: 640px) {
  .hero-shot { max-width: 380px; }
  .b-bar, .pp-keys, .cover b { display: none; }
  .b-body { grid-template-columns: minmax(0, 1fr); }
  .player-page { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) 88px; grid-template-areas: "c t e" "c a e"; column-gap: 12px; align-items: center; padding: 10px 14px 12px; }
  .cover { grid-area: c; width: 42px; padding: 0; border-radius: 6px; }
  .pp-title { grid-area: t; margin: 0; font-size: 15px; }
  .pp-artist { grid-area: a; overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
  .eq { grid-area: e; gap: 2px; height: 28px; margin: 0; }
  .pp-bar { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; margin: 0; border-radius: 0; }
  .pl { aspect-ratio: 4 / 6; border-top: 1px solid var(--rule); border-left: 0; }
}
