/* Шрифти, типові стилі елементів, макет і утиліти. */
/* Fonts, element defaults, layout and utilities. Tokens live in tokens.css. */

/* ---------- Fonts (self-hosted, OFL: static/fonts/OFL.txt) ---------- */
/* Inter and Manrope are variable (one file per script covers every weight). The browser
   downloads Cyrillic or Latin Extended only when a page uses those letters. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght.260c81a4759b.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: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-cyrillic-wght.de93fdc85e3d.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght.1ad231aac0a8.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-wght.938c6e8019b6.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: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-cyrillic-wght.e58febde317b.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext-wght.6d36d5bdedfa.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.79936b18df9f.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-cyrillic-400-normal.2f3900b11191.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-ext-400-normal.6ce02d71b5de.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Fallbacks shown until the real fonts load. Arial (Liberation Sans on Linux) is scaled to the
   metrics of each font, so text keeps its size and line breaks when the real font swaps in.
   Values computed with fontTools from the font files (frequency-weighted average glyph width). */
@font-face {
  font-family: "Inter Fallback";
  font-weight: 100 549;
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans");
  size-adjust: 107.33%;
  ascent-override: 90.26%;
  descent-override: 22.47%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Inter Fallback";
  font-weight: 550 900;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("LiberationSans-Bold");
  size-adjust: 101.4%;
  ascent-override: 95.54%;
  descent-override: 23.79%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Manrope Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans");
  size-adjust: 104.98%;
  ascent-override: 101.55%;
  descent-override: 28.58%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Plex Mono Fallback";
  font-weight: 400;
  src: local("Courier New"), local("CourierNewPSMT"), local("Liberation Mono"), local("LiberationMono");
  size-adjust: 100%;
  ascent-override: 102.52%;
  descent-override: 27.5%;
  line-gap-override: 0%;
}

/* ---------- Element defaults ---------- */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (min-width: 64em) {
  html { font-size: 106.25%; } /* 17px body on desktop */
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-0);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote, pre {
  margin: 0;
}

/* Headlines: Manrope, medium weight, tight. h4 and smaller stay in Inter. */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: var(--track-display);
  text-wrap: balance;
}

h1, h2 { line-height: var(--lh-tight); }
h3 { line-height: var(--lh-snug); letter-spacing: -0.02em; }

h1 { font-size: var(--fs-4); }
h2 { font-size: var(--fs-3); }
h3 { font-size: var(--fs-1); }

/* Long words (German "Nutzungsbedingungen", Polish "odpowiedzialność") must never push the page
   wider than a 360px phone. Hyphenation needs <html lang>, which base.html sets. */
h1, h2, h3, .prose {
  hyphens: auto;
  overflow-wrap: break-word;
}

/* From 48em headings have room: hyphens there ("listen-ing" in a wide thread title) only hurt reading. */
@media (min-width: 48em) {
  h1, h2, h3 { hyphens: manual; }
}

@media (min-width: 48em) {
  h1 { font-size: var(--fs-5); }
  h2 { font-size: var(--fs-4); }
  h3 { font-size: var(--fs-2); }
}

h4 {
  font-size: var(--fs-0);
  font-weight: 600;
  line-height: var(--lh-snug);
}

p { text-wrap: pretty; }

/* Links are text with a quiet underline that firms up on hover. Color is never the only cue. */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.22em;
  transition: none;
}

@media (hover: hover) {
  a:hover { text-decoration-color: var(--signal); }
}

strong, b { font-weight: 600; }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

img, video {
  display: block;
  max-width: 100%;
  height: auto;
}

svg { flex-shrink: 0; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend { padding: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--s-6) 0;
}

:focus-visible {
  outline: 2px solid var(--focus);
  box-shadow: 0 0 0 5px var(--focus-edge);
  outline-offset: 2px;
}

::selection {
  background: var(--text);
  color: var(--paper);
}

/* Reduced motion: every element shows its final, static state. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--pad));
  margin-inline: auto;
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}

.site-main {
  flex: 1 0 auto;
}

/* ---------- Page shell: every page below the header (docs/DESIGN.md "Layout") ----------
   <div class="container shell [shell--narrow|shell--card]">
     <header class="page-head"> eyebrow, h1, lede, actions </header>   (components.css)
     content: one column, a .sheet (aside 4 + main 8) or a page grid of its own
   </div>
   Widths are centred in the 1200px container, so a narrow page sits in the middle, never against the left edge.
   Text inside stays left-aligned. */

.shell {
  padding-top: var(--s-6);
  padding-bottom: var(--s-8);
}

/* Reading width: legal and content pages, a news post, confirmations, errors. */
.shell--narrow { max-width: calc(var(--shell-narrow) + 2 * var(--pad)); }

/* One card in the middle: sign in, sign out, sign-up, report form, accept terms. */
.shell--card { max-width: calc(var(--shell-card) + 2 * var(--pad)); }

@media (min-width: 64em) {
  .shell { padding-top: var(--s-7); padding-bottom: var(--s-9); }
  .shell--card { padding-top: var(--s-8); }
}

/* ---------- Utilities ---------- */

/* Largest headline (landing hero, closing band). */
.display {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--track-display);
  text-wrap: balance;
}

/* Mono label: uppercase meta lines ("Built with AI. Backed by evidence."). */
.label {
  font-family: var(--font-mono);
  font-size: var(--fs--2);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
}

/* Eyebrow above a section headline ("01 / The standard"). */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs--2);
  line-height: 1.5;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--accent-text);
}

/* Lead paragraph under a headline. */
.lede {
  max-width: 52ch;
  color: var(--muted);
  font-size: var(--fs-1);
  line-height: 1.45;
}

@media (max-width: 47.99em) {
  .lede { font-size: 1.125rem; }
}

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.6em; }

.stack > * + * { margin-top: var(--stack, var(--s-4)); }

.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.numeric { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute !important;
  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;
  z-index: 100;
  left: max(var(--s-4), env(safe-area-inset-left));
  top: var(--s-2);
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  padding: 0 var(--s-4);
  background: var(--text);
  color: var(--paper);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

/* Controls that only work with JavaScript. The "js" class is set in <head> before paint. */
html:not(.js) .needs-js { display: none !important; }

/* Notes inside long pages, e.g. "Draft, last updated ..." at the top of the legal pages. */
.prose blockquote {
  padding: var(--s-3) var(--s-4);
  border-left: 2px solid var(--line-strong);
  background: var(--surface);
}

.prose code {
  padding: 0.1em 0.3em;
  background: var(--tint);
}

.prose pre {
  padding: var(--s-3) var(--s-4);
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
}

.prose pre code { padding: 0; background: none; }

/* Tables in long pages (cookie list). Scroll inside the table on narrow screens, never the page. */
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--fs--1);
}

.prose th,
.prose td {
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs--2);
  font-weight: 400;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.prose th:first-child, .prose td:first-child { padding-left: 0; }
