:root {
  /* Design terms: short numeric readouts; Intervene with Precision:** A stepped radial panel resembles a Deco elevator indicator. Each floor represents a simulation layer—terrain. */
  --precision-token: "Precision:**";
  --black: #05020A;
  --indigo: #16104A;
  --orchid: #FF2BD6;
  --fern: #B6FF00;
  --cyan: #00E7FF;
  --gold: #F5B83D;
  --porcelain: #FFF2C8;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--porcelain);
  background: var(--black);
  font-family: "Manrope", sans-serif;
  overflow-x: hidden;
}

.fixed-stage {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 43, 214, .16), transparent 28%),
    radial-gradient(circle at 50% 78%, rgba(0, 231, 255, .12), transparent 34%),
    linear-gradient(90deg, #05020A 0%, #16104A 47%, #05020A 100%);
}

.fixed-stage::before,
.fixed-stage::after {
  content: "";
  position: absolute;
  inset: 7vh 9vw;
  border: 1px solid rgba(245, 184, 61, .35);
  clip-path: polygon(4% 0, 96% 0, 100% 7%, 100% 93%, 96% 100%, 4% 100%, 0 93%, 0 7%);
  box-shadow: inset 0 0 34px rgba(245, 184, 61, .12);
}

.fixed-stage::after {
  inset: 11vh 13vw;
  border-color: rgba(0, 231, 255, .18);
  animation: breatheBorder 5.8s ease-in-out infinite;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 20%, rgba(5, 2, 10, .9) 78%);
}

.fan {
  position: absolute;
  top: -20vh;
  width: 52vw;
  height: 72vh;
  opacity: .35;
  background: repeating-conic-gradient(from 0deg, rgba(245, 184, 61, .26) 0deg 2deg, transparent 2deg 13deg);
  border-radius: 0 0 52vw 52vw;
  filter: drop-shadow(0 0 18px rgba(255, 43, 214, .28));
  animation: fanDrift 18s linear infinite;
}

.fan-left { left: -16vw; transform-origin: top right; }
.fan-right { right: -16vw; transform-origin: top left; animation-direction: reverse; }

.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 5.4rem;
  border-inline: 1px solid rgba(245, 184, 61, .35);
  background: linear-gradient(180deg, rgba(22,16,74,.72), rgba(5,2,10,.75));
  display: grid;
  place-items: center;
}

.rail span {
  writing-mode: vertical-rl;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: .22em;
  color: var(--gold);
  font-size: 1.1rem;
}

.rail-left { left: 0; }
.rail-right { right: 0; }
.gold-axis { position: fixed; top: 0; bottom: 0; left: 50%; width: 1px; background: linear-gradient(transparent, rgba(245,184,61,.5), transparent); }

.chamber {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 8vh 7vw;
  position: relative;
}

.chamber-frame {
  width: min(1380px, 100%);
  min-height: 78vh;
  position: relative;
  padding: clamp(1.25rem, 3vw, 3rem);
  background:
    linear-gradient(135deg, rgba(255,242,200,.08), transparent 18%, transparent 82%, rgba(255,242,200,.08)),
    linear-gradient(180deg, rgba(22, 16, 74, .82), rgba(5, 2, 10, .88));
  border: 1px solid rgba(245, 184, 61, .62);
  clip-path: polygon(3% 0, 97% 0, 100% 5%, 100% 95%, 97% 100%, 3% 100%, 0 95%, 0 5%);
  box-shadow: 0 0 50px rgba(0, 231, 255, .08), inset 0 0 55px rgba(5, 2, 10, .75);
  overflow: hidden;
}

.chamber-frame::before {
  content: "";
  position: absolute;
  inset: 1.05rem;
  border: 1px solid rgba(245, 184, 61, .26);
  clip-path: inherit;
  pointer-events: none;
}

