:root {
  --forest: #07130D;
  --board: #123E2A;
  --moss: #7BAE4F;
  --cream: #E1D9A8;
  --copper: #B46A3C;
  --plum: #2A1831;
  --fog: #9AA882;
  --shadow: rgba(42, 24, 49, 0.62);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--cream);
  background:
    radial-gradient(circle at 72% 8%, rgba(123, 174, 79, 0.16), transparent 32rem),
    radial-gradient(circle at 10% 60%, rgba(180, 106, 60, 0.09), transparent 26rem),
    linear-gradient(145deg, var(--forest) 0%, #051009 48%, #0d1811 100%);
  font-family: "Nunito", sans-serif;
}

.crt-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background:
    linear-gradient(rgba(225, 217, 168, 0.03) 50%, rgba(7, 19, 13, 0.14) 50%),
    radial-gradient(circle at 50% 50%, transparent 48%, rgba(7, 19, 13, 0.64) 100%);
  background-size: 100% 5px, 100% 100%;
  mix-blend-mode: screen;
  opacity: 0.48;
  animation: crtFlicker 6s steps(2, end) infinite;
}

.console-shell {
  position: relative;
  isolation: isolate;
}

.screen {
  min-height: 100vh;
  position: relative;
  padding: clamp(4.5rem, 7vw, 7rem) clamp(1rem, 5vw, 5rem);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.8rem, 1.4vw, 1.4rem);
  overflow: hidden;
}

.screen::before {
  content: attr(data-screen);
  position: absolute;
  right: clamp(1rem, 4vw, 4rem);
  top: clamp(1rem, 3vw, 2rem);
  color: rgba(154, 168, 130, 0.18);
  font-family: "Cherry Bomb One", cursive;
  font-size: clamp(5rem, 15vw, 14rem);
  line-height: 1;
  transform: rotate(-5deg);
}

.screen-label,
.mono-kicker,
.mono-detail,
.stamp,
.terminal-lines,
.status-row {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
}

.screen-label {
  position: absolute;
  top: 1.2rem;
  left: clamp(1rem, 5vw, 5rem);
  z-index: 5;
  font-size: 0.75rem;
  color: var(--fog);
  text-transform: uppercase;
}

.hero-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.9rem, 1.6vw, 1.7rem);
  position: relative;
  z-index: 2;
  min-height: 76vh;
}

.wordmark-block {
  grid-column: 2 / 8;
  align-self: start;
  margin-top: 2.8rem;
  transform: translateX(-24px);
}

.mono-kicker {
  color: var(--moss);
  font-size: clamp(0.74rem, 1.1vw, 0.95rem);
  margin: 0 0 0.6rem;
}

h1 {
  margin: 0;
  font-family: "Cherry Bomb One", cursive;
  font-size: clamp(5.8rem, 17vw, 15.5rem);
  line-height: 0.78;
  letter-spacing: -0.045em;
  color: var(--cream);
  text-shadow: 4px 5px 0 var(--board), 0 0 28px rgba(123, 174, 79, 0.38), -2px 0 0 rgba(180, 106, 60, 0.54);
}

h2 {
  font-size: clamp(1.6rem, 3.4vw, 3rem);
  line-height: 0.95;
  margin: 0 0 1rem;
  font-weight: 900;
}

p {
  color: var(--fog);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.55;
}

.status-row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.1rem;
  padding: 0.65rem 0.9rem;
  color: var(--fog);
  background: rgba(18, 62, 42, 0.72);
  border: 1px solid rgba(123, 174, 79, 0.25);
  border-radius: 999px;
  box-shadow: 0 18px 45px var(--shadow);
  font-size: 0.72rem;
}

.status-light {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 16px var(--moss);
  animation: blink 1.7s infinite;
}

.status-light.dim {
  opacity: 0.35;
  animation-delay: 0.45s;
}

.status-light.copper {
  background: var(--copper);
  box-shadow: 0 0 12px var(--copper);
  animation-delay: 0.9s;
}

