/* Сайт ThunderBolt. Токены повторяют MenuStyle.java и шкалу Rhythm из design/DESIGN.md:
   шаги Фибоначчи 3, 5, 8, 13, 21, 34, 55, 89, 144, монохром, белый акцент по умолчанию.
   Этот файл общий для лендинга, кабинета и админки; раскладка приложения лежит в app.css. */

:root {
  --bg: #08080a;
  --window: #0a0a0b;
  --panel: rgba(20, 20, 22, 0.59);
  --panel-solid: rgba(16, 16, 19, 0.74);
  --tile: rgba(255, 255, 255, 0.05);
  --tile-hover: rgba(255, 255, 255, 0.086);
  --selected: rgba(255, 255, 255, 0.125);
  --control: rgba(255, 255, 255, 0.078);
  --control-hover: rgba(255, 255, 255, 0.133);
  --outline: #4a4a50;
  --hairline: rgba(255, 255, 255, 0.08);
  --ink: #f2f2f3;
  --muted: #a3a3a9;
  --faint: #75757c;
  --glass: blur(21px) saturate(1.3);

  /* Акцент меняется на странице «Настройки» в демо меню, как Theme.Colors в клиенте. */
  --accent: #f5f8ff;
  --accent-ink: #141416;

  --s3: 3px; --s5: 5px; --s8: 8px; --s13: 13px; --s21: 21px;
  --s34: 34px; --s55: 55px; --s89: 89px; --s144: 144px;
  --section: clamp(89px, 11vw, 144px);

  --r-control: 8px;
  --r-tile: 13px;
  --r-panel: 21px;

  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", system-ui, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.32, 0.64, 1);

  --wrap: 1120px;
  --gutter: 21px;
  color-scheme: dark;
}
@media (max-width: 600px) { :root { --gutter: 16px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  overflow-x: hidden;
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
::selection { background: rgba(255, 255, 255, 0.22); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.ic { width: 16px; height: 16px; flex: none; }

/* --- Фон: гроза из главного меню клиента (storm.js), затемняется по мере прокрутки --- */
.sky { position: fixed; inset: 0; z-index: -1; background: var(--bg) url("../img/storm.webp") center / cover no-repeat; }
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s; }
.sky canvas.is-live { opacity: 1; }
.sky__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.55) 0%, rgba(8, 8, 10, 0) 30%, rgba(8, 8, 10, 0) 62%, rgba(8, 8, 10, 0.65) 100%),
    rgba(8, 8, 10, var(--dim, 0.18));
}

/* --- Кнопки: радиус 8 и белая основная, как на экранах клиента --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s8);
  height: 42px; padding: 0 var(--s21);
  border-radius: var(--r-control); border: 0;
  font-weight: 500; font-size: 15px; white-space: nowrap; letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s, transform 0.18s var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: #fff; color: #111113; }
.btn--primary:hover { background: #e6e6e9; }
.btn--ghost { background: var(--control); color: var(--ink); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); }
.btn--ghost:hover { background: var(--control-hover); }
.btn--sm { height: 34px; padding: 0 var(--s13); font-size: 14px; }
.btn--block { width: 100%; }

/* --- Переключатель языка --- */
.lang { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--control); }
.lang button {
  height: 26px; min-width: 34px; padding: 0 var(--s8); border: 0; border-radius: 7px;
  background: none; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; cursor: pointer;
  transition: background-color 0.18s, color 0.18s;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--selected); color: var(--ink); }

/* --- Шапка: прозрачная над первым экраном, стекло после прокрутки --- */
.nav {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}
.nav.is-stuck {
  background: rgba(8, 8, 10, 0.72); border-bottom-color: var(--hairline);
  backdrop-filter: blur(21px) saturate(1.4); -webkit-backdrop-filter: blur(21px) saturate(1.4);
}
.nav__row { display: flex; align-items: center; height: 63px; gap: var(--s34); }
.brand { display: inline-flex; align-items: center; gap: var(--s8); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.nav__links { display: flex; gap: var(--s3); margin-right: auto; }
.nav__links a {
  padding: 6px var(--s13); border-radius: var(--r-control);
  color: var(--muted); font-size: 14px;
  transition: color 0.15s, background-color 0.15s;
}
.nav__links a:hover { color: var(--ink); background: var(--tile); }
.nav__end { display: flex; align-items: center; gap: var(--s13); }
.nav__link { color: var(--muted); font-size: 14px; transition: color 0.15s; }
.nav__link:hover { color: var(--ink); }
@media (max-width: 900px) { .nav__links { display: none; } .nav__row { justify-content: space-between; } }
@media (max-width: 420px) { .nav__link { display: none; } }

/* --- Первый экран --- */
.hero { padding: var(--s55) 0 0; }
.hero__head { margin-bottom: var(--s55); }
.eyebrow { color: var(--muted); font-size: 14px; margin-bottom: var(--s21); }
.hero__title {
  font-size: clamp(44px, 7vw, 84px);
  line-height: 1; letter-spacing: -0.045em; font-weight: 600;
  text-shadow: 0 2px 34px rgba(0, 0, 0, 0.35), 0 0 calc(var(--flash, 0) * 55px) rgba(170, 205, 255, calc(var(--flash, 0) * 0.5));
}
.hero__lead {
  max-width: 32em; margin-top: var(--s21);
  font-size: clamp(17px, 1.5vw, 19px); line-height: 1.55; color: var(--muted);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s8); margin-top: var(--s34); }

