/* =========================================================
   ДИЗАЙН-ТОКЕНЫ. Направление: тёмно-синяя «мастерская ночью» + оранжевый сигнал
   (по макету владельца студии, 12.10.2026).
   ========================================================= */
:root {
  --c-bg: #0a0f18;
  --c-bg-2: #070a10;
  --c-surface: #111925;
  --c-alt: #0d141f;
  --c-text: #eef1f5;
  --c-muted: #9aa5b4;
  --c-brand: #ff6a1a;
  --c-brand-text: #ffffff;
  --c-accent: #ff6a1a;
  --c-line: #223044;
  --c-wa: #1f9e55;
  --c-tg: #1f78b4;
  --c-error: #ff6b5e;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Oswald", "Arial Narrow", "Roboto Condensed", sans-serif;
  --fs-body: 1.0625rem;
  --fs-small: 0.9rem;
  --fs-h2: clamp(2rem, 1.4rem + 2.4vw, 3.2rem);
  --fs-h1: clamp(3rem, 1.6rem + 5.6vw, 6.4rem);
  --fs-h1: clamp(2.6rem, min(1.6rem + 5.6vw, 11vh), 6.4rem);

  --radius: 8px;
  --wrap: 1240px;
  --header-h: 72px;
  --gap: clamp(1rem, 0.6rem + 1.5vw, 2rem);
  --section-y: clamp(3.5rem, 2rem + 5vw, 7rem);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0; background: var(--c-bg); color: var(--c-text);
  font: 400 var(--fs-body)/1.6 var(--font); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-accent); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.02; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.005em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
p { margin: 0 0 1em; }
.wrap { width: calc(100% - 2rem); max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.muted { color: var(--c-muted); }
.prose { max-width: 65ch; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--c-surface); color: var(--c-text); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }
.kicker {
  font: 600 0.82rem/1.3 var(--font-display); letter-spacing: .28em; text-transform: uppercase;
  color: var(--c-accent); margin: 0 0 1rem;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .7rem;
  min-height: 52px; padding: 0 1.6rem;
  border: 1.5px solid var(--c-brand); border-radius: 6px;
  background: var(--c-brand); color: var(--c-brand-text);
  font: 700 1rem var(--font); text-decoration: none; cursor: pointer;
  transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-arrow::after { content: "→"; font-size: 1.25em; line-height: 1; }
.btn-ghost, .btn-outline { background: transparent; color: var(--c-text); }
.btn-small { min-height: 44px; padding: 0 1.3rem; font-size: var(--fs-small); }
.btn-wa { background: var(--c-wa); border-color: var(--c-wa); color: #fff; }
.btn-tg { background: var(--c-tg); border-color: var(--c-tg); color: #fff; }
.link-more {
  color: var(--c-text); text-decoration: none; font-weight: 600;
  padding-bottom: .2rem; border-bottom: 1px solid currentColor; align-self: center;
}
.link-more::after { content: " ↗"; }
.link-more:hover { color: var(--c-accent); }
.actions { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-top: 2rem; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20; height: var(--header-h);
  background: rgba(10, 15, 24, .78); border-bottom: 1px solid rgba(255, 255, 255, .06);   /* запасной вариант для старых браузеров */
  background: color-mix(in srgb, var(--c-bg) 78%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--c-line) 60%, transparent);
}
.header-row { display: flex; align-items: center; gap: var(--gap); height: 100%; }
.logo { display: flex; align-items: center; margin-right: auto; }
.logo img { height: 42px; width: auto; }
.nav { display: flex; gap: 2rem; }
.nav a { color: var(--c-text); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--c-accent); }
@media (max-width: 1020px) { .nav { display: none; } }

/* ---------- Языки (translate="no" обязательно, иначе автопереводчик переименует кнопки) ---------- */
.langs { display: flex; gap: .25rem; }
.langs a {
  display: inline-grid; place-items: center; min-width: 44px; min-height: 40px; padding: 0 .6rem;
  border-radius: 6px; color: var(--c-muted); text-decoration: none; font: 600 .82rem var(--font); letter-spacing: .06em;
}
.langs a[aria-current="page"] { color: var(--c-text); background: var(--c-surface); }
.langs a:hover { color: var(--c-accent); }
/* в шапке — один выпадающий список */
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; display: inline-flex; align-items: center; gap: .45rem; min-width: 64px; min-height: 44px; padding: 0 .8rem;
  border: 1px solid var(--c-line); border-radius: 6px; cursor: pointer; font: 600 .85rem var(--font); letter-spacing: .06em; color: var(--c-text);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: ""; width: 7px; height: 7px; border: solid var(--c-muted); border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.lang-menu[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.lang-menu .langs {
  position: absolute; right: 0; top: calc(100% + .4rem); flex-direction: column; min-width: 150px; padding: .35rem;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 8px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); z-index: 40;
}
.lang-menu .langs a { justify-content: start; display: flex; gap: .7rem; place-items: initial; align-items: center; color: var(--c-text); letter-spacing: 0; font-weight: 500; }
.lang-menu .langs a b { width: 2.2em; color: var(--c-muted); font-weight: 600; letter-spacing: .06em; }
.lang-menu .langs a[aria-current="page"] b { color: var(--c-accent); }

@media (max-width: 720px) {
  .logo img { height: 34px; }
}

/* ---------- Первый экран с двигателем ---------- */
.hero { position: relative; height: 280vh; height: 280svh; }
.hero-stage {
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); height: calc(100svh - var(--header-h));
  overflow: hidden; isolation: isolate;
  background: var(--c-bg);
}
/* фон — img/hero-bg.webp (исходник assets/hero-bg.png), пути относительно css/ — одинаковы для всех языков.
   ::before — фото, при прокрутке немного отдаляется (--explode ставит hero-engine.js);
   ::after — затемнения: слева под текст и снизу плавный переход в цвет следующего блока. */
