/* ============================================================
   LAYOUT — навигация, hero, секции, дашборд
   ============================================================ */

/* ---------------- NAV ---------------- */
.site-nav {
  position: sticky; top: 0;
  z-index: var(--z-nav);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
  transition: background var(--dur), border-color var(--dur);
}
.nav-in {
  display: flex; align-items: center; gap: 16px;
  height: 64px;
}
@media (min-width: 1024px) { .nav-in { height: 72px; } }

.logo { display: flex; align-items: center; gap: 10px; flex: none; }
.logo__mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  color: #fff; box-shadow: var(--glow);
}
.logo__mark svg { width: 19px; height: 19px; stroke-width: 1.9; }
.logo__txt {
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  font-size: 15px; letter-spacing: -.01em;
  white-space: nowrap;
}
[data-theme="neon"] .logo__txt { letter-spacing: .02em; font-size: 14px; }

.nav-links { display: none; gap: 4px; margin-inline: auto; }
@media (min-width: 1024px) { .nav-links { display: flex; } }
.nav-links a {
  padding: 9px 13px; white-space: nowrap; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; color: var(--text-dim);
  transition: color var(--dur-fast), background var(--dur-fast);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text); background: var(--surface-2); }

.nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (min-width: 1024px) { .nav-tools { margin-left: 0; } }

/* переключатели языка/темы */
.switch {
  position: relative;
}
.switch__btn {
  display: flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase;
  transition: all var(--dur-fast);
}
.switch__btn:hover { border-color: var(--border-strong); color: var(--text); }
.switch__menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 168px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  z-index: 10;
}
.switch.is-open .switch__menu { display: block; animation: sheetIn .18s var(--ease) forwards; }
.switch__item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-xs);
  font-size: 14px; font-weight: 600; color: var(--text-dim); text-align: left;
}
.switch__item:hover { background: var(--surface-2); color: var(--text); }
.switch__item.is-active { color: var(--accent); }
.switch__item .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.switch__item .flag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1px; opacity: .7; margin-left: auto; }

/* бургер */
.burger { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-sm); color: var(--text); }
@media (min-width: 1024px) { .burger { display: none; } }
.nav-drop {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--nav-bg);
  padding: 10px var(--gutter) calc(16px + env(safe-area-inset-bottom));
}
.nav-drop.is-open { display: block; }
.nav-drop a {
  display: block; padding: 13px 8px; border-radius: var(--r-sm);
  font-size: 15px; font-weight: 600; color: var(--text-dim);
}
.nav-drop a:hover { color: var(--text); background: var(--surface-2); }
.nav-cta { display: none; }
@media (min-width: 720px) { .nav-cta { display: inline-flex; } }

/* ---------------- HERO ---------------- */
.hero { position: relative; padding-block: clamp(40px, 7vw, 80px) var(--section-y); overflow: hidden; }
.hero__grid {
  display: grid; gap: clamp(28px, 5vw, 52px);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 940px) { .hero__grid { grid-template-columns: 1.06fr .94fr; } }

.hero h1 { font-size: clamp(29px, 5.4vw, 54px); font-weight: var(--head-weight-hero); text-wrap: balance; }
.hero__sub { margin-top: 18px; max-width: 54ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-top: 34px;
  padding-top: 28px; border-top: 1px solid var(--border);
}
.hero__stat b {
  display: block;
  font-family: var(--font-head);
  font-weight: var(--head-weight-hero);
  font-size: clamp(22px, 3.4vw, 32px);
  letter-spacing: -.02em;
  line-height: 1.1;
}
.hero__stat span { display: block; margin-top: 6px; font-size: 12px; color: var(--text-mute); line-height: 1.35; }

/* орбита категорий */
.orbit {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 460px;
  margin-inline: auto;
  width: 100%;
}
.orbit__ring {
  position: absolute; inset: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
}
.orbit__ring:nth-child(2) { inset: 13%; }
.orbit__ring:nth-child(3) { inset: 26%; }
.orbit__core {
  position: absolute; inset: 36%;
  border-radius: 50%;
  background: var(--grad);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: var(--glow-strong);
  animation: pulse 4.5s ease-in-out infinite;
}
.orbit__core svg { width: 34%; height: 34%; stroke-width: 1.5; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}
.orbit__spin {
  position: absolute; inset: 0;
  animation: spinSlow 46s linear infinite;
}
.orbit__spin--rev { animation-direction: reverse; animation-duration: 62s; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.orbit__tag {
  position: absolute;
  width: 0; height: 0;
}
.orbit__tag i {
  display: block;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px; font-style: normal; font-weight: 500;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow-sm);
}
.orbit__spin:not(.orbit__spin--rev) .orbit__tag i { animation: counterSpin 46s linear infinite; }
.orbit__spin--rev .orbit__tag i { animation: counterSpin 62s linear infinite reverse; }
@keyframes counterSpin { to { transform: translate(-50%, -50%) rotate(-360deg); } }

