@font-face {
  font-family: "Golos Text";
  src: url("fonts/golos-cyrillic.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  src: url("fonts/golos-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* цвета с их вывесок: тёмно-синие щиты, красно-оранжевый «Автоэлектрик», светлая стена бокса */
  --night: #0e1524;
  --night-2: #18223a;
  --paper: #f3efe8;
  --paper-2: #e8e2d7;
  --ink: #141c2e;
  --ink-2: #4a5468;
  --snow: #f6f3ee;
  --snow-2: color-mix(in srgb, var(--snow) 70%, transparent);
  --accent: #c0391f;
  --accent-dk: #a02f19;
  --star: #f0b429;
  /* прозрачные слои поверх фото и тёмных блоков */
  --scrim: color-mix(in srgb, var(--night) 55%, transparent);
  --line-dark: color-mix(in srgb, var(--snow) 12%, transparent);
  --line-dark-2: color-mix(in srgb, var(--snow) 18%, transparent);
  --line-dark-3: color-mix(in srgb, var(--snow) 35%, transparent);
  --shadow-float: 0 10px 30px color-mix(in srgb, black 35%, transparent);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --r: 10px;
  --gutter: clamp(16px, 5vw, 56px);
  --max: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { background: var(--night); color-scheme: light; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; }
::selection { background: var(--accent); color: var(--snow); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.muted { color: var(--ink-2); }
.ico { width: 20px; height: 20px; fill: currentColor; flex: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
figure { margin: 0; }

h2 {
  margin: 0;
  font-size: clamp(32px, 7vw, 56px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* шапка поверх фото */
.top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s4) var(--gutter);
  color: var(--snow);
}
.brand { display: flex; align-items: baseline; gap: var(--s2); text-decoration: none; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.brand-sub { font-size: 14px; color: var(--snow-2); }
.top-actions { display: flex; align-items: center; gap: var(--s5); }
.top-phone { display: none; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap; }
.top-phone:hover { text-decoration: underline; }

/* кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 56px;
  padding: 0 var(--s5);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  background: var(--accent);
  color: var(--snow);
  font: 600 17px/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease), transform 120ms var(--ease);
}
.btn:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
.btn:active { transform: scale(0.97); }
/* контурная: берёт цвет текста секции, работает и на тёмном, и на светлом */
.btn--ghost {
  background: transparent;
  color: inherit;
  border-color: color-mix(in srgb, currentColor 45%, transparent);
  font-variant-numeric: tabular-nums;
}
.btn--ghost:hover { background: color-mix(in srgb, currentColor 8%, transparent); border-color: currentColor; }
.btn--small { min-height: 42px; padding: 0 var(--s4); font-size: 15px; }

/* первый экран: фото бокса на весь экран, текст снизу */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: min(100svh, 860px);
  padding: 120px var(--gutter) var(--s7);
  background: var(--night);
  color: var(--snow);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  animation: hero-photo 1.4s var(--ease) both;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, color-mix(in srgb, var(--night) 70%, transparent), color-mix(in srgb, var(--night) 0%, transparent) 22%),
    linear-gradient(to top, color-mix(in srgb, var(--night) 97%, transparent) 8%, color-mix(in srgb, var(--night) 78%, transparent) 42%, color-mix(in srgb, var(--night) 10%, transparent) 78%);
}
.hero-text {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  animation: rise 0.9s 0.15s var(--ease) both;
}
.rating {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  border-radius: 999px;
  background: var(--scrim);
  border: 1px solid var(--line-dark-2);
  font-size: 15px;
  color: var(--snow-2);
  text-decoration: none;
}
.rating b { color: var(--snow); }
.rating:hover span:last-child { text-decoration: underline; }
.stars { color: var(--star); font-size: 13px; letter-spacing: 1px; }
h1 {
  margin: var(--s4) 0 var(--s4);
  max-width: 11ch;
  font-size: clamp(48px, 13.5vw, 112px);
  line-height: 0.94;
  font-weight: 850;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.lead { margin: 0; max-width: 34rem; font-size: 18px; color: var(--snow-2); text-wrap: pretty; }
.cta { display: grid; gap: var(--s3); margin-top: var(--s5); }
.hint { margin: var(--s3) 0 0; font-size: 14px; color: color-mix(in srgb, var(--snow) 60%, transparent); }

@keyframes hero-photo { from { transform: scale(1.06); opacity: 0.4; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* услуги: крупные строки с линиями, без карточек */
.services { padding: var(--s8) 0; }
.services-grid { display: grid; gap: var(--s6); }
.svc { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); }
.svc li {
  display: grid;
  gap: var(--s4);
  padding: var(--s5) 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
}
.svc li:first-child { border-top: 3px solid var(--accent); }
.svc h3 { margin: 0; font-size: clamp(26px, 5.4vw, 38px); line-height: 1.1; font-weight: 750; letter-spacing: -0.025em; }
.svc p { margin: var(--s1) 0 0; color: var(--ink-2); }
.svc img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r); background: var(--paper-2); }
.more { margin: var(--s5) 0 0; color: var(--ink-2); }
.more b { color: var(--ink); font-weight: 600; }
.price-note { margin: var(--s2) 0 0; font-size: 15px; color: var(--ink-2); }

/* строка услуги целиком ведёт на её страницу; кнопка «Подробнее» показывает, что строка нажимается */
.svc li { position: relative; }
.svc h3 a { text-decoration: none; }
.svc h3 a::after { content: ""; position: absolute; inset: 0; }
.svc h3 a:focus-visible { outline: none; }
.svc li:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.svc-more {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  margin-top: var(--s3);
  padding: 0 var(--s4) 0 var(--s5);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 220ms var(--ease), color 220ms var(--ease), transform 120ms var(--ease);
}
.svc-more .ico { width: 18px; height: 18px; transition: transform 220ms var(--ease); }
.svc-more:hover { background: var(--accent); color: var(--snow); }
.svc-more:hover .ico { transform: translateX(3px); }
.svc-more:active { transform: scale(0.97); background: var(--accent-dk); border-color: var(--accent-dk); color: var(--snow); }

/* фото из бокса на тёмном */
.gallery { padding: var(--s8) 0; background: var(--night); color: var(--snow); }
.gallery-head { display: grid; gap: var(--s2); margin-bottom: var(--s6); }
.gallery-head p { margin: 0; color: var(--snow-2); }
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 180px 180px 220px;
  gap: var(--s2);
}
.g { position: relative; overflow: hidden; border-radius: var(--r); background: var(--night-2); }
.g img { width: 100%; height: 100%; object-fit: cover; }
.g figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: var(--s6) var(--s3) var(--s3);
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(to top, color-mix(in srgb, var(--night) 85%, transparent), transparent);
}
.g--engine { grid-row: 1 / 3; grid-column: 1; }
.g--align { grid-row: 1; grid-column: 2; }
.g--prado { grid-row: 2; grid-column: 2; }
.g--prado img { object-position: 50% 20%; }
.g--motor { grid-row: 3; grid-column: 1 / 3; }

/* как найти */
.contact { padding: var(--s8) 0; }
.contact-grid { display: grid; gap: var(--s6); }
.entrance img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r); background: var(--paper-2); }
.entrance figcaption { margin-top: var(--s2); font-size: 14px; color: var(--ink-2); }
.contact-text h2 { margin-bottom: var(--s5); }
.facts { display: grid; gap: var(--s5); margin: 0; }
.facts > div { padding-top: var(--s4); border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); }
.facts dt { margin-bottom: var(--s1); font-size: 14px; color: var(--ink-2); }
.facts dd { margin: 0; font-size: 20px; font-weight: 600; }
.facts dd.big { font-size: clamp(24px, 5vw, 30px); font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; }
.facts .muted { font-size: 15px; font-weight: 400; }
.facts .maps { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s2); font-size: 15px; font-weight: 500; }
.facts .maps a { color: var(--accent); }
.cta--contact { margin-top: var(--s6); }