.chip,
.clue-chip,
.root-copy,
.letter-chip,
.badge,
.map-trace {
  position: relative;
  border-radius: 30px;
  border: 1px solid rgba(225, 217, 168, 0.14);
  background: linear-gradient(145deg, rgba(18, 62, 42, 0.95), rgba(7, 19, 13, 0.92));
  box-shadow: 0 28px 0 -14px var(--plum), 0 32px 70px rgba(0, 0, 0, 0.42), inset 0 0 0 2px rgba(123, 174, 79, 0.08);
  transition: transform 280ms ease, box-shadow 280ms ease, border-color 280ms ease, filter 280ms ease;
}

.hover-chip::after {
  content: attr(data-note);
  position: absolute;
  left: 1.4rem;
  right: 1.4rem;
  bottom: 1rem;
  opacity: 0;
  transform: translateY(8px);
  color: var(--moss);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  transition: opacity 220ms ease, transform 220ms ease;
}

.hover-chip:hover,
.hover-chip.is-lifted {
  transform: translateY(-14px) rotate(1.4deg);
  border-color: rgba(123, 174, 79, 0.62);
  box-shadow: 0 36px 0 -16px var(--plum), 0 0 42px rgba(123, 174, 79, 0.28), 0 40px 82px rgba(0, 0, 0, 0.52), inset 0 0 0 2px rgba(225, 217, 168, 0.08);
}

.hover-chip:hover::after,
.hover-chip.is-lifted::after {
  opacity: 1;
  transform: translateY(0);
}

.hero-photo {
  grid-column: 8 / 12;
  min-height: 22rem;
  transform: translate(12px, 114px) rotate(3deg);
  overflow: hidden;
}

.photo-texture {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 30% 20%, rgba(225, 217, 168, 0.74), transparent 20%),
    radial-gradient(circle at 70% 58%, rgba(180, 106, 60, 0.65), transparent 18%),
    repeating-linear-gradient(110deg, rgba(123, 174, 79, 0.22) 0 2px, transparent 2px 7px),
    linear-gradient(135deg, var(--forest), var(--moss));
  filter: contrast(1.25) saturate(0.78);
  mix-blend-mode: screen;
}

.photo-texture::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(7, 19, 13, 0.48) 1px, transparent 1px);
  background-size: 5px 5px;
  opacity: 0.62;
}

.stamp {
  position: absolute;
  left: 1.2rem;
  top: 1.1rem;
  z-index: 2;
  color: var(--cream);
  background: rgba(7, 19, 13, 0.56);
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  font-size: 0.68rem;
}

.terminal-chip {
  grid-column: 3 / 7;
  align-self: end;
  margin-bottom: 2rem;
  padding: 2rem 2rem 3.4rem;
  transform: translate(-10px, -8px) rotate(-2deg);
}

