:root {
  /* Typography compliance tokens: Space Mono labels such as `sprout` coordinates Mono** */
  --sun-peach: #FFB36B;
  --tomato: #FF5A3D;
  --marigold: #FFD166;
  --leaf: #2FA66A;
  --ink: #16231D;
  --plum: #3A2449;
  --cream: #FFF1D8;
  --cyan: #63F4FF;
  --display: Poppins, Jost, Futura, "Avenir Next", "Century Gothic", sans-serif;
  --body: "Nunito Sans", Nunito, Inter, system-ui, sans-serif;
  --mono: "Space Mono", "SFMono-Regular", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  background:
    radial-gradient(circle at 18% 9%, rgba(99, 244, 255, .42), transparent 20rem),
    radial-gradient(circle at 80% 22%, rgba(255, 90, 61, .52), transparent 24rem),
    linear-gradient(135deg, #FFF1D8 0%, #FFB36B 45%, #FFD166 70%, #2FA66A 140%);
  overflow-x: hidden;
}

.grain,
.glass-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.grain {
  opacity: .24;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(22, 35, 29, .18) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 35%, rgba(58, 36, 73, .16) 0 1px, transparent 1px),
    radial-gradient(circle at 40% 90%, rgba(255, 90, 61, .18) 0 1px, transparent 1px);
  background-size: 19px 23px, 31px 29px, 43px 41px;
}

.glass-grid {
  opacity: .22;
  background:
    linear-gradient(90deg, rgba(255, 241, 216, .34) 1px, transparent 1px) 0 0 / 8.333vw 100%,
    linear-gradient(180deg, rgba(58, 36, 73, .16) 1px, transparent 1px) 0 0 / 100% 25vh;
}

.rail {
  position: fixed;
  top: 18px;
  left: 20px;
  right: 20px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--plum);
}

.rail a {
  color: inherit;
  text-decoration: none;
}

.rail-word {
  width: max-content;
  padding: 8px 10px;
  border: 1px solid rgba(58, 36, 73, .22);
  background: rgba(255, 241, 216, .24);
  backdrop-filter: blur(10px);
}

.rail-links {
  display: flex;
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(22, 35, 29, .16);
  background: rgba(255, 241, 216, .2);
  backdrop-filter: blur(12px);
}

.rail-link { padding: 3px 7px; }
.rail-link.active { color: var(--tomato); background: rgba(255, 209, 102, .34); }

.mode {
  justify-self: end;
  padding: 8px 10px;
  color: var(--leaf);
  border: 1px dashed rgba(47, 166, 106, .48);
  background: rgba(255, 241, 216, .18);
  backdrop-filter: blur(10px);
}

.bay {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 88px 7vw 64px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, minmax(64px, 1fr));
}

.hero {
  background:
    radial-gradient(circle at 70% 52%, rgba(99, 244, 255, .24), transparent 17rem),
    radial-gradient(circle at 16% 68%, rgba(255, 209, 102, .52), transparent 22rem),
    linear-gradient(160deg, rgba(255, 241, 216, .62), rgba(255, 179, 107, .64));
}

.tag-cloud {
  grid-column: 1 / 12;
  grid-row: 2 / 5;
  position: relative;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -.075em;
  line-height: .74;
  font-size: clamp(5rem, 17vw, 16rem);
  color: var(--ink);
  text-transform: lowercase;
}

.tag-cloud span { display: block; filter: drop-shadow(10px 16px rgba(58, 36, 73, .08)); }
.tag-cloud span:nth-child(2) { margin-left: 22vw; color: var(--plum); transform: translateY(-.08em); }
.tag-cloud span:nth-child(3) { margin-left: 7vw; color: transparent; -webkit-text-stroke: 2px rgba(47, 166, 106, .55); font-size: .48em; letter-spacing: -.04em; }

.sprout-stage {
  grid-column: 6 / 11;
  grid-row: 1 / 9;
  position: relative;
  min-height: 620px;
}

.prediction-sprout {
  position: absolute;
  width: min(42vw, 310px);
  height: 86vh;
  right: 18%;
  bottom: -8vh;
  overflow: visible;
}