/* Сцена: меню в дизайн-пикселях 1024x640, масштабом целиком. */
.stage { position: relative; perspective: 1600px; }
.stage__scroller {
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  transform: rotateX(calc(var(--tilt, 0) * 16deg)) scale(calc(1 - var(--tilt, 0) * 0.06)) translateY(calc(var(--tilt, 0) * 21px));
  transform-origin: 50% 0;
  transition: transform 0.12s linear;
}
.stage__scroller::-webkit-scrollbar { display: none; }
.stage__fit { position: relative; margin: 0 auto; }
.stage__hint { margin: var(--s21) auto 0; max-width: 46em; color: var(--muted); font-size: 13px; text-align: center; }

/* --- Секции --- */
.section { padding-top: var(--section); }
main > .section:last-child { padding-bottom: var(--section); }
.section__head { margin-bottom: var(--s34); max-width: 640px; }
.section__head--split { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s21); flex-wrap: wrap; max-width: none; }
.kicker {
  display: flex; align-items: center; gap: var(--s13);
  color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: var(--s13);
}
.kicker::before { content: ""; width: 21px; height: 1px; background: currentColor; opacity: 0.6; }
.section__head h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.03em; font-weight: 600; line-height: 1.12; }
.section__head p.muted { margin-top: var(--s13); }

/* --- Сегменты --- */
.segmented {
  display: flex; gap: var(--s3); padding: var(--s3);
  background: var(--panel-solid); border-radius: 11px;
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  display: inline-flex; align-items: center; gap: var(--s8);
  height: 30px; padding: 0 var(--s13); border: 0; border-radius: var(--r-control);
  background: none; color: var(--muted); font-size: 14px; white-space: nowrap; cursor: pointer;
  transition: background-color 0.18s, color 0.18s;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-selected="true"] { background: var(--selected); color: var(--ink); }

/* --- Возможности: плитки на стеклянной панели, три уровня поверхностей, как в меню --- */
.pillars {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s13);
  background: var(--panel-solid); border-radius: var(--r-panel); padding: var(--s13);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
}
.pillar { background: var(--tile); border-radius: var(--r-tile); padding: var(--s34) var(--s34) var(--s34) var(--s34); }
.pillar__top { display: flex; align-items: center; justify-content: space-between; }
.pillar__ic { width: 24px; height: 24px; color: var(--ink); stroke-width: 1.6; }
.pillar__tag { color: var(--faint); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.pillar h3 { margin-top: var(--s34); font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.pillar p { margin-top: var(--s8); color: var(--muted); font-size: 14.5px; max-width: 34em; }
@media (max-width: 720px) { .pillars { grid-template-columns: 1fr; } .pillar { padding: var(--s21); } .pillar h3 { margin-top: var(--s21); } }

/* --- Тарифы --- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s13); align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel-solid); border-radius: var(--r-panel); padding: var(--s34) var(--s21) var(--s21);
  box-shadow: inset 0 0 0 1px var(--hairline);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
}
.plan--popular { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), 0 21px 55px rgba(0, 0, 0, 0.35); }
.plan__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s8); min-height: 21px; }
.plan__title { font-size: 15px; font-weight: 500; color: var(--muted); }
.plan__price { margin-top: var(--s13); }
.plan__price strong { font-size: 44px; font-weight: 600; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.plan__month { margin-top: var(--s8); color: var(--muted); font-size: 13px; }
.plan ul { list-style: none; margin: var(--s21) 0 var(--s34); padding: var(--s21) 0 0; border-top: 1px solid var(--hairline); display: grid; gap: var(--s13); flex: 1; align-content: start; }
.plan li { display: flex; gap: var(--s8); font-size: 14px; line-height: 1.45; }
.plan li .ic { margin-top: 2px; color: var(--muted); width: 15px; height: 15px; }
.badge {
  height: 21px; padding: 0 var(--s8); border-radius: 6px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11.5px; font-weight: 600; line-height: 21px; font-variant-numeric: tabular-nums;
}
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }

/* --- Вопросы: заголовок слева, список справа --- */
.faq-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: var(--s55); align-items: start; }
.faq-layout .section__head { position: sticky; top: 89px; margin: 0; }
.faq {
  display: grid; gap: var(--s5);
  background: var(--panel-solid); border-radius: var(--r-panel); padding: var(--s13);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
}
.faq details { background: var(--tile); border-radius: var(--r-tile); transition: background-color 0.2s; }
.faq details[open] { background: var(--tile-hover); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s13);
  padding: var(--s13) var(--s21); min-height: 55px;
  font-weight: 500; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--muted); transition: transform 0.36s var(--spring); }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq .faq__a { padding: 0 var(--s21) var(--s21); color: var(--muted); font-size: 14.5px; animation: faq-open 0.36s var(--ease-out); }