.foot { padding: var(--s6) 0; background: var(--night); color: var(--snow); font-size: 14px; }
.foot p { margin: 0 0 var(--s1); }
.foot .muted { color: var(--snow-2); }

/* страницы услуг */
.hero--page {
  min-height: auto;
  padding: 112px var(--gutter) var(--s7);
  background: linear-gradient(to bottom, var(--night-2), var(--night) 70%);
}
.hero-inner { display: grid; gap: var(--s6); width: 100%; max-width: var(--max); margin: 0 auto; }
.hero-photo { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: var(--r); background: var(--night-2); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; animation: hero-photo 1.4s 0.1s var(--ease) both; }
.hero-photo figcaption {
  position: absolute;
  left: var(--s3);
  bottom: var(--s3);
  padding: var(--s1) var(--s3);
  border-radius: 999px;
  background: var(--scrim);
  font-size: 13px;
  color: var(--snow-2);
}
.hero--page::before { display: none; }
.hero--page h1 { max-width: 14ch; font-size: clamp(40px, 10.5vw, 84px); }
.crumbs { font-size: 14px; color: var(--snow-2); }
.crumbs a { color: var(--snow); }
.rating--page { margin-top: var(--s5); }

.detail { padding: var(--s8) 0; }
.detail-grid { display: grid; gap: var(--s6); }
.signs { margin: var(--s5) 0 0; padding: 0; list-style: none; border-bottom: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); }
.signs li {
  position: relative;
  padding: var(--s4) 0 var(--s4) 28px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.35;
}
.signs li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: calc(var(--s4) + 0.45em);
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}
.detail .price-note { margin-top: var(--s4); }
.detail .signs { margin-top: 0; border-top: 3px solid var(--accent); }
.detail .signs li:first-child { border-top: 0; }

