/* ============================================================
   КОМИШКА · base.css — reset, набор, ритм, доступность
   ============================================================ */

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

* { margin: 0; }

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

[data-zone="pro"] { color-scheme: light; }

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

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

img { height: auto; border-radius: var(--radius-0); }

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

button { cursor: pointer; background: none; border: 0; padding: 0; }

hr {
  border: 0;
  border-top: var(--rule);
  margin: calc(var(--gap) * 1.5) 0;
}

::selection { background: var(--wax); color: var(--paper); }

/* ---------- Типографика ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400; /* Prata — один вес, иерархия кеглем */
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: var(--fs-hero); line-height: var(--lh-hero); letter-spacing: -.01em; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.25; }

/* Подзаголовки уровня интерфейса — Golos */
h4, h5, h6 {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1.4;
}

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

p, li { font-feature-settings: var(--num); } /* табличные цифры в тексте */

a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: text-decoration-color var(--dur-fast) var(--ease);
}

a:hover { text-decoration-color: currentColor; }

strong, b { font-weight: 600; }

small { font-size: var(--fs-small); color: var(--text-dim); }

/* Моноширинные служебные наборы */
.mono {
  font-family: var(--font-mono);
  font-weight: 400; /* PT Mono есть только 400 — жирность не синтезировать */
}

.microcaps {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--fs-caption);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-dim);
}

.text-dim { color: var(--text-dim); }
.text-gain { color: var(--gain); }

/* Подрисуночная подпись: mono 12px, короткая линейка слева */
.caption {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: .04em;
  color: var(--text-dim);
  padding-left: 14px;
  position: relative;
  max-width: 52ch;
}

.caption::before {
  content: "";
  position: absolute;
  left: 0;
  top: .7em;
  width: 8px;
  height: 1px;
  background: var(--text-dim);
}

/* ---------- Контейнер и сетка ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section { padding-block: var(--pad-y); }

.grid-12 {
  display: grid;
  grid-template-columns: var(--grid);
  gap: var(--gap);
}

/* Проявленные вертикальные линейки набора */
.ruled-cols > * + * { border-left: var(--rule); padding-left: var(--gap); }

@media (max-width: 719px) {
  .ruled-cols > * + * { border-left: 0; padding-left: 0; border-top: var(--rule); padding-top: var(--gap); }
}

/* ---------- Фолио-колонтитул ----------
   «КОМИШКА · ПХУКЕТ · КАТАЛОГ 093» слева, № раздела справа,
   ниже hairline на всю полосу. Работает и как хлебные крошки. */
.folio {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap);
  padding-block: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-dim);
}

.folio a { color: inherit; text-decoration: none; }
.folio a:hover { color: var(--text); }

.folio__no { flex: none; }

/* ---------- Hairline-утилита ---------- */
.hairline { border-bottom: var(--rule); }
.hairline-top { border-top: var(--rule); }

/* ---------- Фокус-ринги (a11y, видимые всегда) ---------- */
:focus { outline: none; }

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

.skip-link {
  position: absolute;
  left: var(--pad-x);
  top: -48px;
  z-index: calc(var(--z-header) + 1);
  background: var(--wax);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 16px;
  transition: top var(--dur-fast) var(--ease);
}

.skip-link:focus-visible { top: 0; }

/* ---------- Скрытое для скринридеров ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- Скроллбар — чернильный, тонкий ---------- */
html { scrollbar-color: var(--ink-3) var(--ink); scrollbar-width: thin; }
[data-zone="pro"] { scrollbar-color: var(--ledger-rule) var(--paper); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--surface-hover);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

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

/* --- интеграционные дополнения (общие для всех страниц) --- */
.section__kicker { margin-bottom: var(--sp-2, 16px); }
.prop-card__img--empty {
  display: block;
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(127, 127, 127, .08) 14px 15px),
    var(--surface, #1e1b17);
}
[data-zone="pro"] {
  background: var(--bg);
  color: var(--text);
}
