/* ===== Токены ===== */
:root {
  --bg: #0E1116;
  --bg2: #161B22;
  --card: #1B2230;
  --line: #2A3342;
  --text: #E8ECF1;
  --muted: #9AA7B8;
  --accent: #F5A623;
  --accent-dark: #D98F0E;
  --radius: 16px;
  --font: "Manrope", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  /* анимации */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --reveal-duration: .7s;
  --stagger-gap: .08s;
}

/* ===== База ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }
.muted { color: var(--muted); font-size: 15px; margin-top: 24px; }

h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; line-height: 1.2; margin-bottom: 24px; }
h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 760px; margin-bottom: 32px; }

/* ===== Кнопки ===== */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #10131A;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  transition: transform .15s ease, background .15s ease;
  text-align: center;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; transform: translateY(-2px); }
.btn-sm { padding: 8px 16px; font-size: 15px; }
.btn-lg { padding: 16px 32px; font-size: 18px; border-radius: 14px; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

/* ===== Шапка ===== */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 17, 22, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.logo { font-weight: 800; font-size: 19px; color: var(--text); }
.logo:hover { text-decoration: none; color: var(--accent); }
.nav { display: flex; gap: 24px; }
.nav a { color: var(--muted); font-size: 15px; }
.nav a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 900px) { .nav { display: none; } }

