/* ==========================================================================
   AIM landing — content sections layer.
   Hero, logos strip, vision callout, aurora CTA.
   Stage-specific styles live in landing-stage.css.
   ========================================================================== */

/* ==========================================================================
   HERO — Schlieren WebGL background.

   The actual visual is rendered by landing-schlieren.js into a <canvas>
   injected into .aim-hero__bg. CSS here only:
     • establishes the bg layer / clipping region
     • hides the legacy aurora placeholders (kept in DOM for compat)
     • styles the canvas + error overlay
   ========================================================================== */
/* Изначальный фон hero — чистый белый. Шапка при этом прозрачна, так что
   сверху страницы читается ровное белое поле без «бг у шапки». Как только
   каскад сот начинается, ультрамарин заливается поверх белого. */
.aim-hero {
  position: relative;
  margin-top: calc(-1 * var(--aim-nav-h));
  padding: calc(120px + var(--aim-nav-h)) 0 88px;
  overflow: hidden;
  isolation: isolate;
  background: #ffffff;
}

.aim-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: #ffffff;
}

/* ==========================================================================
   HERO HEX OVERLAY + MASK REVEAL — см. landing-hex.js.

   Слои внутри .aim-hero (isolation: isolate):
      0. .aim-hero__hex-base    — статичная еле-видная сетка
      1. .aim-hero__inner       — ОРИГИНАЛ: тёмный текст на светлом фоне
      2. .aim-hero__hex-anim    — ультрамариновая заливка, каскад top→down
      3. .aim-hero__inner-white — БЕЛЫЙ клон, замаскирован #aim-hex-mask
                                  (виден только внутри уже залитых сот)

   Класс `.aim-hero.is-hex-active` (JS ставит через 0.4s после входа во
   viewport) запускает синхронно:
     • заливку синих сот   (.aim-hero__hex-anim polygon → aim-hex-activate)
     • открытие маски      (.aim-hex-mask-poly         → aim-hex-mask-reveal)
   Ключевые кадры совпадают 1-в-1, поэтому белые элементы появляются строго
   внутри уже залитых синих сот. Никакого global repaint.
   ========================================================================== */
.aim-hero__hex-base,
.aim-hero__hex-anim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.aim-hero__hex-base { z-index: 0; }
.aim-hero__hex-anim { z-index: 2; }

.aim-hero__hex-base svg,
.aim-hero__hex-anim svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* SVG <defs> контейнер с маской — физически невидим, нужен только для
   ссылки из CSS `mask: url(#aim-hex-mask)`. */
