:root {
  /* Compliance tokens: Mono` Inter` Grotesk` */
  --deep: #061B12;
  --pollen: #FFC857;
  --cyan: #6DE7FF;
  --mist: #DDF7E8;
  --moss: #0F5F3B;
  --bark: #21352A;
  --leaf: #D8FF5A;
  --glow: #36F28B;
  --display: 'Space Grotesk', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--mist);
  background: var(--deep);
  font-family: var(--body);
  overflow-x: hidden;
  cursor: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(216, 255, 90, .16), transparent 28%),
    radial-gradient(circle at 76% 24%, rgba(54, 242, 139, .13), transparent 32%),
    radial-gradient(circle at 45% 72%, rgba(109, 231, 255, .08), transparent 35%),
    linear-gradient(125deg, #061B12 0%, #082217 46%, #061B12 100%);
  z-index: -5;
}

.canopy {
  position: fixed;
  inset: -8vh -8vw;
  z-index: -4;
  opacity: .34;
  background-image: url("data:image/svg+xml,%3Csvg width='140' height='122' viewBox='0 0 140 122' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%2336F28B' stroke-width='1' opacity='.55'%3E%3Cpath d='M35 1 68 20v39L35 78 2 59V20z'/%3E%3Cpath d='M104 1 137 20v39l-33 19-33-19V20z'/%3E%3Cpath d='M69 62 102 81v39l-33 19-33-19V81z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 190px 166px;
  transform: translate3d(0, 0, 0);
  transition: transform .4s linear;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: .18;
  background: repeating-linear-gradient(to bottom, rgba(221, 247, 232, .13) 0 1px, transparent 1px 5px), radial-gradient(circle, transparent 0, rgba(6, 27, 18, .42) 100%);
  mix-blend-mode: screen;
}

.cursor-core,
.cursor-trail {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 60;
  transform: translate(-40px, -40px);
}

.cursor-core {
  width: 18px;
  height: 18px;
  background: var(--glow);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  box-shadow: 0 0 20px var(--glow), 0 0 42px rgba(216, 255, 90, .45);
}

.cursor-trail {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(54, 242, 139, .55);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}

.command-rail {
  position: fixed;
  left: 20px;
  top: 24px;
  bottom: 24px;
  width: 156px;
  z-index: 20;
  padding: 16px 10px;
  border-left: 1px solid rgba(54, 242, 139, .35);
  background: linear-gradient(90deg, rgba(6, 27, 18, .82), transparent);
  font-family: var(--mono);
}

.rail-top {
  margin-bottom: 28px;
  color: var(--leaf);
  font-size: 12px;
  text-transform: uppercase;
}

.command-rail a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 2px 8px;
  margin: 15px 0;
  padding: 8px 6px;
  color: rgba(221, 247, 232, .48);
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%);
  transition: color .25s, background .25s, transform .25s;
}

.command-rail a span { color: var(--bark); }
.command-rail a b { font-size: 13px; font-weight: 700; }
.command-rail a i { grid-column: 2; font-size: 9px; font-style: normal; color: rgba(109, 231, 255, .55); }
.command-rail a.active { color: var(--glow); background: rgba(15, 95, 59, .62); transform: translateX(6px); box-shadow: inset 3px 0 0 var(--leaf); }

.lattice {
  position: relative;
  width: 100%;
}

.cell-shell,
.story-cell {
  position: relative;
  min-height: 100vh;
  padding: 12vh 8vw 10vh 220px;
}

.hero { overflow: hidden; }

.boot-lines {
  position: absolute;
  top: 10vh;
  left: 220px;
  font-family: var(--mono);
  color: rgba(54, 242, 139, .78);
  font-size: 13px;
  text-shadow: 0 0 14px rgba(54, 242, 139, .45);
}

.boot-lines p { margin: 0 0 8px; opacity: 0; animation: bootLine .55s forwards; }
.boot-lines p:nth-child(2) { animation-delay: .38s; }
.boot-lines p:nth-child(3) { animation-delay: .76s; }

