/* ==========================================================================
   АВТО ТОЧКА — Автоплощадка (г. Шахты, ул. Дачная, 359)
   Минималистичная тёмная монохромная эстетика без неона + GSAP Motion
   ========================================================================== */

:root {
  --bg: #0A0B0D;
  --surface: #111317;
  --surface-alt: #181B21;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ink: #F4F5F7;
  --muted: #8A93A2;
  --accent: #F4F5F7;
  --accent-ink: #0A0B0D;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1200px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
ul { list-style: none; }
section { scroll-margin-top: 74px; }

.container { width: min(100% - 36px, var(--container)); margin-inline: auto; }
.section { padding: 64px 0; }
.section--alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(244, 245, 247, 0.75);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 600;
  pointer-events: none;
}

/* Верхняя полоса */
.topbar {
  background: #07080A;
  color: var(--muted);
  font-size: 0.76rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Шапка */
.header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
}

.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo__badge {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
}
.logo__text { display: flex; flex-direction: column; line-height: 1.15; }
.logo__text strong { font-size: 1rem; font-weight: 700; color: var(--ink); }
.logo__text small { font-size: 0.72rem; color: var(--muted); }

.nav__links { display: flex; gap: 28px; }
.nav__links a { font-size: 0.88rem; font-weight: 500; color: var(--muted); transition: color 0.2s; }
.nav__links a:hover { color: var(--ink); }

.nav__right { display: flex; align-items: center; gap: 16px; }
.nav__phone { font-size: 0.9rem; font-weight: 600; color: var(--ink); white-space: nowrap; transition: opacity 0.2s; }
.nav__phone:hover { opacity: 0.75; }

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background-color 0.2s, border-color 0.2s, transform 0.25s var(--ease), opacity 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }

