/* ============================================================
   Трейдинг Академия — дизайн система
   Палитра: дълбоко нави + злато + трейдинг зелено/червено
   Шрифтове: Sofia Sans (BG кирилица), Sofia Sans Extra Condensed,
             JetBrains Mono (цифри, етикети, тикери)
   ============================================================ */

:root {
  --bg: #0a1120;
  --bg-2: #0d1628;
  --panel: #101b31;
  --panel-2: #14213c;
  --line: rgba(200, 220, 255, 0.09);
  --line-strong: rgba(200, 220, 255, 0.16);
  --text: #e9effa;
  --muted: #8fa1be;
  --gold: #e9b44c;
  --gold-2: #f5d488;
  --gold-ink: #2a2008;
  --up: #2ebd85;
  --down: #f6465d;
  --radius: 14px;
  --radius-sm: 9px;
  --font-body: "Sofia Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Sofia Sans Extra Condensed", "Sofia Sans", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --container: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }

/* Атрибутът hidden трябва да бие всяко display правило (иначе .form { display:grid }
   и подобни показват елементи, които JS смята за скрити). */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* clip, НЕ hidden — hidden създава scroll container и чупи position: sticky */
  overflow-x: clip;
}

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

a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }

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

::selection { background: rgba(233, 180, 76, 0.35); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 22px;
}

/* ---------- Типография ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(3rem, 8.5vw, 6.2rem); }
h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h3 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); letter-spacing: 0.02em; }

p { margin: 0 0 1em; }

.lead {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--muted);
  max-width: 56ch;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--gold);
  flex: none;
}

.gold { color: var(--gold); }
.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- Навигация ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 17, 32, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-right: auto;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; flex: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li a, .nav-links li .btn {
    display: block;
    padding: 13px 22px;
    width: 100%;
    text-align: left;
  }
  .nav-links li .btn { border-radius: 0; background: none; color: var(--gold); box-shadow: none; }
}

/* ---------- Бутони ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: var(--radius-sm);
  border: 0;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.02rem;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-gold {
  background: linear-gradient(160deg, var(--gold-2), var(--gold));
  color: var(--gold-ink);
  box-shadow: 0 8px 28px rgba(233, 180, 76, 0.28);
}
.btn-gold:hover { box-shadow: 0 10px 34px rgba(233, 180, 76, 0.4); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); }

.btn-sm { padding: 11px 20px; font-size: 0.95rem; }
.btn-block { width: 100%; }

.btn[disabled] { opacity: 0.55; cursor: wait; transform: none; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(48px, 8vw, 96px) 0 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0 30px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 4vw, 44px);
  font-family: var(--font-mono);
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.hero-stats .stat b {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.hero-stats .stat span {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-art { position: relative; }
.hero-art img {
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 120px rgba(233, 180, 76, 0.07);
  max-height: 640px;
  width: auto;
  margin-inline: auto;
}
.hero-art::before {
  content: "";
  position: absolute;
  inset: -12% -8%;
  background: radial-gradient(closest-side, rgba(233, 180, 76, 0.14), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 340px; margin-inline: auto; }
}

/* ---------- Подпис: лента от свещи (хаос → система) ---------- */

.candle-band {
  margin-top: clamp(40px, 7vw, 80px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 27, 49, 0.5), rgba(10, 17, 32, 0));
  overflow: hidden;
}
.candle-band svg { display: block; width: 100%; height: auto; }

.candle { opacity: 0; transform: translateY(8px); }
.candle-line {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
}

.candles-go .candle {
  animation: candle-in 0.45s ease forwards;
}
.candles-go .candle-line {
  animation: line-draw 2.6s cubic-bezier(0.4, 0, 0.2, 1) 0.9s forwards;
}

@keyframes candle-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes line-draw {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .candle, .candles-go .candle { animation: none; opacity: 1; transform: none; }
  .candle-line, .candles-go .candle-line { animation: none; stroke-dashoffset: 0; }
}

.candle-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 0 14px;
}
.candle-caption .down { color: var(--down); }
.candle-caption .up { color: var(--up); }

/* ---------- Секции ---------- */

.section { padding: clamp(56px, 9vw, 110px) 0; }
.section-tight { padding: clamp(40px, 6vw, 72px) 0; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--line); }

.section-head { max-width: 720px; margin-bottom: clamp(30px, 5vw, 54px); }

