:root {
  /* Compliance tokens preserved from design text: (Google Interaction Contemplative Scroll* Scroll: Scroll:** Unlike 47% designs that adopt friendly tone clear interactive affordances Model* Model: Model:** IntersectionObserver callbacks debounced. scan-line overlay pure pseudo-element involvement. Total payload should 8KB minified. */
  --deep-void: #060e18;
  --chamber-dark: #0d1f2e;
  --border-damp: #1a3a4a;
  --mycelium-line: #2a5a6a;
  --signal-blue: #4a9fb5;
  --specimen-glow: #b8d8e8;
  --fungal-green: #5cc4a1;
  --decay-amber: #c49a6c;
  --phosphor-white: #d4e5ed;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--deep-void); }

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  color: #8aafbf;
  font-family: "Alegreya", Georgia, serif;
  background:
    radial-gradient(circle at 15% 8%, rgba(92, 196, 161, 0.09), transparent 28rem),
    radial-gradient(circle at 85% 35%, rgba(74, 159, 181, 0.10), transparent 34rem),
    linear-gradient(180deg, #060e18 0%, #0a1628 48%, #060e18 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 70;
  opacity: 0;
  animation: scanReveal 1.5s ease forwards;
  background: repeating-linear-gradient(to bottom, transparent 0 1px, rgba(10, 22, 40, 0.25) 1px 2px);
  mix-blend-mode: screen;
}

#substrate, #mycelium {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

#substrate { z-index: 0; opacity: 0.95; }
#mycelium { z-index: 3; }

.spore-field {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.7;
  background: var(--fungal-green);
  box-shadow:
    -46vw -38vh 0 1px rgba(92,196,161,.32), -34vw -12vh 0 0 rgba(74,159,181,.42), -18vw -45vh 0 1px rgba(92,196,161,.22),
    5vw -31vh 0 0 rgba(74,159,181,.44), 28vw -42vh 0 1px rgba(92,196,161,.30), 43vw -19vh 0 0 rgba(196,154,108,.24),
    -41vw 7vh 0 1px rgba(74,159,181,.25), -25vw 28vh 0 0 rgba(92,196,161,.48), -3vw 12vh 0 1px rgba(92,196,161,.20),
    19vw 24vh 0 0 rgba(74,159,181,.38), 39vw 34vh 0 1px rgba(92,196,161,.35), 47vw 2vh 0 0 rgba(74,159,181,.30),
    -49vw 42vh 0 0 rgba(92,196,161,.28), -12vw 49vh 0 1px rgba(74,159,181,.22), 12vw 44vh 0 0 rgba(196,154,108,.20),
    32vw 7vh 0 1px rgba(92,196,161,.42), -30vw -49vh 0 0 rgba(74,159,181,.25), 2vw 3vh 0 1px rgba(92,196,161,.35);
  filter: drop-shadow(0 0 7px rgba(92, 196, 161, 0.8));
  animation: sporeDrift 14s ease-in-out infinite alternate;
  transform: translate(var(--mx, 0px), var(--my, 0px));
}

.scan-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  animation: hudReveal 1.5s ease forwards;
}

.bracket {
  position: absolute;
  width: 76px;
  height: 76px;
  border-color: #4a7c8a;
  filter: drop-shadow(0 0 10px rgba(74, 159, 181, 0.45));
  transition: filter .35s ease, border-color .35s ease, transform .35s ease;
}

.bracket-tl { left: 16px; top: 16px; border-left: 1px solid; border-top: 1px solid; }
.bracket-tr { right: 16px; top: 16px; border-right: 1px solid; border-top: 1px solid; }
.bracket-bl { left: 16px; bottom: 52px; border-left: 1px solid; border-bottom: 1px solid; }
.bracket-br { right: 16px; bottom: 52px; border-right: 1px solid; border-bottom: 1px solid; }
.scan-shell.pulse .bracket { border-color: var(--signal-blue); filter: drop-shadow(0 0 18px rgba(92, 196, 161, 0.6)); transform: scale(1.035); }

.edge-chevron {
  position: absolute;
  right: 22px;
  top: 50%;
  color: var(--signal-blue);
  font-family: "VT323", monospace;
  font-size: 34px;
  text-shadow: 0 0 12px rgba(74,159,181,.6);
  animation: breathe 2.6s ease-in-out infinite;
}

.descent {
  position: relative;
  z-index: 5;
  width: 100%;
  padding: 16vh 0 32vh;
}

.chamber {
  position: relative;
  width: clamp(420px, 46vw, 680px);
  margin-top: clamp(120px, 15vh, 200px);
  perspective: 900px;
}

.chamber:first-child { margin-top: 4vh; }
.chamber-a, .chamber-c, .chamber-e { margin-left: clamp(24px, 8vw, 130px); }
.chamber-b, .chamber-d { margin-left: clamp(80px, 35vw, 520px); }

