/* ИСТ — main.css | ist-nav.ru */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* ── Layout ── */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }

/* ── Section chrome ── */
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-lt); margin-bottom: 14px;
}
.section-label::before {
  content: ''; display: block; width: 18px; height: 2px;
  background: var(--accent); border-radius: 2px; flex-shrink: 0;
}
.section-header { text-align: center; max-width: 640px; margin: 0 auto 60px; }
.section-title {
  font-size: clamp(26px, 3.8vw, 40px); font-weight: 800;
  line-height: 1.18; letter-spacing: -.02em; color: var(--text); margin-bottom: 14px;
}
.section-desc { font-size: 16px; color: var(--text-muted); line-height: 1.7; }

/* ── Reveal ── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .12s; }
.reveal-delay-2 { transition-delay: .24s; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-md); font-size: 15px; font-weight: 600;
  line-height: 1; cursor: pointer; border: none; transition: var(--t);
  white-space: nowrap; text-decoration: none; position: relative; overflow: hidden;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-lt); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(119,146,216,.38); }
.btn--primary:active { transform: translateY(0); box-shadow: none; }
.btn--ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--border-hov); color: var(--text); }
.btn--nav {
  background: var(--accent-bg); color: var(--accent-lt);
  border: 1px solid var(--border); padding: 8px 16px; font-size: 14px; border-radius: var(--r-sm);
}
.btn--nav:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--lg { padding: 15px 32px; font-size: 16px; border-radius: var(--r-lg); }
.btn--full { width: 100%; }
.btn__loader {
  display: none; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
.btn--loading .btn__text { display: none; }
.btn--loading .btn__loader { display: block; }

/* ══════════════════════════════════════
   NAVIGATION — однорядный хедер
══════════════════════════════════════ */
:root {
  --nav-h:       68px;
  --nav-total-h: 68px;
}

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(13,15,20,0);
  backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0);
  transition: background var(--t), backdrop-filter var(--t), box-shadow var(--t);
}
.nav.scrolled {
  background: rgba(13,15,20,.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border), 0 4px 24px rgba(0,0,0,.5);
}

/* Единая строка: лого — меню — бургер */
.nav__inner {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  gap: 8px;
}

/* Логотип + тэглайн */
.nav__logo {
  display: inline-flex; align-items: center; flex-shrink: 0;
  transform-origin: left center;
  transition: transform var(--t-fast);
  gap: 10px;
}
.nav__logo:hover { transform: scale(1.25); }
.nav__logo-img {
  height: 52px;
  width: auto; display: block;
  opacity: 0.90;
  transition: opacity var(--t-fast);
}
.nav__logo:hover .nav__logo-img { opacity: 1; }

/* Тэглайн рядом с логотипом */
.nav__tagline {
  font-family: Copperplate, 'Copperplate Gothic Light', 'Copperplate Gothic Bold', serif;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.4;
  flex-shrink: 0;
  white-space: nowrap;
  border-left: 1px solid rgba(255,255,255,0.18);
  padding-left: 12px;
  margin-left: 2px;
}
/* Hide tagline on very small screens */
@media (max-width: 380px) { .nav__tagline { display: none; } }


/* Footer logo — smaller */
.footer__logo-img { height: 36px !important; }
@media (min-width: 768px) { .footer__logo-img { height: 40px !important; } }

/* Footer tagline — scaled to match smaller footer logo */
.footer__brand .nav__tagline {
  font-size: 8px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.1em;
}

