/* Metrika — лендинг. Тёмная тема в брендовых тонах (синий акцент + Stem-заголовки).
   Правила: только дизайн-токены, mobile-first (расширяем через min-width),
   z-index через переменные, интерактив — семантические элементы. */

@font-face {
  font-family: 'Stem';
  src:
    url('fonts/Stem-Medium.woff2') format('woff2'),
    url('fonts/Stem-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Фоны и поверхности (тёмный navy) */
  --bg: #0d1a2b;
  --surface: #142744;
  --card: #142744;
  --card-solid: #172c4d;

  /* Бренд */
  --accent: #5b8def; /* синий Metrika для тёмного фона */
  --accent-soft: rgba(91, 141, 239, 0.14);
  --success: #37c98d; /* зелёный акцент-хайлайт (как «IA» у guardia) */
  --premium: #9b7bff;

  /* Текст */
  --text: #eaf1fb;
  --text-muted: #a6b8d3;
  --text-dim: #7188a8;

  /* Границы и тени */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow-card: 0 12px 28px rgba(3, 10, 22, 0.35);

  /* Радиусы */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Ритм и типографика */
  --container: 1320px;
  --gutter: 20px;
  --section-y: 64px;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Stem', var(--font-body);

  /* Слои */
  --z-header: 100;
  --z-menu: 90;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}

p {
  margin: 0;
}

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

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

.accent {
  color: var(--accent);
}

.accent-2 {
  color: var(--success);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Раскладка ─────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}

.section__title {
  font-size: 28px;
}

.section__subtitle {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 16px;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ── Кнопки ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.btn--primary {
  background: var(--accent);
  color: #071426;
}

.btn--primary:hover {
  background: #6f9bf2;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn--block {
  width: 100%;
}

/* ── Шапка ─────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
}

.brand__mark {
  width: 30px;
  height: 30px;
  color: var(--accent);
}

.nav {
  display: none;
  align-items: center;
  gap: 28px;
}

.nav a {
  color: var(--text-muted);
  font-size: 15px;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--text);
}

.header__actions {
  display: none;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Мобильное меню */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px var(--gutter) 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu a {
  padding: 12px 4px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.mobile-menu .btn {
  margin-top: 12px;
}

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 64px); /* фолбэк для браузеров без dvh */
  min-height: calc(100dvh - 64px); /* минус высота залипающей шапки */
  padding-block: 56px;
  text-align: center;
  overflow: hidden;
  background: var(--bg) url('img/hero.webp') no-repeat;
  background-size: cover;
  background-position: center;
}

/* Затемнение поверх арта: читаемость текста + плавный переход в фон снизу.
   На мобильном — равномернее (текст по центру), на десктопе переопределяем на левый градиент. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(13, 26, 43, 0.62) 0%,
    rgba(13, 26, 43, 0.82) 55%,
    var(--bg) 100%
  );
}

.hero > .container {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.hero__badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.hero__title {
  font-size: 38px;
  max-width: 15ch;
  margin-inline: auto;
}

.hero__subtitle {
  margin: 20px auto 0;
  max-width: 60ch;
  color: var(--text-muted);
  font-size: 17px;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-top: 32px;
}

.hero__note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-dim);
}

.hero__login {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.hero__login a {
  color: var(--accent);
  font-weight: 600;
}

/* ── Сетка возможностей ────────────────────────────────── */
.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-strong);
}

/* «Фонарик»: мягкое пятно света на поверхности + светящаяся кромка у курсора.
   Координаты --mx/--my задаёт JS. */
.card::before,
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* Мягкое пятно на поверхности (screen подсвечивает, не перекрывая текст) */
.card::after {
  z-index: 2;
  mix-blend-mode: screen;
  background: radial-gradient(
    320px circle at var(--mx, 50%) var(--my, 50%),
    rgba(130, 175, 255, 0.3),
    rgba(130, 175, 255, 0.08) 32%,
    transparent 62%
  );
}

/* Светящаяся кромка карточки у курсора (маска оставляет только рамку) */
.card::before {
  z-index: 3;
  padding: 1px;
  background: radial-gradient(
    280px circle at var(--mx, 50%) var(--my, 50%),
    rgba(150, 190, 255, 0.75),
    transparent 60%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.card:hover::before,
.card:hover::after {
  opacity: 1;
}

@media (hover: none) {
  .card::before,
  .card::after {
    display: none;
  }
}

/* Появление при скролле: класс reveal вешает JS, is-visible — при входе в экран */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.card__title {
  font-size: 20px;
  margin-bottom: 10px;
}

.card__text {
  color: var(--text-muted);
  font-size: 15px;
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}

.card__link:hover {
  gap: 10px;
}

/* Карточка с картинкой-обложкой: фото сверху во всю ширину, текст под ним */
.card--media {
  padding: 0;
  overflow: hidden;
}

.card__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.card__body {
  padding: 26px;
}

/* ── Статистика ────────────────────────────────────────── */
.stats {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.stats__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  text-align: center;
}

.stat__value {
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--text);
  line-height: 1;
}

.stat__label {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ── «Почему Metrika» ───────────────────────────────────── */
.why__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.why__item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.why__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Иконка-картинка: без фон-плашки, размер 128×128 */
.why__icon--image {
  width: 128px;
  height: 128px;
  background: none;
  border-radius: 0;
}

.why__icon--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.why__title {
  font-size: 21px;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.why__text {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
}

/* ── Блок-акцент (аналитика) ───────────────────────────── */
.spotlight__inner {
  display: grid;
  gap: 32px;
  align-items: center;
}

.spotlight__title {
  font-size: 26px;
}

.spotlight__text {
  margin-top: 16px;
  color: var(--text-muted);
}

.spotlight__list {
  margin: 20px 0 28px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.spotlight__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-muted);
}

.spotlight__list svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--success);
  margin-top: 2px;
}

