/* base.css — шрифты, сброс, поля, типографика, оболочка страницы. */

/* ── Шрифты ────────────────────────────────────────────────────────
   Oswald и Golos Text — SIL Open Font License 1.1, лежат локально.
   Оба файла вариативные, поэтому один файл на подмножество символов
   покрывает весь диапазон весов. Происхождение — assets/fonts/README.md. */

@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url("../assets/fonts/oswald-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url("../assets/fonts/oswald-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../assets/fonts/golos-text-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../assets/fonts/golos-text-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Сброс ─────────────────────────────────────────────────────── */

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

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100dvh;
  background: var(--field-bg);
  color: var(--field-text);
  font-family: var(--font-text);
  font-size: var(--type-body-size);
  font-weight: var(--type-body-weight);
  line-height: var(--type-body-line);
  overflow-x: hidden;
  transition: background-color var(--motion-screen-in), color var(--motion-screen-in);
}

h1,
h2,
h3,
p,
figure,
ul,
ol,
dl,
dd {
  margin: 0;
}

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

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

img {
  height: auto;
}

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

button {
  margin: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

/* ── Фокус ─────────────────────────────────────────────────────────
   Костяной контур на чернильном и оксбладовом поле, лаковый на костяном.
   Ни один интерактивный элемент не остаётся без видимого фокуса. */

:focus-visible {
  outline: var(--focus-width) solid var(--field-focus);
  outline-offset: var(--focus-offset);
}

/* Для мышиного клика контур не нужен, но клавиатурный обязателен —
   поэтому снимается только :focus без :focus-visible. */
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Типографика ───────────────────────────────────────────────── */

.t-hero {
  font-family: var(--font-display);
  font-size: var(--type-hero-size);
  font-weight: var(--type-hero-weight);
  line-height: var(--type-hero-line);
  letter-spacing: var(--type-hero-tracking);
  text-transform: var(--type-hero-case);
}

.t-question {
  font-family: var(--font-display);
  font-size: var(--type-question-size);
  font-weight: var(--type-question-weight);
  line-height: var(--type-question-line);
  letter-spacing: var(--type-question-tracking);
  text-transform: var(--type-question-case);
}

.t-title {
  font-family: var(--font-display);
  font-size: var(--type-title-size);
  font-weight: var(--type-title-weight);
  line-height: var(--type-title-line);
  letter-spacing: var(--type-title-tracking);
  text-transform: var(--type-title-case);
}

.t-body {
  font-family: var(--font-text);
  font-size: var(--type-body-size);
  font-weight: var(--type-body-weight);
  line-height: var(--type-body-line);
}

.t-sub {
  font-family: var(--font-text);
  font-size: var(--type-sub-size);
  font-weight: var(--type-sub-weight);
  line-height: var(--type-sub-line);
  color: var(--field-text-muted);
}

.t-label {
  font-family: var(--font-text);
  font-size: var(--type-label-size);
  font-weight: var(--type-label-weight);
  line-height: var(--type-label-line);
  letter-spacing: var(--type-label-tracking);
  text-transform: var(--type-label-case);
}

.t-action {
  font-family: var(--font-text);
  font-size: var(--type-action-size);
  font-weight: var(--type-action-weight);
  line-height: var(--type-action-line);
  letter-spacing: var(--type-action-tracking);
  text-transform: var(--type-action-case);
}

/* Одно слово в лаке — результат гостьи, выбор, прогресс, действие. */
.accent {
  color: var(--color-lacquer);
}

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

/* ── Оболочка ──────────────────────────────────────────────────── */

.app {
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-h);
  background: var(--field-bg);
  border-bottom: var(--hairline) solid var(--field-line);
  transition: background-color var(--motion-screen-in),
    border-color var(--motion-screen-in);
}

.brand-header__name {
  font-family: var(--font-display);
  font-size: var(--type-title-size);
  font-weight: var(--type-title-weight);
  line-height: var(--type-title-line);
  letter-spacing: var(--type-title-tracking);
  text-transform: var(--type-title-case);
  color: var(--field-text);
}

/* Точка монтирования экранов. Активен ровно один. */
.screens {
  display: block;
}

.screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--column);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(var(--header-h) + var(--space-xl)) var(--gutter)
    calc(var(--action-h) + var(--space-base));
}

.screen[hidden] {
  display: none;
}

/* Вход экрана: 260 мс, прозрачность 0→1 и подъём с 5px. Выхода нет. */
.screen--entering {
  animation: screen-in var(--motion-screen-in) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(var(--motion-screen-in-rise));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Заголовок принимает программный фокус, но не рисует контур: он не
   интерактивен, а контур на входе каждого экрана читался бы как ошибка.
   Видимый фокус обязателен для интерактивных элементов — они его сохраняют. */
.screen__heading:focus,
.screen__heading:focus-visible {
  outline: none;
}

/* Действие прижимается к низу колонки. */
.screen__spacer {
  margin-top: auto;
}

/* Липкая зона действия: 110px с градиентом к текущему полю. */
.action-zone {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 15;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: var(--action-h);
  padding: 0 var(--gutter) var(--space-xl);
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--field-bg) 38%);
}

.action-zone > * {
  width: 100%;
  max-width: calc(var(--column) - var(--gutter) * 2);
  pointer-events: auto;
}

/* Полноширинные элементы выходят за поля колонки. */
.bleed {
  width: var(--bleed-width);
  margin-inline: var(--bleed);
}

/* ── Отключённая анимация ──────────────────────────────────────────
   Те же состояния, только сразу. Штрихи отрисованы, задержка выбора снята. */

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

  .marker-mark__path {
    stroke-dashoffset: 0 !important;
  }
}
