:root {
  --bg: #040d1f;
  --bg2: #06183a;
  --panel: rgba(16, 52, 92, .32);
  --line: rgba(130, 236, 255, .16);
  --ice: #6ff3ff;
  --ice2: #2fc9e6;
  --frost: #e4fdff;
  --text: #cfe6f3;
  --dim: #7894b1;
  --hit: #7ff8ff;
  --miss: #ff7a95;
  --silent: #0b1426;
  --display: 'Unbounded', system-ui, sans-serif;
  --sans: 'Inter Tight', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--sans); overflow-x: hidden;
  background-image:
    radial-gradient(1200px 700px at 75% -10%, rgba(47, 201, 230, .18), transparent 60%),
    radial-gradient(900px 600px at -10% 60%, rgba(47, 120, 230, .10), transparent 60%);
  background-attachment: fixed;
}
em { font-style: normal; color: var(--ice); }
strong { color: var(--frost); font-weight: 600; }
a { color: var(--ice); }
h1, h2, h3 { font-family: var(--display); color: var(--frost); margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(26px, 3.2vw, 42px); font-weight: 700; }
::selection { background: var(--ice); color: var(--bg); }

/* ------------------------------------------------------------ nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; gap: 28px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: linear-gradient(var(--bg) 0%, rgba(4, 13, 31, .7) 70%, transparent);
  backdrop-filter: blur(6px);
}
.mark { display: flex; align-items: center; gap: 10px; font: 700 18px var(--display); color: var(--frost); text-decoration: none; letter-spacing: .08em; }
.mark img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 18px rgba(111, 243, 255, .5); }
.links { display: flex; gap: 22px; margin-left: auto; }
.links a { color: var(--dim); text-decoration: none; font-size: 14px; transition: color .2s; }
.links a:hover { color: var(--frost); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 13px 22px; border-radius: 12px; border: 1px solid rgba(160, 248, 255, .6);
  background: linear-gradient(180deg, #8ff6ff, #2fc9e6); color: #02152c;
  font: 600 15px var(--sans); text-decoration: none; letter-spacing: .01em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset, 0 8px 30px -8px rgba(111, 243, 255, .7);
  transition: transform .15s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .4) inset, 0 12px 40px -8px rgba(111, 243, 255, .9); }
.btn.ghost { background: transparent; color: var(--frost); box-shadow: none; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ice); }
.btn.small { padding: 9px 16px; font-size: 14px; border-radius: 10px; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; filter: saturate(.4); }

/* ------------------------------------------------------------ hero */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
#cube { position: absolute; inset: 0; width: 100%; height: 100%; }
.cube-fallback { display: none; position: absolute; right: 6vw; top: 50%; transform: translateY(-50%); width: min(44vw, 520px); border-radius: 24px; }
.no-webgl .cube-fallback { display: block; }
.hero-copy { position: relative; z-index: 2; padding: 90px clamp(16px, 6vw, 88px) 60px; max-width: 700px; pointer-events: none; }
.hero-copy a, .hero-copy button { pointer-events: auto; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 0 0 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ice); box-shadow: 0 0 12px var(--ice); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
h1 {
  font-size: clamp(72px, 11vw, 150px); font-weight: 900; line-height: .86; letter-spacing: -.04em;
  background: linear-gradient(180deg, #ffffff 10%, #9ff8ff 55%, #2fc9e6 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(111, 243, 255, .35));
}
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--text); max-width: 34ch; margin: 22px 0 28px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.readout { margin: 28px 0 0; font: 400 13.5px/1.7 var(--mono); color: var(--dim); max-width: 52ch; }
.readout b { color: var(--frost); font-weight: 600; }
.readout .up { color: var(--hit); }
.readout .down { color: var(--miss); }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; width: 22px; height: 36px; border: 1.5px solid var(--line); border-radius: 12px; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--ice); animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ------------------------------------------------------------ sections */
section { padding: 100px clamp(16px, 6vw, 88px); position: relative; }
.sec-head { max-width: 760px; margin-bottom: 40px; }
.sec-head p { color: var(--dim); font-size: 17px; margin: 14px 0 0; }