@keyframes faq-open { from { opacity: 0; transform: translateY(-5px); } }
@media (max-width: 860px) { .faq-layout { grid-template-columns: 1fr; gap: 0; } .faq-layout .section__head { position: static; margin-bottom: var(--s34); } }

/* --- Подвал --- */
.footer { border-top: 1px solid var(--hairline); background: rgba(8, 8, 10, 0.78); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); }
.footer__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s21); min-height: 89px; padding-top: var(--s21); padding-bottom: var(--s21); flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; gap: var(--s8); color: var(--faint); font-size: 13px; }
.footer__brand img { opacity: 0.6; }
.footer__links { display: flex; gap: var(--s21); font-size: 14px; color: var(--muted); }
.footer__links a { transition: color 0.15s; }
.footer__links a:hover { color: var(--ink); }

/* --- Движение --- */
/* Первый экран: строки приходят по очереди снизу. Чистый CSS, не ждёт скриптов. */
[data-in] { animation: rise-in 0.9s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 90ms + 60ms); }
@keyframes rise-in { from { opacity: 0; transform: translateY(21px); } }

/* Секции: подъём и проявление при входе в экран, дети по очереди. */
[data-reveal], [data-stagger] > * { opacity: 0; transform: translateY(34px); }
[data-reveal].is-in, [data-stagger].is-in > * {
  opacity: 1; transform: none;
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}

/* Свет за курсором и подъём при наведении. */
.pillar, .plan { position: relative; isolation: isolate; }
.pillar::after, .plan::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.07), transparent 70%);
  opacity: 0; transition: opacity 0.3s;
}
.pillar:hover::after, .plan:hover::after { opacity: 1; }
[data-stagger].is-in > .plan:hover { transform: translateY(-3px); transition: transform 0.4s var(--spring); transition-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-delay: 0s !important; }
  [data-reveal], [data-stagger] > * { opacity: 1 !important; transform: none !important; }
  .stage__scroller { transform: none; }
}

/* --- Телефон: меню-шторка, зоны нажатия, поля без автозума --- */
.burger {
  display: none; position: relative; width: 42px; height: 42px; flex: none;
  border: 0; border-radius: var(--r-control); background: var(--control); cursor: pointer;
}
.burger span {
  position: absolute; left: 13px; right: 13px; height: 1.5px; border-radius: 1px; background: var(--ink);
  transition: transform 0.3s var(--ease-out), top 0.3s var(--ease-out);
}
.burger span:first-child { top: 17px; }
.burger span:last-child { top: 24px; }
.burger[aria-expanded="true"] span:first-child { top: 20.5px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 20.5px; transform: rotate(-45deg); }

.msheet {
  position: absolute; top: calc(100% + var(--s5)); left: var(--gutter); right: var(--gutter);
  display: grid; padding: var(--s8);
  background: rgba(14, 14, 16, 0.92); border-radius: var(--r-panel);
  backdrop-filter: blur(21px) saturate(1.4); -webkit-backdrop-filter: blur(21px) saturate(1.4);
  box-shadow: 0 0 0 1px var(--hairline), 0 34px 89px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: translateY(-8px) scale(0.98); transform-origin: 50% 0;
  transition: opacity 0.22s, transform 0.3s var(--ease-out);
}
.msheet.is-open { opacity: 1; transform: none; }
.msheet[hidden] { display: none; }
.msheet > a {
  display: flex; align-items: center; min-height: 48px; padding: 0 var(--s13);
  border-radius: var(--r-tile); font-size: 17px; font-weight: 500;
}
.msheet > a:active { background: var(--tile); }
.msheet__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s13);
  margin-top: var(--s8); padding: var(--s13) var(--s5) var(--s5); border-top: 1px solid var(--hairline);
}
.msheet__foot .btn { flex: 1; }

@media (max-width: 900px) {
  .burger { display: block; }
  .nav__row { gap: var(--s13); }
  .nav__end { gap: var(--s8); }
  .nav__end > .lang, .nav__end > .nav__link { display: none; }
  .hero { padding-top: var(--s34); }
  .hero__head { margin-bottom: var(--s34); }
  .hero__actions .btn { flex: 1 1 auto; }
  .stage__hint { padding: 0 var(--s8); }
  .footer__row { flex-direction: column; align-items: flex-start; }
  .footer__links { flex-wrap: wrap; gap: var(--s5) var(--s21); }
  .footer__links a { display: inline-flex; align-items: center; min-height: 40px; }
}
@media (max-width: 600px) {
  .section__head h2 { font-size: 28px; }
  .pillar { padding: var(--s21); }
}
/* Пальцы толще курсора: на сенсорных экранах мелкие кнопки подрастают. */
@media (pointer: coarse) {
  .lang button { height: 34px; min-width: 40px; }
  .segmented button { height: 38px; }
  .btn--sm { height: 40px; }
}