/* Эмблемы мессенджеров и звонка */
.emblem {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.emblem svg { width: 13px; height: 13px; fill: currentColor; }
.emblem--lg { width: 38px; height: 38px; border-radius: 10px; }
.emblem--lg svg { width: 19px; height: 19px; }

.emblem--tg { background: linear-gradient(145deg, #38BDF8, #0284C7); color: #FFFFFF; }
.emblem--wa { background: linear-gradient(145deg, #4ADE80, #16A34A); color: #FFFFFF; }
.emblem--max { background: linear-gradient(145deg, #818CF8, #4F46E5); color: #FFFFFF; }
.emblem--tel { background: rgba(10, 11, 13, 0.14); color: var(--accent-ink); }
.social-tile .emblem--tel { background: var(--surface-alt); border: 1px solid var(--border); color: var(--ink); }

.mob-motion-bar { display: none; }
.btn--sm { padding: 8px 14px; font-size: 0.82rem; }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: #E2E4E9; }

.btn--outline {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
}
.btn--outline:hover { border-color: var(--border-strong); background: var(--surface-alt); }

/* Первый экран с фоновой motion-графикой */
.hero {
  position: relative;
  padding: 64px 0 72px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}

.hero__wrap {
  position: relative;
  z-index: 2;
}

.hero__info {
  max-width: 680px;
}

.hero__meta {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 12px;
}

.hero__title {
  font-size: clamp(1.95rem, 3.6vw, 2.9rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 16px;
}

.hero__lead {
  color: #B4BCC8;
  font-size: 0.98rem;
  max-width: 52ch;
  margin-bottom: 26px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}

.hero__facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.hero__facts dt { font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.hero__facts dd { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }

/* Фоновая motion-графика в главном секторе (только для ПК) */
.hero__motion {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: max(2%, calc((100vw - var(--container)) / 2));
}

.hero__motion::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, var(--bg) 18%, rgba(10, 11, 13, 0.72) 52%, rgba(10, 11, 13, 0.25) 100%),
    linear-gradient(180deg, rgba(10, 11, 13, 0.3) 0%, transparent 25%, transparent 75%, var(--bg) 100%);
}

.motion-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
}

.motion-car {
  position: relative;
  z-index: 1;
  width: min(56vw, 720px);
  height: auto;
  opacity: 0.48;
}

.m-body,
.m-chassis {
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.m-cabin,
.m-detail {
  stroke: rgba(244, 245, 247, 0.45);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.m-line { stroke: rgba(255, 255, 255, 0.16); stroke-width: 1.4; }
.m-dash { stroke: rgba(255, 255, 255, 0.24); stroke-width: 1.6; stroke-linecap: round; }
.m-air { stroke: rgba(255, 255, 255, 0.14); stroke-width: 1.4; stroke-linecap: round; }

.m-tire { fill: var(--bg); stroke: var(--ink); stroke-width: 2.4; }
.m-rim { stroke: rgba(244, 245, 247, 0.4); stroke-width: 1.4; }
.m-spokes line { stroke: rgba(244, 245, 247, 0.65); stroke-width: 1.5; stroke-linecap: round; }

.motion-hud {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.motion-hud__ticker { color: var(--ink); font-weight: 600; }

/* Каталог */
.section-title { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.section-head { margin-bottom: 22px; }
.section-note { color: var(--muted); font-size: 0.92rem; margin-top: 6px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.pill:hover { border-color: var(--border-strong); color: var(--ink); }
.pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.search-input {
  min-width: 260px;
  padding: 9px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.search-input::placeholder { color: #6B7280; }
.search-input:focus { border-color: var(--border-strong); }

.cars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.car-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.35s var(--ease), border-color 0.25s;
}
.car-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}
.car-card.is-hidden { display: none; }

.car-card__img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-alt); }
.car-card__img img { transition: transform 0.6s var(--ease); }
.car-card:hover .car-card__img img { transform: scale(1.04); }

.car-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(10, 11, 13, 0.8);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 500;
}

.car-card__body { padding: 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.car-card__body h3 { font-size: 1.08rem; font-weight: 600; color: var(--ink); }
.car-card__body p { font-size: 0.85rem; color: var(--muted); }
.car-card__foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}
.car-card__more { color: var(--ink); font-weight: 600; transition: transform 0.25s var(--ease); }
.car-card:hover .car-card__more { transform: translateX(3px); }

/* Услуги */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.feature-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.feature-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--ink);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.feature-card__icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.feature-card p { font-size: 0.88rem; color: var(--muted); }

/* Карта и контакты */
.map-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 22px; align-items: stretch; }
.map-frame {
  min-height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}
.map-frame iframe { width: 100%; height: 100%; min-height: 360px; border: 0; }

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.contact-card__sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }

.messenger-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social-tile {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease);
}
.social-tile > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.social-tile:hover { border-color: var(--border-strong); background: var(--surface-alt); transform: translateY(-2px); }
.social-tile strong { font-size: 0.92rem; color: var(--ink); }
.social-tile span { font-size: 0.8rem; color: var(--muted); }

/* Модальное окно */
.car-modal {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
}
.car-modal.is-open { pointer-events: auto; }
.car-modal__bg { position: absolute; inset: 0; background: rgba(7, 8, 10, 0.82); backdrop-filter: blur(8px); }
.car-modal__box {
  position: relative;
  z-index: 1;
  width: min(100%, 580px);
  max-height: 90svh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 22px;
  display: grid;
  gap: 12px;
}
.car-modal__box img { aspect-ratio: 16 / 10; border-radius: 10px; }
.car-modal__box h3 { font-size: 1.3rem; font-weight: 700; }
.car-modal__box p { font-size: 0.9rem; color: var(--muted); }
.car-modal__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.car-modal__nav { display: flex; gap: 6px; margin-left: auto; }
.car-modal__arrow {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  display: grid;
  place-items: center;
}
.car-modal__arrow:hover { border-color: var(--border-strong); }
.car-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 11, 13, 0.88);
  border: 1px solid var(--border);
  color: #FFFFFF;
  font-size: 1.3rem;
  display: grid;
  place-items: center;
}

.footer {
  padding: 26px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.84rem; color: var(--muted); }

/* Мобильное нижнее меню */
.mob-nav { display: none; }

@media (max-width: 1024px) {
  .map-grid { grid-template-columns: 1fr; }
  .cars-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .hero__motion,
  .topbar,
  .nav__links,
  .nav__phone { display: none; }
  .hero { padding: 26px 0 32px; }
  .hero__facts { grid-template-columns: 1fr; gap: 10px; }
  .hero__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hero__actions .btn--primary { grid-column: 1 / -1; }
  .hero__actions .btn--outline {
    padding: 10px 6px;
    font-size: 0.78rem;
    gap: 6px;
    white-space: nowrap;
  }
  .hero__actions .btn--outline .emblem { width: 19px; height: 19px; }
  .hero__actions .btn--outline .emblem svg { width: 11px; height: 11px; }
  .mob-motion-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 8px 12px;
    border-radius: 9px;
    background: var(--surface);
    border: 1px solid var(--border);
  }
  .mob-motion-bar__track {
    position: relative;
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    border-radius: 2px;
  }
  .mob-motion-bar__runner {
    position: absolute;
    top: 0;
    left: -35%;
    width: 35%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--ink), transparent);
    animation: mobSlide 2.2s var(--ease) infinite;
  }
  @keyframes mobSlide {
    0% { left: -35%; }
    100% { left: 100%; }
  }
  .mob-motion-bar__label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--muted);
    white-space: nowrap;
  }
  .pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .pills::-webkit-scrollbar { display: none; }
  .pill { flex: 0 0 auto; }
  .search-input { width: 100%; }
  .cars-grid { grid-template-columns: 1fr; }
  .messenger-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .social-tile { padding: 12px 10px; gap: 9px; }
  .social-tile .emblem--lg { width: 32px; height: 32px; }
  .social-tile strong { font-size: 0.84rem; }
  .social-tile span { font-size: 0.72rem; }
  .footer { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }

  .mob-nav {
    position: fixed;
    left: 50%;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    z-index: 450;
    transform: translateX(-50%);
    display: block;
    width: min(94vw, 24rem);
    padding: 0.35rem;
    border-radius: 999px;
    background: rgba(17, 19, 23, 0.94);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  }
  .mob-nav__list { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; }
  .mob-nav__pill {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    z-index: 0;
    border-radius: 999px;
    background: var(--accent);
    transition: transform 0.38s var(--ease), width 0.38s var(--ease);
    pointer-events: none;
  }
  .mob-nav__item {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 7px 4px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-nav__item svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mob-nav__item.is-active { color: var(--accent-ink); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .scroll-progress { display: none !important; }
}
