/* base.css — механика и качественный минимум (§8). Внешнего вида здесь нет: цвет, шрифт, радиус, сетка секций — в styles.css из токенов.
   Файл не правится под проект; нужно другое поведение — переопредели в styles.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h, 72px); }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; text-wrap: balance; }
p { text-wrap: pretty; }
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

/* Фокус виден всегда (§8) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  padding: .6em 1em; background: var(--ink); color: var(--surface);
}
.skip-link:focus { top: var(--gutter); }

/* Форма заявки: механика и состояния; вид полей — в styles.css */
.form { display: grid; gap: var(--space-4); max-width: 34rem; }
.field { display: grid; gap: var(--space-2); }
.field input, .field textarea { font: inherit; color: inherit; width: 100%; min-height: 44px; padding: .7em .9em; background: transparent; border: 1px solid color-mix(in oklab, var(--ink) 30%, transparent); border-radius: var(--radius-control); }
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--danger, #b3261e); }
.field__error { font-size: var(--step--1); color: var(--danger, #b3261e); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status:empty { display: none; }
.form[data-state="sending"] button[type="submit"] { opacity: .6; pointer-events: none; }

/* Шапка и меню: механика */
.header { position: sticky; top: 0; z-index: 50; background: var(--surface); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: var(--header-h, 72px); }
.header__actions { display: flex; align-items: center; gap: var(--space-3); }
.nav__list { display: flex; gap: var(--space-5); }
.burger { display: none; width: 44px; height: 44px; padding: 0; background: none; border: 0; position: relative; }
.burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: currentColor; transition: transform var(--dur-micro) var(--ease-out); }
.burger span:first-child { top: 17px; } .burger span:last-child { top: 25px; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
.mobile-menu { padding: var(--space-5) var(--gutter) var(--space-6); border-top: 1px solid color-mix(in oklab, var(--ink) 12%, transparent); }
.mobile-menu ul { display: grid; gap: var(--space-3); font-size: var(--step-2); }

.lang { display: flex; gap: 2px; }
.lang button { min-width: 36px; min-height: 36px; background: none; border: 0; font-size: var(--step--1); opacity: .6; }
.lang button[aria-pressed="true"] { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .7em 1.4em; text-decoration: none; border: 1px solid transparent; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn:active { transform: translateY(1px); }

/* Слот изображения: пропорция держит место, пока картинки нет; без файла видна плоскость с именем слота */
.slot { position: relative; aspect-ratio: var(--ratio, 4/3); overflow: hidden; background: var(--plane); }
.slot > img, .slot > picture, .slot > picture > img { width: 100%; height: 100%; object-fit: cover; }
.slot.is-empty::after {
  content: attr(data-slot); position: absolute; inset: 0; display: grid; place-items: center;
  font: 500 var(--step--1)/1.2 ui-monospace, monospace; color: var(--ink-muted); letter-spacing: .04em;
}
.slot.is-empty > img, .slot.is-empty > picture { display: none; }

/* Появление при прокрутке — одно на странице, не на каждом блоке */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }

.sticky-cta { display: none; }

@media (max-width: 900px) {
  .nav, .header__cta, .header__actions .lang { display: none; }
  .burger { display: block; }
  .sticky-cta {
    display: block; position: fixed; left: var(--gutter); right: var(--gutter); bottom: max(var(--gutter), env(safe-area-inset-bottom)); z-index: 40;
    transform: translateY(calc(100% + 2 * var(--gutter))); transition: transform var(--dur-reveal) var(--ease-out);
  }
  .sticky-cta .btn { width: 100%; }
  .sticky-cta.is-on { transform: none; }
  body { padding-bottom: 88px; } /* липкая кнопка не закрывает контакты и подвал */
  .mobile-menu .lang { display: flex; margin-top: var(--space-5); }
}

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