:root {
  --ink: #eceeee;
  --ink-soft: #bbc1c2;
  --accent: #6fe8ff;
  --panel: rgba(7, 10, 14, 0.72);
  --panel-line: rgba(123, 163, 173, 0.28);
  --bg-a: #020305;
  --bg-b: #0c1118;
  --bg-c: #161f29;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: "Sora", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(73, 120, 161, 0.22) 0%, transparent 31%),
    radial-gradient(circle at 82% 75%, rgba(82, 52, 70, 0.2) 0%, transparent 34%),
    linear-gradient(160deg, var(--bg-a) 0%, var(--bg-b) 52%, var(--bg-c) 100%);
}

.scroll-shell {
  width: 100%;
}

.scroll-lungs {
  min-height: 480vh;
  position: relative;
}

.sticky-stage {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: clamp(14px, 2vw, 26px);
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.4fr) minmax(210px, 0.62fr);
  gap: clamp(10px, 2vw, 26px);
  align-items: stretch;
}

.hud-panel {
  align-self: center;
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  background: linear-gradient(145deg, rgba(9, 13, 18, 0.88), rgba(13, 18, 24, 0.62));
  box-shadow:
    inset 0 0 0 1px rgba(160, 210, 230, 0.08),
    0 16px 42px rgba(0, 0, 0, 0.28);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #a6d9e4;
  font-size: 0.72rem;
  font-weight: 700;
}

h1 {
  margin: 12px 0 0;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  line-height: 1.05;
  font-size: clamp(1.4rem, 2.7vw, 2.4rem);
}

.intro {
  margin: 14px 0 0;
  color: color-mix(in srgb, var(--ink-soft) 78%, #9f8d80 22%);
  max-width: 42ch;
}

.phase-chip {
  margin-top: 18px;
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.04em;
  font-size: 0.84rem;
  color: #9feeff;
  border: 1px solid rgba(118, 228, 255, 0.45);
  border-radius: 999px;
  width: fit-content;
  padding: 8px 12px;
  background: rgba(13, 45, 58, 0.38);
}

.progress-wrap {
  margin-top: 12px;
  border-radius: 999px;
  height: 7px;
  background: rgba(112, 147, 166, 0.22);
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #8ef1ff, #44bdf1 52%, #8be3ff);
  box-shadow: 0 0 14px rgba(92, 223, 255, 0.64);
}

.art-column {
  position: relative;
  border: 1px solid rgba(112, 157, 173, 0.32);
  border-radius: 22px;
  background: var(--panel);
  overflow: hidden;
  box-shadow:
    0 22px 46px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(178, 219, 235, 0.06);
}

.scan-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(150, 199, 220, 0.07) 0,
    rgba(150, 199, 220, 0.07) 1px,
    transparent 1px,
    transparent 6px
  );
  pointer-events: none;
}

.nebula {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 35% 36%, rgba(96, 172, 208, 0.26), transparent 36%),
    radial-gradient(circle at 72% 64%, rgba(86, 125, 192, 0.2), transparent 36%);
  filter: blur(24px);
  pointer-events: none;
}

.lungs-svg {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

.ring {
  fill: none;
  stroke: rgba(166, 202, 217, 0.22);
  stroke-width: 2;
}

.ring-b {
  stroke-dasharray: 4 8;
}

.ring-c {
  stroke: rgba(92, 185, 219, 0.24);
}

.ring-d {
  stroke: rgba(169, 212, 228, 0.14);
  stroke-dasharray: 10 12;
}

.core-glow {
  fill: url(#centerGlow);
  opacity: 0.58;
  filter: url(#airGlow);
}

.trachea {
  fill: url(#airwaySkin);
  filter: url(#surfaceTexture);
  opacity: 0.9;
}

.bronchi {
  fill: none;
  stroke: #8de8ff;
  stroke-width: 9;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(82, 220, 255, 0.64));
}

.airway-core {
  fill: none;
  stroke: rgba(157, 231, 255, 0.6);
  stroke-width: 4;
  opacity: 0.72;
}

.pleura {
  fill: url(#leftPleura);
  stroke: rgba(234, 181, 182, 0.38);
  stroke-width: 1.4;
  filter: url(#surfaceTexture);
  opacity: 0.76;
}

#right-module .pleura {
  fill: url(#rightPleura);
}

.highlight {
  opacity: 0.54;
  mix-blend-mode: screen;
}

#left-module .highlight {
  fill: url(#leftHighlight);
}

#right-module .highlight {
  fill: url(#rightHighlight);
}

.fissure {
  fill: none;
  stroke: rgba(122, 68, 74, 0.52);
  stroke-width: 2;
  stroke-linecap: round;
}

.capillary-layer path {
  fill: none;
  stroke: rgba(114, 235, 255, 0.76);
  stroke-width: 1.1;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(92, 224, 255, 0.56));
}

.vessel {
  fill: none;
  stroke: rgba(150, 206, 222, 0.52);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.6;
}

.vessel.major {
  stroke-width: 3.6;
}

.alveoli-layer circle {
  fill: rgba(154, 239, 255, 0.44);
  stroke: rgba(188, 246, 255, 0.64);
  stroke-width: 0.6;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 2px rgba(94, 224, 255, 0.6));
}

#external-tree path {
  fill: none;
  stroke: rgba(96, 231, 255, 0.95);
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(78, 215, 255, 0.85));
}

.particle {
  fill: rgba(146, 230, 255, 0.9);
  opacity: 0.28;
}

#diaphragm {
  fill: none;
  stroke: rgba(186, 130, 133, 0.56);
  stroke-width: 12;
  stroke-linecap: round;
  opacity: 0.54;
}

.phase-list {
  align-self: center;
  list-style: none;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(123, 162, 176, 0.26);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  background: linear-gradient(145deg, rgba(10, 13, 18, 0.86), rgba(10, 16, 24, 0.58));
  display: grid;
  gap: 7px;
}

.phase-list li {
  padding: 8px 10px;
  border-radius: 9px;
  color: #b9c2c5;
  border: 1px solid transparent;
  transition: all 180ms ease;
  font-size: 0.92rem;
}

.phase-list li.active {
  color: #e9fbff;
  border-color: rgba(124, 223, 246, 0.52);
  background: rgba(40, 78, 92, 0.42);
}

.phase-list li::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 8px;
  background: rgba(159, 215, 233, 0.35);
}

.phase-list li.active::before {
  background: #8be9ff;
  box-shadow: 0 0 12px rgba(134, 228, 255, 0.8);
}

@media (max-width: 1080px) {
  .sticky-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(290px, 52vh) auto;
    align-items: initial;
  }

  .phase-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .scroll-lungs {
    min-height: 540vh;
  }

  .phase-list {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(1.22rem, 7vw, 1.8rem);
  }
}