/* Скрол разкриване */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Продуктови карти ---------- */

.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 960px) { .products { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; } }

.product {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.product:hover { transform: translateY(-4px); border-color: var(--line-strong); }

.product-media { aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-2); transform-origin: center 30%; }
.products { perspective: 1200px; }
.product-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }

.product-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.product-body h3 { margin-bottom: 2px; }
.product-body .desc { color: var(--muted); font-size: 0.98rem; flex: 1; }

.product-featured {
  border-color: rgba(233, 180, 76, 0.45);
  box-shadow: 0 18px 60px rgba(233, 180, 76, 0.09);
  position: relative;
}
.badge {
  position: absolute;
  top: 14px; left: 14px;
  background: var(--gold);
  color: var(--gold-ink);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 6px;
  z-index: 2;
}

/* ---------- Цени ---------- */

.price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  margin: 4px 0 12px;
}
.price .now { font-size: 1.75rem; font-weight: 700; color: var(--gold-2); }
.price .bgn { font-size: 0.85rem; color: var(--muted); }
.price .was {
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--down);
}

.price-xl .now { font-size: 2.6rem; }

/* ---------- Списъци ✓ / ✗ ---------- */

.checklist, .crosslist {
  list-style: none;
  margin: 0 0 1.2em;
  padding: 0;
  display: grid;
  gap: 11px;
}
.checklist li, .crosslist li {
  position: relative;
  padding-left: 34px;
}
.checklist li::before, .crosslist li::before {
  position: absolute;
  left: 0;
  top: 1px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
}
.checklist li::before { content: "▲"; color: var(--up); }
.crosslist li::before { content: "▼"; color: var(--down); }

.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
}
@media (max-width: 760px) { .cols-2 { grid-template-columns: 1fr; } }

/* ---------- Включено в пакета ---------- */

.includes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  counter-reset: inc;
}
.include {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.include b { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.include span { color: var(--muted); font-size: 0.93rem; }
.include .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(233, 180, 76, 0.35);
  border-radius: 5px;
  padding: 3px 8px;
  margin-bottom: 12px;
}

/* ---------- Отзиви ---------- */

.reviews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.review {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.review .stars { color: var(--gold); letter-spacing: 3px; font-size: 0.9rem; }
.review blockquote { margin: 0; flex: 1; color: var(--text); }
.review cite {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}
.review cite::before { content: "— "; }

/* ---------- FAQ ---------- */

.faq { max-width: 780px; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  padding: 17px 20px;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 1.2rem;
  flex: none;
}
.faq details[open] summary::after { content: "–"; }
.faq .faq-a { padding: 0 20px 18px; color: var(--muted); }

/* ---------- CTA лента ---------- */

.cta-band {
  background:
    radial-gradient(90% 140% at 50% -20%, rgba(233, 180, 76, 0.16), transparent 60%),
    var(--panel);
  border: 1px solid rgba(233, 180, 76, 0.3);
  border-radius: var(--radius);
  padding: clamp(34px, 6vw, 60px);
  text-align: center;
}
.cta-band h2 { margin-bottom: 10px; }
.cta-band .lead { margin-inline: auto; }

/* ---------- Форми ---------- */

.form { display: grid; gap: 16px; max-width: 560px; }
.form label { font-weight: 700; font-size: 0.95rem; display: grid; gap: 7px; }
.form input, .form textarea, .form select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 15px;
}
.form input:focus, .form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(233, 180, 76, 0.18);
}
.form textarea { min-height: 140px; resize: vertical; }
.form .hint { font-size: 0.88rem; color: var(--muted); }

.notice {
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--gold);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 0.97rem;
}
.notice.ok { border-left-color: var(--up); }
.notice.err { border-left-color: var(--down); }

/* ---------- Модал (Revolut) ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 18, 0.78);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  padding: 28px;
  max-height: 90vh;
  overflow: auto;
}
.modal h3 { margin-bottom: 6px; }
.modal-close {
  float: right;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

/* ---------- Курс (защитена страница) ---------- */

