/* Шрифти — локально (assets/fonts, ліцензія OFL): без запитів до Google
   й без «стрибка» шрифту. Bricolage Grotesque — латиниця й цифри, Onest —
   кирилиця (у Bricolage її немає); браузер бере потрібний за unicode-range. */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 200 800; font-display: swap; src: url("/assets/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; }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 200 800; font-display: swap; src: url("/assets/fonts/bricolage-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Onest"; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/onest-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/onest-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

/* Спільне для всіх сторінок beacon.how: кольори, типографіка, шапка,
   кнопки, підвал. Стилі окремої сторінки (фільм на головній, картки
   збірок) — у самій сторінці. */
:root {
  --bg: #f3f1ee; --surface: #fff; --fg: #17191c; --muted: #5f666d;
  --line: #e0dcd6; --field: #f6f4f1;
  --accent: #c4613f;
  /* Кнопки — на тон темніші за акцент: білий текст на #c4613f дає 4,1:1,
     а для звичайного тексту WCAG AA просить 4,5:1. #b5552f — 4,9:1. */
  --btn: #b5552f; --btn-fg: #fff;
  --light: #d97757;                  /* світло маяка з іконки */
  --mark: #15181b; --mark-edge: rgba(255,255,255,0);
  --win: #1b1f24; --win-2: #23282e; --win-line: rgba(255,255,255,.08);
  --win-fg: #eceef0; --win-muted: #9aa2aa;
  --glow: rgba(217,119,87,.28);
  --shadow: 0 1px 2px rgba(23,25,28,.05), 0 8px 24px -12px rgba(23,25,28,.18);
  --shadow-lg: 0 2px 4px rgba(23,25,28,.06), 0 24px 60px -24px rgba(23,25,28,.35);
  --radius: 14px;
  --top-h: 3.75rem;                  /* висота шапки: відступи якорів і фільму */
  --font: "Bricolage Grotesque", "Onest", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f11; --surface: #15181b; --fg: #eceef0; --muted: #959ca4;
    --line: #252a31; --field: #0f1215;
    --accent: #e08664; --btn: #e08664; --btn-fg: #1a0f0a;
    --mark: #1c2025; --mark-edge: rgba(255,255,255,.09);
    --win: #1a1e23; --win-2: #22272d; --win-line: rgba(255,255,255,.09);
    --glow: rgba(217,119,87,.14);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 60px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f11; --surface: #15181b; --fg: #eceef0; --muted: #959ca4;
  --line: #252a31; --field: #0f1215;
  --accent: #e08664; --btn: #e08664; --btn-fg: #1a0f0a;
  --mark: #1c2025; --mark-edge: rgba(255,255,255,.09);
  --win: #1a1e23; --win-2: #22272d; --win-line: rgba(255,255,255,.09);
  --glow: rgba(217,119,87,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 60px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--fg); background: var(--bg);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* clip, а не hidden: hidden ламає position: sticky у сцени фільму */
  overflow-x: clip;
}
a { color: inherit; }
/* Атрибут hidden ховає завжди: інакше display з класу (.live { display: flex })
   його перебиває, і схований блок видно порожнім. */
[hidden] { display: none !important; }
/* якорі не ховаються під закріпленою шапкою */
[id] { scroll-margin-top: calc(var(--top-h) + 1rem); }
.wrap { width: 100%; max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 40rem) { .wrap { padding: 0 1.5rem; } }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .6rem 1rem; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 600; text-decoration: none; }
.skip:focus { top: 1rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* --- шапка: закріплена на всіх сторінках --- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 60; color: var(--fg); }
/* Підкладка — лише коли під шапкою вже є вміст: на першому екрані шапка
   прозора й не перекриває героя. Колір і підкладка — відгук на стан, тож
   короткий CSS-перехід тут доречний. */
.top::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; background: color-mix(in srgb, var(--bg) 80%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 var(--line); }
.top.scrolled::before { opacity: 1; }
.top.on-night { color: #f3f1ee; }
.top.on-night::before { background: rgba(7, 10, 20, .55); box-shadow: 0 1px 0 rgba(255,255,255,.08); }
@media (prefers-reduced-motion: no-preference) { .top::before { transition: opacity .2s ease, background-color .2s ease; } }
.top-in { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 72rem; height: var(--top-h); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 40rem) { .top-in { padding: 0 1.5rem; } }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.125rem; text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 28px; height: 28px; flex: none; }
.nav { display: flex; align-items: center; gap: .125rem; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9375rem; padding: .5rem .75rem; border-radius: 999px; white-space: nowrap; }
.nav a:hover, .nav a:focus-visible { color: var(--fg); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.nav a[aria-current="page"] { color: var(--fg); }
.top.on-night .nav a { color: rgba(243,241,238,.75); }
.top.on-night .nav a:hover, .top.on-night .nav a:focus-visible { color: #f3f1ee; background: rgba(255,255,255,.1); }
.menu-btn { display: none; align-items: center; gap: .5rem; min-height: 2.5rem; padding: 0 .9rem; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 80%, transparent); color: inherit; font: inherit; font-weight: 600; font-size: .9375rem; cursor: pointer; }
.menu-btn i { position: relative; width: 14px; height: 2px; border-radius: 1px; background: currentColor; }
.menu-btn i::before, .menu-btn i::after { content: ""; position: absolute; left: 0; width: 14px; height: 2px; border-radius: 1px; background: currentColor; }
.menu-btn i::before { top: -5px; } .menu-btn i::after { top: 5px; }
.top.on-night .menu-btn { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); }
/* вузький екран: пункти — у випадному меню */
@media (max-width: 47.99rem) {
  .menu-btn { display: inline-flex; }
  .nav { position: absolute; top: calc(var(--top-h) - .25rem); right: 1rem; flex-direction: column; align-items: stretch; min-width: 13rem; padding: .375rem; border-radius: 16px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); visibility: hidden; opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; }
  .nav a, .top.on-night .nav a { color: var(--fg); padding: .7rem .9rem; border-radius: 11px; }
  .nav a:hover, .top.on-night .nav a:hover { background: var(--field); color: var(--fg); }
  .top.open .nav { visibility: visible; opacity: 1; transform: none; }
  @media (prefers-reduced-motion: no-preference) {
    .nav { transition: opacity .16s ease, transform .2s cubic-bezier(.23,1,.32,1), visibility 0s linear .2s; }
    .top.open .nav { transition: opacity .16s ease, transform .2s cubic-bezier(.23,1,.32,1), visibility 0s; }
  }
}

