:root {
  --bg: #0a0d12;
  --panel: #11161e;
  --ink: #f2f6fb;
  --ink-soft: #9fb0c2;
  --accent: #3b9eff;
  --warm: #ffb454;
  --line: rgba(255, 255, 255, 0.08);
}

/* „Светнала" тема — включва се, когато крушката светне */
body.lit {
  --bg: #f6f1e7;
  --panel: #ffffff;
  --ink: #221a10;
  --ink-soft: #6b5d49;
  --accent: #c87f1b;
  --warm: #e8930c;
  --line: rgba(40, 28, 10, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  overflow-x: hidden;
  transition: background 1.2s ease, color 1.2s ease;
}

a { color: inherit; }

/* ---------- Preloader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  gap: 18px;
  background: #07090d;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-brand {
  font-family: "Unbounded", sans-serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.06em;
  color: #f2f6fb;
}
.loader-brand .bolt, .nav-brand .bolt { color: #ffb454; }
.loader-bar {
  width: 240px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.loader-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #3b9eff, #ffb454);
}
.loader-pct {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3em;
  color: rgba(242, 246, 251, 0.6);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(6, 9, 14, 0.7), rgba(6, 9, 14, 0));
}
body.lit .nav { background: linear-gradient(180deg, rgba(246, 241, 231, 0.8), rgba(246, 241, 231, 0)); }
.nav-brand {
  font-family: "Unbounded", sans-serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}
body.lit .nav-brand { text-shadow: none; }
.nav-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.26em;
  color: var(--ink);
  opacity: 0.7;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}
body.lit .nav-tag { text-shadow: none; }
.nav-cta {
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(59, 158, 255, 0.16);
  border: 1px solid rgba(59, 158, 255, 0.45);
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.nav-cta:hover { background: rgba(59, 158, 255, 0.3); transform: translateY(-1px); }
body.lit .nav-cta { background: rgba(200, 127, 27, 0.14); border-color: rgba(200, 127, 27, 0.5); }

/* ---------- Карта на пътя ---------- */
.waypoints {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 49;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.wp { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.wp i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: background 0.3s, box-shadow 0.3s;
}
body.lit .wp i { background: rgba(40, 28, 10, 0.3); }
.wp span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--ink);
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.25s, transform 0.25s;
}
.wp:hover span { opacity: 0.9; transform: none; }
.wp.active i { background: var(--accent); box-shadow: 0 0 14px rgba(59, 158, 255, 0.8); }
.wp.active span { opacity: 0.9; transform: none; }

/* ---------- Едното видео — pinned сцена ---------- */
.cinematic { position: relative; height: 980vh; }
.cinematic .sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}
.cinematic canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 95% at 50% 45%, transparent 52%, rgba(4, 6, 10, 0.5) 100%),
    linear-gradient(180deg, rgba(4, 6, 10, 0.45) 0%, transparent 24%, transparent 78%, rgba(4, 6, 10, 0.6) 100%);
}

/* ---------- Step панел — четимото съдържание ---------- */
.step-panel {
  position: absolute;
  z-index: 10;
  left: clamp(20px, 6vw, 90px);
  bottom: clamp(24px, 8vh, 80px);
  width: min(540px, calc(100vw - 40px));
  min-height: 320px;
}
.step {
  position: absolute;
  inset: auto 0 0 0;
  padding: 30px 32px;
  border-radius: 20px;
  background: rgba(9, 12, 18, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.step.active { opacity: 1; transform: none; pointer-events: auto; }
.step-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: #7cc0ff;
  margin-bottom: 14px;
}
.step h1, .step h2 {
  font-family: "Unbounded", sans-serif;
  font-weight: 900;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  line-height: 1.08;
  color: #ffffff;
}
.step p {
  margin-top: 12px;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}
.step-list {
  list-style: none;
  margin-top: 16px;
  display: grid;
  gap: 9px;
}
.step-list li {
  position: relative;
  padding-left: 24px;
  font-weight: 600;
  font-size: 0.97rem;
  color: rgba(255, 255, 255, 0.92);
}
.step-list li::before {
  content: "⚡";
  position: absolute;
  left: 0;
  color: #ffb454;
}
.step-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.btn-primary {
  padding: 14px 30px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b9eff, #2f7fe0);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 10px 34px rgba(59, 158, 255, 0.35);
  transition: transform 0.2s ease;
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost {
  padding: 14px 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(9, 12, 18, 0.4);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.btn-ghost:hover { border-color: #ffb454; transform: translateY(-2px); }

/* ---------- Progress + hint ---------- */
.progress {
  position: absolute;
  left: 28px; right: 28px; bottom: 20px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.16);
  z-index: 12;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #3b9eff, #ffb454);
  box-shadow: 0 0 14px rgba(59, 158, 255, 0.6);
}
.scroll-hint {
  position: absolute;
  top: 46vh;
  right: clamp(20px, 7vw, 110px);
  z-index: 12;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  animation: bob 1.8s ease-in-out infinite;
  transition: opacity 0.4s;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 2;
  padding: 30px 24px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  background: var(--bg);
  transition: background 1.2s ease;
}
.footer a { font-weight: 800; color: var(--accent); text-decoration: none; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .nav { padding: 12px 16px; }
  .nav-tag { display: none; }
  .nav-cta { font-size: 12px; padding: 9px 14px; }
  .waypoints { right: 10px; gap: 20px; }
  .wp span { display: none; }
  .cinematic { height: 880vh; }

  /* Стъпките без масивната карта — текст направо върху сцената,
     за да остане видеото видимо. Четимостта идва от градиента долу. */
  .step-panel { left: 16px; right: 16px; bottom: 18px; width: auto; min-height: 0; }
  .step {
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }
  .step-tag { font-size: 10px; margin-bottom: 8px; text-shadow: 0 1px 8px rgba(4, 6, 10, 0.9); }
  .step h1, .step h2 { font-size: 1.45rem; text-shadow: 0 2px 14px rgba(4, 6, 10, 0.95); }
  .step p {
    margin-top: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 10px rgba(4, 6, 10, 0.95);
  }
  .step-list { margin-top: 10px; gap: 6px; }
  .step-list li { font-size: 0.84rem; padding-left: 20px; text-shadow: 0 1px 8px rgba(4, 6, 10, 0.95); }
  .step-actions { margin-top: 14px; }
  .btn-primary, .btn-ghost { padding: 11px 20px; font-size: 0.85rem; }

  /* По-плътно затъмняване в долната зона — там живее текстът */
  .veil {
    background:
      radial-gradient(120% 95% at 50% 42%, transparent 50%, rgba(4, 6, 10, 0.45) 100%),
      linear-gradient(
        180deg,
        rgba(4, 6, 10, 0.5) 0%,
        transparent 22%,
        transparent 52%,
        rgba(4, 6, 10, 0.82) 86%,
        rgba(4, 6, 10, 0.92) 100%
      );
  }

  .scroll-hint { display: none; }
  .progress { left: 16px; right: 16px; bottom: 10px; }
}
