:root {
  /* Семантика — surfaces */
  --surface-page: #021e4c;
  --surface-raised: #0a2b60;
  --surface-sunken: #01142f;
  --surface-control: #ffffff;
  --surface-control-active: #c9d2e2;
  --surface-control-ghost-active: #143b75;
  --surface-control-disabled: #3f5477;

  /* Семантика — text */
  --text-primary: #ffffff;
  --text-secondary: #b9c4da;
  --text-muted: #8a98b8;
  --text-on-control: #021e4c;
  --text-disabled: #6f7da0;
  --text-legal: #8a98b8;

  /* Семантика — icons (зеркало text) */
  --icon-primary: #ffffff;
  --icon-secondary: #b9c4da;
  --icon-muted: #8a98b8;
  --icon-on-control: #021e4c;
  --icon-disabled: #6f7da0;

  /* Семантика — borders / tracks / brand */
  --border-subtle: #1b3766;
  --border-strong: #6f7da0;
  --border-focus: #fcc015;
  --border-inverse: #ffffff;
  --track-rest: #3f5477;
  --track-fill: #ffffff;
  --brand-mark: #ffffff;
  --visa-blue: #1434cb;
  --visa-black: #000000;
  --visa-yellow: #fcc015;

  /* Радиусы (§4: всё прямоугольное, набор Foundations) */
  --radius-none: 0;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-pill: 999px;

  /* Spacing шкала (§5) */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-20: 20px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-40: 40px;
  --sp-48: 48px;
  --sp-56: 56px;

  /* Layout — база mobile 360 (один набор имён) */
  --page-margin: 16px;
  --frame-thickness: 24px;
  --card-padding: 20px;
  --hero-inset: 20px;
  --reading-max: 640px;
  --content-max: 1000px;
}

/* Light-остров (карточка плеера — light-ветка семантики) */
.on-light { --text-primary:#021e4c; --text-secondary:#4c5364; --text-muted:#6f7787; --icon-primary:#021e4c; --icon-secondary:#4c5364; --border-subtle:#dde1e8; --border-strong:#6f7787; --track-rest:#dde1e8; --track-fill:#021e4c; --surface-control-ghost-active:#edeff3; color: var(--text-primary); }

@media (min-width: 690px) {
  :root {
    --page-margin: 16px;
    --frame-thickness: 32px;
  }
}

/* База: типографика (research-tokens.md §3, Inter) */
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--surface-page);
  color: var(--text-primary);
}

/* Типографика: px из таблицы §3 */
.t-headline-m { font-weight: 700; font-size: 36px; line-height: 36px; letter-spacing: 1.08px; text-transform: uppercase; }
.t-headline-s { font-weight: 700; font-size: 26px; line-height: 26px; letter-spacing: 1.04px; text-transform: uppercase; }
.t-subhead-l { font-weight: 500; font-size: 24px; line-height: 31.92px; letter-spacing: -0.24px; }
.t-subhead-m { font-weight: 500; font-size: 20px; line-height: 28px; letter-spacing: -0.2px; }
.t-body-l { font-weight: 400; font-size: 18px; line-height: 28.08px; letter-spacing: 0; }
.t-body-m { font-weight: 400; font-size: 16px; line-height: 24px; letter-spacing: 0; }
.t-cta-l { font-weight: 500; font-size: 15px; line-height: 16.05px; letter-spacing: 1.5px; text-transform: uppercase; }
.t-label-meta { font-weight: 500; font-size: 12px; line-height: 15.96px; letter-spacing: 1.44px; text-transform: uppercase; }
.t-nav { font-weight: 500; font-size: 14px; line-height: 20.02px; letter-spacing: 0.28px; }
.t-time { font-weight: 500; font-size: 14px; line-height: 20.02px; letter-spacing: 0.28px; }
.t-legal-s { font-weight: 400; font-size: 11px; line-height: 15.95px; letter-spacing: 0; }

/* Лендинг uk — секции (base 360, перестройка @720). Только токены из tokens.css. */
img { max-width: 100%; }
a { color: inherit; }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 4px; }

.container { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-inline: var(--page-margin); }
.section { padding-block: var(--sp-56); }
.section--raised { background: var(--surface-raised); }
.section--sunken { background: var(--surface-sunken); }
.section-stack { display: grid; gap: var(--sp-32); }
.row-2col { display: grid; gap: var(--sp-32); }
.text-col { display: grid; gap: var(--sp-24); align-content: start; }
.muted { color: var(--text-secondary); }
.media { overflow: hidden; }
.media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.about-media { height: 240px; }
.curator-media { height: 380px; }

