/* ============================================================
   Uzbek Truck World — базовые стили
   Цвета берутся только из theme.css через переменные.
   ============================================================ */

/* ---------- Шрифты ----------
   Файлы кладутся в /assets/fonts/ (см. ТЗ, раздел «Техническая часть»).
   Пока файлов нет — работает запасной системный стек. */

@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plex';
  src: url('../fonts/plex-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plex';
  src: url('../fonts/plex-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Токены размеров ---------- */

:root {
  --font-display: 'Archivo', 'Arial Narrow', Helvetica, Arial, sans-serif;
  --font-text: 'Plex', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section-y: clamp(3.5rem, 8vw, 6.5rem);

  --radius: 4px;
  --radius-lg: 6px;

  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
  --step-0:  clamp(1rem, 0.97rem + 0.15vw, 1.08rem);
  --step-1:  clamp(1.22rem, 1.15rem + 0.35vw, 1.42rem);
  --step-2:  clamp(1.55rem, 1.4rem + 0.7vw, 2rem);
  --step-3:  clamp(2rem, 1.7rem + 1.4vw, 3rem);
  --step-4:  clamp(2.6rem, 2rem + 2.8vw, 4.4rem);

  --header-h: 72px;
}

/* ---------- Сброс ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

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

.section { padding-block: var(--section-y); }

.lead {
  font-size: var(--step-1);
  color: var(--muted);
  max-width: 58ch;
}

.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3rem); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-0);
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

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

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover { border-color: var(--ink); }

.btn-outline-light {
  background: transparent;
  color: var(--on-dark);
  border-color: var(--dark-line);
}
.btn-outline-light:hover { border-color: var(--on-dark); }

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn-row-spaced { margin-top: 1.5rem; }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--dark) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--dark-line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--on-dark);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-right: auto;
}

.brand img { display: block; height: 48px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.nav-link {
  position: relative;
  color: var(--on-dark-muted);
  text-decoration: none;
  font-weight: 500;
  padding-block: 0.5rem;
  white-space: nowrap;
}
.nav-link:hover { color: var(--on-dark); }

.nav-link[aria-current="page"] { color: var(--on-dark); }
.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
}

.hamburger {
  display: none;
  width: 44px; height: 44px;
  padding: 10px;
  background: none;
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
  cursor: pointer;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--on-dark);
  transition: transform .2s ease, opacity .2s ease;
}
.hamburger span + span { margin-top: 5px; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Герой ---------- */

.hero {
  background: var(--dark);
  color: var(--on-dark);
  padding-block: clamp(4rem, 10vw, 7.5rem);
  overflow: hidden;
}

.hero h1 { color: var(--on-dark); max-width: 16ch; }

.hero .lead {
  color: var(--on-dark-muted);
  margin-top: 1.5rem;
  max-width: 52ch;
}

.hero .btn-row { margin-top: 2.5rem; }

/* Единственный декоративный элемент страницы: мильная разметка.
   Отсылка к разметке обочины, заменяет фотографию в герое. */
.mileline {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 34px;
  margin-bottom: 2.5rem;
}
.mileline i {
  display: block;
  width: 2px;
  height: 12px;
  background: var(--dark-line);
}
.mileline i:nth-child(5n + 1) { height: 26px; background: var(--accent); }

/* ---------- Полоса фактов ---------- */

.facts {
  background: var(--dark-2);
  color: var(--on-dark);
  border-top: 1px solid var(--dark-line);
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--dark-line);
}

.fact {
  background: var(--dark-2);
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 2vw, 1.75rem);
}
.fact strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-1);
  letter-spacing: -0.01em;
}
.fact span {
  display: block;
  margin-top: 0.25rem;
  font-size: var(--step--1);
  color: var(--on-dark-muted);
}

/* ---------- Карточки оборудования ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
}
.tile h3 { margin-bottom: 0.35rem; }
.tile p { color: var(--muted); margin: 0; }

.note {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: var(--step--1);
}

/* ---------- Разворот «кто мы» ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.split-aside {
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.dl { margin: 0; }
.dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.dl div:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); font-size: var(--step--1); }
.dl dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  text-align: right;
}

/* ---------- Найм ---------- */

.hiring {
  background: var(--dark);
  color: var(--on-dark);
}
.hiring h2 { color: var(--on-dark); }
.hiring .lead { color: var(--on-dark-muted); }

