/* ============================================================
   /cases/avtokomis — «сайт как кейс».
   Дизайн-система клиента (avtokomis1.by/app/globals.css), перенесённая
   в ванильный CSS и изолированная под .ak. Анимации — только
   transform/opacity (CrUX бережём).
   ============================================================ */
.ak {
  --ak-obsidian: #0a0b0d;
  --ak-graphite: #16181c;
  --ak-steel: #23272e;
  --ak-bone: #eceef1;
  --ak-titan: #8a929e;
  --ak-gold: #ff5e13;
  --ak-gold-600: #fd4401;
  --ak-gold-line: rgba(255, 94, 19, 0.55);
  --ak-ease: cubic-bezier(0.16, 1, 0.3, 1);

  position: relative;
  background: var(--ak-obsidian);
  color: var(--ak-bone);
  font-family: var(--ak-font-inter), ui-sans-serif, system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}
.ak *,
.ak *::before,
.ak *::after { box-sizing: border-box; }
.ak a { color: inherit; text-decoration: none; }
.ak h1, .ak h2, .ak h3, .ak p, .ak dl, .ak dd { margin: 0; }
.ak em { font-style: italic; font-weight: 600; color: var(--ak-gold); }
.ak [id] { scroll-margin-top: 84px; }

.ak-container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}
.ak-section { padding-block: clamp(56px, 8vw, 96px); }
.ak-band { border-block: 1px solid var(--ak-steel); }

.ak-display {
  font-family: var(--ak-font-playfair), Georgia, 'Times New Roman', serif;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.005em;
}
.ak-sans { font-family: var(--ak-font-inter), system-ui, sans-serif; font-weight: 600; }
.ak-tnum { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.ak-h1 { font-size: clamp(2.3rem, 6vw, 5rem); max-width: 14ch; }
.ak-h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); margin-top: 10px !important; }
.ak-eyebrow {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ak-gold);
}
.ak-sub { margin-top: 14px !important; max-width: 56ch; color: var(--ak-titan); font-size: 0.95rem; }

.ak-logo {
  font-family: var(--ak-font-logo), 'Arial Narrow', system-ui, sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  color: var(--ak-bone);
}
.ak-logo-num, .ak-logo em { margin-left: 0.16em; color: var(--ak-gold); font-style: normal; font-weight: 900; }
.ak-logo-sym { font-size: 0.58em; vertical-align: 0.42em; }

/* Кнопки */
.ak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 14px 28px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.ak-btn-sm { height: 40px; padding: 0 20px; font-size: 0.875rem; }
.ak a.ak-btn-gold, .ak-btn-gold { background: var(--ak-gold); color: #16120a; }
.ak a.ak-btn-gold:hover { background: var(--ak-gold-600); }
.ak-btn-ghost { border: 1px solid var(--ak-steel); color: var(--ak-bone); }
.ak a.ak-btn-ghost:hover { border-color: var(--ak-gold); color: var(--ak-gold); }

.ak-card {
  background: var(--ak-graphite);
  border: 1px solid var(--ak-steel);
  border-radius: 18px;
  transition: border-color 0.2s;
}
.ak-card:hover { border-color: var(--ak-gold-line); }

/* ---------- HERO: машина во всё окно ---------- */
.ak-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding-bottom: clamp(28px, 5vh, 56px);
  overflow: hidden;
}
.ak-hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ak-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 11, 13, 0.85) 0%, rgba(10, 11, 13, 0.35) 45%, rgba(10, 11, 13, 0) 75%),
    linear-gradient(180deg, rgba(10, 11, 13, 0.6) 0%, rgba(10, 11, 13, 0) 30%, rgba(10, 11, 13, 0) 55%, rgba(10, 11, 13, 0.98) 100%);
}
.ak-site-header { position: absolute; inset: 72px 0 auto; z-index: 2; }
.ak-site-header-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px;
}
.ak-site-nav { display: flex; gap: 32px; font-size: 0.875rem; color: rgba(236, 238, 241, 0.82); }
.ak-site-nav a:hover { color: #fff; }

.ak-hero-copy { position: relative; z-index: 1; }
.ak-back {
  display: inline-block;
  margin-bottom: 22px;
  font-size: 0.8rem;
  color: var(--ak-titan) !important;
  transition: color 0.2s;
}
.ak-back:hover { color: var(--ak-bone) !important; }
.ak-hero-copy .ak-h1 { margin-top: 10px; }
.ak-hero-lead {
  margin-top: 18px !important;
  max-width: 46ch;
  color: rgba(236, 238, 241, 0.82);
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
}

.ak-search {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 10px;
  margin-top: clamp(24px, 4vh, 40px);
  padding: 12px;
  background: var(--ak-graphite);
  border: 1px solid var(--ak-steel);
  border-radius: 16px;
}
.ak-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 0.95rem;
  background: var(--ak-obsidian);
  border: 1px solid var(--ak-steel);
  border-radius: 12px;
  transition: border-color 0.2s, color 0.2s;
}
.ak-field::after {
  content: '';
  width: 8px;
  height: 8px;
  margin-left: 12px;
  border-right: 2px solid var(--ak-titan);
  border-bottom: 2px solid var(--ak-titan);
  transform: translateY(-2px) rotate(45deg);
  transition: border-color 0.2s;
}
.ak-field:hover { border-color: var(--ak-gold); color: var(--ak-gold); }
.ak-field:hover::after { border-color: var(--ak-gold); }
.ak-search-go { border-radius: 12px; white-space: nowrap; }
.ak-hero-note { margin-top: 10px !important; font-size: 0.75rem; color: var(--ak-titan); }
.ak-hero-note a:hover { color: var(--ak-bone); }