/* карточка-цена в hero */
.price-tag {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 16px 10px 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.price-tag s { color: var(--text-strike); font-size: 13px; }
.price-tag b { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 17px; }

/* ---------------- ТАЙМЕР ---------------- */
.timer { display: flex; gap: 8px; }
.timer__unit {
  min-width: 54px;
  padding: 9px 6px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: center;
}
.timer__unit b {
  display: block;
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  font-size: 21px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.timer__unit span {
  display: block; margin-top: 5px;
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--text-mute);
}

/* ---------------- ПОКАЗ ВОЗМОЖНОСТЕЙ (before/after) ---------------- */
.show-card { overflow: hidden; padding: 0; }
.show-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  overflow: hidden;
}
.show-card__media img { width: 100%; height: 100%; object-fit: cover; }
.show-card__ph {
  position: absolute; inset: 0;
  display: grid; place-items: center; gap: 10px;
  background: var(--grad-soft);
  color: var(--text-mute);
  text-align: center; padding: 20px;
}
.show-card__ph .ico { width: 30px; height: 30px; color: var(--accent); opacity: .7; }
.show-card__body { padding: 18px 20px 22px; }
.show-card__flow {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px;
}
.show-card__flow span {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-mute);
}
.show-card__flow .arr { color: var(--accent); }

/* ---------------- ШАГИ ---------------- */
.step__n {
  font-family: var(--font-head);
  font-weight: var(--head-weight-hero);
  font-size: 30px;
  color: var(--accent);
  line-height: 1;
  display: block; margin-bottom: 12px;
}

/* ---------------- ТАРИФЫ ---------------- */
.plans { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 860px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan { display: flex; flex-direction: column; position: relative; }
.plan--featured {
  border-color: var(--border-strong);
  box-shadow: var(--shadow), var(--glow);
}
.plan--featured::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--grad-soft);
  pointer-events: none;
}
.plan > * { position: relative; }
.plan__badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); z-index: 2; }
.plan__price { display: flex; align-items: baseline; gap: 9px; margin: 14px 0 4px; }
.plan__price b {
  font-family: var(--font-head); font-weight: var(--head-weight-hero);
  font-size: 38px; letter-spacing: -.03em; line-height: 1;
}
.plan__price s { color: var(--text-strike); font-size: 15px; }
.plan__list { margin: 18px 0 22px; display: flex; flex-direction: column; gap: 11px; }
.plan__list li { display: flex; gap: 10px; font-size: 14px; color: var(--text-dim); line-height: 1.5; }
.plan__list .ico { color: var(--accent); margin-top: 2px; width: 17px; height: 17px; }
.plan__list li.off { opacity: .42; }
.plan__list li.off .ico { color: var(--text-mute); }
.plan footer { margin-top: auto; }