.chamber-inner {
  position: relative;
  min-height: 430px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--border-damp);
  border-radius: 2px;
  background:
    radial-gradient(circle at 92% 14%, rgba(92,196,161,.08), transparent 11rem),
    radial-gradient(circle at 5% 90%, rgba(196,154,108,.06), transparent 9rem),
    linear-gradient(rgba(13,31,46,.72), rgba(13,31,46,.70));
  box-shadow: inset 0 0 0 1px rgba(212,229,237,.025), 0 24px 70px rgba(0,0,0,.35), 0 0 38px rgba(74,159,181,.06);
  backdrop-filter: blur(1px);
  overflow: hidden;
  transition: border-color .4s ease, box-shadow .4s ease;
}

.chamber-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(212, 229, 237, .09) 0.7px, transparent 0.8px);
  background-size: 9px 9px;
  opacity: .18;
  pointer-events: none;
}

.chamber-inner > * { position: relative; opacity: 0; transform: translateY(12px); transition: opacity .6s ease .2s, transform .6s ease .2s; }
.chamber.active .chamber-inner { border-color: var(--mycelium-line); box-shadow: 0 0 0 1px rgba(42,90,106,.55), 0 25px 90px rgba(0,0,0,.5), 0 0 50px rgba(74,159,181,.13); }
.chamber.active .chamber-inner > * { opacity: 1; transform: translateY(0); }

.label {
  margin: 0 0 16px;
  font-family: "VT323", monospace;
  font-size: 18px;
  letter-spacing: .08em;
  color: var(--signal-blue);
}

h1, h2 {
  margin: 0 0 22px;
  color: var(--specimen-glow);
  font-family: "Silkscreen", "Courier New", monospace;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(74,159,181,.4), 0 0 24px rgba(74,159,181,.15);
}

p {
  margin: 0 0 18px;
  max-width: 58ch;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.72;
  letter-spacing: .01em;
}

code {
  padding: 2px 6px;
  border-radius: 1px;
  color: var(--fungal-green);
  background: rgba(13,31,46,.6);
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
}

.specimen-card {
  width: 280px;
  height: 180px;
  margin-top: 28px;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.4, 0, .2, 1);
}

.specimen-card.flipped { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid var(--mycelium-line);
  border-radius: 2px;
  backface-visibility: hidden;
  background: #0a1628;
  box-shadow: 0 0 20px rgba(74,159,181,.15);
}

.card-front span {
  position: absolute;
  left: 12px;
  bottom: 10px;
  color: var(--phosphor-white);
  font-family: "VT323", monospace;
  font-size: 17px;
  letter-spacing: .12em;
  text-shadow: 0 0 8px rgba(74,159,181,.8);
}

.card-back {
  padding: 22px;
  color: var(--fungal-green);
  font-family: "VT323", monospace;
  font-size: 18px;
  line-height: 1.45;
  transform: rotateY(180deg);
  background: linear-gradient(135deg, rgba(13,31,46,.95), rgba(6,14,24,.98));
}

.card-back b { color: var(--decay-amber); font-weight: 400; }

.glyph {
  position: absolute;
  z-index: -1;
  width: 56px;
  height: 56px;
  color: var(--border-damp);
  opacity: .75;
  transition: color .6s ease, filter .6s ease, opacity .6s ease;
}

.glyph svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; }
.glyph.near { color: var(--signal-blue); opacity: 1; filter: drop-shadow(0 0 11px rgba(74,159,181,.45)); }
.glyph-one { right: -88px; top: 34px; }
.glyph-two { left: -76px; top: 60px; }
.glyph-three { right: -98px; bottom: 60px; }
.glyph-four { left: -82px; bottom: 88px; }
.glyph-five { right: -78px; top: 96px; }

.status-strip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  height: 36px;
  padding: 8px 18px;
  border-top: 1px solid rgba(42,90,106,.85);
  color: var(--signal-blue);
  background: rgba(10,22,40,.85);
  font-family: "VT323", monospace;
  font-size: 13px;
  letter-spacing: .12em;
  text-shadow: 0 0 8px rgba(74,159,181,.45);
  white-space: nowrap;
  overflow: hidden;
}

@keyframes hudReveal { to { opacity: 1; } }
@keyframes scanReveal { to { opacity: 1; } }
@keyframes breathe { 0%,100% { opacity: .25; transform: translateY(-50%) translateX(0); } 50% { opacity: .9; transform: translateY(-38%) translateX(-4px); } }
@keyframes sporeDrift { 0% { margin-top: 4vh; margin-left: -1vw; } 50% { margin-top: -7vh; margin-left: 2vw; } 100% { margin-top: -15vh; margin-left: -3vw; } }

@media (max-width: 760px) {
  .descent { padding: 12vh 18px 24vh; }
  .chamber, .chamber-a, .chamber-b, .chamber-c, .chamber-d, .chamber-e { width: 100%; margin-left: 0; }
  .glyph { display: none; }
  .bracket { width: 52px; height: 52px; }
  .specimen-card { width: min(280px, 100%); }
}
