/* base.css — основа стартового набора kz10 (Webman). Своего «вида» не имеет: только сброс, сетка,
   шкала из 5 размеров, кнопка, поля, шапка, подвал, появления, режим ?shot и reduced-motion.
   Читает переменные из tokens.css (договор имён в README). Вид сайта задаёт style.css по 03-design.md.
   Правила скилла соблюдены: без теней, градиентов, тонких линий, eyebrow-подписей, моноширинного. */

/* ---------- сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: auto; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-text); font-size: var(--step-body); line-height: 1.5; font-kerning: normal; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, video, svg, canvas { display: block; max-width: 100%; }
img, video { height: auto; background: var(--surface); }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:target { scroll-margin-top: calc(var(--header-h, 4rem) + 1rem); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- типографика: 5 ступеней ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: inherit; text-wrap: balance; hyphens: none; }
.display { font-size: var(--step-display); line-height: 0.95; letter-spacing: -0.035em; }
.head { font-size: var(--step-head); line-height: 1.02; letter-spacing: -0.025em; }
.lead { font-size: var(--step-lead); line-height: 1.35; max-width: 40ch; text-wrap: pretty; }
.small { font-size: var(--step-small); line-height: 1.45; }
.muted { color: var(--muted); }
p { max-width: 62ch; text-wrap: pretty; }
p + p { margin-top: 0.9em; }
.nums { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------- раскладка ---------- */
.wrap { padding-inline: var(--margin); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.section { padding-block: calc(var(--section) / 2); position: relative; }
.bleed { margin-inline: calc(var(--margin) * -1); }
.cover { width: 100%; height: 100%; object-fit: cover; }
.field-1 { background: var(--field-1); color: var(--field-1-ink); --muted: var(--field-1-muted, var(--field-1-ink)); }
.field-2 { background: var(--field-2); color: var(--field-2-ink); --muted: var(--field-2-muted, var(--field-2-ink)); }
/* отдельная ссылка (не в абзаце) с областью нажатия 44 px */
.tap { display: inline-flex; align-items: center; min-height: 2.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.only-phone { display: none; }
@media (max-width: 47.99em) { .only-phone { display: revert; } .only-wide { display: none; } }

/* ---------- кнопка (одна форма на сайт: радиус из --radius) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6em; min-height: 3.25rem; padding: 0 1.5rem; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); font-family: var(--font-text); font-size: var(--step-body); font-weight: 600; line-height: 1.1; text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease; }
.btn:active { transform: scale(0.97); }
.btn--ink { background: var(--ink); color: var(--bg); }
.btn--wide { width: 100%; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--btn-hover, var(--ink)); color: var(--btn-hover-ink, var(--bg)); }
  .btn--ink:hover { background: var(--accent); color: var(--accent-ink); }
}
.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; transition: text-decoration-color var(--t-hover) ease; }
.link-plain { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
@media (hover: hover) and (pointer: fine) { .link:hover { text-decoration-color: currentColor; } }

/* ---------- шапка: знак, 3–5 ссылок, одно действие; на телефоне знак + действие + «Меню» ---------- */
.top { position: relative; z-index: 40; display: flex; align-items: center; gap: var(--gutter); min-height: var(--header-h); padding: 0.75rem var(--margin); }
.top--sticky { position: sticky; top: 0; background: var(--bg); }
.top__mark { display: inline-flex; align-items: center; min-height: 2.75rem; margin-right: auto; font-family: var(--font-display); font-size: var(--step-lead); line-height: 1; letter-spacing: -0.02em; text-decoration: none; }
.top__nav { display: flex; gap: clamp(1rem, 2vw, 2rem); }
.top__nav a { text-decoration: none; padding-block: 0.6rem; transition: opacity var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .top__nav a:hover { opacity: 0.6; } }
.top__act { min-height: 2.75rem; padding: 0 1.1rem; }
.top__menu { display: none; min-height: 2.75rem; padding: 0 0.25rem; font-size: var(--step-body); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }
@media (max-width: 47.99em) {
  .top { gap: 0.75rem; }
  .top__nav { display: none; }
  .top__menu { display: inline-flex; align-items: center; }
  .top__act { padding: 0 0.9rem; }
  .menu-open .top__nav { display: flex; flex-direction: column; gap: 0.25rem; position: fixed; inset: var(--header-h) 0 0 0; z-index: 39; padding: 1.5rem var(--margin) 2rem; background: var(--bg); overflow-y: auto; }
  .menu-open .top__nav a { font-family: var(--font-display); font-size: var(--step-head); line-height: 1.1; padding-block: 0.35rem; }
  .menu-open body { overflow: hidden; }
}

/* ---------- поля и выбор ---------- */
.form { display: grid; gap: 1rem; }
.lab { display: grid; gap: 0.4rem; font-size: var(--step-small); }
.lab > span { font-weight: 600; }
.field { width: 100%; min-height: 3.25rem; padding: 0.8rem 1rem; background: var(--surface); color: var(--ink); border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; font-size: max(1rem, var(--step-body)); }
textarea.field { min-height: 7.5rem; resize: vertical; }
.field:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.field[aria-invalid="true"] { border-bottom-color: #b3261e; }
.form-note { min-height: 1.5em; font-size: var(--step-small); }
.form-note.is-err { color: #b3261e; }
/* «чипы»: радиокнопки и флажки живой вещи (палец: 44 px и больше) */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.chips legend { padding: 0; margin-bottom: 0.6rem; font-weight: 600; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem; background: var(--surface); color: var(--ink); border-radius: var(--radius); transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.chip input:checked + span { background: var(--ink); color: var(--bg); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip input:active + span { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .chip:hover input:not(:checked) + span { background: var(--field-2); } }
/* ползунок: дорожка 6 px, бегунок 28 px, область нажатия 44 px */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 2.75rem; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 6px; background: var(--track, color-mix(in srgb, currentColor 25%, transparent)); border-radius: 3px; }
.range::-moz-range-track { height: 6px; background: var(--track, color-mix(in srgb, currentColor 25%, transparent)); border-radius: 3px; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; background: var(--accent); border: 0; border-radius: 50%; transition: transform var(--t-press) var(--ease-out); }
.range::-moz-range-thumb { width: 28px; height: 28px; background: var(--accent); border: 0; border-radius: 50%; }
.range:active::-webkit-slider-thumb { transform: scale(1.15); }
.range:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- вопросы-ответы (details) без линий: шаг тона ---------- */
.qa { display: grid; gap: 0.5rem; }
.qa details { background: var(--surface); border-radius: var(--radius); }
.qa summary { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; cursor: pointer; font-weight: 600; list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; font-size: 1.4em; line-height: 1; transition: transform var(--t-ui) var(--ease-out); }
.qa details[open] summary::after { transform: rotate(45deg); }
.qa details > div { padding: 0 1.25rem 1.25rem; }

/* ---------- подвал: название во всю ширину + факты ---------- */
.foot { padding: calc(var(--section) / 2) var(--margin) 1.5rem; }
.foot__name { font-family: var(--font-display); font-size: var(--step-display); line-height: 0.9; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.foot__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem var(--gutter); margin-top: 2.5rem; }
.foot__facts a { text-decoration: none; }
.foot__credit { margin-top: 2.5rem; font-size: var(--step-small); color: var(--muted); }

/* ---------- видео-петля и картинки ---------- */
.loop { width: 100%; height: 100%; object-fit: cover; }
.ph { position: relative; overflow: hidden; }
.ph > img, .ph > video { width: 100%; height: 100%; object-fit: cover; }
.credit { font-size: var(--step-small); color: var(--muted); }

/* ---------- появления: скрыто только при классе js и без reduced-motion; в ?shot всё видно ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .rv { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out) var(--d, 0ms), transform 900ms var(--ease-out) var(--d, 0ms); }
  .js .rv.in { opacity: 1; transform: none; }
  /* шторка режет КАРТИНКУ внутри, а не сам .rv-img: элемент с clip-path: inset(100%) IntersectionObserver не видит */
  .js .rv-img > img, .js .rv-img > picture img, .js .rv-img > video { clip-path: inset(0 0 100% 0); transform: scale(1.12); transition: clip-path 1100ms var(--ease-in-out) var(--d, 0ms), transform 1500ms var(--ease-soft) var(--d, 0ms); }
  .js .rv-img.in > img, .js .rv-img.in > picture img, .js .rv-img.in > video { clip-path: inset(0); transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
/* ?shot: честный статичный вид для снимков (класс ставит скрипт в head) */
.shot *, .shot *::before, .shot *::after { animation: none !important; transition: none !important; }