.others { padding: var(--s8) 0; background: var(--night); color: var(--snow); }
.others-list { display: grid; gap: var(--s2); margin: var(--s5) 0 0; padding: 0; list-style: none; }
.others-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-height: 60px;
  padding: var(--s3) var(--s5);
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--night-2);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
}
.others-list a:hover { border-color: var(--line-dark-3); background: color-mix(in srgb, var(--night-2) 80%, var(--snow)); }
.others-list .ico { color: var(--accent); }
.contact--page h2 { margin-bottom: var(--s5); }

/* нижние кнопки на телефоне: стеклянная капсула над панелью Safari, выезжает один раз после первого экрана */
.dock {
  position: fixed;
  inset: auto 12px calc(10px + env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s2);
  padding: var(--s2);
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: color-mix(in srgb, var(--night) 90%, transparent);
  color: var(--snow);
  box-shadow: var(--shadow-float), inset 0 1px 0 color-mix(in srgb, var(--snow) 8%, transparent);
  /* свой слой: панель едет на видеокарте */
  transform: translate3d(0, calc(100% + 24px + env(safe-area-inset-bottom)), 0);
  will-change: transform;
  backface-visibility: hidden;
  transition: transform 320ms var(--ease);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .dock {
    background: color-mix(in srgb, var(--night) 55%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
  }
}
.dock .btn { min-height: 50px; padding: 0 var(--s4); border-radius: 999px; }
.dock .btn--ghost { background: color-mix(in srgb, var(--snow) 10%, transparent); border-color: transparent; }
.dock.is-on { transform: translate3d(0, 0, 0); }

@media (min-width: 560px) {
  .cta { grid-auto-flow: column; justify-content: start; }
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .dock { display: none; }
  .top-phone { display: inline; }
  .gallery-head { grid-template-columns: 1fr auto; align-items: end; }
  .grid { grid-template-columns: 1.1fr 1fr 1fr; grid-template-rows: 280px 280px; gap: var(--s3); }
  .g--engine { grid-row: 1 / 3; grid-column: 1; }
  .g--motor { grid-column: 2 / 4; grid-row: 1; }
  .g--align { grid-column: 2; grid-row: 2; }
  .g--prado { grid-column: 3; grid-row: 2; }
  .facts { grid-template-columns: 1fr 1fr; }
  .svc li { grid-template-columns: 240px 1fr; gap: var(--s6); align-items: center; }
  .svc img { aspect-ratio: 4 / 3; }
  .facts > div:first-child { grid-column: 1 / -1; }
  .others-list { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  .hero { padding-bottom: var(--s8); }
  .hero::before {
    background:
      linear-gradient(to bottom, color-mix(in srgb, var(--night) 70%, transparent), color-mix(in srgb, var(--night) 0%, transparent) 22%),
      linear-gradient(to right, color-mix(in srgb, var(--night) 92%, transparent) 0%, color-mix(in srgb, var(--night) 60%, transparent) 45%, color-mix(in srgb, var(--night) 5%, transparent) 80%),
      linear-gradient(to top, color-mix(in srgb, var(--night) 80%, transparent), color-mix(in srgb, var(--night) 0%, transparent) 45%);
  }
  .hero-bg img { object-position: 70% 50%; }
  .services { padding: var(--s9) 0; }
  .services-grid { grid-template-columns: 1fr 1.6fr; gap: var(--s8); }
  .gallery, .contact { padding: var(--s9) 0; }
  .grid { grid-template-rows: 320px 320px; }
  .contact-grid { grid-template-columns: 440px 1fr; gap: var(--s8); align-items: center; }
  .hero--page { padding: 160px var(--gutter) var(--s8); }
  .detail, .others { padding: var(--s9) 0; }
  .detail-grid { grid-template-columns: 1fr 1.6fr; gap: var(--s8); align-items: start; }
  .hero--page .hero-inner { grid-template-columns: 1.1fr 1fr; gap: var(--s8); align-items: center; }
  .hero--page .hero-photo { aspect-ratio: 5 / 4; }
  .others-list { grid-template-columns: repeat(3, 1fr); }
  .contact--page .facts { grid-template-columns: 1.4fr 1fr 1fr; }
  .contact--page .facts > div:first-child { grid-column: auto; }
}

/* появление: пункты списков и фото приезжают каскадом при прокрутке.
   Класс js-reveal ставит скрипт в <head>; app.js добавляет is-in, без JS всё видно сразу. */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal :is(.svc li, .g, .entrance, .facts > div, .signs li, .others-list li) {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
    transition-delay: calc(var(--i, 0) * 60ms);
  }
  .js-reveal :is(.svc li, .g, .entrance, .facts > div, .signs li, .others-list li).is-in { opacity: 1; transform: none; }

  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 280ms; animation-timing-function: var(--ease); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