.aim-hero__hex-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* --- Слой 0: еле-видная статичная сетка ---------------------------------- */
.aim-hero__hex-base polygon {
  fill: none;
  stroke: var(--aim-ink);
  stroke-opacity: 0.03;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* --- Слой 2: анимируемые соты (ультрамариновая заливка) ------------------
   Только fill-opacity 0→1. Никакого trace'а контура белым ПЕРЕД заливкой
   (раньше stroke-dashoffset «рисовал» белый контур до того, как сота
   наливалась — это убрано). Бордер сразу еле-видимый, постоянный. */
.aim-hero__hex-anim polygon {
  fill: var(--aim-accent);           /* ultramarine #2638e8 */
  fill-opacity: 0;
  stroke: #ffffff;                   /* еле видимый белый бордер */
  stroke-opacity: 0.09;
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.aim-hero.is-hex-active .aim-hero__hex-anim polygon {
  animation: aim-hex-activate 6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes aim-hex-activate {
  0%   { fill-opacity: 0; }
  100% { fill-opacity: 1; }
}

/* Hover: сота под курсором моментально белая, а обратное возвращение к
   ультрамарину — медленное. За счёт этой асимметрии при движении мыши
   остаётся видимый «шлейф» из недавно задетых сот.
   Класс .is-hover выставляется из landing-hex.js по mousemove.

   Трюк с двумя transition: transition активного состояния применяется при
   ВХОДЕ в это состояние. Значит:
     • :hover-add (быстро): берёт transition из .is-hover  → 120ms
     • :hover-remove (медленно): берёт transition из базового полигона → 900ms
*/
.aim-hero__hex-anim polygon {
  transition: fill 3600ms cubic-bezier(0.4, 0, 0.2, 1),
              fill-opacity 3600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.aim-hero__hex-anim polygon.is-hover {
  /* средний ультрамарин — темнее пастельного, но светлее базового fill,
     читается как highlight поверх основного #2638e8 */
  fill: #7c87f0;
  fill-opacity: 1;
  transition: fill 120ms ease-out, fill-opacity 120ms ease-out;
}

/* --- Слой 3: белый клон контента, замаскирован SVG-маской ---------------- */
.aim-hero__inner-white {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  /* маска: черный фон (скрыто) + белые полигоны (открыто); fill-opacity
     анимируется синхронно с синей заливкой. */
  mask: url(#aim-hex-mask);
  -webkit-mask: url(#aim-hex-mask);
}
/* Внутренняя обёртка повторяет padding hero — чтобы .aim-hero__inner внутри
   клона лежал ровно поверх оригинала (тот же padding-top/bottom + flow). */
.aim-hero__inner-white-pad {
  padding: calc(120px + var(--aim-nav-h)) 0 88px;
  height: 100%;
  box-sizing: border-box;
}
.aim-hero__inner-white .aim-hero__inner {
  z-index: auto;
}

/* --- Маска: полигоны анимируются белым fill-opacity (0→1) ---------------- */
.aim-hex-mask-poly {
  fill: #ffffff;
  fill-opacity: 0;
}
.aim-hero.is-hex-active .aim-hex-mask-poly {
  animation: aim-hex-mask-reveal 6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes aim-hex-mask-reveal {
  /* timeline 1-в-1 с aim-hex-activate — белый клон появляется ровно по
     мере того, как синяя заливка появляется в этой же соте */
  0%   { fill-opacity: 0; }
  100% { fill-opacity: 1; }
}

/* --- Окраска белого клона: все элементы → белый. Оригинал не трогаем. --- */
.aim-hero__inner-white,
.aim-hero__inner-white * {
  color: #ffffff !important;
}
.aim-hero__inner-white .aim-hero__line--accent {
  color: #ffffff !important;
}
.aim-hero__inner-white .aim-eyebrow__dot,
.aim-hero__inner-white .aim-hero__engine-dot {
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18) !important;
}
.aim-hero__inner-white .aim-hero__bullet-tick path {
  stroke: #ffffff !important;
}
.aim-hero__inner-white .aim-btn--primary,
.aim-hero__inner-white .aim-btn--ghost {
  background: transparent !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
.aim-hero__inner-white .aim-hero__engine {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
}

@media (prefers-reduced-motion: reduce) {
  .aim-hero.is-hex-active .aim-hero__hex-anim polygon,
  .aim-hero.is-hex-active .aim-hex-mask-poly { animation: none; }
}

.aim-hero__inner {
  position: relative;
  z-index: 1;                    /* hex-base (0) < inner (1) < hex-anim (2) < inner-white (3) */
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
}

/* HUGE display headline — modern grotesk (Geist). Вес 500 компенсирует
   отсутствие serif-контраста; tracking минус ~4% для масштаба 2026. */
.aim-hero__headline {
  font-family: var(--aim-font-display);
  font-weight: 500;
  font-size: clamp(44px, 8vw, 112px);
  line-height: 0.94;
  letter-spacing: -0.038em;
  color: var(--aim-ink);
  margin: 8px 0 28px;
}
.aim-hero__line { display: block; }
.aim-hero__line--accent {
  font-weight: 500;
  color: var(--aim-accent);
  font-style: normal;
}

.aim-hero__lead {
  max-width: 640px;
  margin: 0 auto 28px;
  font-size: clamp(15px, 1.25vw, 18px);
  color: var(--aim-ink-3);
  line-height: 1.55;
}

.aim-hero__bullets {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin: 0 auto 36px;
  font-family: var(--aim-font-mono);
}
.aim-hero__bullet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--aim-ink-2);
  letter-spacing: 0.02em;
}
.aim-hero__bullet-tick {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: var(--aim-accent);
}

.aim-hero__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.aim-hero__engine {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--aim-line);
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--aim-font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--aim-ink-3);
}
.aim-hero__engine-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--aim-accent);
  box-shadow: 0 0 0 4px rgba(38,56,232,0.18);
}

@media (max-width: 720px) {
  .aim-hero { padding: 72px 0 56px; }
  /* Клон-обёртка должна повторять padding hero 1-в-1, иначе белый слой
     смещается относительно оригинала на мобильной. */
  .aim-hero__inner-white-pad { padding: 72px 0 56px; }
  .aim-hero__bullets { flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; max-width: 320px; }
  .aim-hero__engine { font-size: 10.5px; padding: 9px 14px; }
}

/* ==========================================================================
   LOGOS STRIP
   ========================================================================== */
.aim-logos {
  padding: 56px 0 72px;
  background: var(--aim-bg);
  border-bottom: 1px solid var(--aim-line);
}
.aim-logos__eyebrow {
  font-family: var(--aim-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aim-ink-4);
  text-align: center;
  margin: 0 0 36px;
}
.aim-logos__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 32px 24px;
  align-items: center;
  justify-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.aim-logos__item {
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--aim-ink-4);
  font-weight: 500;
  opacity: 0.75;
  transition: color 0.2s var(--aim-ease), opacity 0.2s var(--aim-ease);
  white-space: nowrap;
}
.aim-logos__item:hover { color: var(--aim-ink); opacity: 1; }
.aim-logos__item--serif {
  font-family: var(--aim-font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.aim-logos__item--mono {
  font-family: var(--aim-font-mono);
  font-size: 15px;
  letter-spacing: 0.03em;
}

@media (max-width: 960px) { .aim-logos__grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .aim-logos__grid { grid-template-columns: repeat(3, 1fr); gap: 24px 16px; } }

/* ==========================================================================
   VISION CALLOUT (above footer)
   ========================================================================== */
.aim-vision {
  padding: 56px 0 96px;
  background: var(--aim-bg);
}
.aim-vision__card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  padding: 56px;
  background: transparent;
  border: 1px solid var(--aim-line);
  border-radius: 0;
}
.aim-vision__col--head { display: flex; flex-direction: column; justify-content: flex-start; }
.aim-vision__headline {
  font-family: var(--aim-font-display);
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.06;
  letter-spacing: -0.032em;
  color: var(--aim-ink);
}
.aim-vision__col--body { display: flex; flex-direction: column; gap: 18px; }
.aim-vision__lead {
  font-size: 16px;
  color: var(--aim-ink-3);
  line-height: 1.6;
}
.aim-vision__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--aim-ink);
  text-decoration: underline;
  text-decoration-color: var(--aim-line-strong);
  text-underline-offset: 5px;
  align-self: flex-start;
  transition: text-decoration-color 0.2s var(--aim-ease), color 0.2s var(--aim-ease);
}
.aim-vision__cta:hover { color: var(--aim-accent); text-decoration-color: var(--aim-accent); }

