:root {
  color-scheme: light;
  --paper: #f4f0e8;
  --paper-deep: #e9e3d6;
  --tile: #fbf9f4;
  --ink: #17191c;
  --ink-soft: #55585c;
  --asphalt: #1d2023;
  --asphalt-line: #3a3e43;
  --on-asphalt: #f4f0e8;
  --on-asphalt-soft: #aeb0ae;
  --signal: #c9321a;
  --signal-deep: #a02610;
  --glass: #2a3238;
  --marking: #f2c230;
  --gutter: clamp(16px, 4vw, 48px);
  --road: clamp(74px, 10vw, 112px);
  --font: "Avenir Next", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
}

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }

a { color: inherit; }
a:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
section[id] { scroll-margin-top: 16px; }

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Шапка */
.top {
  display: flex;
  align-items: center;
  gap: 32px;
  padding-block: 20px;
}

.brand {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
}
.brand b { color: var(--signal); font-weight: 700; }

.nav { display: flex; gap: 24px; margin-left: auto; font-size: .96rem; }
.nav a { text-decoration: none; padding-block: 6px; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--signal); }

.top__phone {
  font-size: 1.12rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.top__phone:hover { color: var(--signal); }

/* Первый экран */
.hero { position: relative; overflow: hidden; }
.hero__text { padding-top: clamp(24px, 4vw, 56px); }

.eyebrow {
  color: var(--signal-deep);
  font-size: .95rem;
  font-weight: 600;
}

h1 {
  max-width: 13ch;
  margin-top: 12px;
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -.028em;
  text-wrap: balance;
}

.lead {
  max-width: 34em;
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: clamp(1.08rem, 1.5vw, 1.25rem);
  line-height: 1.45;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.button {
  display: inline-block;
  padding: 15px 24px;
  border: 2px solid var(--signal);
  border-radius: 6px;
  background: var(--signal);
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.button:hover { border-color: var(--signal-deep); background: var(--signal-deep); }
.button--ghost { border-color: var(--ink); background: transparent; color: var(--ink); }
.button--ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* Машина на дороге */
.scene { position: relative; margin-top: 16px; }

.car {
  position: relative;
  z-index: 1;
  display: block;
  width: min(640px, 84vw);
  height: auto;
  margin-left: auto;
  margin-right: var(--gutter);
  margin-bottom: -14px;
}

.car__body { fill: var(--signal); }
.car__glass { fill: var(--glass); }
.car__line { fill: none; stroke: var(--signal-deep); stroke-width: 2.5; }
.car__handle { fill: none; stroke: var(--signal-deep); stroke-width: 5; stroke-linecap: round; }
.car__head { fill: #fff3c9; }
.car__tail { fill: var(--signal-deep); }
.car__arch { fill: var(--asphalt); }
.wheel__tyre { fill: #0e0f11; }
.wheel__rim { fill: #c9c8c2; }
.wheel__spoke { fill: none; stroke: #6d6f70; stroke-width: 4; }
.wheel { transform-box: fill-box; transform-origin: center; animation: spin 1.1s linear infinite; }

.road {
  position: relative;
  height: var(--road);
  background: var(--asphalt);
}
.road::after {
  content: "";
  position: absolute;
  inset: 58% 0 auto;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--marking) 0 56px, transparent 56px 112px);
  animation: drive 1.1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drive { to { background-position-x: -112px; } }

/* Разделы */
.section { padding-block: clamp(52px, 7vw, 88px); }

h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.02em;
}

h3 { font-size: 1.16rem; font-weight: 700; line-height: 1.25; }

/* Марки */
.group { margin-top: 36px; color: var(--ink-soft); font-size: 1rem; font-weight: 600; }

.brands {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.brands li {
  display: grid;
  place-items: center;
  min-height: 72px;
  padding: 10px 6px;
  border: 1px solid var(--paper-deep);
  border-radius: 6px;
  background: var(--tile);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.brands__note { max-width: 44em; margin-top: 28px; color: var(--ink-soft); }
.brands__note a { color: var(--ink); font-weight: 700; white-space: nowrap; }

/* Карточки моделей */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.models { padding-bottom: clamp(52px, 7vw, 88px); }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
  margin-top: 32px;
}

.card {
  overflow: hidden;
  border: 1px solid var(--paper-deep);
  border-radius: 8px;
  background: var(--tile);
}

.card__pic {
  padding: 26px 14px 0;
  background: linear-gradient(var(--paper-deep) 0 82%, #cfc8b9 82%);
}
.vehicle { display: block; width: 100%; height: auto; }
.vehicle--red { color: var(--signal); }
.vehicle--blue { color: #2f5d8a; }
.vehicle--green { color: #4f7566; }
.vehicle--silver { color: #9a9d9e; }
.vehicle--graphite { color: #474b50; }
.v-body { fill: currentColor; }
.v-glass { fill: var(--glass); }
.v-arch { fill: var(--asphalt); }
.v-tyre { fill: #0e0f11; }
.v-rim { fill: #c9c8c2; }

.card__head { padding: 14px 16px 0; }
.card__head h3 { font-size: 1.2rem; }
.card__head p { color: var(--ink-soft); font-size: .98rem; }

.card__price {
  margin: 12px 16px 0;
  padding-top: 12px;
  border-top: 1px solid var(--paper-deep);
  font-weight: 700;
  text-align: center;
}

.card__specs {
  display: flex;
  margin-top: 12px;
  background: var(--asphalt);
  color: var(--on-asphalt);
  font-size: .92rem;
  font-weight: 600;
  text-align: center;
}
.card__specs li { flex: 1 1 auto; padding: 10px 6px; white-space: nowrap; }
.card__specs li + li { border-left: 1px solid var(--asphalt-line); }

.calc { padding: 12px; }
.calc summary {
  display: block;
  padding: 13px 8px;
  border-radius: 6px;
  background: var(--signal);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  text-align: center;
  transition: background-color .15s ease;
}
.calc summary::-webkit-details-marker { display: none; }
.calc summary:hover { background: var(--signal-deep); }
.calc summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.calc__panel { padding: 12px 4px 2px; text-align: center; }
.calc__panel p { color: var(--ink-soft); font-size: .95rem; line-height: 1.35; }
.calc__panel a { display: inline-block; margin-top: 6px; font-size: 1.14rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.calc__panel a:hover { color: var(--signal); }

.models__note { margin-top: 18px; color: var(--ink-soft); font-size: .95rem; }

/* Небольшие моторы */
.engines { padding-block: clamp(44px, 6vw, 72px); background: var(--paper-deep); }
.engines__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(20px, 5vw, 72px);
}
.engines__power {
  color: var(--signal);
  font-size: clamp(3.4rem, 9vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  white-space: nowrap;
}
.engines__power span { font-size: .42em; letter-spacing: -.01em; }
.engines h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
.engines__grid p:not(.engines__power) { max-width: 38em; margin-top: 14px; color: var(--ink-soft); }

/* Маршрут покупки */
.route {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
  margin-top: 44px;
}

.route li {
  counter-increment: step;
  position: relative;
  padding-top: 60px;
}
.route li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}
.route li:last-child::before { background: var(--signal); color: #fff; }
.route li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 19px;
  left: 40px;
  right: -28px;
  border-top: 2px dashed var(--ink-soft);
}
.route p { margin-top: 8px; color: var(--ink-soft); font-size: 1rem; line-height: 1.45; }

/* Цена */
.price {
  padding-block: clamp(52px, 7vw, 88px);
  background: var(--asphalt);
  color: var(--on-asphalt);
}
.price__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 88px);
}
.price__note { max-width: 26em; margin-top: 18px; color: var(--on-asphalt-soft); }

.ledger > div {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 4px 24px;
  padding-block: 15px;
  border-bottom: 1px solid var(--asphalt-line);
}
.ledger > div:first-child { padding-top: 0; }
.ledger dt { font-weight: 700; }
.ledger dd { color: var(--on-asphalt-soft); }
.ledger .ledger__total { border-bottom: 0; padding-bottom: 0; }
.ledger__total dt { color: var(--marking); }
.ledger .ledger__total dd { color: var(--on-asphalt); font-weight: 600; }

/* Контакты */
.contacts {
  padding-block: clamp(52px, 7vw, 88px);
  background: var(--signal);
  color: #fff;
}
.contacts__phone {
  display: inline-block;
  margin-top: 18px;
  font-size: clamp(2.2rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.025em;
  text-decoration: none;
  white-space: nowrap;
}
.contacts__phone:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }
.contacts__phone:focus-visible { outline-color: #fff; }
.contacts p { margin-top: 14px; font-size: 1.1rem; }

/* Подвал */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  padding-block: 24px;
  color: var(--ink-soft);
  font-size: .92rem;
}

/* Кнопка звонка на телефоне */
.callbar { display: none; }

/* Страница 404 */
.missing { min-height: 62vh; }
.missing p { margin-top: 14px; color: var(--ink-soft); }
.missing .button { margin-top: 24px; }

@media (min-width: 1100px) {
  .hero__copy { max-width: min(560px, 48vw); }
  .hero__text { padding-bottom: 52px; }
  .scene { position: static; margin-top: 0; }
  .car {
    position: absolute;
    right: max(var(--gutter), calc((100vw - 1240px) / 2 + var(--gutter)));
    bottom: calc(var(--road) - 14px);
    width: min(46vw, 620px);
    margin: 0;
  }
}

@media (max-width: 960px) {
  .nav { display: none; }
  .top { justify-content: space-between; }

  .brands { grid-template-columns: repeat(4, 1fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .engines__grid { grid-template-columns: 1fr; }

  .route { grid-template-columns: 1fr; gap: 0; margin-top: 36px; }
  .route li { padding: 0 0 30px 60px; }
  .route li:last-child { padding-bottom: 0; }
  .route li:not(:last-child)::after {
    top: 40px;
    bottom: 0;
    left: 19px;
    right: auto;
    border-top: 0;
    border-left: 2px dashed var(--ink-soft);
  }
  .route p { max-width: 32em; }

  .price__grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  .top__phone { font-size: 1rem; }

  .actions .button { width: 100%; }
  .brands { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .brands li { min-height: 60px; font-size: .98rem; }
  .cards { gap: 10px; }
  .card__pic { padding: 16px 8px 0; }
  .card__head { padding: 10px 10px 0; }
  .card__price { margin-inline: 10px; font-size: .95rem; }
  .card__specs { font-size: .78rem; }
  .card__specs li { padding-inline: 4px; }
  .calc { padding: 8px; }
  .calc summary { padding: 12px 4px; font-size: .92rem; }
  .calc__panel { padding-inline: 0; }
  .calc__panel a { font-size: .9rem; }
  .ledger > div { grid-template-columns: 1fr; }

  .callbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 10;
    display: block;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    background: var(--signal);
    color: #fff;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 -2px 12px rgb(0 0 0 / .22);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wheel, .road::after { animation: none; }
  .button, .calc summary { transition: none; }
}