.top-ribbon, .label, .section-title span, .readout, .micro, .state-dial, .plaque span, .lever span, .floor span {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.top-ribbon {
  display: flex;
  justify-content: space-between;
  color: var(--gold);
  font-size: 1rem;
  border-bottom: 1px solid rgba(245,184,61,.3);
  padding-bottom: .7rem;
}

.readout, .micro { font-family: "IBM Plex Mono", monospace; letter-spacing: .05em; color: var(--cyan); }

.wordmark {
  font-family: "Yeseva One", serif;
  font-size: clamp(4rem, 13vw, 12rem);
  line-height: .78;
  letter-spacing: -.055em;
  margin: 3vh 0 0;
  text-align: center;
  color: var(--porcelain);
  text-shadow: 0 0 26px rgba(255,43,214,.52), 0 0 2px var(--gold);
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(150px, .58fr) minmax(360px, 2fr) minmax(150px, .58fr);
  gap: 1.25rem;
  align-items: stretch;
  margin-top: -2vh;
}

.instrument {
  border: 1px solid rgba(245,184,61,.42);
  background: rgba(5,2,10,.58);
  padding: 1rem;
  display: grid;
  align-content: center;
  gap: 1rem;
  min-height: 320px;
  clip-path: polygon(12% 0, 88% 0, 100% 8%, 100% 92%, 88% 100%, 12% 100%, 0 92%, 0 8%);
}

.label { color: var(--gold); margin: 0; font-size: 1.15rem; }
.glyph-list { display: grid; gap: .8rem; }
.glyph-list span { border: 1px solid rgba(0,231,255,.32); padding: .7rem; color: var(--fern); font-family: "IBM Plex Mono", monospace; }

.viewport {
  border: 1px solid rgba(245,184,61,.54);
  background: radial-gradient(circle at center, rgba(0,231,255,.14), rgba(5,2,10,.62) 62%);
  box-shadow: inset 0 0 60px rgba(0,231,255,.13), 0 0 35px rgba(255,43,214,.15);
  overflow: hidden;
}

.hero-port { height: 440px; position: relative; display: grid; place-items: center; clip-path: polygon(6% 0, 94% 0, 100% 12%, 100% 88%, 94% 100%, 6% 100%, 0 88%, 0 12%); }
.sunburst { position: absolute; inset: -25%; background: repeating-conic-gradient(from -20deg, rgba(245,184,61,.28) 0deg 3deg, transparent 3deg 12deg); border-radius: 50%; animation: spin 36s linear infinite; }

.terrarium { position: relative; width: min(520px, 88%); height: 330px; transform-style: preserve-3d; animation: terrariumFloat 7s ease-in-out infinite; }
.glass-dome { position: absolute; inset: 0 8%; border: 2px solid rgba(255,242,200,.45); border-radius: 48% 48% 18% 18%; background: linear-gradient(115deg, rgba(255,242,200,.12), transparent 34%, rgba(0,231,255,.12)); box-shadow: inset 0 0 40px rgba(255,242,200,.12), 0 0 35px rgba(0,231,255,.28); }
.terrain { position: absolute; left: 15%; right: 15%; bottom: 58px; height: 70px; border-radius: 50%; background: radial-gradient(ellipse, var(--fern), #265400 55%, #08050b 72%); box-shadow: 0 0 24px rgba(182,255,0,.45); }
.forest { position: absolute; bottom: 105px; width: 90px; height: 120px; background: linear-gradient(160deg, var(--fern), #0a4f2a); clip-path: polygon(50% 0, 72% 40%, 61% 40%, 83% 76%, 58% 70%, 51% 100%, 43% 70%, 18% 76%, 39% 40%, 29% 40%); filter: drop-shadow(0 0 14px rgba(182,255,0,.6)); }
.forest-a { left: 29%; }
.forest-b { right: 28%; transform: scale(.78); }
.river { position: absolute; left: 22%; right: 22%; bottom: 85px; height: 36px; background: var(--cyan); clip-path: polygon(0 55%, 21% 34%, 43% 60%, 66% 28%, 100% 48%, 100% 76%, 65% 58%, 42% 86%, 20% 58%, 0 86%); filter: blur(.4px) drop-shadow(0 0 12px var(--cyan)); opacity: .9; }
.root-map { position: absolute; inset: 70px 8% 0; width: 84%; height: 72%; }
.root-map path, .neon-roots path { fill: none; stroke: var(--orchid); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 16 12; animation: dash 3.4s linear infinite; filter: drop-shadow(0 0 8px var(--orchid)); }
.agent-swarm i, .flock i { position: absolute; width: 8px; height: 8px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 12px var(--cyan); }
.agent-swarm i:nth-child(1){left:30%;top:38%;animation:orbit 4s linear infinite}.agent-swarm i:nth-child(2){left:62%;top:34%;animation:orbit 5s linear infinite reverse}.agent-swarm i:nth-child(3){left:46%;top:26%;animation:orbit 4.8s linear infinite}.agent-swarm i:nth-child(4){left:54%;top:55%;animation:orbit 3.7s linear infinite reverse}.agent-swarm i:nth-child(5){left:38%;top:62%;animation:orbit 5.5s linear infinite}.agent-swarm i:nth-child(6){left:70%;top:50%;animation:orbit 4.5s linear infinite}.agent-swarm i:nth-child(7){left:24%;top:52%;animation:orbit 4.2s linear infinite reverse}

.radial-meter { width: 130px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--fern) 0 255deg, rgba(255,242,200,.12) 255deg 360deg); display: grid; place-items: center; }
.radial-meter b { width: 72%; aspect-ratio: 1; background: var(--black); border-radius: 50%; border: 1px solid var(--gold); }
.inscription, .closing-inscription { text-align: center; max-width: 780px; margin: 1.6rem auto 0; color: var(--porcelain); font-size: clamp(1rem, 1.8vw, 1.45rem); }

.section-title { text-align: center; position: relative; z-index: 2; }
.design-token { position: absolute; opacity: 0; pointer-events: none; }
.section-title span { color: var(--gold); }
.section-title h2 { font-family: "Yeseva One", serif; font-size: clamp(3.4rem, 8vw, 7.8rem); line-height: .85; margin: .25rem 0 1.7rem; letter-spacing: -.04em; }
.split-frame, .aquarium-frame, .intervention-frame, .archive-frame { display: grid; align-content: center; }

.lever-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; max-width: 1120px; margin: 0 auto; }
.lever { min-height: 320px; border: 1px solid rgba(245,184,61,.45); background: linear-gradient(180deg, rgba(5,2,10,.88), rgba(22,16,74,.7)); display: grid; grid-template-rows: auto 1fr auto; padding: 1rem; position: relative; overflow: hidden; clip-path: polygon(16% 0, 84% 0, 100% 8%, 100% 100%, 0 100%, 0 8%); }
.lever::before { content: ""; position: absolute; left: 50%; top: 58px; bottom: 58px; width: 6px; background: rgba(245,184,61,.3); transform: translateX(-50%); }
.lever b { align-self: end; justify-self: center; width: 42px; height: 96px; border-radius: 22px 22px 6px 6px; background: linear-gradient(var(--orchid), var(--gold)); box-shadow: 0 0 24px rgba(255,43,214,.45); transform: translateY(calc((100 - var(--level, 60)) * -1px)); }
.lever.active b { background: linear-gradient(var(--fern), var(--gold)); box-shadow: 0 0 25px rgba(182,255,0,.5); }
.lever.shock b { background: linear-gradient(var(--orchid), var(--cyan)); }
.lever em { font-family: "IBM Plex Mono", monospace; color: var(--cyan); font-style: normal; text-align: center; }
.glyph-console { margin: 1.5rem auto 0; display: grid; grid-template-columns: 150px minmax(220px, 360px) minmax(260px, 430px); gap: 2rem; align-items: center; max-width: 940px; }
.botanical-glyph { height: 130px; background: var(--gold); clip-path: polygon(50% 0, 62% 35%, 96% 25%, 68% 52%, 100% 78%, 60% 68%, 50% 100%, 40% 68%, 0 78%, 32% 52%, 4% 25%, 38% 35%); filter: drop-shadow(0 0 14px rgba(245,184,61,.55)); }
.input-orbit { position: relative; height: 180px; border: 1px solid rgba(0,231,255,.35); border-radius: 50%; animation: spin 12s linear infinite; }
.input-orbit i { position: absolute; width: 16px; height: 16px; background: var(--fern); border-radius: 50%; box-shadow: 0 0 14px var(--fern); }
.input-orbit i:nth-child(1){top:-8px;left:50%}.input-orbit i:nth-child(2){right:-8px;top:50%}.input-orbit i:nth-child(3){bottom:-8px;left:50%}.input-orbit i:nth-child(4){left:-8px;top:50%}
.glyph-console p { font-size: 1.25rem; line-height: 1.55; }

.aquarium { height: min(58vh, 560px); max-width: 1120px; margin: 0 auto; position: relative; clip-path: polygon(5% 0, 95% 0, 100% 14%, 100% 86%, 95% 100%, 5% 100%, 0 86%, 0 14%); }
.ring-system { position: absolute; inset: 7%; display: grid; place-items: center; }
.ring-system span { position: absolute; border: 1px solid rgba(245,184,61,.34); border-radius: 50%; animation: pulseRing 4s ease-in-out infinite; }
.ring-system span:nth-child(1){width:34%;height:34%}.ring-system span:nth-child(2){width:56%;height:56%;animation-delay:.4s}.ring-system span:nth-child(3){width:78%;height:78%;animation-delay:.8s}
.neon-roots { position: absolute; inset: 8%; width: 84%; height: 84%; }
.flock i:nth-child(1){left:20%;top:24%}.flock i:nth-child(2){left:24%;top:34%}.flock i:nth-child(3){left:30%;top:28%}.flock i:nth-child(4){left:36%;top:42%}.flock i:nth-child(5){left:45%;top:33%}.flock i:nth-child(6){left:52%;top:47%}.flock i:nth-child(7){left:58%;top:38%}.flock i:nth-child(8){left:63%;top:54%}.flock i:nth-child(9){left:69%;top:44%}.flock i:nth-child(10){left:75%;top:58%}.flock i:nth-child(11){left:80%;top:49%}.flock i:nth-child(12){left:84%;top:63%}
.flock i { animation: flockMove 3.8s ease-in-out infinite alternate; }
.delta-map { position: absolute; left: 31%; top: 36%; width: 38%; height: 30%; background: linear-gradient(45deg, transparent 42%, var(--cyan) 43% 47%, transparent 48%), linear-gradient(-35deg, transparent 42%, var(--fern) 43% 47%, transparent 48%); filter: drop-shadow(0 0 13px var(--cyan)); opacity: .72; }

.intervention-frame { grid-template-columns: minmax(240px, 360px) 1fr; gap: 2rem; }
.intervention-frame .section-title { grid-column: 1 / -1; }
.elevator-panel { display: grid; gap: .8rem; align-content: center; }
.floor { appearance: none; border: 1px solid rgba(245,184,61,.48); background: rgba(5,2,10,.72); color: var(--porcelain); padding: 1rem; display: grid; grid-template-columns: 1fr 70px; align-items: center; cursor: pointer; }
.floor b { height: 10px; background: rgba(255,242,200,.18); border-radius: 20px; position: relative; }
.floor b::after { content: ""; position: absolute; inset: 0; width: 22%; background: var(--orchid); box-shadow: 0 0 14px var(--orchid); border-radius: inherit; transition: width .35s ease; }
.floor.active { border-color: var(--fern); color: var(--fern); box-shadow: 0 0 20px rgba(182,255,0,.16); }
.floor.active b::after { width: 100%; background: var(--fern); box-shadow: 0 0 14px var(--fern); }
.medallion-stage { min-height: 420px; border: 1px solid rgba(245,184,61,.45); position: relative; display: grid; place-items: center; background: radial-gradient(circle, rgba(255,43,214,.16), transparent 38%), rgba(5,2,10,.62); clip-path: polygon(8% 0, 92% 0, 100% 12%, 100% 88%, 92% 100%, 8% 100%, 0 88%, 0 12%); }
.medallion { position: absolute; width: 150px; aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--gold); display: grid; place-items: center; background: radial-gradient(circle, rgba(255,242,200,.12), rgba(22,16,74,.55)); animation: medallionSpin 9s linear infinite; }
.medallion i { width: 54%; height: 54%; background: var(--cyan); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 14px var(--cyan)); }
.seed-medal { left: 12%; top: 18%; }.river-medal { right: 13%; top: 20%; animation-direction: reverse; }.flock-medal { bottom: 15%; left: 41%; }
.intervention-copy { max-width: 420px; text-align: center; font-size: 1.4rem; line-height: 1.5; color: var(--porcelain); padding: 1.25rem; background: rgba(5,2,10,.6); border: 1px solid rgba(0,231,255,.25); }