.hero-stage::before, .hero-stage::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.hero-stage::before {
  z-index: -2; background: url("../img/hero-bg.webp") 68% 50% / cover no-repeat;
  transform: scale(calc(1.14 - var(--explode, 0) * 0.14)); transform-origin: 68% 55%; will-change: transform;
}
.hero-stage::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 15, 24, 0) 62%, var(--c-bg) 100%),
    linear-gradient(90deg, rgba(7, 10, 16, .92) 0%, rgba(7, 10, 16, .6) 38%, rgba(7, 10, 16, 0) 65%),
    linear-gradient(180deg, rgba(7, 10, 16, .35) 0%, rgba(7, 10, 16, 0) 30%);
}
@media (max-width: 859px) {
  .hero-stage::before { background-image: url("../img/hero-bg-960.webp"); background-position: 70% 50%; transform-origin: 70% 55%; }
  .hero-stage::after { background: linear-gradient(180deg, rgba(7, 10, 16, .85) 0%, rgba(7, 10, 16, .45) 45%, rgba(10, 15, 24, .2) 70%, var(--c-bg) 100%); }
}
.hero-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.hero-stage { cursor: grab; touch-action: pan-y; }
.hero-stage.is-dragging { cursor: grabbing; }
.hero-text, .hero-strip { cursor: auto; }
.hero-text { max-width: 620px; opacity: calc(1 - var(--explode, 0) * 0.55); }
.hero h1 { text-transform: none; margin-bottom: .35em; }
/* главный слоган не выделяется и без мигающего текстового курсора */
.hero h1 { -webkit-user-select: none; user-select: none; caret-color: transparent; cursor: default; }
.hero h1 em { font-style: normal; color: var(--c-accent); }
.lead { font-size: 1.15rem; color: var(--c-muted); max-width: 44ch; }
/* холст на всю сцену и поверх текста; клики проходят насквозь */
.hero-engine { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 0; pointer-events: none; }
/* собранный мотор — под текстом; при разборке на широком экране детали летят поверх */
@media (min-width: 860px) { .hero.is-exploding .hero-engine { z-index: 2; } }
.hero-text { text-shadow: 0 2px 18px rgba(7, 10, 16, .75); }
.hero-engine canvas { width: 100%; height: 100%; display: block; }
.hero-text { margin-top: auto; margin-bottom: auto; padding-top: 1rem; padding-bottom: 1.2rem; }
.hero-strip {
  position: relative; flex: none; margin: 0; padding: 1.4rem 0; list-style: none;
  display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--c-line);
  opacity: calc(1 - var(--explode, 0) * 0.7);
}
.hero-strip li { display: flex; align-items: center; gap: 1.1rem; color: var(--c-text); font-size: 1rem; }
.hero-strip li + li { padding-left: 1.5rem; border-left: 1px solid var(--c-line); }
.hero-strip .n { font: 600 1.4rem var(--font-display); color: var(--c-accent); padding-right: 1.1rem; border-right: 1px solid var(--c-line); }
.hero-strip svg { width: 28px; height: 28px; fill: none; stroke: var(--c-text); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (max-width: 859px) {
  .hero { height: 240vh; height: 240svh; }
  /* телефон: заголовок и серый текст сверху, кнопки — внизу экрана (над нижней панелью), мотор между ними */
  .hero-inner { justify-content: flex-start; padding-top: 1.6rem; padding-bottom: 1.2rem; }
  .hero-text { flex: 1; display: flex; flex-direction: column; margin: 0; padding: 0; }
  .hero-text .lead { margin-top: 1.4rem; }
  /* ссылка «Наши услуги» — сразу под серым текстом, оранжевая кнопка — внизу */
  .hero-text .actions { display: contents; }
  .hero-text .link-more { align-self: flex-start; margin-top: 1rem; }
  .hero-text .btn-arrow { order: 1; align-self: center; margin: auto 0 calc(.4rem + env(safe-area-inset-bottom, 0px)); }
  .hero-strip { display: none; }
  .lead { font-size: 1.02rem; max-width: 25ch; }
  .hero h1 { font-size: clamp(2.1rem, 1rem + 6vw, 3.2rem); overflow-wrap: break-word; hyphens: auto; }
}

/* ---------- Услуги ---------- */
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.section-alt { background: var(--c-alt); }
.services-grid { display: grid; gap: var(--gap); }
@media (min-width: 960px) {
  .services-grid { grid-template-columns: 0.8fr 2fr; align-items: start; }
  .services-head { position: sticky; top: calc(var(--header-h) + 2rem); }
}
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filters button {
  min-height: 40px; padding: 0 1rem; border: 1px solid var(--c-line); border-radius: 999px;
  background: transparent; color: var(--c-muted); font: 600 var(--fs-small) var(--font); cursor: pointer;
}
.filters button[aria-pressed="true"] { border-color: var(--c-accent); color: var(--c-text); }
.catalog { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.item {
  display: flex; flex-direction: column; position: relative;
  background: linear-gradient(180deg, var(--c-surface), color-mix(in srgb, var(--c-surface) 70%, var(--c-bg)));
  border: 1px solid var(--c-line); border-radius: var(--radius); transition: border-color .2s;
}
.item:hover { border-color: color-mix(in srgb, var(--c-accent) 55%, var(--c-line)); }
.item-icon { width: 40px; height: 40px; margin: 1.4rem 1.4rem 0; fill: none; stroke: var(--c-accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.item-body { display: flex; flex-direction: column; flex: 1; padding: 1rem 1.4rem 1.3rem; }
.item-body h3 { margin-bottom: .4rem; }
.item-body p { color: var(--c-muted); font-size: var(--fs-small); }
.item-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.price { white-space: nowrap; font-weight: 600; font-size: var(--fs-small); color: var(--c-muted); }
.item-foot .btn { min-height: 40px; padding: 0 .9rem; background: transparent; border-color: var(--c-line); color: var(--c-text); }
.item-foot .btn::after { content: "→"; }
.item-foot .btn:hover { border-color: var(--c-accent); }
.item[data-available="false"] { opacity: .55; }

/* ---------- Как проходит ремонт ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: s; }
.steps li { counter-increment: s; border-top: 1px solid var(--c-line); padding-top: 1.4rem; }
.steps li::before { content: "0" counter(s); display: block; font: 600 1.6rem var(--font-display); color: var(--c-accent); margin-bottom: .5rem; }
.steps p { color: var(--c-muted); margin: 0; }

.order-grid, .about-grid, .contacts-grid { display: grid; gap: var(--gap); }
@media (min-width: 860px) { .order-grid, .about-grid, .contacts-grid { grid-template-columns: 1fr 1.5fr; align-items: start; } }

/* ---------- Форма ---------- */
.order-form {
  display: grid; gap: 1rem; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: clamp(1.2rem, 1rem + 1.5vw, 2rem);
}
.order-form label { display: grid; gap: .35rem; font-weight: 600; font-size: var(--fs-small); }
.order-form input, .order-form select, .order-form textarea {
  width: 100%; min-height: 48px; padding: .6rem .8rem; border: 1px solid var(--c-line); border-radius: 6px;
  background: var(--c-bg); color: var(--c-text); font: 400 1rem var(--font); color-scheme: dark;
}
.order-form [aria-invalid="true"] { border-color: var(--c-error); }
.row-2 { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.form-error { color: var(--c-error); margin: 0; }
.form-note { margin: 0; color: var(--c-muted); }
.order-form .actions { margin-top: .25rem; gap: .75rem; }

/* ---------- Лента марок ---------- */
.brands { padding-top: clamp(2.5rem, 1.5rem + 3vw, 4rem); padding-bottom: clamp(2.5rem, 1.5rem + 3vw, 4rem); border-top: 1px solid var(--c-line); overflow: hidden; }
.brands .kicker { margin-bottom: 1.6rem; }
.brands-track {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.brands-row { display: flex; width: max-content; animation: brands 70s linear infinite; }
.brands-row img { height: 48px; width: auto; max-width: none; flex: none; padding-right: 64px; opacity: .6; transition: opacity .3s; }
.brands-track:hover .brands-row { animation-play-state: paused; }
.brands-track:hover img { opacity: .9; }
@keyframes brands { to { transform: translateX(-50%); } }
@media (max-width: 720px) { .brands-row img { height: 34px; padding-right: 44px; } .brands-row { animation-duration: 55s; } }

/* ---------- Контакты и подвал ---------- */
.contacts { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1.5rem; margin: 0; }
.contacts dt { color: var(--c-muted); }
.contacts dd { margin: 0; font-weight: 600; }
.contacts a { color: var(--c-text); }
.messengers { display: flex; gap: 1rem; }
.site-footer { padding-top: 2rem; padding-bottom: 2rem; border-top: 1px solid var(--c-line); color: var(--c-muted); font-size: var(--fs-small); }
.site-footer p { margin: 0; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.site-footer a { color: var(--c-muted); }
.site-footer .studio-credit { margin: 1.25rem auto 0; padding-top: 1rem; border-top: 1px solid var(--c-line); text-align: center; font-size: .8125rem; letter-spacing: .02em; opacity: .75; }
.site-footer .studio-credit a { color: var(--c-muted); text-decoration: none; }
.site-footer .studio-credit a:hover, .site-footer .studio-credit a:focus-visible { color: var(--c-text, #fff); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* старые браузеры без gap у flex (например, Tesla): класс ставит main.js — отступы полями */
.no-flexgap .header-row > * + * { margin-left: 2rem; }
.no-flexgap .header-row > .logo + * { margin-left: 0; }
.no-flexgap .nav a + a { margin-left: 2rem; }
.no-flexgap .langs a + a { margin-left: .25rem; }
.no-flexgap .lang-menu .langs a + a { margin-left: 0; }
.no-flexgap .lang-menu .langs a b, .no-flexgap .lang-menu summary svg { margin-right: .7rem; }
.no-flexgap .btn-arrow::after, .no-flexgap .item-foot .btn::after { margin-left: .7rem; }
.no-flexgap .actions > * { margin: 0 2rem 1rem 0; }
.no-flexgap .hero-strip .n, .no-flexgap .hero-strip svg { margin-right: 1.1rem; }
.no-flexgap .filters button { margin: 0 .5rem .5rem 0; }
.no-flexgap .item-foot > * + * { margin-left: .75rem; }
.no-flexgap .messengers a + a { margin-left: 1rem; }
.no-flexgap .footer-row > * { margin: 0 1rem .5rem 0; }