@keyframes ak-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.ak-rise { animation: ak-rise 0.7s var(--ak-ease) both; }

/* ---------- Шапка секции ---------- */
.ak-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.ak-head-link {
  flex-shrink: 0;
  font-size: 0.875rem;
  color: var(--ak-titan) !important;
  text-underline-offset: 4px;
}
.ak-head-link:hover { color: var(--ak-bone) !important; text-decoration: underline !important; }

/* ---------- Задача ---------- */
.ak-task { max-width: 860px; }
.ak-task .ak-h2 { font-size: clamp(1.7rem, 3.6vw, 2.8rem); }
.ak-task-text { margin-top: 24px; display: grid; gap: 16px; color: rgba(236, 238, 241, 0.84); }

/* ---------- Брендбук ---------- */
.ak-bb {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  margin-top: 32px;
}
.ak-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ak-swatch {
  display: grid;
  gap: 4px;
  padding: 10px 10px 12px;
  text-align: left;
  font: inherit;
  color: var(--ak-bone);
  background: var(--ak-graphite);
  border: 1px solid var(--ak-steel);
  border-radius: 16px;
  transition: border-color 0.2s, transform 0.3s var(--ak-ease);
}
.ak-swatch:hover { border-color: var(--ak-titan); }
.ak-swatch[aria-selected='true'] { border-color: var(--ak-gold); transform: translateY(-3px); }
.ak-swatch-chip {
  display: block;
  height: 64px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid rgba(236, 238, 241, 0.12);
}
.ak-swatch-name { font-size: 0.86rem; font-weight: 600; }
.ak-swatch-hex { font-size: 0.74rem; letter-spacing: 0.06em; color: var(--ak-titan); }