.module {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 18px;
  overflow: hidden;
}
.module-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.module-head .num {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 0.85rem;
}
.module-head h3 { margin: 0; font-size: 1.15rem; }
.video-wrap {
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Блог ---------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.post-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--line-strong); text-decoration: none; }
.post-card .meta { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.post-card p { color: var(--muted); margin: 0; }

.article {
  max-width: 720px;
  margin-inline: auto;
}
.article h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.article h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin-top: 1.6em; }
.article .meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2em;
}
.article ul { padding-left: 22px; }
.article li { margin-bottom: 8px; }
.article .inline-cta {
  border: 1px solid rgba(233, 180, 76, 0.35);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 2em 0;
}
.article .inline-cta p { margin-bottom: 14px; }

/* ---------- Админ ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.orders { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
table.orders th, table.orders td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.orders th { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); }
table.orders .st-paid { color: var(--up); }
table.orders .st-pending { color: var(--gold); }

/* ---------- Футър ---------- */

.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 44px 0 28px;
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { color: var(--text); }
.footer a:hover { color: var(--gold-2); }
.disclaimer {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.6;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

/* ---------- 3D книга (CSS слой) ---------- */

.book3d {
  position: relative;
  perspective: 1400px;
  perspective-origin: 50% 45%;
  width: min(340px, 78vw);
  margin-inline: auto;
}
/* Ъглите са БЕЗ мерна единица (GSAP анимира числа) — deg се слага в calc */
.book3d-body {
  --rx: 0;
  --ry: 0;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--rx) * 1deg)) rotateY(calc((-14 + var(--ry)) * 1deg));
  transition: transform 0.5s cubic-bezier(.2, .8, .2, 1);
  will-change: transform;
}
.book3d.active .book3d-body { transition: transform 0.12s linear; }

/* Влизане: книгата се „отваря" към читателя — също чист CSS */
html.js .book3d .book3d-body {
  animation: book-in 1s cubic-bezier(.2, .9, .25, 1) .12s both;
}
@keyframes book-in {
  from { opacity: 0; transform: rotateX(6deg) rotateY(-42deg) translateY(24px) scale(.94); }
  to { opacity: 1; transform: rotateX(calc(var(--rx) * 1deg)) rotateY(calc((-14 + var(--ry)) * 1deg)); }
}
.book3d.no-motion .book3d-body { animation: none; transition: none; }

/* Лицето — корицата. Изрично отменя общото правило за .hero-art img */
.book3d picture { display: block; }
.book3d-face,
.hero-art .book3d .book3d-face {
  --open: 0;
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 3px 8px 8px 3px;
  transform-origin: left center;
  transform: translateZ(14px) rotateY(calc(var(--open) * 1deg));
  box-shadow: 0 2px 5px rgba(0, 0, 0, .55);
  backface-visibility: hidden;
}

/* Първата страница — показва се, докато корицата се отваря */
.book3d-page {
  position: absolute;
  inset: 0;
  transform: translateZ(12px);
  background: linear-gradient(160deg, #f7f9fc, #e7ecf5);
  border-radius: 3px 8px 8px 3px;
  padding: 12% 11%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  overflow: hidden;
}
.book3d-page p {
  margin: 0;
  color: #24304a;
  font-size: clamp(0.62rem, 1.15vw, 0.82rem);
  line-height: 1.62;
}
.book3d-page .page-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #9a7420;
}
.book3d-page .page-sign {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  color: #6b7a95;
}
/* Дебелина: срез от страници — панел, завъртян около центъра си на десния ръб */
.book3d-pages {
  position: absolute;
  top: 0;
  left: calc(100% - 14px);
  height: 100%;
  width: 28px;
  transform: rotateY(90deg);
  background:
    repeating-linear-gradient(to right,
      #e9edf5 0 1px, #c9d1e0 1px 2px, #f4f7fb 2px 3px);
}
/* Гръбче — същият похват на левия ръб */
.book3d-spine {
  position: absolute;
  top: 0;
  left: -14px;
  height: 100%;
  width: 28px;
  transform: rotateY(-90deg);
  background: linear-gradient(90deg, #060c18, #14243f 55%, #060c18);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, .7);
}
.book3d-spine span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}
/* Задна корица */
.book3d-back {
  position: absolute;
  inset: 0;
  transform: translateZ(-14px);
  background: linear-gradient(160deg, #101b31, #0a1120);
  border-radius: 8px 3px 3px 8px;
}
/* Сянка на пода */
.book3d-shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -22px;
  height: 26px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .65), transparent 75%);
  filter: blur(6px);
  transform: translateZ(-40px);
}
/* Златно сияние зад книгата */
.book3d::before {
  content: "";
  position: absolute;
  inset: -14% -18%;
  background: radial-gradient(closest-side, rgba(233, 180, 76, .16), transparent 70%);
  pointer-events: none;
}

