/* =================================================================
   SPEC-54 — Main CSS
   Аренда спецтехники в Новосибирске
   Содержит: переменные, reset, типографику, контейнеры/секции,
   header, footer, мобильное меню, mobile CTA bar
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

/* ===== 1. Design tokens ===== */
:root {
  /* Brand colors */
  --color-primary: #1E3A5F;
  --color-primary-600: #14283F;
  --color-primary-700: #0F1E30;
  --color-primary-100: #E8EEF5;
  --color-primary-50: #F3F6FA;

  --color-accent: #FF7A1A;
  --color-accent-600: #E8650A;
  --color-accent-700: #C9560A;
  --color-accent-100: #FFF0E2;
  --color-accent-50: #FFF8F2;

  /* Neutrals */
  --color-text: #17202E;
  --color-text-secondary: #545E6E;
  --color-muted: #6B7688;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F5F7FA;
  --color-bg-dark: #0F1B2D;
  --color-bg-dark-alt: #16273E;
  --color-border: #E3E7EE;
  --color-border-dark: #2A3B54;
  --color-white: #FFFFFF;

  /* State colors */
  --color-success: #1D9A6C;
  --color-success-bg: #E8F7F1;
  --color-warning: #F2A93B;
  --color-warning-bg: #FEF5E7;
  --color-error: #E5484D;
  --color-error-bg: #FCEBEC;

  /* Typography */
  --font-heading: 'Manrope', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;

  --fs-h1: clamp(2rem, 1.6rem + 2vw, 3.25rem);
  --fs-h2: clamp(1.6rem, 1.35rem + 1.25vw, 2.5rem);
  --fs-h3: clamp(1.25rem, 1.12rem + 0.65vw, 1.75rem);
  --fs-h4: clamp(1.125rem, 1.05rem + 0.35vw, 1.375rem);
  --fs-lead: clamp(1.05rem, 1rem + 0.25vw, 1.25rem);
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;

  --lh-tight: 1.2;
  --lh-heading: 1.3;
  --lh-body: 1.65;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 1px rgba(15, 27, 45, .04);
  --shadow-md: 0 8px 24px rgba(15, 27, 45, .08);
  --shadow-lg: 0 20px 48px rgba(15, 27, 45, .14);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  --section-padding-y: clamp(48px, 6vw, 96px);
  --section-padding-y-sm: clamp(32px, 4vw, 64px);

  /* Layout */
  --container-width: 1280px;
  --container-padding: 24px;
  --header-height: 84px;
  --header-height-scrolled: 72px;
  --topbar-height: 40px;

  /* Motion */
  --transition-fast: .15s ease;
  --transition-base: .25s cubic-bezier(.4, 0, .2, 1);
  --transition-slow: .4s cubic-bezier(.4, 0, .2, 1);
}

/* ===== 2. Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height-scrolled) + var(--space-4));
}

body {
  min-height: 100svh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

svg { fill: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: var(--lh-heading);
  color: var(--color-primary);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: 700; }

p { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration: none;
}

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

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

button { cursor: pointer; }

table {
  border-collapse: collapse;
  width: 100%;
}

fieldset { border: none; padding: 0; }

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

::selection {
  background: var(--color-accent-100);
  color: var(--color-primary-700);
}

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

/* ===== 3. Layout helpers ===== */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

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

.section--sm { padding-block: var(--section-padding-y-sm); }
.section--alt { background: var(--color-bg-alt); }
.section--dark { background: var(--color-bg-dark); color: #C9D3E0; }
.section--dark h2, .section--dark h3, .section--dark h4 { color: var(--color-white); }
.section--no-top { padding-top: 0; }
.section--no-bottom { padding-bottom: 0; }

.section-head {
  max-width: 720px;
  margin-bottom: var(--space-10);
}
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  max-width: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--color-accent-600);
  margin-bottom: var(--space-4);
}
.eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  flex-shrink: 0;
}

.section-head p {
  color: var(--color-text-secondary);
  font-size: var(--fs-lead);
  margin-top: var(--space-3);
}
.section--dark .section-head p { color: #9FADC2; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-4);
  z-index: 999;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  transition: top var(--transition-base);
}
.skip-link:focus {
  top: var(--space-4);
}

.icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-fill { fill: currentColor; stroke: none; }
.icon-flip { transform: scaleX(-1); }

.sprite-sheet { position: absolute; width: 0; height: 0; overflow: hidden; }

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 3b. Grid layouts ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-5); }

.cols-hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: var(--space-12);
  align-items: center;
}
.cols-sidebar {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-12);
  align-items: start;
}
.cols-sidebar__aside { position: sticky; top: calc(var(--header-height-scrolled) + var(--space-6)); }
.cols-even {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}
.cols-contacts {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: var(--space-12);
  align-items: start;
}

/* Защита от переполнения: grid-треки по умолчанию не сжимаются
   меньше min-content своего содержимого (например, широкой таблицы) */
.cols-hero > *,
.cols-sidebar > *,
.cols-even > *,
.cols-contacts > *,
.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.grid-5 > * {
  min-width: 0;
}

/* ===== 4. Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.topbar {
  background: var(--color-primary-700);
  color: #A9B7CC;
  font-size: var(--fs-xs);
  height: var(--topbar-height);
  overflow: hidden;
  transition: height var(--transition-base), opacity var(--transition-base);
}
.header.is-scrolled .topbar {
  height: 0;
  opacity: 0;
}

.topbar__inner {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.topbar__info {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.topbar__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}
.topbar__item .icon { color: var(--color-accent); }
a.topbar__item:hover { color: #fff; }

.topbar__social {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.topbar__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.08);
  transition: background var(--transition-fast);
}
.topbar__social-link:hover { background: var(--color-accent); color: #fff; }
.topbar__social-link .icon { width: 14px; height: 14px; }

.header__main {
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: height var(--transition-base);
}
.header.is-scrolled .header__main { height: var(--header-height-scrolled); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  height: 100%;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.375rem;
  color: var(--color-primary);
  flex-shrink: 0;
}
.logo__mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-600) 100%);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo__mark .icon { width: 22px; height: 22px; stroke-width: 2.2; }
.logo__text-sub {
  display: block;
  font-family: var(--font-body);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.nav { flex: 1; min-width: 0; }
.nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.nav__link {
  position: relative;
  font-weight: 600;
  font-size: .9375rem;
  color: var(--color-text);
  padding-block: var(--space-2);
  white-space: nowrap;
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform var(--transition-fast);
}
.nav__link:hover { color: var(--color-primary); }
.nav__link:hover::after { transform: scaleX(1); }
.nav__link.is-active { color: var(--color-primary); }
.nav__link.is-active::after { transform: scaleX(1); }

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-shrink: 0;
}

.header__phone {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.header__phone-number {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
}
.header__phone-label {
  font-size: .6875rem;
  color: var(--color-muted);
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.burger span,
.burger::before,
.burger::after {
  content: '';
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}
.burger[aria-expanded="true"]::before { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span { opacity: 0; }
.burger[aria-expanded="true"]::after { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
}
.mobile-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 45, .5);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.mobile-menu__panel {
  position: absolute;
  top: 0; right: 0;
  width: min(360px, 86vw);
  height: 100%;
  background: var(--color-bg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
}
.mobile-menu.is-open { visibility: visible; }
.mobile-menu.is-open .mobile-menu__backdrop { opacity: 1; }
.mobile-menu.is-open .mobile-menu__panel { transform: translateX(0); }

.mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-menu__close {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
}

.mobile-menu__list { display: flex; flex-direction: column; }
.mobile-menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--color-primary);
}
.mobile-menu__link .icon { color: var(--color-muted); width: 18px; height: 18px; }

.mobile-menu__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: auto;
}
.mobile-menu__phone {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-primary);
  text-align: center;
}
.mobile-menu__social {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
}
.mobile-menu__social .topbar__social-link {
  background: var(--color-bg-alt);
  color: var(--color-primary);
}
.mobile-menu__social .topbar__social-link:hover { background: var(--color-accent); color: #fff; }

/* ===== 4b. Hero & trust bar ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(48px, 6vw, 88px);
  padding-bottom: clamp(48px, 6vw, 88px);
}
.hero::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto auto;
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, var(--color-primary-100) 0%, transparent 70%);
  z-index: -1;
}
.hero::after {
  content: '';
  position: absolute;
  left: -12%;
  bottom: -30%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, var(--color-accent-50) 0%, transparent 70%);
  z-index: -1;
}
.hero__content .eyebrow { margin-bottom: var(--space-5); }
.hero__lead {
  font-size: var(--fs-lead);
  color: var(--color-text-secondary);
  margin-top: var(--space-5);
  max-width: 560px;
}
.hero__actions {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}
.hero__points {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-10);
}
.hero__points li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
}
.hero__points .icon {
  width: 22px; height: 22px;
  padding: 4px;
  border-radius: var(--radius-full);
  background: var(--color-success-bg);
  color: var(--color-success);
  flex-shrink: 0;
}

.trustbar { background: var(--color-primary-50); border-block: 1px solid var(--color-border); }

/* ===== 4c. Page header (внутренние страницы) ===== */
.page-header { padding-block: var(--space-6) var(--space-2); }
.page-header h1 { max-width: 820px; }
.page-header__lead { margin-top: var(--space-4); font-size: var(--fs-lead); color: var(--color-text-secondary); max-width: 680px; }
.page-header__meta {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-5);
  flex-wrap: wrap;
}

