/* Base: fonts (local Onest 400/700, cyrillic + latin), reset, typography, page frame (header, content, footer). */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/onest-400-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-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/onest-400-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: "Onest"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/onest-700-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-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/onest-700-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; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 12px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.55; overflow-wrap: break-word; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--tg); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding-left: 1.25rem; }
img, svg { max-width: 100%; }
strong, b { font-weight: 700; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; background: var(--soft); padding: 0.1em 0.35em; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--surface); border-radius: var(--radius-field); box-shadow: var(--shadow); }
.skip-link:focus { top: 8px; }
.icon { flex: none; width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (max-width: 480px) { h1 { font-size: 1.65rem; } }

/* ─── Frame ─── */
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; max-width: calc(var(--page-app) + 32px); margin: 0 auto; padding: 12px 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.header-nav { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; justify-content: flex-end; }
.header-link { color: var(--muted); font-size: 0.92rem; text-decoration: none; padding: 10px 0; }
.header-link:hover, .header-link[aria-current="page"] { color: var(--fg); }
.theme-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}
.tape { height: 8px; background: repeating-linear-gradient(-45deg, var(--tape-yellow) 0 10px, var(--tape-black) 10px 20px); }
.page { flex: 1; width: 100%; max-width: calc(var(--page) + 32px); margin: 0 auto; padding: 16px 16px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }
.page.wide { max-width: calc(var(--page-wide) + 32px); }
.page.app { max-width: calc(var(--page-app) + 32px); }
.site-footer { width: 100%; max-width: calc(var(--page-wide) + 32px); margin: 0 auto; padding: 20px 16px 28px; color: var(--muted); font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center; }
.site-footer a, .site-footer button { color: var(--muted); }
.link-btn { padding: 8px 0; font: inherit; text-decoration: underline; background: none; border: 0; cursor: pointer; }
