/* ── Base layer — siarheimardovich.com v2 ── */
/* 0814_3 repair of the 0815 base file. Defect D2: @font-face url() was written as
   'assets/fonts/…' from a stylesheet already inside assets/, so all 6 faces 404'd and the
   page rendered in system-ui. url() resolves against the stylesheet, so the correct path
   is 'fonts/…'. Verified over HTTP and via document.fonts. */

/* Vendored Geist — OFL, vercel/geist-font v1.7.2 */
@font-face {
  font-family: 'Geist Sans';
  src: url('fonts/geist-sans-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Geist Sans';
  src: url('fonts/geist-sans-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Geist Sans';
  src: url('fonts/geist-sans-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Geist Sans';
  src: url('fonts/geist-sans-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/geist-mono-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/geist-mono-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* The universal reset above is specificity 0,0,0, so it loses to any bare element rule
   a host theme happens to set. Standalone that never comes up; inside WordPress it does
   — GeneratePress ships `p { margin-bottom: 1.5em }`, `h1..h6 { margin-bottom: 20px }`
   and `ul, ol { margin: 0 0 1.5em 3em }` at 0,0,1, and every one of them outranked the
   line above, so the design rendered with spacing it never asked for.

   Repeating the reset as an element list puts it at 0,0,1: level with a theme's element
   rules and later in the cascade, so it wins, while still losing to every rule in this
   design, which is class-based or compound. No effect standalone. */
body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, dl, dd, dt,
figure, figcaption, blockquote, pre, table, hr, fieldset, legend, form {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + var(--space-16));
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1;
}

/* ── Headings — sizes come from single-length tokens ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  line-height: var(--lh-heading);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}
h1 { font-size: var(--text-display); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
h2 { font-size: var(--text-2xl);     font-weight: var(--fw-semibold); }
h3 { font-size: var(--text-xl);      font-weight: var(--fw-semibold); }
h4 { font-size: var(--text-lg);      font-weight: var(--fw-semibold); }
h5 { font-size: var(--text-base);    font-weight: var(--fw-semibold); }
h6 { font-size: var(--text-sm);      font-weight: var(--fw-semibold); }

p, li { font-size: var(--text-base); }

/* ── Links — ink, not blue; emphasis via weight and rule ── */
a { color: inherit; text-decoration: none; }

/* Links carry the colour of whatever they sit in, hovered included: emphasis is the
   underline, never a colour change. `color: inherit` is repeated here rather than left
   to the rule above because `a { }` is specificity 0,0,1 and a host theme's
   `a:hover, a:focus, a:active { color: … }` is 0,1,1, which outranks it.
   GeneratePress does exactly that, with `--contrast: #222222` — so on WordPress the
   wordmark and the case-nav links turned near-black on hover, against a black page.
   At 0,1,1 this is level with the theme rule and later in the cascade, and still loses
   to this design's own hover rules, which are 0,2,1. */
a:hover,
a:focus,
a:active {
  color: inherit;
}
a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:focus-visible,
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

strong { font-weight: var(--fw-semibold); }

/* House style: no italics. Normalise anything a paste introduces. */
em, i { font-style: normal; font-weight: var(--fw-semibold); }

/* ── Lists ── */
ul, ol { padding-left: 1.25em; }
li + li { margin-top: var(--space-8); }

/* ── Code ── */
code { font-family: var(--font-mono); font-size: 0.9em; }
pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-16);
  overflow-x: auto;
}

/* ── Media ── */
img, svg, iframe { max-width: 100%; }
img { height: auto; display: block; }

/* ── Tables ── */
table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
th, td {
  text-align: left;
  padding: var(--space-8) var(--space-12);
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
th { font-weight: var(--fw-semibold); color: var(--ink); }

/* ── Skip link ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-8) var(--space-16);
  font-size: var(--text-sm);
  z-index: calc(var(--z-topbar) + 1);
}
.skip-link:focus { left: var(--space-8); top: var(--space-8); }

/* ── Selection ── */
::selection { background: var(--ink); color: var(--paper); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hairline-2); border-radius: var(--radius-sm); }

/* ── Motion: at most one orchestrated moment per page, and none of it here ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