.hire-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.hire-card {
  background: var(--dark-2);
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.hire-card h3 { color: var(--on-dark); margin: 0; }
.hire-card p { color: var(--on-dark-muted); margin: 0; }
.hire-card .btn { margin-top: auto; align-self: flex-start; }
.hire-card small { color: var(--on-dark-muted); font-size: var(--step--1); }

/* ---------- CTA ---------- */

.cta-band {
  background: var(--accent);
  color: var(--accent-on);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.cta-band h2 { color: var(--accent-on); margin-bottom: 0.25rem; }
.cta-band p { color: var(--accent-on); opacity: .9; }

.cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.cta-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-1);
}
.cta-contacts a { color: var(--accent-on); text-decoration: none; }
.cta-contacts a:hover { text-decoration: underline; }

/* ---------- Футер ---------- */

.footer {
  background: var(--dark);
  color: var(--on-dark-muted);
  padding-top: clamp(2.5rem, 6vw, 4rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: 2.5rem;
}

.footer h4 {
  color: var(--on-dark);
  font-size: var(--step-0);
  margin-bottom: 1rem;
}

.footer-col a,
.footer-brand a { color: var(--on-dark-muted); text-decoration: none; }
.footer-col a { display: block; padding-block: 0.35rem; }
.footer-col a:hover,
.footer-brand a:hover { color: var(--on-dark); }

.footer-brand img { display: block; width: 220px; height: auto; margin-bottom: 1.25rem; }
.footer-brand p { max-width: 34ch; }

.creds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--on-dark);
  font-size: var(--step--1);
}

.socials { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.socials a {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
}
.socials svg { width: 19px; height: 19px; }

.footer-bottom {
  border-top: 1px solid var(--dark-line);
  padding-block: 1.25rem;
  font-size: var(--step--1);
}
.footer-bottom .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}
.footer-bottom nav { display: flex; gap: 1.5rem; }
.footer-bottom a { color: var(--on-dark-muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--on-dark); }

/* ---------- Компактный герой внутренних страниц ---------- */

.page-hero {
  background: var(--dark);
  color: var(--on-dark);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.page-hero h1 { color: var(--on-dark); font-size: var(--step-3); }
.page-hero .lead { color: var(--on-dark-muted); margin: 0; }

/* ---------- Формы ---------- */

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: var(--step--1);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--error); }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.checkbox-label,
.field .checkbox-label {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 0.75rem;
  align-items: start;
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 1.5;
}
.checkbox-label input {
  width: 20px; height: 20px;
  min-height: 0;
  padding: 0;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.checkbox-label .opt { font-weight: 400; color: var(--muted); }

/* Отдельный блок SMS-согласия: подпись у чекбокса + мелкий текст условий */
.sms-consent {
  padding: 1rem;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.sms-consent .checkbox-label { color: var(--ink); font-weight: 500; margin: 0; }
.sms-consent .fine {
  margin: 0.75rem 0 0;
  padding-left: calc(20px + 0.75rem);
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 1.5;
}

.form-note { margin-top: 1rem; font-size: var(--step--1); color: var(--muted); }

.form-message { padding: 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; }
.form-message.is-ok { border: 1px solid var(--ok); color: var(--ok); }
.form-message.is-error { border: 1px solid var(--error); color: var(--error); }

/* ---------- Юридические страницы ---------- */

.legal-content { max-width: 760px; }
.legal-content h2 { font-size: var(--step-2); margin-top: 2.5rem; }
.legal-content h3 { margin-top: 1.75rem; }

.legal-callout {
  margin-block: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface-sunk);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.eyebrow {
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Адаптив ---------- */

@media (max-width: 960px) {
  .facts-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* В меню 4 пункта: ниже 720px они не помещаются рядом с логотипом,
   переходим на гамбургер. Порог синхронизирован с common.js. */
@media (max-width: 720px) {
  .hamburger { display: block; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem var(--gutter) 2rem;
    background: var(--dark);
    border-bottom: 1px solid var(--dark-line);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }
  .nav.is-open { display: flex; }

  .nav-link {
    padding-block: 0.9rem;
    border-bottom: 1px solid var(--dark-line);
    font-size: var(--step-1);
  }
  .nav-link[aria-current="page"]::after { display: none; }
}

@media (max-width: 560px) {
  .brand img { height: 38px; }
  .facts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .btn-row .btn { width: auto; flex: 1 1 200px; }
}

/* 320px: при высоте 38px логотип + гамбургер не помещаются в строку */
@media (max-width: 359px) {
  .brand img { height: 32px; }
}

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