/* ===== 5. Footer ===== */
.footer {
  background: var(--color-bg-dark);
  color: #93A1B8;
}

.footer__top {
  padding-block: var(--space-16);
  border-bottom: 1px solid var(--color-border-dark);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: var(--space-10);
}

.footer__brand-desc {
  margin-block: var(--space-4);
  max-width: 320px;
  font-size: var(--fs-sm);
  line-height: 1.7;
}

.footer .logo { color: #fff; }
.footer .logo__text-sub { color: #6C7A91; }

.footer__social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.06);
  color: #fff;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.footer__social-link:hover { background: var(--color-accent); }

.footer__col h3 {
  font-family: var(--font-heading);
  color: #fff;
  font-size: 1rem;
  margin-bottom: var(--space-5);
}
.footer__col ul { display: flex; flex-direction: column; gap: var(--space-3); }
.footer__col a { font-size: var(--fs-sm); transition: color var(--transition-fast); }
.footer__col a:hover { color: #fff; }

.footer__contacts li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--fs-sm);
}
.footer__contacts .icon { color: var(--color-accent); flex-shrink: 0; margin-top: 3px; width: 16px; height: 16px; }
.footer__contacts a:hover { color: #fff; }
.footer__contacts strong { display: block; color: #fff; font-weight: 600; }

.footer__bottom-inner {
  padding-block: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--fs-xs);
  flex-wrap: wrap;
}
.footer__bottom a:hover { color: #fff; }

/* Cookie-баннер */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 95;
  background: var(--color-bg-dark);
  color: #C9D3E0;
  padding-block: var(--space-4);
  transform: translateY(100%);
  transition: transform var(--transition-slow);
  box-shadow: 0 -8px 24px rgba(15,27,45,.12);
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.cookie-banner__text { font-size: var(--fs-sm); max-width: 760px; }
.cookie-banner__text a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.cookie-banner__actions { flex-shrink: 0; }

/* Mobile sticky CTA bar */
.mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 90;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
  gap: var(--space-3);
  box-shadow: 0 -8px 24px rgba(15,27,45,.08);
}
.mobile-cta-bar__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 48px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: var(--fs-sm);
}
.mobile-cta-bar__btn--call {
  background: var(--color-primary-100);
  color: var(--color-primary);
}
.mobile-cta-bar__btn--request {
  background: var(--color-accent);
  color: #fff;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-6);
  width: 48px; height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--transition-base), transform var(--transition-base), background var(--transition-fast);
  z-index: 80;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--color-accent); }
.back-to-top .icon { width: 20px; height: 20px; transform: rotate(180deg); }