/* Бургер (мобайл) */
.nav__burger {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: none; border: none;
  cursor: pointer; padding: 8px; flex-shrink: 0; margin-left: auto;
  border-radius: var(--r-sm); transition: background var(--t-fast);
  position: relative; z-index: 201;
}
.nav__burger:hover { background: rgba(255,255,255,.06); }
/* Explicit hex color + integer px height + translateZ fix for old iOS Safari */
.nav__burger span {
  display: block;
  width: 22px; height: 2px;
  background: #c8d4ea;
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
  transform-origin: center;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.nav__burger.open span:nth-child(1) { -webkit-transform: translateY(7px) rotate(45deg); transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; -webkit-transform: scaleX(0); transform: scaleX(0); }
.nav__burger.open span:nth-child(3) { -webkit-transform: translateY(-7px) rotate(-45deg); transform: translateY(-7px) rotate(-45deg); }

/* Меню — мобайл: аккордеон под шапкой */
.nav__menu {
  position: absolute;
  top: var(--nav-h);
  left: 0; right: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s var(--ease);
  background: rgba(10,12,18,.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.nav__menu.open {
  max-height: 820px;
  border-bottom: 1px solid var(--border);
}

.nav__links {
  display: flex; flex-direction: column;
  gap: 2px; padding: 10px var(--gutter) 18px;
}
.nav__link {
  display: block; padding: 12px 16px;
  font-size: 15px; font-weight: 500;
  color: var(--text-muted); border-radius: var(--r-md);
  transition: var(--t-fast);
}
.nav__link:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav__links .btn--nav {
  margin-top: 6px; padding: 12px 16px;
  font-size: 15px; text-align: center; border-radius: var(--r-md);
}

/* ── Desktop 768px+ ── */
@media (min-width: 768px) {
  :root { --nav-h: 72px; --nav-total-h: 72px; }

  .nav__logo-img { height: 58px; }
  .nav__tagline { font-size: 13px; }
  .nav__burger { display: none; }

  /* Меню встраивается в flex-строку справа */
  .nav__menu {
    position: static;
    max-height: none !important;
    overflow: visible;
    background: transparent;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    transition: none;
    margin-left: auto;
    border: none;
  }
  .nav__links {
    flex-direction: row;
    align-items: center;
    gap: 4px; padding: 0;
    height: var(--nav-h);
  }
  .nav__link { padding: 6px 10px; font-size: 14px; }
  .nav__links .btn--nav { margin-top: 0; padding: 7px 16px; font-size: 14px; border-radius: var(--r-sm); }

  .hero { padding-top: calc(var(--nav-total-h) + 32px); }
  .hero__visual { display: block !important; }
  .hero__desc br { display: block; }
}

/* ── Hero ── */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: calc(var(--nav-total-h) + 48px) var(--gutter) 72px; overflow: hidden;
}
.hero__bg-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(119,146,216,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119,146,216,.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.hero__glow {
  position: absolute; right: -5%; top: 5%; width: 55%; height: 90%; pointer-events: none;
  background: radial-gradient(ellipse at 60% 40%, rgba(119,146,216,.09) 0%, transparent 65%);
}
.hero__inner { position: relative; z-index: 1; display: flex; align-items: center; gap: 40px; width: 100%; min-width: 0; }
.hero__content { flex: 1 1 auto; min-width: 0; max-width: 600px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-bg); border: 1px solid var(--border);
  padding: 5px 14px; border-radius: 100px; font-size: 12px; color: var(--text-muted); margin-bottom: 26px;
}
.hero__badge-dot {
  width: 6px; height: 6px; background: var(--success); border-radius: 50%;
  flex-shrink: 0; animation: pulse-dot 2.4s ease-in-out infinite;
}
.hero__title {
  font-size: clamp(30px, 4.8vw, 58px); font-weight: 800; line-height: 1.1;
  letter-spacing: -.025em; color: var(--text); margin-bottom: 18px;
}
.hero__title-accent { color: var(--accent-lt); }
.hero__desc { font-size: 17px; color: var(--text-muted); line-height: 1.75; margin-bottom: 36px; }
.hero__desc br { display: none; }
.hero__stats {
  display: flex; align-items: stretch; margin-bottom: 36px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
}
.hero__stat { flex: 1; padding: 18px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.hero__stat-num { font-size: clamp(18px, 2.4vw, 22px); font-weight: 800; color: var(--accent-lt); letter-spacing: -.02em; line-height: 1; }
.hero__stat-label { font-size: 11px; color: var(--text-dim); line-height: 1.35; }
.hero__stat-sep { width: 1px; background: var(--border); flex-shrink: 0; align-self: stretch; margin: 14px 0; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__visual { flex: 1; min-width: 0; display: none; }
.hero__mockup-wrap {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 3px; box-shadow: var(--shadow-lg), var(--glow); overflow: hidden;
}
.hero__mockup { width: 100%; height: auto; display: block; border-radius: calc(var(--r-lg) - 3px); }
.hero__scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase;
}
.hero__scroll-arrow {
  width: 18px; height: 18px; border-right: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg); animation: bounce-down 1.6s ease-in-out infinite;
}

/* ── Animations ── */
@keyframes pulse-dot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.75)} }