/* WebGL слой — покрива CSS книгата, когато е готов */
.book3d-gl {
  position: absolute;
  inset: -8%;
  opacity: 0;
  transition: opacity .8s ease;
  pointer-events: none;
}
.book3d-gl.ready { opacity: 1; }
.book3d.gl-on .book3d-body { opacity: 0; transition: opacity .6s ease; }

@media (prefers-reduced-motion: reduce) {
  html.js .book3d .book3d-body {
    opacity: 1;
    transform: rotateY(-14deg);
    animation: none;
    transition: none;
  }
}

/* ---------- Входна оркестрация на hero-то ---------- */

/* Чиста CSS анимация — не чака JavaScript, значи няма как да „заседне" скрита */
html.js .hero-in > * {
  opacity: 0;
  animation: hero-rise .55s cubic-bezier(.2, .8, .2, 1) forwards;
}
html.js .hero-in > *:nth-child(1) { animation-delay: .05s; }
html.js .hero-in > *:nth-child(2) { animation-delay: .13s; }
html.js .hero-in > *:nth-child(3) { animation-delay: .21s; }
html.js .hero-in > *:nth-child(4) { animation-delay: .29s; }
html.js .hero-in > *:nth-child(5) { animation-delay: .37s; }

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* Светлинна вълна по златната дума — веднъж */
.shine {
  background: linear-gradient(100deg, var(--gold) 38%, #fff4d6 48%, var(--gold) 58%);
  background-size: 260% 100%;
  background-position: 120% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html.js .hero-in .shine { animation: shine-sweep 1.5s cubic-bezier(.3, 0, .2, 1) .75s 1 forwards; }
@keyframes shine-sweep {
  to { background-position: -40% 0; }
}

@media (prefers-reduced-motion: reduce) {
  html.js .hero-in > * { opacity: 1; transform: none; animation: none; }
  html.js .hero-in .shine { animation: none; }
  .shine { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--gold); }
}

/* ---------- Курсорно осветяване на картите ---------- */

.lit { position: relative; overflow: hidden; }
.lit::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(233, 180, 76, .13), transparent 70%);
}
@media (hover: hover) {
  .lit:hover::after { opacity: 1; }
}

/* ---------- Магнитни бутони ---------- */
.btn.magnetic { will-change: transform; }

/* ---------- Отзиви с лека 3D дълбочина ---------- */
@media (hover: hover) {
  .reviews { perspective: 900px; }
  .review { transition: transform .3s cubic-bezier(.2, .8, .2, 1), border-color .3s ease, box-shadow .3s ease; }
  .review:hover {
    transform: translateZ(24px) translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: 0 22px 50px rgba(0, 0, 0, .45);
  }
}
@media (prefers-reduced-motion: reduce) {
  .review:hover { transform: none; }
}

/* ---------- Доверителен ред ---------- */
.trustline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 16px;
}
.trustline span { display: inline-flex; align-items: center; gap: 7px; }
.trustline .icon { width: 15px; height: 15px; color: var(--up); }

/* ---------- Социални доказателства (екрани от TikTok) ---------- */
.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.proof {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.proof-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.proof-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); flex: none; }
.proof p { margin: 0; font-size: 0.97rem; }
.proof img { border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* ---------- Автор ---------- */
.author-hero {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
}
@media (max-width: 760px) {
  .author-hero { grid-template-columns: 1fr; text-align: center; }
  .author-portrait { margin-inline: auto; }
}
.author-portrait {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(233, 180, 76, .28), transparent 60%),
    var(--panel);
  border: 2px solid rgba(233, 180, 76, .45);
  overflow: hidden;
  position: relative;
}
.author-portrait img { width: 100%; height: 100%; object-fit: cover; }
.author-portrait .initials {
  font-family: var(--font-display);
  font-size: 4.2rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.04em;
}
.principles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.principle {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 20px;
}
.principle b { display: block; margin-bottom: 6px; font-size: 1.05rem; }
.principle span { color: var(--muted); font-size: 0.95rem; }

/* ---------- Премиум полиш ---------- */