.stem-line,
.prediction-sprout .leaf {
  fill: none;
  stroke: var(--leaf);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stem-line {
  stroke-dasharray: 840;
  stroke-dashoffset: 840;
  animation: growStem 2.8s cubic-bezier(.2, .8, .2, 1) forwards .25s;
}

.prediction-sprout .leaf { fill: rgba(47, 166, 106, .74); stroke-width: 3; opacity: 0; transform-origin: center; animation: leafPop .8s cubic-bezier(.2, 1.4, .2, 1) forwards; }
.leaf-one { animation-delay: 1.2s !important; }
.leaf-two { animation-delay: 1.75s !important; }
.leaf-three { animation-delay: 2.1s !important; }

.hud-ring {
  position: absolute;
  right: 2vw;
  top: 15vh;
  width: clamp(170px, 25vw, 310px);
  aspect-ratio: 1;
  border: 2px solid rgba(99, 244, 255, .84);
  border-radius: 50%;
  box-shadow: 0 0 32px rgba(99, 244, 255, .34), inset 0 0 42px rgba(99, 244, 255, .12);
  animation: hudSpin 12s linear infinite;
}

.hud-ring span,
.final-hud span {
  position: absolute;
  width: 18%;
  height: 18%;
  border-color: var(--cyan);
  border-style: solid;
}
.hud-ring span:nth-child(1) { left: 8%; top: 8%; border-width: 2px 0 0 2px; }
.hud-ring span:nth-child(2) { right: 8%; top: 8%; border-width: 2px 2px 0 0; }
.hud-ring span:nth-child(3) { right: 8%; bottom: 8%; border-width: 0 2px 2px 0; }
.hud-ring span:nth-child(4) { left: 8%; bottom: 8%; border-width: 0 0 2px 2px; }

.pollen {
  position: absolute;
  left: 48%;
  top: 48%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--marigold);
  box-shadow: 0 0 0 9px rgba(255, 209, 102, .18), 0 0 25px rgba(255, 209, 102, .9);
}

.panel {
  background: rgba(255, 241, 216, .58);
  border: 1px solid rgba(255, 241, 216, .74);
  box-shadow: 0 24px 80px rgba(58, 36, 73, .12);
  backdrop-filter: blur(18px);
}

.hero-note {
  grid-column: 2 / 6;
  grid-row: 6 / 8;
  align-self: end;
  padding: clamp(20px, 3vw, 34px);
}

.kicker {
  margin: 0 0 12px;
  color: var(--tomato);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
}

h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: .88;
}

h1 { font-size: clamp(3rem, 7vw, 7.6rem); }
h2 { font-size: clamp(2.8rem, 6vw, 6.7rem); }
p { font-size: clamp(1rem, 1.35vw, 1.25rem); line-height: 1.48; }

.scanline-label {
  grid-column: 8 / 12;
  grid-row: 8;
  align-self: end;
  color: var(--plum);
  font-family: var(--mono);
  font-size: 12px;
  background: repeating-linear-gradient(0deg, rgba(255, 90, 61, .2) 0 1px, transparent 1px 5px);
  padding: 12px;
}

.scanner {
  background:
    radial-gradient(circle at 86% 18%, rgba(99, 244, 255, .28), transparent 18rem),
    linear-gradient(115deg, rgba(255, 209, 102, .35), rgba(255, 179, 107, .34) 45%, rgba(47, 166, 106, .2));
}

.oversize-word {
  grid-column: 1 / 8;
  grid-row: 1 / 3;
  color: rgba(58, 36, 73, .16);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(7rem, 22vw, 20rem);
  letter-spacing: -.08em;
  line-height: .75;
}

.hanging-scanner { grid-column: 8 / 12; grid-row: 1 / 6; position: relative; justify-self: center; width: 290px; }
.scanner-cord { width: 2px; height: 22vh; margin: 0 auto; background: linear-gradient(var(--plum), transparent); }
.scanner-head {
  position: relative;
  height: 260px;
  border: 1px solid rgba(99, 244, 255, .8);
  border-radius: 50%;
  background: rgba(255, 241, 216, .22);
  box-shadow: inset 0 0 46px rgba(99, 244, 255, .18), 0 0 40px rgba(99, 244, 255, .2);
  animation: bob 3.6s ease-in-out infinite;
}
.scanner-head p { position: absolute; bottom: 28px; left: 35px; font-family: var(--mono); font-size: 12px; color: var(--tomato); }
.reticle, .reticle span { position: absolute; inset: 38px; border: 1px solid rgba(99, 244, 255, .72); border-radius: 50%; }
.reticle { animation: hudSpin 9s linear infinite reverse; }
.reticle span:nth-child(1) { inset: 38px; }
.reticle span:nth-child(2) { inset: 70px; border-style: dashed; }

