/* MOUSE. Screening room meets microscope bench.
   Warm black, bone type, one signal colour: the green of GCaMP. */

:root {
  --ink: #090a08;
  --ink-2: #10120f;
  --bone: #e9e4d4;
  --bone-2: #b9b5a6;
  --mute: #7d7b70;
  --line: rgba(233, 228, 212, 0.14);
  --line-2: rgba(233, 228, 212, 0.28);
  --fire: #3dff8b;
  --cold: #8b9bff;
  --inh: #ff9050;
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --mono: 'Martian Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --serif: 'Newsreader', Georgia, serif;
  --pad: clamp(18px, 4vw, 56px);
  --bar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--mono);
  font-weight: 300;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
b { font-weight: 500; }
::selection { background: var(--fire); color: var(--ink); }
:focus-visible { outline: 1px solid var(--fire); outline-offset: 3px; }

/* ------------------------------------------------------------------ bar */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 var(--pad);
  transition: background 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.bar.solid { background: rgba(9, 10, 8, 0.86); backdrop-filter: blur(14px); border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand svg { width: 30px; height: 30px; }
.brand-name { font-family: var(--display); font-weight: 900; font-size: 26px; letter-spacing: 0.04em; line-height: 1; }
.brand-meta { color: var(--mute); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
i:empty { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; vertical-align: middle; }
.nav { display: flex; gap: 24px; }
.nav a { text-decoration: none; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-2); transition: color 0.2s; }
.nav a:hover { color: var(--fire); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 16px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
  border: 1px solid var(--line-2); background: transparent; color: var(--bone);
  cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--bone); }
.btn-buy { background: var(--fire); color: var(--ink); border-color: var(--fire); }
.btn-buy:hover { background: var(--bone); border-color: var(--bone); }
.btn-buy[aria-disabled="true"] { background: transparent; color: var(--fire); border-color: rgba(61, 255, 139, 0.45); cursor: default; }
.btn-x { width: 36px; padding: 0; margin-right: -16px; }
.btn-x svg { width: 14px; height: 14px; }
.btn-x:hover { color: var(--fire); border-color: var(--fire); }
.btn-lg { height: 48px; padding: 0 26px; font-size: 12px; }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  height: 100svh; min-height: 640px; max-height: 1100px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 68% 46%, rgba(40, 60, 46, 0.35), transparent 70%),
    var(--ink);
}
#cortex { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
#cortex:active { cursor: grabbing; }
.grain {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.09; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}
.hero::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 46%; pointer-events: none;
  background: linear-gradient(to top, var(--ink) 8%, rgba(9, 10, 8, 0.7) 45%, transparent);
}

.hero-copy {
  position: absolute; z-index: 3; left: var(--pad); top: calc(var(--bar-h) + clamp(16px, 6vh, 72px));
  max-width: min(820px, 56vw); pointer-events: none;
}
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--bone-2); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: clamp(14px, 2.4vh, 26px); }
.eyebrow i { margin: 0 6px; }
.rec { width: 7px; height: 7px; border-radius: 50%; background: var(--fire); box-shadow: 0 0 12px var(--fire); animation: rec 1.6s ease-in-out infinite; }
@keyframes rec { 50% { opacity: 0.25; } }
h1 {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(44px, min(6.3vw, 11.6vh), 128px); line-height: 0.88; letter-spacing: 0.002em;
  width: fit-content;
}
h1 span { display: block; white-space: nowrap; opacity: 0; transform: translateY(0.35em); animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.1, 1) forwards; }
h1 span:nth-child(2) { animation-delay: 0.08s; }
h1 span:nth-child(3) { animation-delay: 0.5s; }
h1 span:nth-child(4) { animation-delay: 0.58s; }
h1 .lit { color: var(--fire); text-shadow: 0 0 42px rgba(61, 255, 139, 0.28); }
@keyframes rise { to { opacity: 1; transform: none; } }
.lede {
  margin-top: clamp(16px, 2.6vh, 30px); max-width: 40ch;
  font-family: var(--serif); font-size: clamp(16px, 1.3vw, 20px); line-height: 1.45; color: var(--bone-2); font-weight: 400;
  opacity: 0; animation: rise 1s 0.9s forwards;
}
.lede b { color: var(--bone); font-family: var(--mono); font-size: 0.78em; font-weight: 400; letter-spacing: 0.02em; }

