/* =====================================================================
   Base: reset, typography, layout primitives
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-weight: var(--fw-medium);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
body.is-locked { overflow: hidden; }
main { flex: 1 0 auto; display: block; }

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:where(ul, ol)[role="list"] { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }

/* Suomen sanoja ei tavuteta: rivinvaihto vain sanojen välistä (ei «tilo-ja») */
h1, h2, h3, h4,
.h1, .h2, .h3, .h4,
.hero__lead, .lead, .btn, .chip, .link-arrow,
.card__cta, .mobile-menu__link, .nav__link,
.site-footer__list a, .step__text h3, .work-item {
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
}
h1, h2, h3, h4 {
  color: var(--color-ink);
  line-height: var(--lh-snug);
  font-weight: var(--fw-semibold);
  text-wrap: balance;
}
p { text-wrap: pretty; overflow-wrap: break-word; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
strong, b { color: var(--color-ink); font-weight: var(--fw-bold); }

:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
::selection { background: var(--color-accent); color: #fff; }
[hidden] { display: none !important; }

/* ---------- Текстовые стили ---------- */
.h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); }
.h2 { font-size: var(--fs-h2); line-height: 1.2; font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.h3 { font-size: var(--fs-h3); line-height: 1.25; font-weight: var(--fw-bold); }
.h4 { font-size: var(--fs-h4); line-height: 1.3; font-weight: var(--fw-bold); }
.lead { font-size: var(--fs-lg); line-height: 1.6; max-width: 46ch; }
.eyebrow {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-accent);
}
.accent { color: var(--color-accent); }
.muted { color: var(--color-muted); }
.small { font-size: var(--fs-sm); }

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--fs-h3); margin-top: 1.8em; }
.prose h3 { font-size: var(--fs-h4); margin-top: 1.5em; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 0.35em; }
/* Ссылки в тексте: область нажатия ≥ 24px без изменения высоты строки */
.prose a { padding-block: 4px; }

.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: fixed;
  left: var(--space-4);
  top: var(--space-3);
  z-index: calc(var(--z-menu) + 1);
  padding: var(--space-3) var(--space-4);
  background: var(--color-ink);
  color: #fff;
  font-weight: var(--fw-semibold);
  transform: translateY(-300%);
}
.skip-link:not(:focus) { clip-path: inset(50%); }
.skip-link:focus { transform: none; }

/* ---------- Раскладка ---------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container--narrow { width: min(100% - 2 * var(--gutter), 60rem); }
.section { padding-block: var(--space-section); }
.section--tight { padding-block: calc(var(--space-section) * 0.6); }
.section--flush-top { padding-top: 0; }
.section--surface { background: var(--color-surface); }
.stack > * + * { margin-top: var(--stack, var(--space-4)); }