/* ---------------- ОПЛАТА (демо) ---------------- */
.pay-stage { text-align: center; padding: 20px 0 8px; }
.pay-orb {
  width: 108px; height: 108px; margin: 0 auto 26px;
  position: relative; display: grid; place-items: center;
}
.pay-orb__ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 1.1s linear infinite;
}
.pay-orb__ring:nth-child(2) { inset: 13px; animation-duration: 1.7s; animation-direction: reverse; border-top-color: var(--accent-2); border-right-color: transparent; }
.pay-orb__core {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center; color: #fff;
  box-shadow: var(--glow-strong);
}
.pay-orb.is-done .pay-orb__ring { animation: none; border-color: var(--ok); opacity: .35; }
.pay-orb.is-done .pay-orb__core { background: var(--ok); animation: popIn .45s var(--ease); }
@keyframes popIn { 0% { transform: scale(.4); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

.pay-steps { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; text-align: left; }
.pay-step {
  display: flex; align-items: center; gap: 12px;
  font-size: 14.5px; color: var(--text-mute);
  opacity: .4; transition: opacity var(--dur), color var(--dur);
}
.pay-step.is-active { opacity: 1; color: var(--text); }
.pay-step.is-done { opacity: 1; color: var(--text-dim); }
.pay-step__dot {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: grid; place-items: center;
}
.pay-step.is-done .pay-step__dot { background: var(--grad); border-color: transparent; }
.pay-step.is-done .pay-step__dot svg { opacity: 1; }
.pay-step__dot svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.pay-step.is-active .pay-step__dot { border-color: var(--accent); }

/* конфетти */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: var(--z-toast); overflow: hidden; }
.confetti i {
  position: absolute; top: -12px;
  width: 8px; height: 13px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ---------------- ДАШБОРД ---------------- */
.app-shell { display: grid; gap: 0; grid-template-columns: 1fr; min-height: 60vh; }
@media (min-width: 1024px) { .app-shell { grid-template-columns: 248px 1fr; gap: 32px; } }

.side { display: none; padding-block: 28px; }
@media (min-width: 1024px) {
  .side { display: block; position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; }
}
.side__group + .side__group { margin-top: 24px; }
.side__group > .mono { display: block; padding: 0 12px 8px; }
.side a, .side button {
  width: 100%;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; color: var(--text-dim); text-align: left;
  transition: all var(--dur-fast);
}
.side a:hover, .side button:hover { background: var(--surface-2); color: var(--text); }
.side a.is-active { background: var(--grad-soft); color: var(--accent); }

.app-main { padding-block: 28px 40px; min-width: 0; }
@media (max-width: 1023px) { .app-main { padding-bottom: 104px; } }

/* нижний таб-бар (мобильный) */
.tabbar {
  position: fixed; z-index: var(--z-nav);
  bottom: calc(14px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  display: grid; grid-auto-flow: column; gap: 2px;
  padding: 8px;
  border-radius: var(--r-xl);
  background: var(--surface-glass);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: calc(100vw - 24px);
}
@media (min-width: 1024px) { .tabbar { display: none; } }
.tabbar a {
  display: grid; justify-items: center; gap: 4px;
  padding: 8px 13px; border-radius: var(--r-sm);
  color: var(--text-mute); min-width: 60px;
}
.tabbar a span { font-family: var(--font-mono); font-size: 9px; letter-spacing: .8px; text-transform: uppercase; }
.tabbar a.is-active { color: var(--text); }
.tabbar a.is-active .ico { color: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }

/* ---------------- ТАБЛИЦА С ПРОКРУТКОЙ ---------------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; min-width: 520px; }
table.data th, table.data td {
  padding: 12px 16px; text-align: left; font-size: 13.5px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data th {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-mute); font-weight: 500;
  background: var(--bg-alt);
}
table.data td { color: var(--text-dim); }
table.data td b { color: var(--text); font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--grad-soft); }
.table-hint {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--text-mute);
}

/* ---------------- ФУТЕР ---------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 40px calc(36px + env(safe-area-inset-bottom));
  margin-top: var(--section-y);
}
.foot-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot-grid h4 { font-size: 13px; margin-bottom: 12px; }
.foot-grid a { display: block; padding: 5px 0; font-size: 13.5px; color: var(--text-mute); }
.foot-grid a:hover { color: var(--accent); }
.foot-bottom {
  margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: 12px; color: var(--text-mute);
}

/* ============================================================
   БЛОК АВТОРА
   ============================================================ */
.author-grid {
  display: grid; gap: clamp(24px, 4vw, 48px);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 880px) { .author-grid { grid-template-columns: .82fr 1.18fr; } }

.author-photo {
  position: relative; margin: 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  aspect-ratio: 3 / 4;
  max-width: 420px;
}
.author-photo img { width: 100%; height: 100%; object-fit: cover; }
.author-photo.is-empty::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--grad-soft);
}
.author-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 44px 20px 18px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.72));
  color: #fff;
  display: grid; gap: 4px;
}
[data-theme="warm"] .author-photo figcaption {
  background: linear-gradient(180deg, transparent, rgba(28,27,23,.78));
}
.author-photo figcaption b { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 17px; }
.author-photo figcaption span { font-size: 12.5px; opacity: .82; }

.author-quote {
  margin: 0; padding: 18px 22px;
  border-left: 2px solid var(--accent);
  background: var(--grad-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: clamp(15px, 1.9vw, 18px);
  line-height: 1.55;
}

.author-byline {
  align-items: center;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  transition: border-color var(--dur-fast);
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  .author-byline:hover { border-color: var(--border-strong); }
}
.author-byline .ico { color: var(--text-mute); }

/* знак: подставляем присланный логотип, если файл существует */
.logo__mark { position: relative; overflow: hidden; }
.logo__mark img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 2;
}
.logo__mark img + svg { opacity: 1; }
.logo__mark:has(img) { background: #0b0906; box-shadow: 0 0 18px rgba(255,190,60,.28); }
.logo__mark:has(img) svg { opacity: 0; }

/* грид-элементы не должны растягивать колонку под свой min-content */
.hero__grid > *, .author-grid > *, .app-shell > * { min-width: 0; }
.hero__stat { min-width: 0; }
.hero__stat span { overflow-wrap: anywhere; }

/* на узких экранах «пилюли» переносятся, а не распирают вёрстку */
@media (max-width: 560px) {
  .pill { white-space: normal; }
  .hero .pill.mono { line-height: 1.4; }
  .timer__unit { min-width: 46px; }
}