/* Мок-дашборд из CSS (без картинок) */
.dashboard {
  background: var(--card-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.dashboard__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.dashboard__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.dashboard__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--success);
  border: 1px solid rgba(55, 201, 141, 0.35);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

.dashboard__live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.dashboard__tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.dashboard__tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.dashboard__tile b {
  font-family: var(--font-display);
  font-size: 20px;
  display: block;
}

.dashboard__tile small {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
}

.dashboard__delta {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--success);
}

.dashboard__chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 8px;
  border-bottom: 1px solid var(--border);
}

.dashboard__bar {
  flex: 1;
  border-radius: 5px 5px 0 0;
  background: var(--accent);
  transform-origin: bottom;
}

.dashboard__bar--peak {
  background: var(--success);
}

/* Столбцы «вырастают» при появлении секции (только когда анимация разрешена) */
.dashboard.reveal .dashboard__bar {
  transform: scaleY(0);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.dashboard.reveal.is-visible .dashboard__bar {
  transform: scaleY(1);
}

.dashboard.reveal .dashboard__bar:nth-child(2) {
  transition-delay: 0.06s;
}
.dashboard.reveal .dashboard__bar:nth-child(3) {
  transition-delay: 0.12s;
}
.dashboard.reveal .dashboard__bar:nth-child(4) {
  transition-delay: 0.18s;
}
.dashboard.reveal .dashboard__bar:nth-child(5) {
  transition-delay: 0.24s;
}
.dashboard.reveal .dashboard__bar:nth-child(6) {
  transition-delay: 0.3s;
}
.dashboard.reveal .dashboard__bar:nth-child(7) {
  transition-delay: 0.36s;
}

.dashboard__days {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.dashboard__days span {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
}

/* ── Тарифы ────────────────────────────────────────────── */
.pricing__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.plan {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.plan--featured {
  border-color: var(--accent);
}

.plan__tag {
  position: absolute;
  top: -11px;
  left: 26px;
  background: var(--accent);
  color: #071426;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
}

.plan__name {
  font-size: 20px;
  margin-bottom: 6px;
}

.plan__price {
  font-family: var(--font-display);
  font-size: 30px;
  margin-bottom: 4px;
}

.plan__price small {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 400;
}

.plan__desc {
  color: var(--text-muted);
  font-size: 14px;
  min-height: 40px;
}

.plan__features {
  list-style: none;
  padding: 0;
  margin: 18px 0 24px;
  display: grid;
  gap: 10px;
}

.plan__features li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: var(--text-muted);
  font-size: 14px;
}

.plan__features svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--success);
  margin-top: 2px;
}

.plan .btn {
  margin-top: auto;
}

.plan--premium .plan__price small {
  color: var(--premium);
}

/* Тарифы временно скрыты: заблюренный скелет + плашка «Скоро».
   Реальных текстов в разметке нет — снятие блюра в консоли ничего не откроет. */
.pricing__gate {
  position: relative;
}

.pricing__grid--soon {
  filter: blur(7px);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

.plan--skeleton {
  gap: 0;
}

.sk {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.sk--title {
  width: 42%;
  height: 20px;
  margin-bottom: 16px;
}

.sk--price {
  width: 58%;
  height: 30px;
  margin-bottom: 20px;
}

.sk--short {
  width: 65%;
}

.sk--btn {
  height: 44px;
  border-radius: var(--radius-pill);
  margin-top: auto;
}

.pricing__soon {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text);
}

.pricing__soon svg {
  width: 30px;
  height: 30px;
  color: var(--accent);
}

/* ── Финальный CTA ─────────────────────────────────────── */
.cta {
  text-align: center;
}

.cta__box {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
}

.cta__title {
  font-size: 28px;
  max-width: 20ch;
  margin-inline: auto;
}

.cta__text {
  margin: 16px auto 28px;
  max-width: 52ch;
  color: var(--text-muted);
}

/* ── Футер ─────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding-block: 48px 28px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 20px;
}

.footer__brand {
  grid-column: 1 / -1;
}

.footer__tagline {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 14px;
  max-width: 30ch;
}

.footer__col h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0 0 14px;
}

.footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.footer__col a {
  color: var(--text-muted);
  font-size: 14px;
}

.footer__col a:hover {
  color: var(--text);
}

.footer__bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* ── Адаптив ───────────────────────────────────────────── */
@media (min-width: 640px) {
  .hero__actions {
    flex-direction: row;
    justify-content: center;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .why__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .footer__brand {
    grid-column: auto;
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 960px) {
  :root {
    --section-y: 92px;
  }

  .nav,
  .header__actions {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .section__title {
    font-size: 34px;
  }

  .hero {
    padding-block: 104px;
    text-align: left;
    background-position: center;
  }

  .hero::before {
    background: linear-gradient(
      90deg,
      var(--bg) 0%,
      rgba(13, 26, 43, 0.9) 34%,
      rgba(13, 26, 43, 0.25) 62%,
      rgba(13, 26, 43, 0.55) 100%
    );
  }

  .hero__title {
    font-size: 56px;
    margin-inline: 0;
  }

  .hero__subtitle {
    margin-inline: 0;
    max-width: 44ch;
  }

  .hero__actions {
    justify-content: flex-start;
  }

  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .why__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 40px;
  }

  .spotlight__inner {
    grid-template-columns: 1fr 1fr;
  }

  .pricing__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .cta__box {
    padding: 72px 24px;
  }

  .cta__title {
    font-size: 36px;
  }
}