/* header / footer */
.site-header { background: var(--surface-page); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-16); padding-block: var(--sp-16); min-height: 76px; border-bottom: 1px solid var(--border-subtle); }
.co-brand { display: flex; align-items: center; gap: var(--sp-16); }
.co-brand img { display: block; height: 24px; width: auto; }
.co-brand .divider { width: 1px; height: 24px; background: var(--border-strong); }
.lang { display: flex; border: 1px solid var(--border-strong); }
.lang .seg { padding: var(--sp-12) var(--sp-16); text-decoration: none; color: var(--text-secondary); }
.lang .seg.is-active { background: var(--surface-control); color: var(--text-on-control); }
.site-footer { background: var(--surface-page); }
.footer-stack { display: grid; gap: var(--sp-24); padding-block: var(--sp-48); }
.footer-stack--capped { max-width: 640px; margin-inline: auto; }
.legal { color: var(--text-legal); }

/* hero */
.hero { padding: var(--sp-32); }
.hero-photo { position: relative; width: 100%; max-width: var(--content-max); margin-inline: auto; height: 416px; overflow: hidden; }
.hero-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-scrim { position: absolute; inset: 0; background: linear-gradient(to bottom, #021e4c00 0%, #021e4c38 45%, #021e4ce0 100%); }
.hero-content { position: absolute; inset-inline: 0; bottom: 0; padding: var(--hero-inset); display: grid; gap: var(--sp-24); }
.headline-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-16); }
.brand-symbol { display: flex; flex-direction: column; justify-content: space-between; flex: none; width: 33px; height: 21px; }
.brand-symbol i { display: block; height: 7px; }
.bar-blue { background: var(--visa-blue); }
.bar-yellow { background: var(--visa-yellow); }

/* audio player */
.player-card { background: var(--surface-control); padding: var(--card-padding); display: grid; gap: var(--sp-32); }
.meta-row { display: flex; flex-wrap: nowrap; gap: var(--sp-8); margin-right: -2px; }
.chip { display: inline-flex; align-items: center; gap: var(--sp-8); border: 1px solid var(--border-strong); padding: var(--sp-8) var(--sp-12); color: var(--text-secondary); width: fit-content; flex: none; white-space: nowrap; }
.titles { display: grid; gap: var(--sp-8); }
.now-playing { display: grid; gap: var(--sp-4); }
.work-counter { color: var(--text-muted); }
.marquee { overflow: hidden; }
.work-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { display: grid; gap: var(--sp-12); }
.track { position: relative; height: 4px; background: var(--track-rest); }
.elapsed { position: absolute; top: 0; bottom: 0; left: 0; width: 37%; background: var(--track-fill); }
.handle { position: absolute; top: 50%; left: 37%; width: 4px; height: 16px; background: var(--track-fill); transform: translate(-50%, -50%); }
.times { display: flex; justify-content: space-between; color: var(--text-secondary); }
.controls { display: flex; justify-content: center; }
.transport { display: flex; align-items: center; gap: var(--sp-16); }
.transport-item { display: grid; justify-items: center; gap: var(--sp-4); padding: var(--sp-20) 0 0; color: var(--text-secondary); min-width: 88px; }
.btn-ghost { width: 48px; height: 48px; display: grid; place-items: center; background: transparent; border: 0; padding: 0; cursor: pointer; }
.btn-play { width: 72px; height: 72px; background: var(--surface-page); border: 0; padding: 0; display: grid; place-items: center; cursor: pointer; }
.player-divider { height: 1px; border: 0; background: var(--border-subtle); }
.player-info, .player-playback { display: contents; }
.btn-tertiary { display: inline-flex; align-items: center; gap: var(--sp-8); padding: var(--sp-16); min-height: 56px; text-decoration: none; }

.is-disabled { opacity: 0.5; }

/* чип-иконки: цветовые варианты SVG (icon-clock-mid/world-mid в .on-light, icon-clock-light/world-light на тёмном) */
img.ic-chip { display: block; }
img.ic-arrow { display: block; }
img.ic-doc { display: block; }

/* how-to-listen */
.cards { display: grid; gap: var(--sp-16); }
.card { background: var(--surface-raised); padding: var(--card-padding); display: grid; gap: var(--sp-24); align-content: start; }
.card-text { display: grid; gap: var(--sp-8); }
.card > img { width: 24px; height: 24px; }

/* pre-footer cta */
.cta-stack { display: grid; gap: var(--sp-32); justify-items: start; }
.btn-primary { display: inline-flex; align-items: center; gap: var(--sp-12); background: var(--surface-control); color: var(--text-on-control); text-decoration: none; padding: var(--sp-16) var(--sp-32); min-height: 56px; }
.btn-primary img { width: 16px; height: 14px; flex: none; }
.btn-primary:active { background: var(--surface-control-active); }
.btn-play:active { background: var(--surface-sunken); }
.btn-ghost:active { background: var(--surface-control-ghost-active); }
.btn-tertiary:active { background: var(--surface-control-ghost-active); }
.skip:active { opacity: .7; }
.topbar-link:active { background: var(--surface-control-ghost-active); }
.toc-link:active { color: var(--text-secondary); }
.lang .seg:active { opacity: .85; }

