/* base.css */

/* ==== @font-face (DESIGN_SYSTEM.md §2, дословно) ==== */
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

body { margin: 0; }

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

h1, h2, h3, p, ul { margin: 0; }

ul { padding: 0; }

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

/* ==== БАЗА ==== */
html { scroll-behavior: smooth; }

body {
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

/* ==== ТИПОГРАФИКА (DESIGN_SYSTEM.md §3) ==== */
h1 {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--weight-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  color: var(--color-ink);
  max-width: 20ch;
}

h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: var(--weight-display);
  line-height: var(--leading-h2);
  letter-spacing: var(--tracking-display);
  color: var(--color-ink);
  max-width: 20ch;
}

h3 {
  font-family: var(--font-body);
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-h3);
  color: var(--color-ink);
}

.lead {
  font-family: var(--font-body);
  font-size: var(--text-lead);
  font-weight: var(--weight-body);
  line-height: var(--leading-body);
  color: var(--color-ink-soft);
  max-width: 65ch;
}

/* ==== FOCUS (DESIGN_SYSTEM.md §3) ==== */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) { outline: none; }

/* ==== REVEAL (T-11; переменные — DESIGN_SYSTEM.md §1) ==== */
.js .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-shift));
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--duration-reveal) var(--ease-out),
    transform var(--duration-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--reveal-stagger));
}

/* ==== MOTION (DESIGN_SYSTEM.md §3, дословно) ==== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