/* ------------------------------------------------------------ shelf */
.shelf {
  display: flex; gap: 22px; overflow-x: auto; padding: 36px 6px 30px; scroll-snap-type: x proximity;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  position: relative;
}
.shelf::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.shelf::-webkit-scrollbar { height: 6px; }
.shelf::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.blk {
  --c: var(--ice);
  flex: 0 0 152px; height: 172px; scroll-snap-align: center; position: relative; cursor: pointer;
  border-radius: 18px; padding: 14px; display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid rgba(160, 248, 255, .35); color: var(--frost); text-align: left; font: inherit;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, .35), transparent 38%),
    linear-gradient(320deg, rgba(0, 30, 60, .45), transparent 50%),
    linear-gradient(160deg, #57dff2, #239fc4);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .15) inset, 0 18px 40px -18px rgba(111, 243, 255, .65);
  transition: transform .25s, box-shadow .25s;
}
.blk:hover, .blk.sel { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 0 0 1px rgba(255, 255, 255, .35) inset, 0 26px 60px -16px rgba(111, 243, 255, .9); }
.blk .id { font: 600 12px var(--mono); opacity: .8; }
.blk .big { font: 700 19px/1.15 var(--display); }
.blk .sub { font: 400 12px/1.4 var(--mono); opacity: .9; }
.blk.frozen {
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .06) 0 6px, transparent 6px 14px),
    linear-gradient(160deg, #b9f3fb, #6cc9de);
  color: #0a2c44;
}
.blk.frozen::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at 70% 20%, rgba(255, 255, 255, .5), transparent 40%); pointer-events: none; }
.blk.thawed { background: linear-gradient(160deg, rgba(87, 223, 242, .35), rgba(35, 159, 196, .25)); border-style: dashed; }
.blk.hit { background: linear-gradient(140deg, rgba(255, 255, 255, .45), transparent 40%), linear-gradient(160deg, #8ff6ff, #2fc9e6); color: #02233d; }
.blk.miss { background: linear-gradient(160deg, #3c6a86, #1d3e5a); border-color: rgba(255, 122, 149, .45); }
.blk.miss .crack { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.blk.silent { background: linear-gradient(160deg, #13223a, #050b17); border-color: rgba(120, 148, 177, .25); color: var(--dim); box-shadow: none; }
.shelf-legend { display: flex; flex-wrap: wrap; gap: 18px; font: 12.5px var(--mono); color: var(--dim); }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.lg.frozen { background: #b9f3fb; } .lg.thawed { border: 1px dashed var(--ice); } .lg.hit { background: var(--ice); }
.lg.miss { background: #2b5370; outline: 1px solid var(--miss); } .lg.silent { background: #0b1426; outline: 1px solid #23344f; }
.demo-tag { color: var(--miss); margin-left: auto; }

.detail {
  margin-top: 30px; max-width: 860px; padding: 26px 28px; border-radius: 20px;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px);
}
.detail-top { display: flex; align-items: center; justify-content: space-between; }
.detail h3 { font-size: 20px; }
.x { background: none; border: 0; color: var(--dim); font-size: 28px; cursor: pointer; line-height: 1; }
.note { font: 400 15px/1.6 var(--mono); color: var(--frost); background: rgba(4, 13, 31, .5); border-left: 2px solid var(--ice); padding: 12px 16px; border-radius: 0 10px 10px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; font: 13px var(--mono); margin: 18px 0 22px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; color: var(--frost); overflow-wrap: anywhere; }
.vlog { font: 12.5px/1.75 var(--mono); color: var(--text); background: #020815; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 18px 0 0; }
.vlog .ok { color: var(--hit); } .vlog .bad { color: var(--miss); } .vlog .k { color: var(--dim); }

/* ------------------------------------------------------------ how */
.how { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.how-text p { font-size: 17px; color: var(--text); max-width: 60ch; }
.ink-silent { background: #0b1426; color: var(--frost); padding: 1px 8px; border-radius: 6px; border: 1px solid #23344f; }
.track { margin: 0; padding: 22px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); }
.track svg { width: 100%; height: auto; display: block; }
.track figcaption { font: 13px/1.6 var(--mono); color: var(--dim); margin-top: 10px; }
.track figcaption b { color: var(--frost); }
.track .mk text { font: 600 12px var(--mono); fill: var(--frost); }
.track .mk.worse circle { fill: var(--ice); filter: drop-shadow(0 0 6px var(--ice)); }
.track .mk.better circle { fill: none; stroke: var(--dim); stroke-width: 1.5; }
.track .mk.better text { fill: var(--dim); }

/* ------------------------------------------------------------ letter + rule */
.letter-wrap { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: start; }
.letter {
  padding: 40px 44px; border-radius: 26px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(185, 243, 251, .10), rgba(35, 159, 196, .05)), var(--bg2);
  border: 1px solid var(--line); font-size: 17.5px; line-height: 1.75;
}
.letter::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 60%; height: 80%; background: radial-gradient(rgba(111, 243, 255, .18), transparent 70%); }
.letter p { position: relative; margin: 0 0 16px; }
.salute { font: 500 14px var(--mono); color: var(--dim); letter-spacing: .06em; }
.sign { font: 700 18px var(--display); color: var(--ice); margin-top: 20px !important; }
.rule h3 { font-size: 18px; }
.rule-sub { color: var(--dim); font-size: 15px; }
.rule pre {
  font: 13px/1.9 var(--mono); color: var(--frost); white-space: pre-wrap; margin: 16px 0 0;
  padding: 22px 24px; border-radius: 18px;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .025) 0 8px, transparent 8px 18px), linear-gradient(160deg, rgba(87, 223, 242, .14), rgba(4, 13, 31, .6));
  border: 1px solid rgba(160, 248, 255, .28); box-shadow: 0 0 40px -10px rgba(111, 243, 255, .35) inset;
}

/* ------------------------------------------------------------ verify */
.verify-box { max-width: 900px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.verify-box label { font: 14px var(--mono); color: var(--dim); display: flex; gap: 10px; align-items: center; }
select { background: var(--bg2); color: var(--frost); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; font: 14px var(--mono); }
.vlog.big { flex: 1 1 100%; min-height: 220px; font-size: 13px; }

/* ------------------------------------------------------------ token */
.token { display: grid; grid-template-columns: 1.2fr .8fr; gap: 56px; align-items: center; }
.token p { font-size: 17px; max-width: 58ch; }
.addr { margin-bottom: 26px; }
.token-art { width: 100%; max-width: 380px; justify-self: center; border-radius: 28px; box-shadow: 0 0 80px -10px rgba(111, 243, 255, .55); }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 30px clamp(16px, 6vw, 88px) 40px; border-top: 1px solid var(--line); font: 12.5px var(--mono); color: var(--dim); }

/* ------------------------------------------------------------ reveal on scroll */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .8s, transform .8s; }
.rv.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  .links { display: none; }
  .nav { justify-content: space-between; }
  .hero { align-items: flex-end; }
  .hero-copy { padding-bottom: 80px; }
  #cube { opacity: .55; }
  .how, .letter-wrap, .token { grid-template-columns: 1fr; }
  .letter { padding: 28px 22px; }
  section { padding: 72px 16px; }
  .token-art { max-width: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .dot, .scroll-cue span { animation: none; }
}

/* ============================================================ agent layer */
.status {
  display: inline-flex; align-items: center; gap: 8px; margin-left: 6px;
  font: 500 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim);
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(4, 13, 31, .5);
}
.status i { width: 7px; height: 7px; border-radius: 50%; background: #7dffc4; box-shadow: 0 0 10px #7dffc4; animation: pulse 1.6s infinite; }
.status b { color: var(--frost); font-weight: 600; }

/* HUD frame around the cube */
.hud { position: absolute; z-index: 1; pointer-events: none; right: 7vw; top: calc(50% + 4px); width: min(34vw, 430px); aspect-ratio: 1; transform: translateY(-50%); }
.hud .br { position: absolute; width: 28px; height: 28px; border: 1.5px solid rgba(111, 243, 255, .6); }
.hud .tl { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.hud .tr { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.hud .bl { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.hud .br2 { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.hud::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 49.6%, rgba(111, 243, 255, .12) 50%, transparent 50.4%); animation: hudscan 4s linear infinite; }
@keyframes hudscan { from { transform: translateY(-50%); } to { transform: translateY(50%); } }
.hl { position: absolute; font: 500 10.5px var(--mono); letter-spacing: .12em; color: var(--dim); white-space: nowrap; }
.hl b { color: var(--ice); font-weight: 600; letter-spacing: .04em; margin-left: 6px; }
.hl.a { left: 0; top: -22px; } .hl.b { right: 0; top: -22px; }
.hl.c { left: -24px; top: 50%; writing-mode: vertical-rl; transform: translateY(-50%) rotate(180deg); }
.hl.d { right: -24px; top: 50%; writing-mode: vertical-rl; transform: translateY(-50%); }

/* terminals */
.term { border-radius: 16px; border: 1px solid rgba(130, 236, 255, .22); background: rgba(2, 8, 21, .78); backdrop-filter: blur(10px); overflow: hidden; box-shadow: 0 20px 60px -30px rgba(111, 243, 255, .5); }
.term-head { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); border-bottom: 1px solid var(--line); }
.leds { display: inline-flex; gap: 5px; } .leds i { width: 7px; height: 7px; border-radius: 50%; background: #23344f; }
.leds i:first-child { background: #7dffc4; box-shadow: 0 0 8px #7dffc4; }
.term-note { margin-left: auto; text-transform: none; letter-spacing: 0; color: #ffd27a; }
.term-body { padding: 10px 14px 12px; font: 12px/1.65 var(--mono); }
.ln { display: grid; grid-template-columns: 62px 64px 1fr; gap: 8px; color: var(--text); opacity: .55; }
.ln:last-child { opacity: 1; }
.ln:nth-last-child(2), .ln:nth-last-child(3) { opacity: .8; }
.ln .ts { color: #4d6a88; }
.ln .tag { text-transform: uppercase; font-size: 10.5px; letter-spacing: .08em; padding-top: 1px; }
.k-perceive .tag { color: #8fb4d6; } .k-think .tag { color: var(--ice); } .k-decide .tag { color: #ffd27a; }
.k-act .tag { color: #7dffc4; } .k-ledger .tag { color: #c9a7ff; }
.k-act .tx, .k-decide .tx { color: var(--frost); }
.caret { display: inline-block; width: 7px; height: 13px; background: var(--ice); vertical-align: -2px; margin-left: 2px; animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term.mini { position: absolute; z-index: 3; right: clamp(16px, 4vw, 48px); bottom: 26px; width: min(470px, 40vw); }
.term.mini .term-body { height: 168px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; font-size: 11.5px; }
.term.mini .ln { grid-template-columns: 58px 58px 1fr; }
.term.big { margin-top: 26px; }
.term.big .term-body { height: 330px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }

/* mind */
.sentence { font-size: 19px !important; color: var(--text) !important; line-height: 1.6; min-height: 3.2em; }
.sentence b { color: var(--frost); }
.sentence b.hot { color: #ffd27a; }
.mind-grid { display: grid; grid-template-columns: 330px 120px 1fr; gap: 22px; align-items: stretch; }
.mind-grid figure { margin: 0; padding: 18px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; }
.mind-grid figcaption { font: 12.5px/1.6 var(--mono); color: var(--dim); margin-top: 10px; }
.loop svg { width: 100%; height: auto; }
.loop .orbit { fill: none; stroke: rgba(130, 236, 255, .25); stroke-width: 1.2; stroke-dasharray: 2 5; }
.loop .orbit.faint { stroke: rgba(130, 236, 255, .1); stroke-dasharray: none; }
.loop .comet circle { fill: var(--ice); filter: drop-shadow(0 0 8px var(--ice)) drop-shadow(0 0 16px var(--ice)); }
.loop .node circle { fill: #071a36; stroke: rgba(130, 236, 255, .4); stroke-width: 1.5; transition: all .4s; }
.loop .node text { font: 600 11px var(--mono); fill: var(--dim); transition: fill .4s; }
.loop .node.on circle { fill: var(--ice); stroke: #fff; }
.loop .node.on text { fill: var(--frost); }
.loop .core rect:first-child { fill: #2fb9d4; stroke: #9ff8ff; stroke-width: 1.5; filter: drop-shadow(0 0 14px rgba(111, 243, 255, .6)); }
.loop .core rect:not(:first-child) { fill: #f2feff; }
.thermo svg { width: 100%; flex: 1; max-height: 330px; }
.thermo .tube { fill: rgba(4, 13, 31, .8); stroke: rgba(130, 236, 255, .35); }
.thermo .merc { fill: var(--ice); filter: drop-shadow(0 0 6px var(--ice)); transition: y .6s, height .6s, fill .4s; }
.thermo .merc.hot { fill: #ffd27a; filter: drop-shadow(0 0 8px #ffd27a); }
.thermo .thr { stroke: rgba(255, 122, 149, .7); stroke-dasharray: 3 3; }
.thermo .zero { stroke: rgba(130, 236, 255, .3); }
.thermo text { font: 11px var(--mono); fill: var(--dim); }
.thermo .ic { font-size: 9px; fill: #4d6a88; }
.thermo figcaption { text-align: center; }
.thermo figcaption b { color: var(--frost); }
.scope-wrap canvas { width: 100%; flex: 1; min-height: 280px; border-radius: 12px; background: rgba(2, 8, 21, .6); }

@media (max-width: 1100px) {
  .mind-grid { grid-template-columns: 1fr 120px; }
  .scope-wrap { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .status { display: none; }
  .hud, .term.mini { display: none; }
  .mind-grid { grid-template-columns: 1fr; }
  .thermo svg { max-height: 220px; }
  .ln { grid-template-columns: 54px 1fr; }
  .ln .ts { display: none; }
  .term.big .term-body { height: 300px; font-size: 11.5px; }
}