.ruler { position: absolute; z-index: 2; right: var(--pad); top: 0; bottom: 0; width: 120px; list-style: none; pointer-events: none; opacity: 0; transition: opacity 1.2s 0.6s; }
.ruler.on { opacity: 1; }
.ruler li { position: absolute; right: 0; display: flex; align-items: baseline; gap: 10px; justify-content: flex-end; transform: translateY(-50%); white-space: nowrap; }
.ruler li b { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: 0.04em; line-height: 1; }
.ruler li span { color: var(--mute); font-size: 9px; letter-spacing: 0.08em; }
.ruler li.tick { height: 1px; width: 34px; background: var(--line-2); transform: none; }

.legend { position: absolute; z-index: 3; right: var(--pad); bottom: 196px; display: flex; gap: 18px; color: var(--mute); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }
.legend span { display: flex; align-items: center; gap: 7px; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-fire { background: var(--fire); box-shadow: 0 0 8px var(--fire); }
.dot-neuron { background: #cfc9b6; }
.dot-inh { background: var(--inh); }
.dot-glia { background: #5a6370; }

/* ------------------------------------------------------------------ deck */
.deck {
  position: absolute; z-index: 4; left: var(--pad); right: var(--pad); bottom: clamp(16px, 3vh, 32px);
  border-top: 1px solid var(--line-2);
  padding-top: 14px;
}
.deck-head { display: flex; align-items: center; gap: 20px; margin-bottom: 12px; }
.switch { display: inline-flex; border: 1px solid var(--line-2); }
.switch button {
  font: 500 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  height: 32px; padding: 0 18px; border: 0; background: transparent; color: var(--bone-2); cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.switch button[aria-selected="true"] { background: var(--bone); color: var(--ink); }
.deck-status { color: var(--mute); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-status b { color: var(--bone); font-weight: 500; }
.deck-status span:not(:empty)::before { content: ''; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; vertical-align: middle; margin: 0 12px; }
.deck-hint { margin-left: auto; color: var(--mute); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; }

.deck-body { display: flex; align-items: stretch; gap: 16px; height: 100px; }
.screen { flex: none; position: relative; height: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line-2); background: #0c0e0b; overflow: hidden; }
.screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.screen figcaption { position: absolute; left: 7px; bottom: 5px; right: 7px; font-size: 8px; line-height: 1.2; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 6px #0c0e0b, 0 0 2px #0c0e0b; }
.screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,0.22) 0 1px, transparent 1px 3px); }

.panel { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 16px; }
.panel[hidden] { display: none; }
.play { flex: none; width: 48px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; display: grid; place-items: center; transition: border-color 0.2s; }
.play:hover { border-color: var(--fire); }
.play span { width: 12px; height: 14px; border-left: 4px solid var(--bone); border-right: 4px solid var(--bone); }
.play.paused span { width: 0; height: 0; border: 8px solid transparent; border-left: 13px solid var(--bone); border-right: 0; margin-left: 3px; }
.reel { position: relative; flex: 1; min-width: 0; border: 1px solid var(--line); cursor: pointer; overflow: hidden; touch-action: none;
  /* sprocket holes, because it is a reel */
  background:
    repeating-linear-gradient(90deg, rgba(233,228,212,0.16) 0 6px, transparent 6px 14px) top left / 100% 3px no-repeat,
    repeating-linear-gradient(90deg, rgba(233,228,212,0.16) 0 6px, transparent 6px 14px) bottom left / 100% 3px no-repeat;
}
.reel canvas { position: absolute; left: 0; top: 6px; width: 100%; height: calc(100% - 12px); }
.clips { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, 1fr); list-style: none; }
.clips li { border-left: 1px solid var(--line-2); padding: 9px 8px; font-size: 9px; line-height: 1; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-2); text-shadow: 0 0 6px var(--ink), 0 0 3px var(--ink); }
.clips li:first-child { border-left: 0; }
.head { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--bone); box-shadow: 0 0 14px 2px rgba(233, 228, 212, 0.55); will-change: transform; }
.timecode { flex: none; width: 118px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; }
.timecode b { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
.timecode span { color: var(--mute); font-size: 10px; letter-spacing: 0.1em; margin-top: 6px; }
.reel-key { display: none; }

#chart { flex: 1; min-width: 0; width: 100%; height: 100%; border: 1px solid var(--line); display: block; }
.tape { flex: none; width: 270px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.tape-last { font-size: 11px; letter-spacing: 0.04em; color: var(--bone); line-height: 1.5; min-height: 4.5em; }
.tape-last .buy { color: var(--fire); }
.tape-last .sell { color: var(--cold); }
.tape-count { display: flex; gap: 18px; color: var(--mute); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.tape-count b { color: var(--bone); }

/* ------------------------------------------------------------------ sections */
.sec { padding: clamp(80px, 12vw, 170px) var(--pad) 0; max-width: 1480px; margin: 0 auto; }
.kicker { color: var(--fire); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
h2 { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(38px, 5.6vw, 92px); line-height: 0.92; max-width: 16ch; margin-bottom: clamp(30px, 4vw, 60px); }
h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 30px; letter-spacing: 0.03em; line-height: 1; margin-bottom: 12px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 5vw, 80px); align-items: start; }
.prose { font-family: var(--serif); font-size: clamp(18px, 1.5vw, 23px); line-height: 1.5; color: var(--bone-2); font-weight: 400; max-width: 34em; }
.prose + .prose { margin-top: 1.1em; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(40px, 6vw, 90px); border-top: 1px solid var(--line-2); }
.stats div { padding: 26px 24px 30px 0; border-bottom: 1px solid var(--line); }
.stats dt { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 3.4vw, 54px); line-height: 1; letter-spacing: 0.01em; }
.stats dd { color: var(--mute); font-size: 11px; letter-spacing: 0.06em; margin-top: 10px; max-width: 30ch; }

.fig { margin-top: clamp(40px, 6vw, 90px); }
.fig canvas { display: block; width: 100%; }
.fig figcaption { margin-top: 16px; color: var(--mute); font-size: 11px; line-height: 1.75; max-width: 96ch; }
.fig figcaption b { color: var(--bone); font-weight: 500; }
.fig figcaption span[data-n] { color: var(--bone-2); }
.fig-depth canvas { height: clamp(170px, 20vw, 280px); }
.key { white-space: nowrap; color: var(--bone-2); }
.key::before { content: ''; display: inline-block; width: 8px; height: 8px; margin: 0 6px 0 4px; vertical-align: baseline; }
.key-neuron::before { background: #cfc9b6; }
.key-inh::before { background: var(--inh); }
.key-glia::before { background: #5a6370; }
.fig-raster { margin-top: 30px; }
.fig-raster canvas { height: 190px; border-bottom: 1px solid var(--line-2); }
.fig-rose { margin-top: 30px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; align-items: center; }
.fig-rose canvas { width: 190px; height: 190px; }
.fig-rose figcaption { margin-top: 0; }
.stats { margin-top: clamp(30px, 4vw, 60px) !important; }

.credits { border-left: 1px solid var(--line-2); padding-left: clamp(20px, 3vw, 44px); }
.credits-title { color: var(--mute); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 18px; }
.credits ul { list-style: none; }
.credits li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-family: var(--display); font-weight: 600; text-transform: uppercase; font-size: clamp(20px, 2vw, 30px); line-height: 1.25; letter-spacing: 0.02em; border-bottom: 1px solid var(--line); padding: 5px 0; }
.credits li span { font-family: var(--mono); font-size: 10px; color: var(--mute); letter-spacing: 0.1em; }
.credits-foot { margin-top: 18px; color: var(--mute); font-size: 11px; max-width: 46ch; }

.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.modes article { padding: 34px clamp(20px, 4vw, 64px) 10px 0; }
.modes article + article { border-left: 1px solid var(--line); padding-left: clamp(20px, 4vw, 64px); padding-right: 0; }
.modes h3 { font-size: clamp(40px, 4.4vw, 68px); font-weight: 900; }
.mode-tag { color: var(--fire); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 22px; }
.modes article + article .mode-tag { color: var(--cold); }
.modes p:not(.mode-tag) { font-family: var(--serif); font-size: 18px; line-height: 1.55; color: var(--bone-2); font-weight: 400; max-width: 32em; margin-bottom: 1em; }
.modes p b { font-family: var(--mono); font-size: 0.8em; color: var(--bone); font-weight: 400; }

.sec-token h2 { max-width: none; margin-bottom: 20px; padding-top: 0.08em; }
.sec-token .kicker { margin-bottom: 34px; }
.ticker { font-size: clamp(84px, 17vw, 300px); line-height: 0.8; color: var(--fire); display: block; letter-spacing: 0; text-shadow: 0 0 80px rgba(61, 255, 139, 0.22); }
.token-line { max-width: 30em; }
.ca { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 40px; padding: 16px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.ca-label { color: var(--mute); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; }
.ca code { font-family: var(--mono); font-size: clamp(12px, 1.4vw, 18px); margin-right: auto; word-break: break-all; }
.token-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.fine { margin-top: 30px; color: var(--mute); font-size: 11px; max-width: 78ch; }

.method { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3.5vw, 60px); border-top: 1px solid var(--line-2); padding-top: 30px; }
.method ul { list-style: none; }
.method li { color: var(--bone-2); font-size: 12px; line-height: 1.75; padding: 12px 0; border-top: 1px solid var(--line); }
.method li span { color: var(--bone); }
.refs { margin-top: clamp(40px, 5vw, 70px); padding-left: 0; list-style: none; counter-reset: ref; border-top: 1px solid var(--line-2); }
.refs li { counter-increment: ref; position: relative; padding: 14px 0 14px 44px; border-bottom: 1px solid var(--line); color: var(--bone-2); font-size: 12px; max-width: 110ch; }
.refs li::before { content: counter(ref, decimal-leading-zero); position: absolute; left: 0; color: var(--fire); letter-spacing: 0.1em; }
.refs a { color: var(--bone); text-underline-offset: 3px; }
.refs a:hover { color: var(--fire); }

.foot { margin-top: clamp(80px, 12vw, 160px); padding: 26px var(--pad) 34px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--mute); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.foot-links { margin-left: 14px; display: inline-flex; gap: 16px; }
.foot-links a { color: var(--bone-2); text-decoration: none; }
.foot-links a:hover { color: var(--fire); }
.foot b { font-family: var(--display); font-weight: 900; font-size: 18px; color: var(--bone); letter-spacing: 0.06em; margin-right: 10px; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s, transform 0.9s cubic-bezier(0.2, 0.7, 0.1, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 1080px) {
  .nav { display: none; }
  .hero-copy { max-width: 62vw; }
}
@media (max-width: 760px) {
  :root { --bar-h: 56px; }
  .brand-meta { display: none; }
  .hero { min-height: 700px; }
  .hero::after { height: 30%; }
  .hero-copy { max-width: none; right: var(--pad); top: calc(var(--bar-h) + 8px); }
  .eyebrow { font-size: 9px; letter-spacing: 0.12em; margin-bottom: 12px; white-space: nowrap; }
  .eyebrow i { margin: 0 3px; }
  h1 { font-size: min(11.1vw, 60px); }
  .lede { font-size: 15px; max-width: 36ch; margin-top: 14px; }
  .ruler { width: 40px; right: 8px; }
  .ruler li b { font-size: 13px; color: var(--bone-2); }
  .ruler li span { display: none; }
  .ruler li.tick { width: 10px; }
  .legend, .deck-hint { display: none; }
  .deck { padding-top: 12px; }
  .deck-head { gap: 12px; margin-bottom: 10px; }
  .switch button { padding: 0 13px; }
  .deck-status span { display: none; }
  .deck-body { height: auto; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
  .screen { height: 68px; }
  .screen figcaption { font-size: 7px; letter-spacing: 0.08em; left: 5px; right: 5px; }
  .panel { display: contents; }
  .play { width: 36px; height: 68px; }
  .reel { height: 68px; flex: 1 0 140px; }
  #chart { height: 68px; flex: 1 0 140px; width: auto; }
  .timecode { width: auto; flex: none; height: 50px; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 6px; }
  .timecode b { font-size: 26px; }
  .timecode span { margin: 0; font-size: 9px; }
  .reel-key { display: block; flex: 1; min-width: 0; height: 50px; color: var(--mute); font-size: 9px; line-height: 1.6; letter-spacing: 0.04em; padding-left: 6px; }
  .clips li { font-size: 0; padding: 0; }
  .tape { width: 100%; flex: none; gap: 4px; height: 50px; justify-content: flex-start; }
  .tape-last { font-size: 10px; min-height: 0; height: 3.2em; line-height: 1.6; overflow: hidden; }
  .tape-count { gap: 14px; font-size: 9px; }
  .cols, .modes, .method { grid-template-columns: 1fr; }
  .fig-rose { grid-template-columns: 1fr; }
  .fig-rose canvas { width: 200px; height: 200px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div { padding-right: 14px; }
  .credits { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-2); padding-top: 24px; }
  .modes article + article { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .btn-buy:not(.btn-lg) { height: 32px; padding: 0 12px; font-size: 10px; }
  .bar { gap: 20px; }
  .btn-x { width: 32px; height: 32px; margin-right: -10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  h1 span, .lede { animation: none; opacity: 1; transform: none; }
  .rec { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