/* Фонова дълбочина: фин mesh + шум */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(90% 50% at 85% -5%, rgba(233, 180, 76, 0.05), transparent 60%),
    radial-gradient(80% 55% at 8% 105%, rgba(46, 189, 133, 0.045), transparent 60%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* Микро-интеракции на бутоните */
.btn { transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease; }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-gold:active { box-shadow: 0 4px 16px rgba(233, 180, 76, 0.3); }

/* SVG маркери на списъците (замяна на текстовите ▲/▼) */
.checklist li::before, .crosslist li::before { content: ""; width: 18px; height: 18px; top: 5px; background-repeat: no-repeat; background-size: contain; }
.checklist li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232ebd85' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.crosslist li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6465d' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }

.icon {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- Value stack ---------- */

.stack {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 6px 0 14px;
  font-size: 0.95rem;
}
.stack-row, .stack-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 10px 14px;
}
.stack-row + .stack-row, .stack-total { border-top: 1px solid var(--line); }
.stack-row span { color: var(--muted); }
.stack-row b { font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.stack-row b s { color: var(--muted); margin-right: 6px; }
.stack-row .gift { color: var(--up); font-weight: 700; }
.stack-total { background: rgba(233, 180, 76, 0.07); }
.stack-total b { font-family: var(--font-mono); color: var(--gold-2); }

.rating-line {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin: -4px 0 12px;
}
.rating-line .gold { letter-spacing: 2px; }

/* ---------- Мини-тест „Кой мозък те води?" ---------- */

.quiz {
  max-width: 640px;
  margin-inline: auto;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 36px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.quiz-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}
.quiz-progress i {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--line-strong);
  transition: background 0.3s ease;
}
.quiz-progress i.done { background: var(--gold); }
.quiz-q {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 18px;
}
.quiz-answers { display: grid; gap: 10px; }
.quiz-answer {
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
  min-height: 48px;
}
.quiz-answer:hover { border-color: var(--gold); }
.quiz-answer:active { transform: scale(0.98); }
.quiz-step { animation: quiz-in 0.35s ease; }
@keyframes quiz-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-step { animation: none; }
}
.quiz-result { text-align: center; }
.quiz-result .brain-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid rgba(233, 180, 76, 0.4);
  border-radius: 999px;
  padding: 8px 18px;
  color: var(--gold);
  margin-bottom: 14px;
}
.quiz-result h3 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.quiz-result p { color: var(--muted); max-width: 46ch; margin-inline: auto; }
.quiz-restart {
  background: none;
  border: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 14px;
  text-decoration: underline;
}

/* ---------- 7-те гряха — чеклист на болката ---------- */

.sins { display: grid; gap: 10px; max-width: 760px; }
.sin {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 16px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
  min-height: 48px;
}
.sin .sin-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  flex: none;
  width: 22px;
}
.sin .sin-check {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  flex: none;
  display: grid;
  place-items: center;
  color: transparent;
  transition: all 0.16s ease;
}
.sin[aria-pressed="true"] {
  border-color: rgba(246, 70, 93, 0.55);
  background: rgba(246, 70, 93, 0.07);
}
.sin[aria-pressed="true"] .sin-check {
  border-color: var(--down);
  background: var(--down);
  color: #fff;
}
.sins-verdict {
  margin-top: 18px;
  font-size: 1.05rem;
}
.sins-verdict b { color: var(--gold-2); }

/* ---------- Безплатен откъс (lead form) ---------- */

.sample-box {
  background:
    radial-gradient(100% 160% at 50% -30%, rgba(233, 180, 76, 0.13), transparent 55%),
    var(--panel);
  border: 1px solid rgba(233, 180, 76, 0.35);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}
.sample-box h3 { margin-bottom: 8px; }
.sample-box .lead { margin-inline: auto; font-size: 1.02rem; }
.sample-form {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 18px auto 0;
}
.sample-form input[type="email"] {
  flex: 1;
  min-width: 0;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 15px;
}
.sample-form input[type="email"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(233, 180, 76, 0.18);
}
@media (max-width: 560px) {
  .sample-form { flex-direction: column; }
}
.sample-note { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); margin-top: 10px; }

/* ---------- Гаранция ---------- */

.guarantee {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid rgba(46, 189, 133, 0.35);
  background: rgba(46, 189, 133, 0.05);
  border-radius: var(--radius);
  padding: 20px 22px;
  max-width: 640px;
}
.guarantee .icon { width: 30px; height: 30px; color: var(--up); margin-top: 3px; }
.guarantee b { display: block; margin-bottom: 4px; }
.guarantee p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* ---------- Отзиви: аватари ---------- */

