/* АкваКлима — site-wide layout & motion CSS
   Tokens live in tokens.css; this file is composition + motion only. */

/* overflow-x: clip (не hidden!) — обрезает горизонтальный вылет, но НЕ создаёт
   scroll-container, поэтому не ломает position:sticky у вложенных секций. */
html, body { margin: 0; padding: 0; overflow-x: clip; max-width: 100%; }
* { box-sizing: border-box; }
body {
  background: var(--aq-paper);
  color: var(--aq-ink);
  font-family: var(--aq-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

/* Selection — cool tint */
::selection { background: rgba(0, 168, 240, 0.22); color: var(--aq-ink); }

/* ----- Native scroll behaviour ----- */
html { scroll-behavior: smooth; }

/* ----- Generic reveal primitive ----- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 800ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }
.reveal[data-delay="5"] { transition-delay: 400ms; }
.reveal[data-delay="6"] { transition-delay: 480ms; }
.reveal[data-delay="7"] { transition-delay: 560ms; }

/* ----- Layout container ----- */
.aq-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
.aq-container--wide { max-width: 1440px; }
.aq-container--narrow { max-width: 880px; }

/* ----- Mobile padding ----- */
@media (max-width: 720px) {
  .aq-container { padding: 0 16px; }
  .aq-pad-section { padding-top: clamp(40px, 8vw, 64px); padding-bottom: clamp(40px, 8vw, 64px); }
  .aq-pad-section--tight { padding-top: clamp(28px, 6vw, 48px); padding-bottom: clamp(28px, 6vw, 48px); }

  /* Все inline grid'ы с многими колонками сводим к 1-2 на мобилке */
  [style*="repeat(6,"],
  [style*="repeat(5,"],
  [style*="repeat(4,"],
  [style*="repeat(3,"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  /* Footer sitemap — стек */
  [style*="minmax(0, 1.4fr) repeat(4"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    padding-bottom: 32px !important;
  }
  /* Любой 2-col асимметричный layout → 1 кол.
     React сериализует `0` в `0px` в inline-style, поэтому матчим по fr-числам. */
  [style*="1.2fr"],
  [style*="1.4fr"],
  [style*="1.1fr"],
  [style*="0.9fr"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  /* Большие display-шрифты — чуть меньше */
  .aq-display--hero { font-size: clamp(40px, 11vw, 64px); }
  .aq-display--h1 { font-size: clamp(32px, 9vw, 44px); }
  .aq-display--h2 { font-size: clamp(26px, 7vw, 36px); }
  /* Lead-параграфы — меньше */
  .aq-lead { font-size: 15px; }
  /* Nav — на мобилке убираем меню, оставляем лого и CTA */
  .aq-nav-links { display: none !important; }
  /* Логотип в Nav — компактный на мобилке */
  .aq-nav img { height: 16px !important; }
  /* Nav CTA — компактнее, чтобы не налезала на лого */
  .aq-nav-cta .aq-btn {
    padding: 8px 14px !important;
    font-size: 12px !important;
    height: auto !important;
    min-height: 0 !important;
  }
  /* На очень узких экранах — скрываем CTA и оставляем только лого */
}
@media (max-width: 380px) {
  .aq-nav-cta { display: none !important; }
}

/* На очень узких — таблицы и спецификации в 1 кол */
@media (max-width: 480px) {
  [style*="repeat(6,"],
  [style*="repeat(5,"],
  [style*="repeat(4,"],
  [style*="repeat(3,"],
  [style*="repeat(2,"] {
    grid-template-columns: 1fr !important;
  }
}

/* ----- Section paddings — tighter than typical marketing sites
        so sections feel substantive, not airy. ----- */
.aq-pad-section {
  padding-top: clamp(56px, 6vw, 96px);
  padding-bottom: clamp(56px, 6vw, 96px);
}
.aq-pad-section--tight {
  padding-top: clamp(40px, 4.5vw, 72px);
  padding-bottom: clamp(40px, 4.5vw, 72px);
}

/* ----- Typography helpers ----- */
.aq-display {
  font-family: var(--aq-font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 0.98;
  text-wrap: balance;
  color: var(--aq-ink);
}
.aq-display--hero { font-size: clamp(56px, 7.6vw, 120px); }
.aq-display--h1   { font-size: clamp(40px, 5.2vw, 80px); line-height: 1.02; }
.aq-display--h2   { font-size: clamp(32px, 3.8vw, 56px); font-weight: 500; line-height: 1.06; letter-spacing: -0.02em; }
.aq-display--h3   { font-size: clamp(24px, 2.4vw, 36px); font-weight: 500; line-height: 1.12; letter-spacing: -0.015em; }

.aq-eyebrow {
  font-family: var(--aq-font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--aq-cool-3);
}
.aq-eyebrow--mute { color: var(--aq-ink-3); }
.aq-eyebrow--heat { color: var(--aq-heat-3); }
.aq-eyebrow--paper { color: var(--aq-cool-1); }

.aq-lead {
  font-family: var(--aq-font-body);
  font-weight: 400;
  font-size: clamp(17px, 1.4vw, 22px);
  line-height: 1.5;
  color: var(--aq-ink-2);
  text-wrap: pretty;
}

.aq-body { font-family: var(--aq-font-body); font-size: 16px; line-height: 1.6; color: var(--aq-ink-2); }
.aq-mono { font-family: var(--aq-font-mono); font-size: 13px; color: var(--aq-ink-3); }

.aq-grad-text-cool {
  background: linear-gradient(135deg, #30CDFF 0%, #0078D4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.aq-grad-text-heat {
  background: linear-gradient(135deg, #FF8A3D 0%, #E62528 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ----- Buttons (rendered as plain anchors mostly) ----- */
.aq-btn {
  font-family: var(--aq-font-body);
  font-weight: 500;
  border-radius: var(--aq-radius-pill);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: background 200ms cubic-bezier(0.22,1,0.36,1), color 200ms, transform 120ms;
  white-space: nowrap;
}
.aq-btn--md { padding: 12px 22px; font-size: 15px; }
.aq-btn--lg { padding: 16px 28px; font-size: 16px; }
.aq-btn--primary { background: var(--aq-ink); color: #fff; }
.aq-btn--primary:hover { background: #1a2540; }
.aq-btn--cool { background: var(--aq-cool-2); color: #fff; }
.aq-btn--cool:hover { background: var(--aq-cool-3); }
.aq-btn--ghost { background: transparent; color: var(--aq-ink); border: 1px solid var(--aq-line-2); }
.aq-btn--ghost:hover { border-color: var(--aq-ink); }
.aq-btn--light { background: #fff; color: var(--aq-ink); box-shadow: var(--aq-shadow-2); }
.aq-btn--light:hover { box-shadow: var(--aq-shadow-3); }
.aq-btn:active { transform: scale(0.985); }
.aq-btn .aq-arrow { transition: transform 200ms; display: inline-block; }
.aq-btn:hover .aq-arrow { transform: translateX(4px); }

/* ----- Surfaces ----- */
.aq-surface-paper2 { background: var(--aq-paper-2); }
.aq-surface-stone  { background: var(--aq-stone); }
.aq-surface-deep   { background: var(--aq-deep); color: var(--aq-paper); }
.aq-surface-sky    { background: linear-gradient(180deg, #EAF6FF 0%, #FFFFFF 100%); }

/* ----- Hairline ----- */
.aq-hairline { height: 1px; background: var(--aq-line); width: 100%; }

/* ----- Sticky nav glass ----- */
/* Nav — стеклянная пилюля по центру сверху (как на design/story) */
.aq-nav {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  width: min(1280px, calc(100% - 40px));
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: 0 8px 32px rgba(20,40,70,.12);
}
@media (max-width: 900px) {
  .aq-nav { padding: 10px 18px; }
}

/* ----- Cards / radii ----- */
.aq-card {
  background: var(--aq-paper);
  border-radius: var(--aq-radius-lg);
  box-shadow: var(--aq-shadow-2);
  overflow: hidden;
}

/* ----- Photo placeholder fallback ----- */
.aq-photo-fallback {
  background: linear-gradient(180deg, #DAE7F1 0%, #EEF4F9 100%);
  position: relative;
}

/* ----- Focus ring ----- */
:focus-visible { outline: none; box-shadow: var(--aq-shadow-focus); border-radius: 6px; }

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

/* ----- Hide scrollbar utility ----- */
.aq-noscrollbar::-webkit-scrollbar { display: none; }
.aq-noscrollbar { scrollbar-width: none; }

/* ----- Блок «Статьи и новости» (NewsTeaser) -----
   В разметке лежат все материалы сразу — это нужно поисковым роботам.
   Десктоп: горизонтальная карусель, видно три карточки, остальные листаются
   стрелками. Мобильная версия: колонка с кнопкой «Показать ещё». */
.aq-nt-track {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0;
  -webkit-overflow-scrolling: touch;
}
.aq-nt-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 calc((100% - 44px) / 3);
  scroll-snap-align: start;
}
.aq-nt-arrow {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--aq-line-2);
  background: transparent;
  color: var(--aq-ink);
  font-family: Onest, sans-serif; font-size: 16px; line-height: 1;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, opacity 200ms ease;
}
.aq-nt-arrow:hover:not(:disabled) { background: var(--aq-paper); border-color: var(--aq-ink-3); }
.aq-nt-arrow:disabled { opacity: 0.35; cursor: default; }
.aq-nt-more { display: none; }

@media (max-width: 1024px) {
  .aq-nt-card { flex-basis: calc((100% - 22px) / 2); }
}

@media (max-width: 720px) {
  /* Карусель разворачивается в обычную колонку — листаем кнопкой, а не пальцем */
  .aq-nt-track { display: grid; grid-template-columns: 1fr; overflow: visible; }
  .aq-nt-card--rest { display: none; }
  .aq-nt-arrow { display: none; }
  .aq-nt-more {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    margin-top: 22px;
    padding: 14px 20px;
    border-radius: 999px;
    border: 1px solid var(--aq-line-2);
    background: transparent;
    color: var(--aq-ink);
    font-family: Onest, sans-serif; font-size: 14px; font-weight: 500;
    cursor: pointer;
  }
}
