/* ───────────────────────────────────────────────
   Audi Community Almaty — audicommunity.com
   Шрифт: Audi Type Variable (wght 400–700, wdth 100–130)
   ─────────────────────────────────────────────── */

@font-face {
  font-family: "Audi Type";
  src: url("../fonts/AudiTypeVF.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-stretch: 100% 130%;
  font-display: swap;
}

:root {
  --red: #e51132;
  --black: #000000;
  --white: #ffffff;

  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.32);
  --muted: rgba(255, 255, 255, 0.62);

  /* фирменный наклон параллелограмма Audi — 28° */
  --skew: -28deg;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1320px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: "Audi Type", "Helvetica Neue", Arial, sans-serif;
  font-variation-settings: "wght" 400, "wdth" 100;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

/* Экранный ридер */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Надзаголовок / метка ────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(11px, 1.1vw, 13px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-variation-settings: "wght" 700, "wdth" 100;
}

/* Тот же знак Audi Sport в мелком размере — пропорции задаёт aspect-ratio */
.eyebrow::before {
  content: "";
  width: 26px;
  aspect-ratio: 299 / 186;
  background: url("../img/audi-sport.svg") no-repeat center / contain;
  flex: none;
}

/* ── Шапка ───────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

/* Кольца Audi — пропорции задаёт сам файл, задаём только высоту */
.header__logo img { height: clamp(22px, 2.6vw, 30px); width: auto; }

.header__nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 38px);
}

.header__nav a {
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 0.25s var(--ease);
}

.header__nav a:hover { color: var(--white); }

@media (max-width: 720px) {
  .header__nav { display: none; }
}

/* ── Кнопки ──────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 19px 34px;
  font: inherit;
  font-size: clamp(14px, 1.3vw, 16px);
  font-variation-settings: "wght" 700, "wdth" 100;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}

/* заливка, выезжающая под фирменным углом */
.btn::before {
  content: "";
  position: absolute;
  inset: -2px -30px;
  z-index: -1;
  transform: skewX(var(--skew)) translateX(-115%);
  transition: transform 0.45s var(--ease);
}

.btn:hover::before,
.btn:focus-visible::before { transform: skewX(var(--skew)) translateX(0); }

.btn__arrow {
  flex: none;
  transition: transform 0.35s var(--ease);
}

.btn:hover .btn__arrow { transform: translateX(6px); }

.btn--primary {
  background: var(--red);
  color: var(--white);
}
.btn--primary::before { background: var(--white); }
.btn--primary:hover,
.btn--primary:focus-visible { color: var(--black); }

.btn--ghost {
  background: transparent;
  color: var(--white);
  border-color: var(--line-strong);
}
.btn--ghost::before { background: var(--white); }
.btn--ghost:hover,
.btn--ghost:focus-visible {
  color: var(--black);
  border-color: var(--white);
}

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

/* ── Первый экран ────────────────────────────── */
.hero {
  position: relative;
  padding-top: clamp(56px, 12vh, 132px);
  padding-bottom: clamp(56px, 11vh, 118px);
  overflow: hidden;
}

/* Фирменный знак Audi Sport на фоне.
   Только масштабируется — пропорции 299:186 задаёт сам SVG,
   height: auto обязателен, иначе знак растянется. */
.hero__slash {
  position: absolute;
  top: 44%;
  right: -8%;
  width: min(36vw, 500px);
  height: auto;
  z-index: 0;
  pointer-events: none;
}

/* На узких экранах уводим знак в пустой верхний угол,
   чтобы он не наезжал на текст */
@media (max-width: 900px) {
  .hero__slash {
    top: 0;
    right: -30%;
    width: min(78vw, 380px);
  }
}

/* тонкая сетка-подложка */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: calc(100% / 6) 100%;
  opacity: 0.5;
  pointer-events: none;
}

.hero .wrap { position: relative; z-index: 2; }

/* Кегль заголовка привязан к ширине контейнера:
   «Информационный» в начертании Extended занимает 13.6em,
   поэтому 7.05cqw гарантирует, что слово впишется на любой ширине */
.hero__head { container-type: inline-size; }

/* Логотип A3 KZ на первом экране — только масштаб, пропорции из файла */
.hero__brand {
  width: clamp(112px, 13vw, 172px);
  height: auto;
}

.hero h1 {
  margin: 26px 0 0;
  font-size: min(7.05cqw, 104px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  /* «растянутое» начертание — ось wdth на максимуме */
  font-variation-settings: "wght" 700, "wdth" 130;
  text-transform: uppercase;
}

.hero h1 .accent { color: var(--red); }

.hero__body { margin-top: clamp(34px, 4.6vw, 58px); }

.hero__lead {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(16px, 1.7vw, 21px);
  line-height: 1.6;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(30px, 3.6vw, 44px);
}

@media (max-width: 560px) {
  .hero__actions { display: grid; gap: 12px; }
  .hero__actions .btn { justify-content: space-between; }
}

/* Нижняя строка характеристик */
.hero__meta {
  margin: clamp(44px, 6vw, 76px) 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 48px);
}