.plaque-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.plaque { min-height: 470px; margin: 0; padding: 1rem; border: 1px solid rgba(245,184,61,.48); background: linear-gradient(180deg, rgba(22,16,74,.82), rgba(5,2,10,.9)); display: grid; grid-template-rows: auto 1fr auto; gap: 1rem; clip-path: polygon(18% 0, 82% 0, 100% 8%, 100% 100%, 0 100%, 0 8%); }
.plaque span { color: var(--gold); text-align: center; font-size: 1.2rem; }
.plaque p { margin: 0; line-height: 1.45; }
.specimen { align-self: center; justify-self: center; width: 82%; aspect-ratio: .72; border: 1px solid rgba(255,242,200,.35); border-radius: 45% 45% 10% 10%; background: radial-gradient(circle at 50% 35%, rgba(255,242,200,.15), transparent 28%), rgba(0,231,255,.08); position: relative; box-shadow: inset 0 0 34px rgba(0,231,255,.12); }
.specimen::before, .specimen::after { content: ""; position: absolute; inset: 22%; filter: drop-shadow(0 0 14px currentColor); animation: specimenPulse 3s ease-in-out infinite; }
.city { color: var(--cyan); }.city::before { background: currentColor; clip-path: polygon(10% 90%,10% 50%,24% 50%,24% 30%,38% 30%,38% 60%,52% 60%,52% 18%,66% 18%,66% 45%,82% 45%,82% 90%); }
.root { color: var(--fern); }.root::before { background: currentColor; clip-path: polygon(47% 0,53% 0,53% 52%,82% 28%,88% 34%,58% 60%,92% 82%,86% 90%,52% 66%,41% 100%,33% 98%,44% 64%,8% 88%,2% 80%,39% 58%,12% 35%,19% 27%,47% 52%); }
.coral { color: var(--orchid); }.coral::before { background: currentColor; clip-path: polygon(46% 100%,54% 100%,54% 55%,72% 24%,80% 27%,65% 62%,88% 52%,93% 60%,61% 74%,56% 100%,44% 100%,39% 72%,8% 56%,13% 48%,35% 59%,20% 24%,28% 20%,46% 55%); }
.flocking { color: var(--gold); }.flocking::before { background: radial-gradient(circle, currentColor 0 18%, transparent 19%); background-size: 34px 34px; inset: 14%; }
.closing-inscription { font-family: "Yeseva One", serif; color: var(--fern); }

