/* =============================================================================
   Слой 2 из 7: основа. Шрифт Golos Text (свои файлы, SIL OFL), сброс,
   типографика, ссылки, фокус, служебные классы, индикаторы HTMX,
   сокращённое движение. Компонентов здесь нет.
   ============================================================================= */

/* ---------- Шрифт: Golos Text, TTF из static (инструмента WOFF2 в окружении нет) ---------- */
@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos-regular.d80d20e78075.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos-bold.5b01b0dd0684.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Сброс ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--ink) var(--ground);
  scrollbar-width: thin;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-feature-settings: "kern";
  caret-color: var(--coral);
  -webkit-font-smoothing: antialiased;
}

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

ul,
ol {
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

::selection {
  background: var(--yellow);
  color: var(--ink);
}

/* ---------- Заголовки и текст ---------- */
h1 {
  margin-bottom: var(--s-4);
  font-size: var(--t-h1);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.025em;
  text-wrap: balance;
}

h2 {
  margin: var(--s-6) 0 var(--s-3);
  font-size: var(--t-h2);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
}

h3 {
  margin-bottom: var(--s-2);
  font-size: var(--t-h3);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.h1 {
  margin: 0;
  font-size: var(--t-h1);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.h2 {
  margin: 0;
  font-size: var(--t-h2);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.h3 {
  margin: 0;
  font-size: var(--t-h3);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}

p + p {
  margin-top: var(--s-3);
}

b,
strong {
  font-weight: 700;
}

/* Заглавный «крик» направления 02: только для названий сборов и приютов */
.display,
.hero-title {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--track-display);
  line-height: var(--lh-tight);
  hyphens: auto;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.display {
  font-size: var(--t-display);
}

/* Заголовок главной — предложение: не разбивается по слогам */
.hero-title {
  font-size: var(--t-hero);
  hyphens: manual;
  overflow-wrap: normal;
}

/* Логотип «Паналап» (DESIGN.md «Бренд»): inline SVG из components/_logo.html. Высоту задаёт контекст, ширина идёт
   по пропорции; арка и слово берут цвет текста ссылки (на ночных поверхностях светлеют), лапа всегда --coral.
   Охранное поле — две толщины штриха арки (≈ ¼ высоты); минимум: логотип 20 px по высоте, один знак 16 px. */
.wordmark {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  white-space: nowrap;
}

.logo {
  display: block;
  width: auto;
  height: 1.375rem;
  overflow: visible;
}

.logo__paw {
  fill: var(--coral);
}

.logo__word {
  fill: currentColor;
}

@media (min-width: 768px) {
  .logo {
    height: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .logo {
    height: 2rem;
  }
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.45;
}

.small {
  font-size: var(--t-small);
  line-height: 1.45;
}

/* Подпись (type.meta): верхний регистр, мелко, разрядка */
.meta,
.kicker {
  margin: 0 0 var(--s-2);
  font-size: var(--t-meta);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--track-meta);
  line-height: 1.3;
}

.muted,
.hint {
  color: var(--muted);
}

.hint {
  margin: var(--s-1) 0 0;
  font-size: var(--t-small);
}

.measure {
  max-width: var(--measure);
}

.amount {
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.num,
.amount,
td,
.tabular {
  font-variant-numeric: tabular-nums;
}

pre.details,
.report-text {
  margin: 0 0 var(--s-3);
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* ---------- Ссылки и фокус ---------- */
a {
  color: inherit;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .2em;
  transition: text-underline-offset var(--d-hover) var(--ease-out), background-color var(--d-hover) var(--ease-out);
}

a:hover {
  text-decoration-thickness: 2px;
  text-underline-offset: .3em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- Служебные классы ---------- */
.visually-hidden,
.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--s-4);
  top: -60px;
  z-index: var(--z-skip);
  padding: var(--s-3) var(--s-4);
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
}

.skip:focus {
  top: var(--s-4);
}

/* Индикаторы HTMX: встроенные стили htmx отключены (`includeIndicatorStyles:false`), CSP `style-src 'self'`. */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* ---------- Сокращённое движение: страховка для всех слоёв ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