.ak-swatch-roles { position: relative; display: grid; margin-top: 22px; }
.ak-swatch-roles p {
  grid-area: 1 / 1;
  padding-left: 16px;
  border-left: 2px solid var(--ak-gold);
  color: rgba(236, 238, 241, 0.84);
  font-size: 0.98rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.35s, transform 0.35s var(--ak-ease), visibility 0s 0.35s;
}
.ak[data-hl='gold'] [data-role='gold'],
.ak[data-hl='obsidian'] [data-role='obsidian'],
.ak[data-hl='graphite'] [data-role='graphite'],
.ak[data-hl='steel'] [data-role='steel'],
.ak[data-hl='bone'] [data-role='bone'],
.ak[data-hl='titan'] [data-role='titan'] {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.ak-bb-stage {
  display: grid;
  gap: 16px;
  justify-items: stretch;
  padding: clamp(20px, 3vw, 36px);
  background: var(--ak-obsidian);
  border: 1px solid var(--ak-steel);
  border-radius: 24px;
  outline: 1.5px dashed transparent;
  outline-offset: -8px;
  transition: outline-color 0.35s;
}
.ak-bb-stage [data-c],
.ak-bb-stage img { transition: opacity 0.35s, filter 0.35s, border-color 0.35s, outline-color 0.35s, background-color 0.35s; }
.ak-bb-btn { border-radius: 12px; cursor: default; }

/* подсветка: «листовые» цвета гаснут, выбранный светится */
.ak[data-hl] .ak-bb-stage img { opacity: 0.5; }
.ak[data-hl='gold'] .ak-bb-stage :is([data-c='bone'], [data-c='titan']),
.ak[data-hl='bone'] .ak-bb-stage :is([data-c='gold'], [data-c='titan']),
.ak[data-hl='titan'] .ak-bb-stage :is([data-c='gold'], [data-c='bone']),
.ak:is([data-hl='graphite'], [data-hl='steel'], [data-hl='obsidian']) .ak-bb-stage :is([data-c='gold'], [data-c='bone'], [data-c='titan']) {
  opacity: 0.2;
}
.ak[data-hl='gold'] .ak-bb-stage [data-c='gold'] { filter: drop-shadow(0 0 12px rgba(255, 94, 19, 0.6)); }
.ak[data-hl='bone'] .ak-bb-stage [data-c='bone'] { filter: drop-shadow(0 0 10px rgba(236, 238, 241, 0.45)); }
.ak[data-hl='titan'] .ak-bb-stage [data-c='titan'] { filter: drop-shadow(0 0 10px rgba(138, 146, 158, 0.7)); }
.ak[data-hl='graphite'] .ak-bb-stage .ak-car { outline-color: var(--ak-gold); background: #1c1f25; }
.ak[data-hl='graphite'] .ak-bb-stage img { opacity: 0.12; }
.ak[data-hl='steel'] .ak-bb-stage :is(.ak-car, .ak-car-specs) { border-color: var(--ak-bone); }
.ak[data-hl='obsidian'] .ak-bb-stage { outline-color: var(--ak-gold); }
.ak[data-hl='obsidian'] .ak-bb-stage .ak-car { opacity: 0.25; }

/* Карточка авто (CarCard) */
.ak-car {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ak-graphite);
  border: 1px solid var(--ak-steel);
  border-radius: 16px;
  outline: 1.5px dashed transparent;
  outline-offset: 5px;
  transition: border-color 0.2s;
}
.ak-car-photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.ak-car-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.ak-car-pay {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--ak-gold);
  color: #16120a;
}
.ak-car-checked {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 500;
  border-radius: 999px;
  color: var(--ak-bone);
  background: rgba(138, 146, 158, 0.28);
  border: 1px solid rgba(138, 146, 158, 0.5);
  backdrop-filter: blur(8px);
}
.ak-car-body { display: flex; flex: 1; flex-direction: column; padding: 12px; }
.ak-car-body h3 { font-size: 0.98rem; font-weight: 600; line-height: 1.25; }
.ak-car-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-top: 10px !important;
  padding-top: 10px !important;
  border-top: 1px solid var(--ak-steel);
}
.ak-car-specs > div { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 0.78rem; line-height: 1.2; }
.ak-car-specs dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(236, 238, 241, 0.84); }
.ak-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--ak-gold); }
.ak-car-foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.ak-car-price { font-size: 1.35rem; line-height: 1; color: var(--ak-gold); }
.ak-car-more { font-size: 0.8rem; color: var(--ak-titan); transition: color 0.2s; }

/* Шрифты */
.ak-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: clamp(40px, 6vw, 72px); }
.ak-type { padding-top: 20px; border-top: 1px solid var(--ak-steel); }
.ak-type-sample { min-height: 2.2em; font-size: clamp(1.5rem, 2.4vw, 2.1rem); line-height: 1.1; }
.ak-type-sample.ak-sans { font-size: clamp(1.1rem, 1.7vw, 1.4rem); font-variant-numeric: tabular-nums; padding-top: 0.4em; }
.ak-type-sample.ak-logo em { font-size: 1em; }
.ak-type-name { margin-top: 14px; font-weight: 600; }
.ak-type-role { margin-top: 6px; font-size: 0.86rem; line-height: 1.45; color: var(--ak-titan); }

/* ---------- Рельс экранов ---------- */
.ak-rail {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  padding-block: 4px 8px;
  padding-inline: max(clamp(20px, 5vw, 48px), calc((100vw - 1240px) / 2 + 48px));
  scroll-padding-inline: max(clamp(20px, 5vw, 48px), calc((100vw - 1240px) / 2 + 48px));
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
}
.ak-rail::-webkit-scrollbar { display: none; }
.ak-rail.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.ak-rail a, .ak-rail img { -webkit-user-drag: none; user-select: none; }
.ak-screen { flex: 0 0 min(80vw, 340px); scroll-snap-align: start; }
.ak-screen:hover { border-color: var(--ak-gold-line); }
.ak-screen:hover .ak-car-more { color: var(--ak-bone); }
.ak-screen .ak-car-photo img { transition: transform 0.5s; }
.ak-screen:hover .ak-car-photo img { transform: scale(1.04); }
.ak-screen .ak-car-price { font-size: 1.15rem; }

/* ---------- Почему мы / шаги ---------- */
.ak-why { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 32px; margin-top: 28px; }
.ak-why-num { font-size: 1.6rem; color: var(--ak-gold); }
.ak-why-t { margin-top: 8px; font-weight: 600; }
.ak-why-d { margin-top: 6px; font-size: 0.86rem; line-height: 1.45; color: var(--ak-titan); }

.ak-services { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 28px; }
.ak-service { display: flex; flex-direction: column; gap: 8px; padding: 20px; }
.ak-service-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  border-radius: 50%;
  background: #1c1f24;
  color: var(--ak-gold);
}
.ak-service-t { margin-top: 4px; font-weight: 600; }
.ak-service-d { font-size: 0.82rem; line-height: 1.4; color: var(--ak-titan); }