.review-head { display: flex; align-items: center; gap: 12px; }
.review-head cite::before { content: none; }
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #0a1120;
  flex: none;
}
.review-head cite { font-size: 0.95rem; color: var(--text); font-weight: 700; }
.review-head .stars { font-size: 0.78rem; display: block; margin-top: 2px; }

/* ---------- Sticky CTA лента (мобилно) ---------- */

.buybar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(13, 22, 40, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(233, 180, 76, 0.35);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  transform: translateY(110%);
  transition: transform 0.3s ease;
}
.buybar .buybar-info b { display: block; font-size: 0.92rem; line-height: 1.25; }
.buybar .buybar-info span { font-family: var(--font-mono); font-size: 0.78rem; color: var(--gold-2); }
.buybar .btn { flex: none; }
@media (max-width: 860px) {
  .buybar { display: flex; }
  body.buybar-on .buybar { transform: translateY(0); }
  body.buybar-on { padding-bottom: 76px; }
  body.modal-open .buybar { transform: translateY(110%); }
}
@media (prefers-reduced-motion: reduce) {
  .buybar { transition: none; }
}

/* ---------- Скрол-история „Пътят на Иван" ---------- */

.story {
  background: var(--bg-2);
  border-block: 1px solid var(--line);
}
.story-track { position: relative; }
.story-live .story-track { height: 260vh; }
.story-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px;
}
.story-live .story-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 0;
}

