/* Reset, page atmosphere (static grid + static grain), typography, focus, motion guard. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
  scrollbar-color: var(--line-strong) transparent;
}
/* Phones and zoomed desktops (< 768 CSS px): the fixed top bar must never cover a control that
   receives focus (Shift+Tab scrolls it into view below the bar, WCAG 2.4.11). */
@media (max-width: 767.98px) {
  html { scroll-padding-top: calc(var(--topbar-h) + 8px); }
}
html.is-scroll-locked { overflow: hidden; }

/* Keep html without a background: body's bg then paints on the canvas,
   below the negative-z grid/grain layers. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.5;
  font-weight: 400;
  font-feature-settings: 'kern' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  caret-color: var(--accent);
}

/* Very thin static grid on a fixed layer (never scrolls, never animates). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(25, 27, 32, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(25, 27, 32, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
}

/* Static grain: SVG feTurbulence, rendered once, never animated. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

img, svg, video, canvas, picture { display: block; max-width: 100%; }
img { height: auto; }
svg { flex-shrink: 0; }

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; text-wrap: balance; color: var(--ink); }
p { text-wrap: pretty; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
table { border-collapse: collapse; }
td, th { font-variant-numeric: tabular-nums; }

::selection { background: var(--accent-tint); color: var(--ink); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--bg);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #B9BDC5; }

/* Focus: visible 2px ring for keyboard users only. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Headings focused by the router / skip link are reading positions, not controls: no ring. */
h1[tabindex='-1']:focus-visible,
h2[tabindex='-1']:focus-visible { outline: none; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Type scale -------------------------------------------------------------- */
/* Display type: Alumni Sans, always upright (a true Cyrillic italic switches to cursive forms).
   The slant is synthetic: add .oblique to the element (or to the whole block for multi-line titles). */
.t-display {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: normal;
  font-synthesis: none;
  text-transform: uppercase;
  font-size: var(--fs-display);
  line-height: .9;
  letter-spacing: 0;
  color: var(--ink);
}
.t-display--900 { font-weight: 900; }
/* Alumni Sans has no italic cut, so the slant is a transform — and transformed text is rasterized without
   hinting. Measured on 06.10.2026: at 2rem it still holds, at 1.75rem and below the counters of «О», «А», «Ш»
   close up and the heading reads as a smudge beside an untransformed one. **Never set .oblique text below 2rem
   (32px).** Either size it up or leave the slant off. */
.oblique { display: inline-block; transform: skewX(-10deg); }
.t-h1 { font-size: var(--fs-3xl); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.t-h2 { font-size: var(--fs-2xl); font-weight: 600; line-height: 1.15; letter-spacing: -.015em; }
.t-h3 { font-size: var(--fs-xl); font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.t-h4 { font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; }
.t-body { font-size: var(--fs-base); line-height: 1.55; }
.t-lead { font-size: var(--fs-lg); line-height: 1.5; color: var(--ink-2); }
.t-small { font-size: var(--fs-sm); line-height: 1.45; }
.t-caption { font-size: var(--fs-xs); line-height: 1.4; color: var(--ink-3); }
.t-muted { color: var(--ink-2); }
.t-subtle { color: var(--ink-3); }
.t-num { font-variant-numeric: tabular-nums; }
.t-price { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }

/* Reduced motion: state changes become instant everywhere.
   Transitions are 0s, not 1ms: a 1ms transition still starts from the old value, so a panel revealed
   with `visibility` (drawer, sheets) would be hidden for that frame and a same-task focus() into it
   would silently fail. Nothing listens for transitionend; animations keep 1ms so animationend fires. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