/* ══════════════════════════════════════
   NAV MEGA-DROPDOWNS
══════════════════════════════════════ */

/* Desktop: nav__menu must be overflow:visible so absolute panels show */
@media (min-width: 768px) {
  .nav__menu { overflow: visible; }
}

/* Nav item wrapper */
.nav__item { position: relative; }

/* Trigger button — mirrors .nav__link visually */
.nav__link--trigger {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 6px 10px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500; font-family: var(--font);
  color: var(--text-muted); white-space: nowrap;
  transition: var(--t-fast); line-height: 1;
}
.nav__link--trigger:hover,
.nav__item--dropdown.open > .nav__link--trigger {
  color: var(--text); background: rgba(255,255,255,.05);
}

/* Chevron */
.nav__chevron { transition: transform .22s var(--ease); flex-shrink: 0; opacity: .6; }
.nav__item--dropdown.open > .nav__link--trigger .nav__chevron {
  transform: rotate(180deg); opacity: 1;
}

/* ── Desktop dropdown panel ── */
@media (min-width: 768px) {
  .nav__dropdown {
    position: absolute; top: calc(100% + 10px); right: 0;
    background: rgba(10,12,18,.97);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 8px;
    box-shadow: 0 24px 64px rgba(0,0,0,.6), 0 4px 16px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
    opacity: 0; visibility: hidden;
    transform: translateY(-10px) scale(.97);
    transform-origin: top right;
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
    pointer-events: none; z-index: 300;
  }
  .nav__item--dropdown.open > .nav__dropdown {
    opacity: 1; visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
  .nav__link--trigger { padding: 6px 10px; }
}

/* ── Mobile accordion ── */
@media (max-width: 767px) {
  .nav__dropdown { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
  .nav__item--dropdown.open > .nav__dropdown { max-height: 600px; }
  .nav__link--trigger { padding: 12px 16px; font-size: 15px; width: 100%; justify-content: space-between; }
}

/* ── Grid layouts ── */
.nav__dd-grid--1col { display: flex; flex-direction: column; gap: 2px; min-width: 210px; }
.nav__dd-grid--2col { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; min-width: 390px; }
@media (max-width: 767px) { .nav__dd-grid--2col { grid-template-columns: 1fr; min-width: 0; } }

/* ── Dropdown item ── */
.nav__dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--r-md);
  transition: background var(--t-fast);
}
.nav__dd-item:hover { background: rgba(255,255,255,.07); }
.nav__dd-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: rgba(91,127,166,.1); border: 1px solid rgba(139,168,231,.15);
  display: flex; align-items: center; justify-content: center;
}
.nav__dd-text { min-width: 0; }
.nav__dd-text strong { display: block; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.nav__dd-text em { font-style: normal; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }

/* Mobile: roomier items */
@media (max-width: 767px) {
  .nav__dd-item { padding: 10px 16px 10px 28px; }
  .nav__dd-icon { width: 28px; height: 28px; }
  .nav__dd-text strong { font-size: 14px; }
}
@keyframes bounce-down { 0%,100%{transform:rotate(45deg) translateY(0)} 50%{transform:rotate(45deg) translateY(5px)} }
@keyframes spin { to{transform:rotate(360deg)} }