.wordmark {
  position: absolute;
  left: 184px;
  top: 29vh;
  transform: rotate(-8deg) translateX(-4vw);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.07em;
  line-height: .78;
  font-size: clamp(58px, 12vw, 184px);
  color: var(--mist);
  text-shadow: 0 0 32px rgba(54, 242, 139, .22);
  opacity: 0;
  animation: wordBoot 1s .9s cubic-bezier(.2,.9,.15,1) forwards;
}

.wordmark em { color: var(--leaf); font-style: normal; }
.blink { display: inline-block; width: .12em; height: .72em; margin-left: .05em; background: var(--glow); box-shadow: 0 0 22px var(--glow); animation: blink 1s steps(2) infinite; }

.hex-panel {
  background: linear-gradient(135deg, rgba(15, 95, 59, .83), rgba(33, 53, 42, .62));
  border: 1px solid rgba(54, 242, 139, .55);
  clip-path: polygon(8% 0, 92% 0, 100% 18%, 100% 82%, 92% 100%, 8% 100%, 0 82%, 0 18%);
  box-shadow: 0 26px 90px rgba(0, 0, 0, .36), inset 0 0 34px rgba(54, 242, 139, .08);
}

.hero-copy {
  position: absolute;
  right: 8vw;
  bottom: 10vh;
  width: min(520px, 42vw);
  padding: 36px 44px;
}

.prompt { font-family: var(--mono); color: var(--glow); font-size: 13px; margin-bottom: 16px; text-shadow: 0 0 12px rgba(54, 242, 139, .38); }

h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.07em;
  line-height: .86;
}

h1 { font-size: clamp(38px, 5vw, 76px); color: var(--mist); }
h2 { font-size: clamp(74px, 11vw, 158px); color: var(--mist); text-transform: lowercase; }
p { color: rgba(221, 247, 232, .78); line-height: 1.55; font-size: 17px; }

.settlement-core {
  position: absolute;
  top: 17vh;
  right: 13vw;
  width: 310px;
  height: 310px;
  perspective: 900px;
}

.hex-prism {
  position: absolute;
  inset: 60px;
  transform-style: preserve-3d;
  animation: prismSpin 16s linear infinite;
}

.prism-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--leaf);
  background: linear-gradient(145deg, rgba(221, 247, 232, .22), rgba(15, 95, 59, .42));
  border: 1px solid rgba(109, 231, 255, .7);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  box-shadow: inset 0 0 28px rgba(109, 231, 255, .17), 0 0 32px rgba(54, 242, 139, .22);
}
.face-front { transform: translateZ(72px); }
.face-back { transform: rotateY(180deg) translateZ(72px); }
.face-left { transform: rotateY(-90deg) translateZ(72px); }
.face-right { transform: rotateY(90deg) translateZ(72px); }

.core-ring { position: absolute; inset: 18px; border: 1px solid rgba(109, 231, 255, .4); border-radius: 50%; transform: rotateX(68deg); animation: ringPulse 7s linear infinite; }
.ring-b { inset: 44px; border-color: rgba(216, 255, 90, .42); transform: rotateX(68deg) rotateZ(60deg); animation-duration: 10s; }

.path-field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .85; }
.trace { fill: none; stroke: var(--glow); stroke-width: 3; stroke-linecap: square; stroke-dasharray: 18 22; filter: drop-shadow(0 0 9px rgba(54, 242, 139, .75)); animation: dashFlow 9s linear infinite; }
.trace-two { stroke: var(--cyan); animation-duration: 12s; opacity: .55; }

.story-cell { display: grid; grid-template-columns: minmax(320px, 680px) minmax(260px, 430px); align-items: center; gap: 5vw; }
.offset-right { padding-left: 26vw; }
.offset-left { padding-left: 200px; padding-right: 22vw; grid-template-columns: minmax(280px, 410px) minmax(360px, 760px); }
.offset-left .chapter-panel { grid-column: 2; grid-row: 1; }
.offset-left .artifact { grid-column: 1; grid-row: 1; }
.compact { min-height: 86vh; }

