/* =========================================================
   Базовые стили: токены, сброс, общие компоненты
   ========================================================= */

:root {
  /* Цвета */
  --c-bg: #000;
  --c-surface: #141414;
  /* Стекло: заметнее на чёрном, чем в Тильде (там rgba(20,20,20,.3)) */
  --c-glass: rgba(26, 26, 28, 0.38);
  --c-glass-border: rgba(255, 255, 255, 0.05);
  --glass-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.03);
  --c-blue: #0269ff;
  --c-blue-dark: #0155cc;
  --c-blue-soft: #e6edff;
  --c-white: #fff;
  --c-text: #e6e6e6;
  --c-muted: #999;
  --c-dim: #666;

  /* Шрифты */
  --f-head: 'Mulish', Arial, sans-serif;
  --f-text: 'Inter', Arial, sans-serif;

  /* Сетка */
  --container: 1520px;
  --gutter: 16px;

  /* Хедер: отступ плашки от верха экрана */
  --header-top: 40px;

  /* Анимации */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 959px) {
  :root { --header-top: 32px; }
}
@media (max-width: 639px) {
  :root { --header-top: 16px; }
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background-color: var(--c-bg); }

body {
  color: var(--c-white);
  font-family: var(--f-text);
  font-size: 16px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { font-weight: inherit; }

::selection { background: var(--c-blue); color: #fff; }

/* Фокус только с клавиатуры */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 3px; border-radius: 8px; }

/* Скроллбар */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: rgba(28, 28, 28, 0.5); border-radius: 3px; }
* { scrollbar-color: rgba(28, 28, 28, 0.5) #000; scrollbar-width: thin; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Сетка ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section { padding-top: 160px; }

@media (max-width: 959px) { .section { padding-top: 120px; } }
@media (max-width: 639px) { .section { padding-top: 96px; } }

/* ---------- Типографика ---------- */
.h2 {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 48px;
  line-height: 1.2;
}
@media (max-width: 1519px) { .h2 { font-size: 40px; } }
@media (max-width: 959px)  { .h2 { font-size: 32px; } }

.section-title { text-align: center; margin-bottom: 64px; }
@media (max-width: 639px) { .section-title { margin-bottom: 40px; } }

.text-grey {
  background-image: linear-gradient(to right, #fff 0%, #666 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-blue {
  background-image: linear-gradient(to right, #3484ff 0%, #002b66 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Проявление серого градиента: маска едет слева направо.
   Позицию маски двигает JS (--reveal от 100% до 0%). */
.js-scroll-reveal,
.js-hero-reveal {
  background-image: linear-gradient(to right, #fff 0%, #666 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 30%, transparent 60%, transparent 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 30%, transparent 60%, transparent 100%);
  -webkit-mask-size: 300% 100%;
  mask-size: 300% 100%;
  -webkit-mask-position: var(--reveal, 100%) 0;
  mask-position: var(--reveal, 100%) 0;
}

@keyframes reveal-text {
  from { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  to   { -webkit-mask-position: 0% 0;   mask-position: 0% 0; }
}

/* ---------- Стекло ---------- */
.glass {
  background-color: var(--c-glass);
  border: 1px solid var(--c-glass-border);
  box-shadow: var(--glass-highlight);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
@media (max-width: 639px) {
  .glass { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
}

/* ---------- Кнопка ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: 16px;
  background: var(--c-blue);
  color: #fff;
  font-size: 18px;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover  { filter: brightness(0.95); transform: scale(1.02); box-shadow: 0 0 15px 0 rgba(2, 105, 255, 0.2); }
.btn:active { filter: brightness(0.9);  transform: scale(0.98); }

.btn--small {
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
}

/* ---------- Фоновые пятна ----------
   Лежат поверх секций, как в оригинале: подкрашивают всю страницу. */
.blob {
  position: fixed;
  z-index: 10; /* выше секций, ниже хедера */
  pointer-events: none;
  will-change: transform, border-radius;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background: radial-gradient(ellipse at 50% 50%, rgba(2, 105, 255, 0.65) 0%, rgba(1, 63, 153, 0.25) 55%, transparent 75%);
}
.blob--1 {
  --s: clamp(700px, 110vw, 1800px);
  width: var(--s); height: var(--s);
  top: calc(var(--s) / -2); left: calc(var(--s) / -2);
  opacity: 0.5;
  filter: blur(clamp(70px, 9vw, 180px));
  animation: morph-blob-1 20s ease-in-out infinite;
}
.blob--2 {
  --s: clamp(650px, 105vw, 1700px);
  width: var(--s); height: var(--s);
  top: calc(40vh - var(--s) / 2); right: calc(var(--s) / -2);
  opacity: 0.4;
  filter: blur(clamp(65px, 8vw, 170px));
  animation: morph-blob-2 26s ease-in-out -9s infinite;
}
.blob--3 {
  --s: clamp(600px, 100vw, 1600px);
  width: var(--s); height: var(--s);
  bottom: calc(var(--s) / -2); left: calc(35vw - var(--s) / 2);
  opacity: 0.36;
  filter: blur(clamp(60px, 8vw, 160px));
  animation: morph-blob-3 23s ease-in-out -15s infinite;
}
@media (max-width: 639px) {
  .blob { will-change: transform; border-radius: 50%; animation-name: none; }
}

@keyframes morph-blob-1 {
  0%, 100% { border-radius: 60% 40% 30% 70% / 100% 85% 92% 74%; transform: translate(0, 0) scale(1); }
  25%      { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;  transform: translate(3vw, 2vw) scale(1.05); }
  50%      { border-radius: 50% 60% 80% 20% / 25% 80% 20% 80%;  transform: translate(-2vw, 3vw) scale(0.96); }
  75%      { border-radius: 67% 33% 47% 53% / 37% 20% 80% 63%;  transform: translate(2vw, -2vw) scale(1.03); }
}
@keyframes morph-blob-2 {
  0%, 100% { border-radius: 30% 70% 70% 30% / 30% 52% 48% 70%; transform: translate(0, 0) scale(1); }
  33%      { border-radius: 70% 30% 46% 54% / 60% 40% 72% 40%; transform: translate(-3vw, 2vw) scale(1.08); }
  66%      { border-radius: 40% 60% 30% 70% / 70% 30% 60% 40%; transform: translate(2vw, -3vw) scale(0.93); }
}
@keyframes morph-blob-3 {
  0%, 100% { border-radius: 74% 26% 83% 17% / 53% 54% 46% 47%; transform: translate(0, 0) scale(1); }
  40%      { border-radius: 26% 74% 17% 83% / 46% 47% 53% 54%; transform: translate(2vw, -2vw) scale(1.06); }
  80%      { border-radius: 53% 47% 54% 46% / 74% 26% 83% 17%; transform: translate(-2vw, 2vw) scale(0.95); }
}

/* ---------- Уменьшение движения ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js-scroll-reveal, .js-hero-reveal { -webkit-mask-image: none; mask-image: none; }
}