.leaf-cluster { grid-column: 2 / 7; grid-row: 3 / 8; position: relative; }
.leaf-cluster i {
  position: absolute;
  width: 150px;
  height: 72px;
  border-radius: 100% 0 100% 0;
  background: rgba(47, 166, 106, .72);
  transform: rotate(var(--r));
  box-shadow: inset -18px -12px rgba(22, 35, 29, .12);
}
.leaf-cluster i:nth-child(1) { --r: 18deg; left: 8%; top: 8%; }
.leaf-cluster i:nth-child(2) { --r: -34deg; left: 34%; top: 25%; background: rgba(47, 166, 106, .46); }
.leaf-cluster i:nth-child(3) { --r: 54deg; left: 1%; top: 45%; background: rgba(22, 35, 29, .7); }
.leaf-cluster i:nth-child(4) { --r: -12deg; left: 48%; top: 58%; }
.leaf-cluster i:nth-child(5) { --r: 77deg; left: 23%; top: 72%; background: rgba(255, 90, 61, .62); }

.scanner-note { grid-column: 6 / 11; grid-row: 6 / 8; padding: clamp(18px, 3vw, 32px); }
.calibration-box {
  grid-column: 2 / 5;
  grid-row: 7 / 9;
  align-self: center;
  border: 1px dashed rgba(58, 36, 73, .5);
  padding: 16px;
  color: var(--plum);
  font-family: var(--mono);
  font-size: 12px;
  animation: calibrate 2.8s steps(2, end) infinite;
}
.calibration-box b { display: inline-block; width: 10px; height: 10px; margin: 16px 8px 0 0; background: var(--marigold); border-radius: 50%; animation: seedPop 1.4s infinite; }
.calibration-box b:nth-child(3) { animation-delay: .22s; background: var(--tomato); }
.calibration-box b:nth-child(4) { animation-delay: .44s; background: var(--cyan); }

.archive {
  background:
    radial-gradient(circle at 25% 70%, rgba(255, 90, 61, .42), transparent 16rem),
    linear-gradient(145deg, rgba(58, 36, 73, .92), rgba(22, 35, 29, .82));
  color: var(--cream);
}
.archive-window { grid-column: 2 / 8; grid-row: 2 / 5; padding: clamp(22px, 4vw, 46px); border: 1px solid rgba(255, 241, 216, .22); background: rgba(255, 241, 216, .08); }
.archive-window h2 { color: var(--cream); text-shadow: 5px 0 rgba(255, 90, 61, .35), -5px 0 rgba(99, 244, 255, .2); }

.glitch-flower { grid-column: 8 / 12; grid-row: 2 / 7; position: relative; width: min(36vw, 380px); aspect-ratio: 1; justify-self: center; align-self: center; filter: drop-shadow(0 28px 40px rgba(0,0,0,.25)); }
.petal, .core, .glitch-block { position: absolute; }
.petal { width: 42%; height: 26%; left: 29%; top: 37%; border-radius: 80% 20% 80% 20%; background: var(--tomato); transform-origin: 50% 50%; animation: petalGlitch 2.6s steps(2, end) infinite; }
.p1 { transform: rotate(0deg) translateX(31%); }
.p2 { transform: rotate(72deg) translateX(31%); background: var(--sun-peach); animation-delay: .12s; }
.p3 { transform: rotate(144deg) translateX(31%); background: var(--marigold); animation-delay: .2s; }
.p4 { transform: rotate(216deg) translateX(31%); background: var(--tomato); animation-delay: .28s; }
.p5 { transform: rotate(288deg) translateX(31%); background: var(--cyan); animation-delay: .36s; }
.core { width: 23%; height: 23%; left: 38.5%; top: 38.5%; border-radius: 50%; background: var(--marigold); box-shadow: 0 0 0 10px rgba(255, 209, 102, .2); }
.glitch-block { background: var(--cyan); mix-blend-mode: screen; animation: blockHop 1.8s steps(3, end) infinite; }
.g1 { width: 72px; height: 18px; left: 2%; top: 28%; }
.g2 { width: 56px; height: 24px; right: 6%; top: 61%; background: var(--tomato); animation-delay: .25s; }
.g3 { width: 38px; height: 38px; right: 29%; top: 8%; background: var(--marigold); animation-delay: .5s; }

.seed-orbit { grid-column: 2 / 5; grid-row: 6 / 8; position: relative; width: 210px; height: 210px; border: 1px dashed rgba(99, 244, 255, .55); border-radius: 50%; animation: hudSpin 16s linear infinite; }
.seed-orbit i { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: var(--marigold); }
.seed-orbit i:nth-child(1) { left: 47%; top: -7px; }
.seed-orbit i:nth-child(2) { right: -7px; top: 47%; background: var(--cyan); }
.seed-orbit i:nth-child(3) { left: 47%; bottom: -7px; background: var(--tomato); }
.seed-orbit i:nth-child(4) { left: -7px; top: 47%; background: var(--leaf); }
.seed-orbit span { position: absolute; inset: 42%; width: max-content; font-family: var(--mono); font-size: 11px; color: var(--cyan); }
.drift-note { grid-column: 6 / 10; grid-row: 7 / 8; color: rgba(255, 241, 216, .78); font-family: var(--mono); font-size: 13px; }