/* ===== Hero ===== */
.hero { padding: 72px 0 56px; background: radial-gradient(1200px 500px at 80% -10%, rgba(59,130,246,.12), transparent), var(--bg); }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; }
.hero-title { font-size: clamp(30px, 4.6vw, 52px); font-weight: 800; line-height: 1.12; margin-bottom: 20px; min-height: 2.2em; }
#heroOffer { display: inline-block; transition: opacity .5s ease, transform .5s ease; }
#heroOffer.swap { opacity: 0; transform: translateY(12px); }
.hero-sub { font-size: clamp(16px, 2vw, 19px); color: var(--muted); margin-bottom: 24px; max-width: 560px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.badge {
  font-size: 14px; font-weight: 600; color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  background: var(--bg2);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* Видео-превью (вертикальное, 9:16) */
.video-preview {
  position: relative; display: block; width: 100%; max-width: 320px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  background: var(--bg2); cursor: pointer; padding: 0;
  aspect-ratio: 9 / 16;
}
.video-preview video { width: 100%; height: 100%; object-fit: cover; }
.video-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(245, 166, 35, .92); color: #10131A;
  font-size: 26px; display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.video-preview:hover .video-play { transform: translate(-50%, -50%) scale(1.1); }
.video-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px;
  font-size: 14px; color: var(--text); text-align: left;
  background: linear-gradient(transparent, rgba(14,17,22,.9));
}

/* ===== Цифры ===== */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg2); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 32px 20px; }
.stat { text-align: center; }
.stat-num { display: block; font-size: clamp(24px, 3.4vw, 38px); font-weight: 800; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 15px; }
@media (max-width: 720px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== Секции ===== */
.section { padding: 72px 0; }
.section-alt { background: var(--bg2); }

/* ===== Табы ===== */
.tabs { display: inline-flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 28px; }
.tab {
  border: none; background: transparent; color: var(--muted);
  font: inherit; font-weight: 700; font-size: 16px; padding: 10px 22px;
  border-radius: 9px; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.tab.active { background: var(--accent); color: #10131A; }
.pane { display: none; }
.pane.active { display: block; }

/* ===== Списки ===== */
.check-list { list-style: none; display: grid; gap: 14px; max-width: 760px; }
.check-list li { padding-left: 34px; position: relative; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ===== Карточки ===== */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.cards-3x2 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card p { color: var(--muted); font-size: 15px; }
@media (max-width: 1024px) { .cards { grid-template-columns: repeat(2, 1fr); } .cards-3x2 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards, .cards-3x2 { grid-template-columns: 1fr; } }

/* ===== Галерея ===== */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 8px; }
.gallery-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery-item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.gallery-item figcaption { padding: 12px 16px; font-size: 14px; color: var(--muted); }
.gallery-video .video-preview { border: none; border-radius: 0; max-width: none; aspect-ratio: 3 / 2; }
.pain-gallery { grid-template-columns: repeat(2, 1fr); max-width: 760px; margin: 8px 0 32px; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gallery, .pain-gallery { grid-template-columns: 1fr; } }

/* ===== Цены ===== */
.price-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 16px; }
.price-card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 24px;
  display: flex; flex-direction: column; gap: 6px;
  transition: transform .2s ease, border-color .2s ease;
}
.price-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.price-card-best { border-color: var(--accent); box-shadow: 0 8px 40px rgba(245,166,35,.12); }
.ribbon {
  position: absolute; top: -13px; left: 24px;
  background: var(--accent); color: #10131A; font-size: 13px; font-weight: 800;
  padding: 4px 12px; border-radius: 999px;
}
.price { font-size: clamp(26px, 2.6vw, 32px); font-weight: 800; color: var(--accent); }
.price-note { color: var(--muted); font-size: 14px; flex: 1; }
.price-card .btn { margin-top: 16px; }
@media (max-width: 1024px) { .price-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .price-cards { grid-template-columns: 1fr; } }

/* ===== Калькулятор ===== */
.calc {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; margin-bottom: 8px;
}
.calc-inputs { display: grid; gap: 24px; align-content: center; }
.calc-inputs label { display: grid; gap: 10px; font-weight: 600; }
.calc-inputs output { color: var(--accent); font-weight: 800; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 32px; }
.calc-results-groups { display: grid; gap: 24px; }
.calc-group-title { font-size: 15px; font-weight: 700; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .02em; }
.calc-results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.calc-results div {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; text-align: center;
}
.calc-results span { display: block; font-size: clamp(18px, 2.2vw, 26px); font-weight: 800; color: var(--accent); }
.calc-results small { color: var(--muted); }
@media (max-width: 1200px) { .calc-results { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) { .calc { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .calc-results { grid-template-columns: 1fr; } }

/* ===== График рынка ===== */
.chart {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; margin-bottom: 32px;
}
.chart-title { font-size: 19px; font-weight: 700; }
.chart-badge {
  display: inline-block; margin: 10px 0 24px;
  background: rgba(245,166,35,.15); color: var(--accent);
  font-weight: 800; padding: 6px 14px; border-radius: 999px;
}
.chart-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: end; height: 260px; }
.market-bar { display: grid; grid-template-rows: auto 1fr auto; gap: 8px; height: 100%; text-align: center; }
.bar-col {
  align-self: end; height: 0; border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #3B82F6, #1D4ED8);
  transition: height .8s cubic-bezier(.22,.8,.32,1);
}
.chart.in-view .bar-col { height: var(--h); }
.bar-accent .bar-col { background: linear-gradient(180deg, var(--accent), var(--accent-dark)); }
.chart.in-view .market-bar:nth-child(2) .bar-col { transition-delay: .15s; }
.chart.in-view .market-bar:nth-child(3) .bar-col { transition-delay: .3s; }
.chart.in-view .market-bar:nth-child(4) .bar-col { transition-delay: .45s; }
.bar-value { font-weight: 800; font-size: 15px; }
.bar-year { color: var(--muted); font-size: 14px; }
.chart-source { margin-top: 20px; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .chart-bars { height: 200px; gap: 10px; } .bar-value { font-size: 13px; } }

/* ===== Карта ===== */
.map-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 32px; align-items: center; }
.map-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-frame iframe { display: block; width: 100%; height: 420px; filter: grayscale(.2) contrast(1.05); }
.map-text p { margin-bottom: 14px; }
.map-text .btn { margin-top: 8px; }
@media (max-width: 860px) { .map-grid { grid-template-columns: 1fr; } }

/* ===== Шаги ===== */
.steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 32px; counter-reset: step; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #10131A; font-weight: 800; margin-bottom: 12px;
}
.steps p { font-size: 15px; color: var(--muted); }
@media (max-width: 1024px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ===== Форма ===== */
.lead-form { display: grid; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.lead-form label { display: grid; gap: 8px; font-weight: 600; font-size: 15px; }
.lead-form input[type="text"], .lead-form input[type="tel"], .lead-form input[type="email"],
.lead-form select, .lead-form textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.lead-form input:focus, .lead-form select:focus, .lead-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.lead-form ::placeholder { color: var(--muted); opacity: .6; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.agree { display: flex !important; grid-template-columns: none; flex-direction: row; align-items: center; gap: 10px !important; font-weight: 400 !important; }
.agree input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-error { color: #FF6B6B; font-size: 15px; }
.form-ok { background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius); padding: 32px; text-align: center; }
.form-ok h3 { color: var(--accent); margin-bottom: 8px; }

/* ===== FAQ ===== */
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; margin-bottom: 12px; }
summary { cursor: pointer; font-weight: 700; font-size: 17px; }
summary::marker { color: var(--accent); }
details p { margin-top: 10px; color: var(--muted); }

/* ===== Финальный CTA, футер ===== */
.final-cta { text-align: center; background: radial-gradient(800px 300px at 50% 0%, rgba(245,166,35,.1), transparent), var(--bg); }
.final-cta .lead { margin-left: auto; margin-right: auto; }
.contacts { margin-top: 24px; color: var(--muted); }
.footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 14px; }
.footer p + p { margin-top: 8px; }

/* ===== Липкая кнопка (мобайл) ===== */
.sticky-cta {
  display: none; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  padding: 14px; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
@media (max-width: 768px) { .sticky-cta { display: block; } }

/* ===== Лайтбокс фото ===== */
.g-link { display: block; cursor: zoom-in; overflow: hidden; }
.g-link img { transition: transform .3s ease; }
.g-link:hover img { transform: scale(1.04); }
.img-dialog {
  border: none; border-radius: 16px; padding: 0; background: transparent;
  max-width: min(1100px, 94vw);
  overflow: visible;
}
.img-dialog::backdrop { background: rgba(0,0,0,.85); }
.img-dialog img { max-width: 100%; max-height: 88vh; border-radius: 16px; }

/* ===== Диалог с видео ===== */
.video-dialog {
  border: none; border-radius: 20px; padding: 0; background: transparent;
  max-width: min(420px, 92vw);
  overflow: visible;
}
.video-dialog::backdrop { background: rgba(0,0,0,.8); }
.video-dialog video { width: 100%; border-radius: 20px; }
.video-close {
  position: absolute; top: -14px; right: -14px; z-index: 10;
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid #10131A;
  background: var(--accent); color: #10131A; font-size: 18px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.video-preview:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
@media (max-width: 560px) {
  .img-dialog .video-close,
  .video-dialog .video-close { top: 12px; right: 12px; border-color: rgba(255,255,255,.35); }
}

/* ===== Reveal-анимации ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--reveal-duration) var(--ease-out),
    transform var(--reveal-duration) var(--ease-out);
  will-change: opacity, transform;
}
.reveal.in-view { opacity: 1; transform: none; }

/* детям .reveal-group анимируем с задержкой при входе в секцию */
.reveal-group .reveal { transition-delay: 0s; }
.reveal-group.in-view .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-group.in-view .reveal:nth-child(2) { transition-delay: var(--stagger-gap); }
.reveal-group.in-view .reveal:nth-child(3) { transition-delay: calc(var(--stagger-gap) * 2); }
.reveal-group.in-view .reveal:nth-child(4) { transition-delay: calc(var(--stagger-gap) * 3); }
.reveal-group.in-view .reveal:nth-child(5) { transition-delay: calc(var(--stagger-gap) * 4); }
.reveal-group.in-view .reveal:nth-child(6) { transition-delay: calc(var(--stagger-gap) * 5); }
.reveal-group.in-view .reveal:nth-child(7) { transition-delay: calc(var(--stagger-gap) * 6); }
.reveal-group.in-view .reveal:nth-child(8) { transition-delay: calc(var(--stagger-gap) * 7); }

/* ===== Микро-анимации ===== */
/* кнопки: press feedback */
.btn {
  transition:
    transform .15s var(--ease-out),
    background .15s var(--ease-out),
    box-shadow .15s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-2px); }
}
.btn:active { transform: translateY(0) scale(.98); }

/* карточки: lift на hover (только указатель) */
.card, .price-card {
  transition:
    transform .25s var(--ease-out),
    border-color .25s var(--ease-out),
    box-shadow .25s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .card:hover, .price-card:hover { transform: translateY(-6px); }
  .price-card-best:hover { box-shadow: 0 12px 48px rgba(245,166,35,.18); }
}

/* badge + hero-text entrance */
.hero-text .reveal { transform: translateY(20px); }

/* табы */
.tab {
  position: relative;
  transition: background .18s var(--ease-out), color .18s var(--ease-out);
}
.tab::before {
  content: "";
  position: absolute; inset: 0; border-radius: 9px;
  background: var(--accent); opacity: 0;
  transform: scale(.92);
  transition: opacity .18s var(--ease-out), transform .18s var(--ease-out);
  z-index: -1;
}
.tab.active { background: transparent; }
.tab.active::before { opacity: 1; transform: scale(1); }

/* панели табов */
.pane {
  display: block;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  position: absolute;
  width: 100%;
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}
.pane.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  position: relative;
}
.tab-content { position: relative; min-height: 240px; }

