/* === BASE === */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

:root {
  --reactor-black: #0A0A14;
  --plasma-charcoal: #121220;
  --toroidal-magenta: #FF2D78;
  --confinement-cyan: #00E5FF;
  --fusion-chartreuse: #CCFF00;
  --soft-platinum: #D8D8E8;
  --tungsten-gray: #3A3A5C;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Karla', sans-serif;
  --font-accent: 'Caveat', cursive;
}

html { scroll-behavior: smooth; }

body {
  background: var(--reactor-black);
  color: var(--soft-platinum);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.72;
  overflow-x: hidden;
}

/* === PROGRESS INDICATOR === */
.progress-indicator {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
}

.progress-dot {
  width: 12px;
  height: 8px;
  border: 1px solid var(--tungsten-gray);
  border-radius: 50%;
  transition: background 0.3s, border-color 0.3s;
}

.progress-dot.active[data-chamber="1"],
.progress-dot.active[data-chamber="5"] { background: var(--toroidal-magenta); border-color: var(--toroidal-magenta); }
.progress-dot.active[data-chamber="2"],
.progress-dot.active[data-chamber="4"] { background: var(--confinement-cyan); border-color: var(--confinement-cyan); }
.progress-dot.active[data-chamber="3"] { background: var(--fusion-chartreuse); border-color: var(--fusion-chartreuse); }

/* === CHAMBERS === */
.chamber {
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  padding: 6rem clamp(2rem, 5vw, 4rem);
}

/* === WATERCOLOR WASH BACKGROUNDS === */
.wash-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  filter: url(#watercolor-distort);
  pointer-events: none;
  z-index: 0;
}

.wash-magenta {
  background: radial-gradient(ellipse at 30% 40%, rgba(255,45,120,0.15), transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(0,229,255,0.08), transparent 50%);
}

.wash-cyan {
  background: radial-gradient(ellipse at 60% 30%, rgba(0,229,255,0.12), transparent 55%),
              radial-gradient(ellipse at 20% 70%, rgba(255,45,120,0.06), transparent 50%);
}

.wash-chartreuse {
  background: radial-gradient(ellipse at 50% 50%, rgba(204,255,0,0.12), transparent 55%),
              radial-gradient(ellipse at 80% 20%, rgba(0,229,255,0.06), transparent 50%);
}

.wash-magenta-alt {
  background: radial-gradient(ellipse at 70% 40%, rgba(255,45,120,0.1), transparent 55%),
              radial-gradient(ellipse at 30% 80%, rgba(204,255,0,0.06), transparent 50%);
}

.wash-multi {
  background: radial-gradient(ellipse at 40% 50%, rgba(255,45,120,0.12), transparent 50%),
              radial-gradient(ellipse at 60% 30%, rgba(0,229,255,0.1), transparent 50%),
              radial-gradient(ellipse at 50% 70%, rgba(204,255,0,0.08), transparent 50%);
  animation: wash-pulse 8s ease-in-out infinite;
}

@keyframes wash-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* === BG ILLUSTRATIONS === */
.bg-illustration {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  pointer-events: none;
  z-index: 0;
}

.bg-illustration svg { width: 100%; height: auto; }

/* === PLASMA BARRIER === */
.plasma-barrier {
  height: 100px;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,45,120,0.25), rgba(0,229,255,0.18), transparent 70%);
  filter: url(#watercolor-distort);
  animation: barrier-breathe 8s ease-in-out infinite;
}

.barrier-cyan {
  background: radial-gradient(ellipse at 50% 50%, rgba(0,229,255,0.25), rgba(204,255,0,0.15), transparent 70%);
}

.barrier-chartreuse {
  background: radial-gradient(ellipse at 50% 50%, rgba(204,255,0,0.2), rgba(255,45,120,0.15), transparent 70%);
}

@keyframes barrier-breathe {
  0%, 100% { transform: scaleX(0.8); opacity: 0.6; }
  50% { transform: scaleX(1.2); opacity: 1; }
}

/* === IGNITION CHAMBER === */
.ignition {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--reactor-black);
}