.bloom {
  background:
    radial-gradient(circle at 50% -10%, rgba(99, 244, 255, .55), transparent 28rem),
    linear-gradient(180deg, #63F4FF -22%, #FFF1D8 23%, #FFB36B 58%, #FF5A3D 140%);
}
.roof-open { grid-column: 1 / 13; grid-row: 1 / 4; border: 1px solid rgba(255, 241, 216, .55); border-top: 0; transform: skewX(-12deg); background: linear-gradient(90deg, rgba(255,255,255,.18), transparent 16%, rgba(255,255,255,.16) 18%, transparent 34%); }
.final-sprout { grid-column: 2 / 6; grid-row: 4 / 9; position: relative; align-self: end; height: 420px; }
.final-sprout svg { position: absolute; bottom: 0; left: 18%; height: 100%; overflow: visible; }
.final-sprout path { fill: rgba(47,166,106,.72); stroke: var(--leaf); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; animation: finalSway 4s ease-in-out infinite; transform-origin: bottom center; }
.final-sprout path:first-child { fill: none; }
.final-hud { position: absolute; left: 20%; top: 2%; width: 220px; height: 220px; border: 2px solid rgba(99, 244, 255, .78); border-radius: 50%; animation: hudSpin 13s linear infinite; }
.final-hud span:nth-child(1) { left: 7%; top: 7%; border-width: 2px 0 0 2px; }
.final-hud span:nth-child(2) { right: 7%; bottom: 7%; border-width: 0 2px 2px 0; }
.bloom-copy { grid-column: 6 / 12; grid-row: 3 / 7; align-self: center; color: var(--ink); }
.bloom-copy h2 { font-size: clamp(4rem, 9vw, 10rem); color: var(--plum); }
.horizon-dots { grid-column: 6 / 12; grid-row: 7 / 8; display: flex; gap: 23px; align-items: center; }
.horizon-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--marigold); box-shadow: 0 0 22px rgba(255,209,102,.8); animation: seedPop 1.8s ease-in-out infinite; }
.horizon-dots i:nth-child(2) { animation-delay: .2s; background: var(--tomato); }
.horizon-dots i:nth-child(3) { animation-delay: .4s; background: var(--cyan); }
.horizon-dots i:nth-child(4) { animation-delay: .6s; background: var(--leaf); }
.horizon-dots i:nth-child(5) { animation-delay: .8s; background: var(--cream); }

.reveal { opacity: 0; transform: translateY(38px) rotate(-.4deg); transition: opacity .75s ease, transform .75s cubic-bezier(.2, .9, .2, 1); }
.reveal.visible { opacity: 1; transform: translateY(0) rotate(0deg); }

@keyframes growStem { to { stroke-dashoffset: 0; } }
@keyframes leafPop { from { opacity: 0; transform: scale(.45) rotate(-10deg); } to { opacity: 1; transform: scale(1) rotate(0deg); } }
@keyframes hudSpin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(1deg); } 50% { transform: translateY(18px) rotate(-2deg); } }
@keyframes calibrate { 0%, 100% { transform: translate(0,0); border-color: rgba(58,36,73,.5); } 50% { transform: translate(4px,-3px); border-color: var(--tomato); } }
@keyframes seedPop { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-14px) scale(1.25); } }
@keyframes petalGlitch { 0%, 100% { filter: none; margin-left: 0; } 35% { filter: hue-rotate(18deg); margin-left: 12px; } 60% { filter: saturate(1.5); margin-left: -10px; } }
@keyframes blockHop { 0%, 100% { transform: translate(0,0); opacity: .7; } 50% { transform: translate(18px,-11px); opacity: 1; } }
@keyframes finalSway { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(2deg); } }

@media (max-width: 760px) {
  .rail { grid-template-columns: 1fr; right: auto; gap: 7px; }
  .mode { justify-self: start; }
  .bay { display: block; padding: 132px 22px 72px; min-height: 110vh; }
  .tag-cloud { font-size: clamp(4.4rem, 24vw, 9rem); }
  .sprout-stage, .hanging-scanner, .leaf-cluster, .glitch-flower, .final-sprout { min-height: 360px; width: 100%; margin: 28px 0; }
  .prediction-sprout { left: 18%; right: auto; height: 520px; }
  .hud-ring { right: 4%; top: 42px; }
  .panel, .archive-window, .scanner-note { margin: 24px 0; }
  .glitch-flower { width: 82vw; }
  .bloom-copy h2 { font-size: clamp(3.8rem, 20vw, 7rem); }
}
