/* =============================================================
   base.css — reset/normalize, типографика, контейнер.
   Загружается ПОСЛЕ tokens.css и ПЕРЕД main.css.
   ============================================================= */

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

/* ----- Document ----- */
html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Высота sticky-шапки — чтобы при клике по якорю секция не уезжала под шапку */
  scroll-padding-top: 140px;
}

/* Дополнительная страховка для секций-целей якорных ссылок */
section[id],
[id="author"],
[id="product"],
[id="founders"],
[id="cases"],
[id="circle"] {
  scroll-margin-top: 140px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  color: var(--color-ink);
  background: var(--color-white);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ----- Sectioning ----- */
main {
  display: block;
}

/* ----- Links ----- */
a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}

a:hover {
  color: var(--color-primary);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ----- Media ----- */
img,
svg,
video,
canvas {
  max-width: 100%;
  display: block;
}

img {
  height: auto;
}

/* ----- Forms ----- */
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

[disabled] {
  cursor: not-allowed;
}

/* ----- Headings (Figma: Montserrat Alternates Medium 500) ----- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: var(--fw-medium);   /* 500 — как в Figma */
  color: var(--color-ink);
}

h1 {
  /* Hero в Figma 96/100. На остальных страницах меньше — компромисс 56. */
  font-size: var(--fs-56);
  line-height: var(--lh-tight);
  letter-spacing: -0.5px;
}

h2 {
  /* В Figma секции лендинга — 32/48. */
  font-size: var(--fs-32);
  line-height: 48px;
}

h3 {
  font-size: var(--fs-24);
  line-height: var(--lh-snug);
}

h4 {
  font-size: var(--fs-18);
  line-height: 1.3;
}

h5 {
  font-size: var(--fs-16);
  line-height: var(--lh-snug);
}

h6 {
  font-size: var(--fs-14);
  line-height: var(--lh-snug);
}

p {
  margin: 0 0 1em;
  line-height: 1.55;
}

small {
  font-size: var(--fs-12);
}

/* ----- Текстовые утилитарные классы ----- */
.script {
  font-family: var(--font-script);
  font-weight: var(--fw-regular);
  font-style: normal;
}

.display {
  font-family: var(--font-display);
}

/* ----- Container ----- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container--narrow {
  max-width: 880px;
}

.container--wide {
  max-width: 1440px;
}

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

/* ----- A11y ----- */
.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;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