.story-chart {
  width: min(1100px, 96%);
  height: auto;
  display: block;
}
.story-candle {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.story-candle.show { opacity: 1; }
.story-equity {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}
.story-static .story-candle { transition: none; }

/* Иван на бюрото */
.story-scene {
  position: absolute;
  left: clamp(8px, 6vw, 90px);
  bottom: 24vh;
  bottom: 24svh;
  width: min(320px, 44vw);
  height: auto;
  pointer-events: none;
}
.story-scene .fig {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.story-scene[data-pose="1"] .fig-1,
.story-scene[data-pose="2"] .fig-2,
.story-scene[data-pose="3"] .fig-3,
.story-scene[data-pose="4"] .fig-4 { opacity: 1; }
.story-scene .scene-glow { transition: fill 0.4s ease, opacity 0.4s ease; }
.story-scene[data-mood="red"] .scene-glow { fill: #f6465d; opacity: 0.3; }
.story-scene[data-mood="dim"] .scene-glow { fill: #8fa1be; opacity: 0.12; }
.story-scene[data-mood="green"] .scene-glow { fill: #2ebd85; opacity: 0.32; }
.story-scene .stop-chip {
  opacity: 0;
  transition: opacity 0.25s ease;
}
.story-scene.stop-on .stop-chip { opacity: 1; }
@media (max-width: 700px) {
  .story-scene {
    left: 50%;
    transform: translateX(-50%);
    bottom: 34vh;
    bottom: 34svh;
    width: min(240px, 70vw);
  }
}
.story-static .story-scene { position: static; margin: 20px auto; transform: none; }

/* WebGL слой със свещите — ФОНОВА дълбочина ЗАД плоските свещи (само десктоп).
   Нарочно не заменя SVG-то: така историята изглежда правилно навсякъде,
   а на мощните машини получава обем и паралакс. */
.story-3d {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
.story-3d.ready { opacity: .6; }
.story-chart { position: relative; z-index: 1; }

.story-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 50%, transparent 40%, rgba(246, 70, 93, 0.28) 100%);
  opacity: 0;
}

.story-hud {
  position: absolute;
  top: clamp(16px, 4vh, 40px);
  top: clamp(16px, 4svh, 40px);
  right: clamp(16px, 5vw, 56px);
  text-align: right;
  font-family: var(--font-mono);
  pointer-events: none;
}
.story-hud-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.story-balance {
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.story-balance.down { color: var(--down); }
.story-balance.up { color: var(--up); }

.story-act-label {
  position: absolute;
  top: clamp(16px, 4vh, 40px);
  top: clamp(16px, 4svh, 40px);
  left: clamp(16px, 5vw, 56px);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  pointer-events: none;
}

.story-beat {
  position: absolute;
  max-width: min(420px, 86vw);
  pointer-events: none;
}
.story-live .story-beat {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.story-live .story-beat.on { opacity: 1; transform: none; }

.story-beat .story-brain {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  margin: 0 0 6px;
}
.story-beat .story-line {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 600;
  margin: 0;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}
[data-beat="1a"] { left: clamp(12px, 7vw, 90px); top: 16vh; top: 16svh; }
[data-beat="1a"] .story-line { border-left: 3px solid var(--down); }
[data-beat="1b"] { right: clamp(12px, 7vw, 90px); top: 26vh; top: 26svh; }
[data-beat="1b"] .story-line { border-left: 3px solid var(--down); }

.story-book {
  left: 50%;
  top: 50%;
  text-align: center;
  max-width: min(480px, 90vw);
}
.story-live .story-book {
  transform: translate(-50%, -46%) scale(0.94);
}
.story-live .story-book.on {
  transform: translate(-50%, -50%) scale(1);
}
.story-static .story-book {
  position: static;
  margin: 30px auto;
}
.story-book img {
  width: auto;
  max-height: 44vh;
  max-height: 44svh;
  max-width: 70vw;
  margin: 0 auto 16px;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 90px rgba(233, 180, 76, 0.35);
}
.story-book .story-line {
  background: none;
  border: 0;
  box-shadow: none;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  padding: 0;
}
.story-brains-row {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin: 10px 0 0;
}

.story-badges {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 12vh;
  top: 12svh;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: max-content;
  max-width: 92vw;
  pointer-events: none;
}
.story-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--up);
  border: 1px solid rgba(46, 189, 133, 0.45);
  background: rgba(46, 189, 133, 0.08);
  border-radius: 999px;
  padding: 7px 14px;
}
.story-live .story-badge {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.story-live .story-badge.on { opacity: 1; transform: none; }

.story-finale {
  left: 50%;
  bottom: 6vh;
  bottom: 6svh;
  text-align: center;
  max-width: min(640px, 92vw);
}
.story-live .story-finale { transform: translate(-50%, 18px); }
.story-live .story-finale.on { transform: translate(-50%, 0); }
.story-static .story-finale { position: static; margin: 30px auto 10px; }
.story-finale blockquote {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.6vw, 2.3rem);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
}
.story-finale blockquote .gold-word { color: var(--gold); }
.story-finale cite {
  display: block;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 18px;
}
.story-finale .btn { pointer-events: auto; }

.story-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 4vh;
  bottom: 4svh;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  pointer-events: none;
  transition: opacity 0.4s ease;
  animation: hint-bob 1.6s ease-in-out infinite;
}
.story-hint.off { opacity: 0; }
.story-static .story-hint { display: none; }
@keyframes hint-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}
@media (prefers-reduced-motion: reduce) {
  .story-hint { animation: none; }
}

@keyframes story-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(2px, -1px); }
  50% { transform: translate(-2px, 1px); }
  75% { transform: translate(1px, 2px); }
}
.story-live .story-stage.shake .story-chart {
  animation: story-shake 0.28s linear infinite;
}

/* Статичен режим: панелите се подреждат вертикално */
.story-static .story-stage { height: auto; padding: 48px 24px; }
.story-static .story-beat { position: static; margin: 18px auto; pointer-events: auto; }
.story-static .story-badges { position: static; transform: none; margin: 18px auto; }

@media (max-width: 700px) {
  [data-beat="1a"] { top: 12vh; top: 12svh; }
  [data-beat="1b"] { top: 30vh; top: 30svh; }
  .story-badges { top: 14vh; top: 14svh; }
  .story-book img { max-height: 36vh; max-height: 36svh; }
}

/* ---------- TikTok landing (/start) ---------- */

.start-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 0;
  text-align: center;
}
.start-page .hero-art { max-width: 250px; margin: 0 auto 26px; }
.start-page h1 { font-size: clamp(2.6rem, 10vw, 4rem); }
.start-page .lead { margin-inline: auto; }
.start-cta { display: grid; gap: 12px; max-width: 380px; margin: 26px auto 0; }
.start-note { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); margin-top: 16px; }

/* ---------- Банер за бисквитки ---------- */