/* --- кнопки й адреса --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: 0 1.25rem; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
}
.btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-fg); }
.btn[aria-disabled="true"] { opacity: .55; cursor: default; }
/* Натискання — коротка відповідь на дію; лише там, де є миша */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .btn { transition: transform .16s cubic-bezier(.23,1,.32,1), box-shadow .16s ease; }
  .btn:not([aria-disabled="true"]):hover { transform: translateY(-1px); box-shadow: var(--shadow); }
  .btn:not([aria-disabled="true"]):active { transform: scale(.97); }
}
.address {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .375rem .375rem .375rem 1rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  max-width: 100%;
}
.address .label { color: var(--muted); font-size: .875rem; font-weight: 600; margin-right: .25rem; }
/* min-width: 0 — останній запобіжник: на дуже вузькому екрані адреса скоріше
   обріжеться трикрапкою, ніж кнопка «Копіювати» вилізе за край */
.address code { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 1rem; font-weight: 600; white-space: nowrap; }
.address .copy { flex: none; }
/* «Адреса» + адреса + «Скопійовано» потребують ~20rem: у вужчому місці підпис
   лишається лише для екранних читачів (адресу видно й без нього). Контейнер —
   колонка, де стоїть адреса (container-type на сторінці); media — запас для
   браузерів без container queries і для 320 px. */
@container (max-width: 20rem) {
  .address { padding-left: .875rem; }
  .address .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 359px) {
  .address { padding-left: .875rem; }
  .address .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.copy {
  margin-left: .5rem; min-height: 2.25rem; padding: 0 .875rem; border-radius: 999px;
  border: 0; background: var(--bg); color: var(--fg); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer;
}
.copy:hover { background: var(--line); }

/* --- секції й підвал --- */
section.block { padding: 3rem 0; border-top: 1px solid var(--line); }
h2 { margin: 0 0 .5rem; font-size: clamp(1.625rem, 3.5vw, 2.125rem); letter-spacing: -.025em; line-height: 1.15; }
.sub { margin: 0 0 2rem; color: var(--muted); max-width: 40rem; }
.sub a { color: var(--fg); font-weight: 600; text-decoration-color: var(--accent); text-underline-offset: 3px; }
footer { padding: 2.5rem 0 3rem; color: var(--muted); font-size: .875rem; border-top: 1px solid var(--line); }
footer a { color: inherit; }
footer p { margin: 0; }
/* посилання на сторінки збірок (scripts/build-site-pages.py) — з кожної сторінки сайту */
footer .foot-packs { margin-bottom: .625rem; color: var(--fg); font-weight: 600; }
footer .foot-legal { margin-bottom: .625rem; font-size: .875rem; }

/* --- перемикач теми (☀/☾) і перехід колом від нього --- */
.theme-sw { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: space-between; width: 58px; height: 32px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); cursor: pointer; }
.theme-sw svg { position: relative; z-index: 1; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-sw .i-moon { fill: currentColor; stroke: none; }
.theme-sw .knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--fg); }
.theme-sw[aria-checked="true"] .knob { transform: translateX(26px); }
.theme-sw[aria-checked="false"] .i-sun, .theme-sw[aria-checked="true"] .i-moon { color: var(--bg); }
@media (prefers-reduced-motion: no-preference) {
  .theme-sw .knob { transition: transform .28s cubic-bezier(.23, 1, .32, 1); }
  .theme-sw svg { transition: color .2s ease; }
}
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: beacon-theme-reveal .6s cubic-bezier(.23, 1, .32, 1); }
@keyframes beacon-theme-reveal {
  from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); }
  to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 0)); }
}
.top-r { display: flex; align-items: center; gap: .5rem; }
.top.on-night .theme-sw { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: rgba(243,241,238,.75); }
.top.on-night .theme-sw .knob { background: #f3f1ee; }
.top.on-night .theme-sw[aria-checked="false"] .i-sun, .top.on-night .theme-sw[aria-checked="true"] .i-moon { color: #0d0f11; }