.ak-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px 20px; margin-top: clamp(40px, 6vw, 64px); }
.ak-step-wrap { display: flex; align-items: flex-start; gap: 20px; }
.ak-step { flex: 1; }
.ak-step .ak-why-num { font-size: 1.9rem; }
.ak-step-arrow { flex-shrink: 0; margin-top: 10px; color: var(--ak-gold); }
.ak-step-arrow path { stroke-dasharray: 1; stroke-dashoffset: 0; }

/* ---------- CRM ---------- */
.ak-crm { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 28px; }
.ak-crm-card { padding: clamp(20px, 3vw, 32px); }
.ak-crm-t { font-size: 1.35rem; }
.ak-crm-card .ak-why-d { margin-top: 10px; font-size: 0.95rem; }

/* ---------- Технологии (плитки марок) ---------- */
.ak-brands { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-top: 28px; }
.ak-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 10px 18px; text-align: center; }
.ak-brand-logo {
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  background: var(--ak-titan);
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
  transition: background-color 0.2s;
}
.ak-brand:hover .ak-brand-logo { background: var(--ak-gold); }
.ak-brand-t { font-weight: 600; font-size: 0.95rem; }
.ak-brand-d { font-size: 0.78rem; line-height: 1.35; color: var(--ak-titan); }

/* ---------- Счётчики ---------- */
.ak-trust { border-block: 1px solid var(--ak-steel); background: var(--ak-graphite); }
.ak-trust-in { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px 16px; padding-block: 48px; }
.ak-trust-num { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.ak-trust-label { margin-top: 4px; font-size: 0.875rem; color: var(--ak-titan); }

/* ---------- Финал ---------- */
.ak-final { max-width: 1240px; }
.ak-final .ak-h2 { font-size: clamp(2rem, 5vw, 3.6rem); }
.ak-final-text { margin-top: 22px !important; max-width: 68ch; color: rgba(236, 238, 241, 0.84); }
.ak-final-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.ak-made {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: clamp(40px, 6vw, 72px) !important;
  padding-top: 24px !important;
  border-top: 1px solid var(--ak-steel);
  font-size: 0.86rem;
  color: var(--ak-titan);
}
.ak-made .ak-logo { font-size: 1.1rem; }

/* ---------- Появления (только с JS и без reduced-motion) ---------- */
.ak.js-sc [data-sc='reveal'] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ak-ease), transform 0.7s var(--ak-ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.ak.js-sc [data-sc='reveal'].in-view { opacity: 1; transform: none; }
.ak.js-sc [data-sc='steps'] .ak-step {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s, transform 0.5s var(--ak-ease);
  transition-delay: calc(var(--i, 0) * 140ms);
}
.ak.js-sc [data-sc='steps'] .ak-step-arrow path {
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.5s ease-out;
  transition-delay: calc(140ms + var(--i, 0) * 140ms);
}
.ak.js-sc [data-sc='steps'].in-view .ak-step { opacity: 1; transform: none; }
.ak.js-sc [data-sc='steps'].in-view .ak-step-arrow path { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
  .ak-rise { animation: none; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 1023px) {
  .ak-site-nav { display: none; }
  .ak-bb { grid-template-columns: 1fr; }
  .ak-bb-stage { max-width: 440px; }
  .ak-why { grid-template-columns: repeat(2, 1fr); }
  .ak-services { grid-template-columns: repeat(3, 1fr); }
  .ak-brands { grid-template-columns: repeat(3, 1fr); }
  .ak-steps { grid-template-columns: repeat(2, 1fr); }
  .ak-step-arrow { display: none; }
}
@media (max-width: 767px) {
  .ak-search { grid-template-columns: 1fr 1fr; }
  .ak-search-go { grid-column: 1 / -1; }
  .ak-field { padding: 12px 14px; font-size: 0.9rem; }
  .ak-hero-media { object-position: 50% 40%; }
  /* на узком экране боковое затемнение съедает машину — оставляем только вертикальное */
  .ak-hero-shade {
    background: linear-gradient(180deg, rgba(10, 11, 13, 0.55) 0%, rgba(10, 11, 13, 0) 28%, rgba(10, 11, 13, 0.55) 52%, rgba(10, 11, 13, 0.98) 100%);
  }
  .ak-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ak-types { grid-template-columns: 1fr; gap: 24px; }
  .ak-services { grid-template-columns: repeat(2, 1fr); }
  .ak-crm { grid-template-columns: 1fr; }
  .ak-trust-in { grid-template-columns: repeat(2, 1fr); }
  .ak-swatch-chip { height: 48px; }
}
@media (max-width: 479px) {
  .ak-swatches { grid-template-columns: repeat(2, 1fr); }
  .ak-why, .ak-steps { grid-template-columns: 1fr; }
  .ak-site-header .ak-btn { display: none; }
}