.cookie-banner {
  position: fixed;
  left: 0; right: 0; top: 0;
  z-index: 300;
  background: rgba(10, 17, 32, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(233, 180, 76, 0.35);
  transform: translateY(-110%);
  transition: transform 0.35s ease;
  padding: env(safe-area-inset-top) 0 0;
}
.cookie-banner.cookie-banner-in { transform: translateY(0); }
.cookie-banner.cookie-banner-out { transform: translateY(-110%); }
.cookie-banner-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.cookie-banner-text {
  flex: 1 1 420px;
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}
.cookie-banner-text a { color: var(--gold-2); }
.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex: none;
  flex-wrap: wrap;
}
@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transition: none; }
}
@media (max-width: 640px) {
  .cookie-banner-inner { padding: 12px 16px; }
  .cookie-banner-actions { width: 100%; }
  .cookie-banner-actions .btn { flex: 1; }
}

/* ---------- Toast известия (грешки при покупка) ---------- */

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(140%);
  z-index: 400;
  max-width: min(440px, 92vw);
  width: max-content;
  transition: transform 0.3s ease;
  pointer-events: none;
}
.toast-wrap.show { transform: translateX(-50%) translateY(0); }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--down);
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  padding: 14px 16px;
  font-size: 0.93rem;
  color: var(--text);
  pointer-events: auto;
}
.toast-close {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
  margin-left: auto;
  padding: 0;
}
body.buybar-on .toast-wrap { bottom: 86px; }
@media (prefers-reduced-motion: reduce) {
  .toast-wrap { transition: none; }
}

/* ============================================================
   Клиентски панел (/panel/) — книгата, курсът, материалите
   ============================================================ */

/* Панелът има своя проста шапка — без мобилното падащо меню на сайта */
.panel-nav-actions { display: flex; align-items: center; gap: 18px; }
.panel-nav-link { color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.panel-nav-link:hover { color: var(--text); text-decoration: none; }
@media (max-width: 560px) {
  .panel-nav-link { display: none; }
  .panel-nav-actions { gap: 10px; }
}

.panel-spinner {
  width: 42px;
  height: 42px;
  margin: 30px auto 0;
  border: 3px solid var(--line-strong);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: panel-spin 0.9s linear infinite;
}
@keyframes panel-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .panel-spinner { animation-duration: 3s; }
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(24px, 5vw, 40px);
}
.code-input {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  letter-spacing: 0.5em;
  text-align: center;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.panel-progress { display: grid; justify-items: center; gap: 6px; }
.panel-progress .ring {
  --p: 0;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gold);
  background:
    conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(200, 220, 255, 0.12) 0);
  transition: background 0.4s ease;
}
.panel-progress .ring::before {
  content: "";
  position: absolute;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--bg);
}
.panel-progress .ring { position: relative; }
.panel-progress .ring span { position: relative; }
.panel-progress .label { font-size: 0.8rem; color: var(--muted); }

.panel-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
  overflow-x: auto;
  scrollbar-width: none;
}
.panel-tabs::-webkit-scrollbar { display: none; }
.ptab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.ptab svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.ptab:hover { color: var(--text); }
.ptab.is-active { color: var(--gold); border-bottom-color: var(--gold); }

.ptab-panel { display: none; }
.ptab-panel.is-active { display: block; animation: ptab-in 0.35s ease both; }
@keyframes ptab-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .ptab-panel.is-active { animation: none; }
}

.reader {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.reader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.reader-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.reader-frame { position: relative; background: #16182a; }
.reader-frame iframe {
  width: 100%;
  height: min(78vh, 900px);
  border: 0;
  display: block;
  position: relative;
  z-index: 1;
}
.reader-hint {
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
@media (max-width: 640px) {
  .reader-frame iframe { height: 62vh; }
}

.module.is-watched { border-color: rgba(46, 189, 133, 0.45); }
.module.is-watched .module-head .num { color: var(--up); }
.watch-mark {
  margin-left: auto;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.watch-mark:hover { color: var(--text); border-color: var(--line-strong); }
.watch-mark[aria-pressed="true"] {
  color: var(--up);
  border-color: rgba(46, 189, 133, 0.5);
  background: rgba(46, 189, 133, 0.1);
}
.module-soon { color: var(--muted); padding: 18px; margin: 0; }

.extras { display: grid; gap: 14px; }
.extra {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: 18px 20px;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.extra:hover { border-color: var(--gold); transform: translateY(-2px); text-decoration: none; }
.extra b { font-size: 1.05rem; }
.extra span { color: var(--muted); font-size: 0.92rem; }