@media (max-width: 800px) {
  .aim-vision__card { grid-template-columns: 1fr; gap: 24px; padding: 40px 28px; }
}

/* ==========================================================================
   AURORA FINAL CTA
   ========================================================================== */
.aim-aurora {
  position: relative;
  isolation: isolate;
  padding: 140px 0 200px;
  background: var(--aim-bg);
  overflow: hidden;
  border-top: 1px solid var(--aim-line);
}
.aim-aurora__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.aim-aurora__band {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.7;
}
.aim-aurora__band--a {
  width: 80%; height: 420px;
  background: radial-gradient(ellipse, rgba(38,56,232,0.34), transparent 70%);
  bottom: -120px; left: 10%;
}
.aim-aurora__band--b {
  width: 60%; height: 380px;
  background: radial-gradient(ellipse, rgba(90,120,245,0.28), transparent 70%);
  bottom: -80px; left: 5%;
}
.aim-aurora__band--c {
  width: 40%; height: 320px;
  background: radial-gradient(ellipse, rgba(150,170,250,0.32), transparent 70%);
  bottom: -60px; right: 10%;
}
.aim-aurora__horizon {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(38,56,232,0.6), transparent);
  filter: blur(0.5px);
}

.aim-aurora__inner { position: relative; text-align: center; max-width: 880px; margin: 0 auto; }
.aim-aurora__headline {
  font-family: var(--aim-font-display);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 0.96;
  letter-spacing: -0.038em;
  margin: 8px 0 22px;
  color: var(--aim-ink);
}
.aim-aurora__lead {
  font-size: 17px;
  color: var(--aim-ink-2);
  margin: 0 0 32px;
}
.aim-aurora__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .aim-aurora { padding: 96px 0 140px; }
}
