/* Нитишоп — базовые стили: сброс, текст, контейнер, ссылки. */

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

/* Масштаб под макет 1920 px — считает assets/js/fit.js (1 вне диапазона 1280–1919) */
body {
  zoom: var(--z, 1);
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-18);
  line-height: var(--lh-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

ul { list-style: none; }

fieldset {
  min-width: 0;
  border: 0;
}

legend { padding: 0; }

a {
  color: inherit;
  text-decoration: none;
  transition: color .25s;
}

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

svg { display: block; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 4px;
}

/* GRID-01: один контейнер на весь сайт */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--side) * 2);
  margin-inline: auto;
  padding-inline: var(--side);
}

/* TEXT-06: подчёркнутая ссылка — 1 px, 50 % цвета текста (в проекте как в макете), при наведении линия уходит */
a.u {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);  /* 50 % — как в макете Нитишопа */
  text-underline-offset: .2em;
  transition: color .25s, text-decoration-color .25s;
}

a.u:hover {
  color: var(--link-hover);
  text-decoration-color: transparent;
}

/* Временная заглушка над подвалом, пока нет остальных блоков */
.stub {
  min-height: 70vh;
  padding-block: 64px;
  color: var(--muted);
}

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

/* Смена темы: свет расходится кругом от лампочки (View Transitions).
   Сам круг рисует assets/js/theme.js, здесь — отключаем стандартное затухание. */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

html.is-theme-closing::view-transition-old(root) { z-index: 2; }
html.is-theme-closing::view-transition-new(root) { z-index: 1; }

/* Верхний слой страницы — шапка и контент. Лежит поверх подвала и закрывает его
   своим фоном, пока подвал «выезжает» снизу (assets/js/footer-reveal.js). */
.page {
  position: relative;
  z-index: 1;
  background: var(--bg);
}

[data-footer-parallax] {
  position: relative;
  z-index: 0;
  will-change: transform;
}

/* Полоса прокрутки: тонкая, тёмная (#212121), в тёмной теме — светлая.
   Chrome, Safari, Яндекс — через ::-webkit-scrollbar, Firefox — через scrollbar-color. */
html::-webkit-scrollbar {
  width: 10px;
  background: var(--bg);
}

html::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--fg) padding-box;
}

html::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--fg) var(--bg);
  }
}

/* ---------- хлебные крошки (общий компонент) ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  margin-top: 8px;
  font-size: var(--fs-16);
}

.crumbs li {
  display: flex;
  align-items: center;
  gap: 16px;
}

.crumbs li > svg { color: var(--muted); }

.crumbs [aria-current] { color: var(--muted); }

@media (min-width: 1280px) {
  .crumbs { margin-top: 32px; }
}

/* ---------- кнопки (общий компонент) ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding-inline: 24px;
  border-radius: var(--r-8);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-16);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: opacity .25s, background-color .25s;
}

.btn:hover { opacity: .88; }

/* второстепенная: без заливки, с обводкой */
.btn--ghost {
  background: transparent;
  color: var(--fg);
  box-shadow: inset 0 0 0 var(--stroke) var(--line);
}

.btn--ghost:hover { opacity: 1; box-shadow: inset 0 0 0 var(--stroke) var(--fg); }
