/* =========================================================
   ГаражБатя — THEME (базовый слой тёмного редизайна)
   Порядок подключения: theme.css → components.css → sections.css
   Токены (:root), reset, типографика, контейнер, секции,
   кнопки, утилиты, keyframes.
   Шрифты: Sora (заголовки), Inter (текст) — подключены через <link>.
   ========================================================= */

/* ---------- ТОКЕНЫ ---------- */
:root {
  /* Фоны / поверхности */
  --bg: #0A0C0F;
  --bg-2: #0F1318;
  --surface: #14181E;
  --graphite: #1B2027;

  /* Стекло */
  --glass: rgba(255, 255, 255, .05);
  --glass-brd: rgba(255, 255, 255, .09);
  --glass-hi: rgba(255, 255, 255, .14);

  /* Текст */
  --text: #EEF1F5;
  --text-soft: #98A2B0;
  --muted: #6B7480;

  /* Акценты */
  --accent: #FF6A1A;
  --accent-2: #FF3B30;
  --accent-grad: linear-gradient(135deg, #FF6A1A, #FF3B30);
  --info: #3B82F6;

  /* Границы / радиусы */
  --brd: rgba(255, 255, 255, .08);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;

  /* Тени */
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, .35);

  /* Раскладка / анимация */
  --container: 1200px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .5s;

  /* Шрифты */
  --font-head: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Совместимость со старыми переменными (мягкий маппинг, чтобы
     не сломать инлайн-стили/легаси-классы, если где-то остались) */
  --c-primary: var(--accent);
  --c-primary-d: var(--accent-2);
  --c-accent: var(--accent);
  --c-accent-d: var(--accent-2);
  --c-bg: var(--bg);
  --c-muted: var(--surface);
  --c-text: var(--text);
  --c-text-soft: var(--text-soft);
  --c-border: var(--brd);
  --transition: var(--dur) var(--ease);
  --header-h: 72px;
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--graphite) var(--bg);
}

body {
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Деликатные акцентные «свечения» по углам — даже без фото фон живой */
  background-image:
    radial-gradient(60% 50% at 0% 0%, rgba(255, 106, 26, .10) 0%, transparent 60%),
    radial-gradient(55% 45% at 100% 0%, rgba(255, 59, 48, .08) 0%, transparent 60%),
    radial-gradient(70% 60% at 100% 100%, rgba(59, 130, 246, .06) 0%, transparent 65%),
    radial-gradient(60% 55% at 0% 100%, rgba(255, 106, 26, .05) 0%, transparent 65%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

h1, h2, h3, h4, h5, h6,
p, ul, ol, figure, blockquote, dl, dd { margin: 0; }

ul, ol { padding: 0; list-style: none; }

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

/* Картинки-фолбэк: тёмный фон даже без фото */
img { background-color: var(--graphite); }

a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--accent); }

button { font-family: inherit; cursor: pointer; }

input, textarea, select, button { font: inherit; color: inherit; }

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

::selection {
  background: var(--accent);
  color: #fff;
}

/* ---------- ТИПОГРАФИКА ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 700; }
h3 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); font-weight: 700; letter-spacing: -.015em; }
h4 { font-size: clamp(1.1rem, 1.8vw, 1.3rem); font-weight: 700; letter-spacing: -.01em; }

p { color: var(--text); }
p + p { margin-top: 1em; }

strong, b { font-weight: 700; color: var(--text); }
small { font-size: .85em; color: var(--text-soft); }

/* Надзаголовок */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- КОНТЕЙНЕР ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- СЕКЦИИ ---------- */
.section {
  position: relative;
  padding: clamp(56px, 9vw, 120px) 0;
}
/* Единый небольшой отступ между хлебными крошками и первым заголовком
   внутренних страниц. Покрывает оба случая: main с собственным
   padding-block и страницы с первой .section. Главную не трогаем —
   там нет крошек, и крупный отступ уместен. */
.breadcrumbs ~ main[class] { padding-top: clamp(14px, 2.2vw, 26px); }
.breadcrumbs ~ main > .section:first-child,
.breadcrumbs ~ main > .container:first-child > .section:first-child { padding-top: 0; }
.section--alt { background: var(--bg-2); }
.section--dark { background: var(--bg); }

.section__title {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: clamp(28px, 4vw, 48px);
}

/* ---------- КНОПКИ ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.btn:active { transform: translateY(0) scale(.99); }

/* Основная и акцентная — одинаковый «фирменный» градиент */
.btn--primary,
.btn--accent {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(255, 80, 30, .28);
}
.btn--primary:hover,
.btn--accent:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(255, 80, 30, .42);
}

/* Призрак — стекло/контур на тёмном */
.btn--ghost {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  color: var(--text);
  border-color: var(--glass-brd);
}
.btn--ghost:hover {
  color: var(--text);
  border-color: var(--glass-hi);
  background: rgba(255, 255, 255, .09);
  transform: translateY(-2px);
}

.btn--block { display: flex; width: 100%; }
.btn--sm { padding: 10px 18px; font-size: .9rem; }
.btn--lg { padding: 17px 34px; font-size: 1.08rem; }

/* ---------- УТИЛИТЫ ---------- */

/* Глассморфизм */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
}

/* Reveal-анимация (включает JS через IntersectionObserver: .is-visible) */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease);
  will-change: opacity, transform;
}
.is-visible {
  opacity: 1;
  transform: none;
}

/* Скрытый, но доступный для скринридеров */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Зерно/noise (опционально; добавь .grain на элемент) */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("/assets/img/noise.png");
  background-size: 180px;
  opacity: .035;
  mix-blend-mode: overlay;
  z-index: 0;
}

/* Прочие хелперы */
.bg-muted { background: var(--surface); }
body.no-scroll { overflow: hidden; }
.text-soft { color: var(--text-soft); }
.text-accent { color: var(--accent); }

/* Кастомный скроллбар */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--graphite);
  border: 3px solid var(--bg);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #2a313b; }

/* ---------- ХЛЕБНЫЕ КРОШКИ ---------- */
.breadcrumbs {
  padding: 14px 0;
  font-size: .85rem;
  color: var(--text-soft);
}
.breadcrumbs ol,
.breadcrumbs ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: var(--muted);
}
.breadcrumbs a { color: var(--text-soft); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs li:last-child { color: var(--text); font-weight: 500; }

/* ---------- KEYFRAMES ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 106, 26, .45); }
  50%      { box-shadow: 0 0 0 14px rgba(255, 106, 26, 0); }
}

/* ---------- ДОСТУПНОСТЬ: уважение к reduce-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