/* FAQ аккордеон */
details {
  transition: background .2s var(--ease-out), border-color .2s var(--ease-out);
}
details[open] { background: var(--bg2); border-color: var(--accent); }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }
details .faq-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s var(--ease-out);
}
details[open] .faq-body { grid-template-rows: 1fr; }
details .faq-inner { overflow: hidden; }

/* диалоги */
.img-dialog, .video-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  opacity: 0;
  transform: scale(.96);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}
.img-dialog[open], .video-dialog[open] {
  opacity: 1;
  transform: scale(1);
}
.img-dialog::backdrop, .video-dialog::backdrop {
  opacity: 0;
  transition: opacity .25s var(--ease-out);
}
.img-dialog[open]::backdrop, .video-dialog[open]::backdrop { opacity: 1; }

/* липкая CTA */
.sticky-cta {
  transition: transform .3s var(--ease-out), opacity .3s var(--ease-out);
}
.sticky-cta.is-hidden { transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .reveal-group.in-view .reveal { transition-delay: 0s !important; }
  .bar-col { height: var(--h) !important; }
  .pane { position: relative; opacity: 1; transform: none; pointer-events: auto; }
  .pane:not(.active) { display: none; }
  .faq-body { grid-template-rows: 1fr !important; }
  .sticky-cta { transform: none; opacity: 1; }
  .img-dialog, .video-dialog { opacity: 1; transform: none; }
  .img-dialog::backdrop, .video-dialog::backdrop { opacity: 1; }
}

/* ===== Адаптив Hero ===== */
@media (max-width: 900px) {
  .hero { padding: 48px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-title { min-height: 0; }
  .section { padding: 52px 0; }
}