.story-cell::before {
  content: "";
  position: absolute;
  width: 74vw;
  height: 74vh;
  left: 18vw;
  top: 12vh;
  background: rgba(15, 95, 59, .13);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  border: 1px solid rgba(54, 242, 139, .16);
  z-index: -1;
  transform: translateX(var(--cell-shift, 0));
}

.cell-index { position: absolute; top: 11vh; left: max(210px, 14vw); font-family: var(--mono); color: rgba(216, 255, 90, .68); font-size: 12px; }
.chapter-panel { padding: 44px 54px 54px; transform: scale(.94); opacity: .58; transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .7s, box-shadow .7s; }
.story-cell.active .chapter-panel { transform: scale(1); opacity: 1; box-shadow: 0 32px 100px rgba(0,0,0,.42), 0 0 34px rgba(54, 242, 139, .24); }
.chapter-panel.wide { padding: 52px 64px; }

.artifact { position: relative; min-height: 300px; }
.token { position: absolute; display: grid; place-items: center; width: 104px; height: 92px; font-family: var(--mono); color: var(--deep); background: var(--leaf); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); box-shadow: 0 0 32px rgba(216,255,90,.35); animation: floatHex 4s ease-in-out infinite; }
.t1 { left: 8%; top: 16%; }
.t2 { right: 8%; top: 34%; animation-delay: .6s; background: var(--glow); }
.t3 { left: 34%; bottom: 10%; animation-delay: 1.2s; background: var(--mist); }
.chevron { position: absolute; width: 82px; height: 22px; background: var(--glow); clip-path: polygon(0 0, 72% 0, 100% 50%, 72% 100%, 0 100%, 22% 50%); opacity: .75; animation: packetMove 2.4s ease-in-out infinite; }
.c1 { left: 29%; top: 28%; transform: rotate(14deg); }
.c2 { left: 48%; top: 54%; transform: rotate(142deg); animation-delay: .45s; }
.c3 { left: 20%; bottom: 20%; transform: rotate(-18deg); animation-delay: .8s; }

.proof-capsule { display: grid; place-items: center; perspective: 700px; }
.capsule-shell { width: 250px; height: 112px; display: grid; place-items: center; font-family: var(--mono); color: var(--cyan); border: 1px solid var(--cyan); border-radius: 999px; background: linear-gradient(90deg, rgba(109,231,255,.12), rgba(54,242,139,.2)); box-shadow: 0 0 38px rgba(109,231,255,.28), inset 0 0 30px rgba(109,231,255,.12); transform: rotateX(18deg) rotateY(-22deg); }
.orbit { position: absolute; width: 320px; height: 150px; border: 1px solid rgba(216,255,90,.45); border-radius: 50%; transform: rotate(-18deg); animation: ringPulse 5s linear infinite; }
.orbit-two { width: 380px; transform: rotate(38deg); border-color: rgba(54,242,139,.45); animation-duration: 8s; }

.commit-stack { transform-style: preserve-3d; transform: rotateX(55deg) rotateZ(-28deg); }
.commit-stack div { width: 250px; height: 98px; margin: -18px auto; background: linear-gradient(135deg, rgba(54,242,139,.34), rgba(15,95,59,.72)); border: 1px solid rgba(216,255,90,.52); clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%); box-shadow: 0 16px 35px rgba(0,0,0,.28); animation: commitLock 3.5s ease-in-out infinite; }
.commit-stack div:nth-child(2) { animation-delay: .2s; }
.commit-stack div:nth-child(3) { animation-delay: .4s; }
.commit-stack div:nth-child(4) { animation-delay: .6s; }