/* Текстова версія uk (фреймы 4001:1173 / 156:516, контент in/ua.txt) */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.skip { position: absolute; left: var(--sp-16); top: -100px; z-index: 50; background: var(--surface-control); color: var(--text-on-control); padding: var(--sp-12) var(--sp-16); text-decoration: none; }
.skip:focus-visible { top: var(--sp-8); }
.text-topbar { position: sticky; top: 0; z-index: 30; background: var(--surface-page); border-bottom: 1px solid var(--border-subtle); }
.text-topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); width: 100%; max-width: var(--content-max); margin-inline: auto; min-height: max(64px, var(--frame-thickness)); padding: var(--sp-8); }
.topbar-link { display: inline-flex; align-items: center; gap: var(--sp-8); min-height: 48px; padding: var(--sp-12) var(--sp-8); color: var(--text-primary); text-decoration: none; }
.topbar-link img { display: block; }
.ic-flip { transform: rotate(180deg); }
.doc-header { padding-block: var(--sp-40); }
.doc-header-inner { display: grid; gap: var(--sp-16); max-width: 640px; margin-inline: auto; padding-inline: var(--sp-16); }
.toc-link:focus-visible { outline-color: #1434CB; }
.progress.is-dragging .track, .progress.is-dragging .elapsed { height: 6px; }
.progress.is-dragging .handle { width: 6px; height: 24px; }
.doc-header .eyebrow { color: var(--text-muted); }
.reading { background: var(--surface-control); padding: var(--sp-40) 20px; }
.reading-inner { max-width: var(--reading-max); margin-inline: auto; display: grid; gap: var(--sp-40); }
.toc { display: grid; gap: var(--sp-16); scroll-margin-top: calc(64px + 8px); }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li + li { border-top: 1px solid var(--border-subtle); }
.toc-link { display: flex; align-items: center; gap: var(--sp-12); min-height: 48px; padding-block: var(--sp-12); text-decoration: none; color: var(--text-primary); }
.toc-num { flex: none; color: var(--text-muted); }
.toc-title { flex: 1; }
/* стрелки/документ: 16×14 (стрелка), 17×14 (file-text), цветовые варианты SVG (light=#fff topbar, dark=#021e4c TOC/btn-primary) */
.exhibit { display: grid; gap: var(--sp-8); align-content: start; border-top: 1px solid var(--border-subtle); padding-top: var(--sp-40); scroll-margin-top: calc(64px + 8px); }
.exhibit:first-of-type { border-top: 0; padding-top: 0; }
.exhibit .muted-label { color: var(--text-muted); }
.exhibit p.t-body-m { color: var(--text-secondary); }
.back-cta { display: grid; justify-items: center; padding: var(--sp-40) 20px var(--sp-56); }
.back-cta .btn-primary { width: 100%; max-width: 640px; justify-content: center; min-height: 48px; white-space: nowrap; padding-inline: var(--sp-24); }

@media (min-width: 690px) {
  .site-header .header-inner { padding-block: var(--sp-8); min-height: 80px; }
  .section { padding-block: var(--sp-40); }
  .section-stack { gap: var(--sp-24); }
  .hero { padding: var(--sp-24) var(--sp-16); }
  .hero-photo { height: 272px; }
  .player-card { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "info playback" "footer playback"; column-gap: var(--sp-32); row-gap: var(--sp-16); align-items: start; }
  .player-info { grid-area: info; display: flex; flex-direction: column; gap: var(--sp-16); }
  .player-playback { grid-area: playback; display: flex; flex-direction: column; gap: var(--sp-16); }
  .player-footer { grid-area: footer; }
  .player-divider { display: none; }
  .row-2col { grid-template-columns: 1fr 1fr; gap: var(--sp-24); align-items: stretch; }
  .about-media { aspect-ratio: auto; position: relative; height: auto; }
  .curator-media { aspect-ratio: auto; position: relative; height: auto; }
  .about-media img, .curator-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .text-topbar-inner { padding: var(--sp-8) var(--sp-16); }
  .doc-header-inner { padding-inline: 0; }
  .reading { padding-inline: var(--sp-32); }
  .back-cta { padding-inline: var(--sp-32); }
}

.cta-stack { display: grid; gap: var(--sp-32); justify-items: start; }
@media (min-width: 690px) {
  .cta-stack { gap: var(--sp-24); }
}

.site-footer--bordered { border-top: 1px solid var(--border-subtle); }

/* Плеер — бегущая строка названия работы */
#track { touch-action: none; cursor: pointer; }
.marquee.is-marquee .work-title { display: inline-flex; overflow: visible; text-overflow: clip; animation-name: marquee; animation-timing-function: linear; animation-iteration-count: infinite; animation-delay: 2s; will-change: transform; }
.marquee.is-marquee .work-title span { flex: none; padding-right: 48px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee.is-marquee .work-title { animation: none; } }
