/* ==========================================================================
   База: сброс, типографика, контейнер, ссылки
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  transition: background-color var(--dur-base) var(--ease-fade),
    color var(--dur-base) var(--ease-fade);
}

/* Прокрутка заблокирована, пока открыты оверлеи */
body.is-locked {
  overflow: hidden;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: normal;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 1.4rem + 4vw, 5rem);
  font-weight: 800;
}
h2 {
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.8rem);
}
h3 {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem);
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-fade),
    opacity var(--dur-fast) var(--ease-fade);
}

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

ul,
ol {
  list-style: none;
  padding: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}

/* --- Контейнер и сетка --- */
.container {
  width: var(--grid-width);
  margin-inline: auto;
}

.section {
  padding-block: clamp(var(--space-l), 6vw, var(--space-xxl));
}

/* --- Утилиты --- */
.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;
}

/* --- Каркас страницы --- */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page__main {
  flex: 1 0 auto;
  padding-top: var(--nav-height);
}

/* --- Кнопки --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xxs);
  height: 52px;
  padding-inline: var(--space-m);
  border-radius: var(--radius-m);
  font-family: var(--font-text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-fade),
    color var(--dur-base) var(--ease-fade),
    border-color var(--dur-base) var(--ease-fade),
    transform var(--dur-fast) var(--ease-move);
}
.btn:active {
  transform: translateY(1px);
}
.btn--solid {
  background: var(--text);
  color: var(--bg);
}
.btn--solid:hover {
  background: var(--text-muted);
  color: var(--bg);
}
.btn--ghost {
  border: 1px solid currentColor;
  color: var(--text);
}
.btn--ghost:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
/* Инверсный набор для тёмных подложек (герой) */
.btn--on-dark.btn--solid {
  background: #fff;
  color: #000;
}
.btn--on-dark.btn--solid:hover {
  background: rgba(255, 255, 255, 0.85);
}
.btn--on-dark.btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
}
.btn--on-dark.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* --- Подвал (базовый) --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-l);
  color: var(--text-muted);
  font-size: 0.85rem;
}