.settlement-bloom { min-height: 360px; display: grid; place-items: center; }
.settlement-bloom span { position: absolute; display: grid; place-items: center; width: 112px; height: 98px; font-family: var(--mono); color: var(--deep); background: var(--pollen); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); box-shadow: 0 0 34px rgba(255,200,87,.42); animation: bloom 4s ease-in-out infinite; }
.settlement-bloom span:nth-child(1) { transform: translate(0, -130px); }
.settlement-bloom span:nth-child(2) { transform: translate(116px, -62px); animation-delay: .2s; }
.settlement-bloom span:nth-child(3) { transform: translate(116px, 62px); animation-delay: .4s; }
.settlement-bloom span:nth-child(4) { transform: translate(0, 130px); animation-delay: .6s; }
.settlement-bloom span:nth-child(5) { transform: translate(-116px, 62px); animation-delay: .8s; }
.settlement-bloom span:nth-child(6) { transform: translate(-116px, -62px); animation-delay: 1s; }

.final-cell { display: grid; grid-template-columns: minmax(420px, 680px) minmax(300px, 500px); gap: 5vw; padding-left: 18vw; }
.final-panel { padding: 56px 64px; }
.terminal-action { margin-top: 20px; padding: 16px 24px; border: 1px solid var(--glow); background: rgba(6, 27, 18, .6); color: var(--leaf); font-family: var(--mono); font-size: 14px; clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 10px 50%); cursor: none; transition: background .2s, transform .2s, box-shadow .2s; }
.terminal-action:hover { background: rgba(54,242,139,.18); transform: translateX(8px); box-shadow: 0 0 25px rgba(54,242,139,.28); }
.memory-ledger { font-family: var(--mono); color: rgba(221,247,232,.72); padding: 24px; border-left: 1px solid rgba(54,242,139,.45); background: linear-gradient(90deg, rgba(15,95,59,.44), transparent); }
.memory-ledger div { margin: 15px 0; transform: translateX(-10px); opacity: .55; transition: .35s; }
.memory-ledger div.lit { transform: translateX(0); opacity: 1; color: var(--mist); }
.memory-ledger b { color: var(--glow); font-weight: 700; }

.magnetized { filter: drop-shadow(0 0 24px rgba(54,242,139,.65)); }
.pulse-ok::after { content: "ok"; position: absolute; right: 10%; top: 12%; font-family: var(--mono); color: var(--leaf); animation: okPulse .8s ease-out forwards; }

@keyframes bootLine { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes wordBoot { from { opacity: 0; transform: rotate(-8deg) translateX(-14vw) skewX(-8deg); } to { opacity: 1; transform: rotate(-8deg) translateX(-4vw) skewX(0); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes prismSpin { to { transform: rotateY(360deg) rotateX(18deg); } }
@keyframes ringPulse { to { transform: rotateX(68deg) rotateZ(360deg); } }
@keyframes dashFlow { to { stroke-dashoffset: -240; } }
@keyframes floatHex { 50% { transform: translateY(-18px) rotate(4deg); } }
@keyframes packetMove { 50% { opacity: 1; filter: drop-shadow(0 0 14px var(--glow)); } }
@keyframes commitLock { 50% { transform: translateY(-12px); filter: brightness(1.25); } }
@keyframes bloom { 50% { filter: brightness(1.25) drop-shadow(0 0 20px rgba(216,255,90,.5)); } }
@keyframes okPulse { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-28px); } }

@media (max-width: 900px) {
  body { cursor: auto; }
  .cursor-core, .cursor-trail { display: none; }
  .command-rail { position: fixed; inset: auto 12px 12px; width: auto; height: 74px; display: flex; overflow-x: auto; border-left: 0; border-top: 1px solid rgba(54,242,139,.35); }
  .rail-top, .command-rail a i { display: none; }
  .command-rail a { min-width: 92px; }
  .cell-shell, .story-cell, .final-cell { padding: 12vh 6vw 110px; display: block; }
  .boot-lines { left: 6vw; }
  .wordmark { left: 6vw; top: 22vh; font-size: 18vw; }
  .hero-copy { position: relative; right: auto; bottom: auto; top: 52vh; width: 100%; }
  .settlement-core { right: 4vw; top: 31vh; width: 210px; height: 210px; opacity: .75; }
  .chapter-panel, .chapter-panel.wide, .final-panel { padding: 36px 32px; margin-top: 12vh; }
  .cell-index { left: 6vw; }
  .artifact { margin-top: 32px; }
  h2 { font-size: 22vw; }
}