.state-dial { position: fixed; left: 50%; bottom: 1.1rem; transform: translateX(-50%); z-index: 5; display: flex; gap: .8rem; align-items: center; padding: .5rem .9rem; background: rgba(5,2,10,.78); border: 1px solid rgba(245,184,61,.5); color: var(--gold); backdrop-filter: blur(3px); }
.state-dial span { font-family: "IBM Plex Mono", monospace; color: var(--cyan); }
.state-dial b { font-weight: 400; }

.chamber .chamber-frame { transform: scale(.985); opacity: .72; transition: transform .8s ease, opacity .8s ease, box-shadow .8s ease; }
.chamber.active .chamber-frame { transform: scale(1); opacity: 1; box-shadow: 0 0 70px rgba(255,43,214,.16), inset 0 0 55px rgba(5,2,10,.75); }

@keyframes fanDrift { to { transform: rotate(360deg); } }
@keyframes breatheBorder { 50% { opacity: .45; transform: scale(.985); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes terrariumFloat { 50% { transform: translateY(-14px) rotateY(7deg); } }
@keyframes dash { to { stroke-dashoffset: -56; } }
@keyframes orbit { 50% { transform: translate(34px, -28px) scale(1.7); } }
@keyframes pulseRing { 50% { transform: scale(1.06); border-color: rgba(182,255,0,.62); } }
@keyframes flockMove { to { transform: translate(26px, -16px) scale(1.35); background: var(--fern); } }
@keyframes medallionSpin { to { transform: rotate(360deg); } }
@keyframes specimenPulse { 50% { transform: scale(1.08); opacity: .65; } }

@media (max-width: 980px) {
  .rail { width: 2.4rem; }
  .rail span { font-size: .8rem; }
  .chamber { padding-inline: 3rem; }
  .console-grid, .intervention-frame, .glyph-console { grid-template-columns: 1fr; }
  .instrument { min-height: auto; }
  .lever-board, .plaque-wall { grid-template-columns: repeat(2, 1fr); }
  .wordmark { font-size: clamp(4rem, 20vw, 8rem); }
}

@media (max-width: 640px) {
  .chamber { padding-inline: 1rem; }
  .rail { display: none; }
  .lever-board, .plaque-wall { grid-template-columns: 1fr; }
  .top-ribbon { flex-direction: column; gap: .4rem; }
  .hero-port { height: 360px; }
  .terrarium { width: 100%; }
}
