:root {
  --bg: #05070d;
  --surface: rgba(9, 14, 25, 0.72);
  --surface-soft: rgba(16, 24, 39, 0.64);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f2f5ff;
  --muted: #9eb0ca;
  --accent: #ff3d2e;
  --accent-2: #34c8ff;
  --ok: #48d597;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: radial-gradient(circle at 20% 20%, #1b1225 0%, #05070d 44%),
    radial-gradient(circle at 80% 10%, #122542 0%, transparent 40%),
    var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, #000 52%, transparent 95%);
  z-index: -1;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(38px);
  opacity: 0.34;
  z-index: -1;
  pointer-events: none;
  animation: drift 15s ease-in-out infinite alternate;
}

.orb-a {
  width: 340px;
  height: 340px;
  background: #f54a37;
  top: -70px;
  right: -100px;
}

.orb-b {
  width: 300px;
  height: 300px;
  background: #15aeff;
  bottom: -40px;
  left: -70px;
  animation-delay: 2s;
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-18px, 12px) scale(1.08);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 1rem clamp(1rem, 2vw, 2rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(8px);
  background: rgba(4, 8, 16, 0.48);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  margin: 0;
  font-family: "Archivo", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.brand-link {
  display: inline-block;
}

.brand-signature {
  display: block;
  width: clamp(96px, 12vw, 136px);
  height: auto;
  filter: brightness(0) invert(1);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.04);
}

#scrollProgressBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 24px rgba(52, 200, 255, 0.6);
}

.layout {
  width: min(1320px, calc(100% - 2rem));
  margin: 1.2rem auto 0;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1rem, 2vw, 2rem);
}

.stage-wrap {
  position: relative;
}

.stage {
  position: sticky;
  top: 5.6rem;
  min-height: calc(100vh - 6.8rem);
  border: 1px solid var(--line);
  background: linear-gradient(152deg, rgba(31, 44, 72, 0.36), rgba(9, 15, 25, 0.72));
  border-radius: 1.5rem;
  padding: clamp(1rem, 2vw, 1.5rem);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 16px 70px rgba(0, 0, 0, 0.45);
  transition: border-color 260ms ease, box-shadow 260ms ease;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.stage-head h1 {
  margin: 0.2rem 0 0.4rem;
  font-family: "Archivo", sans-serif;
  font-size: clamp(1.3rem, 2vw, 1.95rem);
  line-height: 1.1;
}

.stage-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 64ch;
}

.stage-kicker {
  margin: 0;
  color: #c7d4eb;
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.device-zone {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 0.8rem;
}

.device {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--surface);
  border-radius: 1rem;
  padding: 0.9rem;
  transition: transform 280ms ease, border-color 280ms ease, box-shadow 280ms ease;
}

.device-label {
  margin: 0;
  font-size: 0.73rem;
  color: #9db3d6;
  letter-spacing: 0.09em;
  font-weight: 700;
}

.mobile .device-gauge {
  margin-top: 0.5rem;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
}

.ring {
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  background: conic-gradient(var(--accent) calc(var(--student-progress, 42) * 1%), rgba(255, 255, 255, 0.08) 0);
  display: grid;
  place-items: center;
  transition: background 420ms ease;
}

.ring::after {
  content: "";
  width: 90px;
  height: 90px;
  border-radius: 999px;
  background: #0a101c;
  position: absolute;
}

.ring-value {
  position: relative;
  z-index: 1;
  font-family: "Archivo", sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
}

.device-list {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.device-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
}

.chip {
  color: #d5e0f4;
}

.device-list b {
  color: #7bd3ff;
  font-weight: 700;
}

.kpi-row {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.kpi {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.65rem;
  padding: 0.45rem;
  display: grid;
  gap: 0.2rem;
}

.kpi span {
  color: #a5b7d3;
  font-size: 0.72rem;
}

.kpi b {
  font-family: "Archivo", sans-serif;
  font-size: 1rem;
}

.timeline {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.32rem;
}

.timeline p {
  margin: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.16);
  padding: 0.32rem 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.45rem;
  font-size: 0.78rem;
  color: #e5ecfb;
}

.timeline span {
  color: #79cbff;
  font-weight: 700;
  margin-right: 0.35rem;
}

.pipeline {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
}

.pipeline .node {
  font-size: 0.73rem;
  padding: 0.4rem 0.52rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #dbe7fb;
  background: rgba(255, 255, 255, 0.04);
}

.pipeline .node.active {
  background: rgba(52, 200, 255, 0.16);
  color: #8ce2ff;
  border-color: rgba(52, 200, 255, 0.45);
}

.pipeline .link {
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(91, 206, 255, 0.6));
}

.pill-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.pill-row span {
  font-size: 0.72rem;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d8e5fa;
  background: rgba(255, 255, 255, 0.04);
}

.scene-dots {
  margin-top: auto;
  display: flex;
  gap: 0.35rem;
}

.scene-dots button {
  border: 0;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  transition: transform 180ms ease, background 180ms ease;
}

.scene-dots button.is-active {
  background: var(--accent-2);
  transform: scale(1.28);
}

.story {
  position: relative;
  padding-bottom: 28vh;
}

.step {
  min-height: 72vh;
  margin-bottom: 2.2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--surface-soft);
  border-radius: 1.2rem;
  padding: clamp(1rem, 1.8vw, 1.4rem);
  opacity: 0.48;
  transform: translateY(20px) scale(0.99);
  transition: opacity 300ms ease, transform 300ms ease, border-color 300ms ease;
}

.step.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  border-color: rgba(52, 200, 255, 0.44);
}

.step-n {
  margin: 0;
  color: #87b7df;
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
}

.step h2 {
  margin: 0.55rem 0 0.8rem;
  font-family: "Archivo", sans-serif;
  font-size: clamp(1.38rem, 2.4vw, 2rem);
  line-height: 1.12;
}

.step p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.62;
  color: #d5e2f8;
  max-width: 60ch;
}

body[data-active-step="0"] .stage {
  box-shadow: 0 16px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(52, 200, 255, 0.15);
}

body[data-active-step="1"] .stage,
body[data-active-step="2"] .stage,
body[data-active-step="3"] .stage {
  box-shadow: 0 16px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 61, 46, 0.2);
}

body[data-active-step="4"] .stage,
body[data-active-step="5"] .stage {
  box-shadow: 0 16px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(79, 169, 255, 0.25);
}

body[data-active-step="6"] .stage,
body[data-active-step="7"] .stage {
  box-shadow: 0 16px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(72, 213, 151, 0.3);
}

.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .stage {
    position: relative;
    top: 0;
    min-height: auto;
  }

  .step {
    min-height: 55vh;
  }
}

@media (max-width: 740px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .device-zone {
    grid-template-columns: 1fr;
  }

  .step {
    min-height: 46vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