@media (max-width: 640px) {
  .hero__meta { grid-template-columns: 1fr; gap: 18px; }
  .hero__meta div { display: flex; justify-content: space-between; gap: 20px; }
}

.hero__meta dt {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__meta dd {
  margin: 8px 0 0;
  font-size: clamp(15px, 1.5vw, 18px);
  font-variation-settings: "wght" 700, "wdth" 105;
}

@media (max-width: 640px) {
  .hero__meta dd { margin: 0; }
}

/* ── Бегущая строка ──────────────────────────── */
.ticker {
  border-block: 1px solid var(--line);
  padding: 18px 0;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.ticker__track {
  display: inline-flex;
  align-items: center;
  gap: 30px;
  padding-right: 30px;
  animation: ticker 38s linear infinite;
  will-change: transform;
}

.ticker span {
  font-size: clamp(13px, 1.4vw, 16px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-variation-settings: "wght" 700, "wdth" 115;
}

.ticker i {
  display: inline-block;
  width: 22px;
  aspect-ratio: 299 / 186;
  background: url("../img/audi-sport.svg") no-repeat center / contain;
  flex: none;
}

@keyframes ticker {
  to { transform: translateX(-50%); }
}

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

/* ── Секции ──────────────────────────────────── */
.section {
  padding-block: clamp(64px, 10vw, 132px);
}

.section__head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: end;
  gap: 26px clamp(32px, 4vw, 64px);
  margin-bottom: clamp(38px, 5vw, 66px);
}

@media (max-width: 900px) {
  .section__head { grid-template-columns: 1fr; align-items: start; }
}

/* Кегль так же привязан к контейнеру: длинные слова
   в начертании Extended иначе вылезают за колонку */
.section__head > div:first-child { container-type: inline-size; }

.section__head h2 {
  margin: 18px 0 0;
  font-size: min(5.5cqw, 62px);
  line-height: 1.0;
  letter-spacing: -0.015em;
  font-variation-settings: "wght" 700, "wdth" 130;
  text-transform: uppercase;
}

/* Карточки направлений */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 268px), 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.card {
  position: relative;
  padding: clamp(28px, 3.4vw, 42px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: clamp(220px, 24vw, 300px);
  display: flex;
  flex-direction: column;
  transition: background-color 0.4s var(--ease);
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.card:hover { background: rgba(255, 255, 255, 0.04); }
.card:hover::after { transform: scaleX(1); }

.card__num {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--red);
  font-variation-settings: "wght" 700, "wdth" 100;
}

.card h3 {
  margin: 20px 0 0;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.15;
  letter-spacing: -0.005em;
  font-variation-settings: "wght" 700, "wdth" 105;
  text-transform: uppercase;
}

.card p {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.card__soon {
  margin-top: auto;
  padding-top: 22px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

/* ── Финальный призыв ────────────────────────── */
.cta {
  position: relative;
  border-top: 1px solid var(--line);
  padding-block: clamp(68px, 10vw, 128px);
  overflow: hidden;
}

.cta__slash {
  position: absolute;
  top: 50%;
  left: -6%;
  width: min(34vw, 460px);
  height: auto;
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
}

/* На десктопе освобождаем под знак левую полосу,
   на узких экранах уводим его вниз за текст */
@media (min-width: 901px) {
  .cta__inner { padding-left: min(24vw, 300px); }
}

@media (max-width: 900px) {
  .cta__slash {
    top: auto;
    bottom: -8%;
    left: auto;
    right: -34%;
    width: min(72vw, 340px);
    transform: none;
  }
}

.cta .wrap { position: relative; z-index: 1; }

.cta__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(28px, 4vw, 60px);
}

.cta__text { container-type: inline-size; flex: 1 1 380px; }

.cta h2 {
  margin: 16px 0 0;
  max-width: 16ch;
  font-size: min(11cqw, 70px);
  line-height: 0.98;
  letter-spacing: -0.015em;
  font-variation-settings: "wght" 700, "wdth" 130;
  text-transform: uppercase;
}

.cta__note {
  margin: 20px 0 0;
  max-width: 34ch;
  font-size: 15px;
  color: var(--muted);
}

/* ── Подвал ──────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(44px, 6vw, 72px);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.footer__rings img,
.footer__brand img { width: clamp(96px, 11vw, 132px); height: auto; }

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 2.4vw, 34px);
  font-size: 14px;
  color: var(--muted);
}

.footer__links a { transition: color 0.25s var(--ease); }
.footer__links a:hover { color: var(--white); }

.footer__legal {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.42);
  max-width: 78ch;
}

/* ── Появление при скролле ───────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto !important; }
}

html { scroll-behavior: smooth; }