.tag {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  color: var(--forest);
  background: var(--copper);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.tag.crooked {
  transform: rotate(-5deg);
}

.terminal-lines {
  display: grid;
  gap: 0.32rem;
  margin-top: 1.2rem;
  color: var(--moss);
  font-size: 0.72rem;
}

.audit-whisper {
  margin: 0.75rem 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(154, 168, 130, 0.72);
}

.badge {
  grid-column: 7 / 10;
  align-self: center;
  justify-self: center;
  padding: 1rem 1.4rem 2.2rem;
  color: var(--forest);
  background: var(--cream);
  border-radius: 22px 34px 22px 34px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transform: translate(4px, 25px) rotate(-8deg);
}

.map-trace {
  grid-column: 9 / 13;
  align-self: end;
  padding: 1rem 1rem 2.5rem;
  transform: translate(-8px, -18px) rotate(2deg);
}

.map-trace span {
  font-family: "IBM Plex Mono", monospace;
  color: var(--fog);
  font-size: 0.78rem;
}

.map-trace svg {
  width: 100%;
  margin-top: 0.6rem;
  overflow: visible;
}

.map-trace path,
.map-trace circle,
.circuit path,
.root-svg path {
  fill: none;
  stroke: var(--moss);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-trace circle,
.node,
.root-nodes circle {
  fill: var(--copper);
  stroke: none;
}

.circuit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.74;
  filter: drop-shadow(0 0 14px rgba(123, 174, 79, 0.24));
}

.trace {
  stroke-dasharray: 10 18;
  animation: pulseTrace 18s linear infinite;
}

.trace-faint {
  opacity: 0.4;
}

.pulse-node {
  fill: var(--moss);
  animation: nodeGlow 2.5s ease-in-out infinite;
}

.pulse-node.delay {
  animation-delay: 1.1s;
}

.copper-node {
  fill: var(--copper);
}

.signal-beetle {
  fill: var(--copper);
  filter: drop-shadow(0 0 8px rgba(180, 106, 60, 0.75));
}

.beetle-one {
  offset-path: path("M80 172 H292 Q318 172 318 198 V286 H496 V238 H708 Q746 238 746 276 V402 H1018");
  animation: crawl 17s linear infinite;
}

.clues-screen {
  background: radial-gradient(circle at 12% 14%, rgba(42, 24, 49, 0.4), transparent 28rem);
}

.clue-orbit {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.3rem;
  min-height: 74vh;
  align-items: center;
}

.clue-chip {
  padding: 2rem 2rem 3.6rem;
  min-height: 20rem;
}

.chip-number {
  font-family: "Cherry Bomb One", cursive;
  color: var(--moss);
  font-size: 4rem;
  line-height: 1;
  text-shadow: 0 0 20px rgba(123, 174, 79, 0.34);
}

.clue-one {
  grid-column: 2 / 6;
  transform: translateY(4rem) rotate(-3deg);
}

.photo-clue {
  grid-column: 6 / 10;
  transform: translate(-16px, -3rem) rotate(2deg);
  overflow: hidden;
  background: var(--board);
}

.photo-clue h2,
.photo-clue p,
.photo-clue .mono-detail {
  position: relative;
  z-index: 2;
}

.photo-texture.rings {
  opacity: 0.56;
  background:
    repeating-radial-gradient(circle at 35% 46%, rgba(225, 217, 168, 0.42) 0 3px, transparent 3px 13px),
    linear-gradient(135deg, var(--forest), var(--moss) 52%, var(--copper));
}

.clue-three {
  grid-column: 9 / 13;
  transform: translateY(6.4rem) rotate(4deg);
}

.mono-detail {
  color: var(--moss);
  font-size: 0.72rem;
}

.rootboard-screen {
  padding-inline: 0;
}

.rootboard-screen .screen-label {
  left: clamp(1rem, 5vw, 5rem);
}

.rootboard-panel {
  grid-column: 1 / -1;
  position: relative;
  min-height: 72vh;
  margin-top: 3rem;
  border-block: 1px solid rgba(123, 174, 79, 0.28);
  background:
    radial-gradient(circle at 48% 52%, rgba(123, 174, 79, 0.14), transparent 25rem),
    linear-gradient(180deg, rgba(18, 62, 42, 0.26), rgba(7, 19, 13, 0.4));
  overflow: hidden;
}

.forest-silhouette {
  position: absolute;
  inset: auto 0 0;
  height: 52%;
  background:
    linear-gradient(150deg, transparent 0 18%, rgba(18, 62, 42, 0.82) 18% 20%, transparent 20% 35%, rgba(18, 62, 42, 0.8) 35% 38%, transparent 38%),
    repeating-linear-gradient(90deg, rgba(18, 62, 42, 0.42) 0 18px, transparent 18px 46px);
  clip-path: polygon(0 35%, 7% 20%, 11% 42%, 18% 12%, 23% 38%, 30% 24%, 36% 44%, 44% 18%, 52% 40%, 60% 22%, 66% 48%, 73% 16%, 80% 44%, 88% 24%, 95% 46%, 100% 30%, 100% 100%, 0 100%);
  opacity: 0.66;
}

.root-svg {
  position: absolute;
  inset: 5% 0 0;
  width: 100%;
  height: 88%;
  overflow: visible;
}

.root-trace {
  stroke-width: 5;
  stroke-dasharray: 18 24;
  animation: pulseTrace 20s linear infinite reverse;
}

.root-trace.main {
  stroke-width: 7;
  filter: drop-shadow(0 0 18px rgba(123, 174, 79, 0.36));
}

.root-nodes circle {
  fill: var(--cream);
  animation: nodeGlow 3s ease-in-out infinite;
}

.beetle-two {
  offset-path: path("M30 316 H222 C268 316 274 252 330 252 H486 C548 252 540 342 606 342 H810 C864 342 880 276 938 276 H1362");
  animation: crawl 23s linear infinite;
}

.root-copy {
  position: absolute;
  right: 8vw;
  top: 13vh;
  width: min(31rem, 76vw);
  padding: 2rem 2rem 3.4rem;
  transform: rotate(2deg);
}

.decode-screen {
  place-items: center;
  text-align: center;
  background: radial-gradient(circle at center, rgba(123, 174, 79, 0.13), transparent 33rem);
}

.decode-field {
  grid-column: 2 / 12;
  position: relative;
  min-height: 68vh;
  display: grid;
  place-items: center;
}

.letter-cloud {
  position: relative;
  width: min(58rem, 92vw);
  min-height: 19rem;
  margin: 1rem auto;
}

.letter-chip {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(5rem, 10vw, 8.5rem);
  aspect-ratio: 1;
  color: var(--cream);
  font-family: "Cherry Bomb One", cursive;
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 1;
  cursor: default;
}

.letter-chip:nth-child(1) { left: 8%; top: 34%; transform: rotate(-10deg); }
.letter-chip:nth-child(2) { left: 26%; top: 8%; transform: rotate(7deg); }
.letter-chip:nth-child(3) { left: 44%; top: 46%; transform: rotate(-5deg); }
.letter-chip:nth-child(4) { left: 57%; top: 19%; transform: rotate(11deg); }
.letter-chip:nth-child(5) { left: 68%; top: 42%; transform: rotate(-8deg); }
.letter-chip:nth-child(6) { left: 82%; top: 12%; transform: rotate(5deg); }

.letter-chip.dot {
  color: var(--copper);
}

.resolved-word {
  position: absolute;
  bottom: 6%;
  margin: 0;
  font-family: "Cherry Bomb One", cursive;
  font-size: clamp(4rem, 11vw, 10rem);
  color: rgba(225, 217, 168, 0.13);
  text-shadow: 0 0 30px rgba(123, 174, 79, 0.24);
}

.decode-copy {
  position: absolute;
  bottom: 0;
  max-width: 40rem;
  margin: 0;
}

body.ready .chip,
body.ready .clue-chip,
body.ready .root-copy,
body.ready .letter-chip,
body.ready .badge,
body.ready .map-trace {
  animation: slowDrift var(--drift, 8s) ease-in-out infinite alternate;
}

@keyframes pulseTrace {
  to { stroke-dashoffset: -240; }
}

@keyframes nodeGlow {
  0%, 100% { opacity: 0.55; filter: drop-shadow(0 0 4px rgba(123, 174, 79, 0.35)); }
  50% { opacity: 1; filter: drop-shadow(0 0 18px rgba(123, 174, 79, 0.95)); }
}

@keyframes blink {
  0%, 30%, 100% { opacity: 0.34; }
  10%, 18% { opacity: 1; }
}

@keyframes crawl {
  to { offset-distance: 100%; }
}

@keyframes crtFlicker {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.52; }
}

@keyframes slowDrift {
  from { translate: 0 0; }
  to { translate: var(--drift-x, 8px) var(--drift-y, -10px); }
}

@media (max-width: 900px) {
  .screen {
    display: block;
    padding-inline: 1rem;
  }

  .hero-grid,
  .clue-orbit {
    display: block;
  }

  .wordmark-block,
  .hero-photo,
  .terminal-chip,
  .badge,
  .map-trace,
  .clue-one,
  .photo-clue,
  .clue-three {
    transform: none;
    margin: 1rem 0;
  }

  .chip,
  .clue-chip,
  .map-trace {
    min-height: auto;
  }

  .hero-photo {
    min-height: 18rem;
  }

  .root-copy {
    left: 1rem;
    right: 1rem;
    width: auto;
  }

  .letter-chip:nth-child(n) {
    position: relative;
    left: auto;
    top: auto;
    display: inline-grid;
    margin: 0.25rem;
  }

  .letter-cloud {
    min-height: auto;
  }
}