.hero-text {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 10vw, 7rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--toroidal-magenta);
  text-shadow: 0 0 30px rgba(255,45,120,0.4);
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-text .char {
  display: inline-block;
  opacity: 0;
  transform: scale(0);
  filter: blur(8px);
  animation: watercolor-bloom 600ms cubic-bezier(0.23, 1.4, 0.32, 1) forwards;
}

@keyframes watercolor-bloom {
  0% { opacity: 0; transform: scale(0); filter: blur(8px); }
  60% { opacity: 1; transform: scale(1.15); filter: blur(1px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

.hero-sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--tungsten-gray);
  margin-top: 1.5rem;
  position: relative;
  z-index: 2;
  text-align: center;
}

.toroid-glyph {
  position: absolute;
  bottom: 3rem;
  animation: glyph-pulse 2s ease-in-out infinite;
}

.toroid-spin {
  animation: toroid-rotate 20s linear infinite;
  transform-origin: center;
}

@keyframes toroid-rotate { to { transform: rotate(360deg); } }
@keyframes glyph-pulse { 0%,100%{opacity:0.4;transform:translateY(0);} 50%{opacity:1;transform:translateY(6px);} }

/* === CONFINEMENT FIELD === */
.confinement {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  justify-content: center;
  background: var(--plasma-charcoal);
}

.content-block {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.content-block.left { align-self: flex-start; }
.content-block.right { align-self: flex-end; }

.watercolor-card {
  background: rgba(18,18,32,0.8);
  padding: 2.5rem;
  position: relative;
  clip-path: polygon(0% 2%, 98% 0%, 100% 97%, 3% 100%);
}

.card-cyan { border-left: 2px solid rgba(0,229,255,0.3); }

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.5rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--confinement-cyan);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.body-text {
  color: var(--soft-platinum);
  margin-bottom: 1rem;
}

.annotation {
  font-family: var(--font-accent);
  font-size: 0.9rem;
  color: var(--fusion-chartreuse);
  opacity: 0.7;
  margin-top: 1rem;
}

.caveat { font-family: var(--font-accent); }

/* === PLASMA CORE === */
.plasma-core {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--reactor-black);
}

.core-text-stack {
  position: relative;
  z-index: 2;
  text-align: center;
}

.core-heading {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 6rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fusion-chartreuse);
  text-shadow: 0 0 30px rgba(204,255,0,0.3);
  line-height: 1.05;
}

/* === DIAGNOSTIC ARRAY === */
.diagnostic {
  background: var(--plasma-charcoal);
  display: flex;
  align-items: center;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: 55% 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

.diagnostic-grid .section-heading {
  color: var(--toroidal-magenta);
}

.annotation-card {
  background: rgba(10,10,20,0.6);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 2px solid var(--tungsten-gray);
}

.inline-diagram { width: 100%; max-width: 280px; margin-bottom: 0.5rem; }

.annotation-label {
  font-size: 0.85rem;
  color: var(--confinement-cyan);
  opacity: 0.8;
  line-height: 1.8;
}

/* === EXHAUST MANIFOLD === */
.exhaust {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--reactor-black);
}

.exhaust-content {
  text-align: center;
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.exhaust-heading {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: 0.04em;
  color: var(--toroidal-magenta);
  text-shadow: 0 0 40px rgba(255,45,120,0.3);
  margin-bottom: 2rem;
}

.exhaust-statement {
  color: var(--soft-platinum);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.exhaust-contact {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  color: var(--confinement-cyan);
  letter-spacing: 0.04em;
}

/* === BOUNCE-ENTER === */
.bounce-enter {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 500ms ease-out, transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: var(--bounce-delay, 0s);
  will-change: transform, opacity;
}

.bounce-enter.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === RESPONSIVE === */
@media (max-width: 960px) {
  .diagnostic-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .chamber { padding: 4rem 1.5rem; }
  .content-block.left,
  .content-block.right {
    align-self: center;
    max-width: 100%;
  }
  .watercolor-card { clip-path: none; }
  .progress-indicator { right: 0.5rem; }
}
