/* ============ DIGITAL KARMAA — 3D story experience ============ */

.story-body {
  background: #05060f;
}

/* Full-page fixed 3D world behind everything */
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ============ PROGRESS RAIL ============ */
.rail {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  height: 46vh;
  z-index: 50;
  pointer-events: none;
}
.rail-line {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, rgba(139, 92, 246, 0.6), rgba(34, 211, 238, 0.35), rgba(255, 255, 255, 0.08));
}
.rail-dot {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -50%);
  color: #e879f9;
  font-size: 14px;
  text-shadow: 0 0 12px rgba(232, 121, 249, 0.9), 0 0 26px rgba(139, 92, 246, 0.7);
  transition: top 0.15s linear;
}

/* ============ CHAPTERS ============ */
.chapter {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 0;
}
.ch-content {
  width: min(1160px, 92%);
  margin: 0 auto;
}
.ch-left .ch-content { display: flex; justify-content: flex-start; }
.ch-right .ch-content { display: flex; justify-content: flex-end; }
.ch-center .ch-content { text-align: center; }

.ch-left .glass, .ch-right .glass { max-width: 520px; }
.glass {
  background: rgba(8, 10, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 44px 40px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.ch-eyebrow {
  color: var(--cyan);
  font-family: var(--font-head);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.ch-num {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 16px;
}
.ch-hero-title {
  font-size: clamp(3rem, 8vw, 6.2rem);
  font-weight: 700;
  letter-spacing: -2px;
  margin-bottom: 22px;
}
.ch-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -1.2px;
  margin-bottom: 18px;
}
.ch-sub {
  color: var(--text-dim);
  font-size: 1.12rem;
  max-width: 560px;
}
.ch-center .ch-sub { margin: 0 auto; }
.ch-service {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 0.98rem;
}
.ch-cta { margin-top: 36px; }
.ch-center .ch-cta { justify-content: center; }

/* Chapter 4 stats */
.story-stats {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 6vw, 72px);
  margin-top: 44px;
  flex-wrap: wrap;
}
.story-stats p { color: var(--text-dim); font-size: 0.9rem; margin-top: 2px; }

/* ============ FINALE / FOOTER ============ */
.chapter-final {
  justify-content: flex-end;
  gap: 12vh;
  padding-top: 30vh;
  padding-bottom: 0;
}
.chapter-final .ch-content { flex: none; }
.story-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 6, 15, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 26px 0;
  width: 100%;
}
.story-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.story-footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.story-footer-links a {
  color: var(--text);
  opacity: 0.75;
  text-decoration: none;
  font-size: 0.92rem;
  transition: opacity 0.2s, color 0.2s;
}
.story-footer-links a:hover { opacity: 1; color: var(--cyan); }
.story-footer p { color: var(--text-dim); font-size: 0.85rem; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .rail { right: 12px; height: 38vh; }
  .glass { padding: 32px 24px; }
  .ch-left .ch-content, .ch-right .ch-content { justify-content: center; }
  .story-footer-inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .rail-dot { transition: none; }
}
