/* AJMJ Lab Studio */

:root {
  --ink: #05060a;
  --ink-2: #0b0d13;
  --paper: #eef2f7;
  --copy: #bcc5d2;
  --mute: #8d97a8;
  --line: rgba(255, 255, 255, .14);
  --a: 184, 255, 60;
  --display: 'Anybody', 'Arial Black', Impact, sans-serif;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Martian Mono', ui-monospace, Consolas, Menlo, monospace;
  --gut: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* Anybody and Instrument Sans are Latin only. Other scripts fall through to these, glyph by glyph. */
[data-lang="ru"] {
  --display: 'Anybody', 'Unbounded', 'Arial Black', sans-serif;
  --body: 'Instrument Sans', 'Golos Text', system-ui, sans-serif;
}
[data-lang="zh"] {
  --display: 'Anybody', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --body: 'Instrument Sans', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'Martian Mono', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', monospace;
}
[data-lang="ja"] {
  --display: 'Anybody', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --body: 'Instrument Sans', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --mono: 'Martian Mono', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink);
  color: var(--paper);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: rgba(var(--a), .6) var(--ink);
  scrollbar-width: thin;
}

body {
  margin: 0;
  font: 400 1.05rem/1.6 var(--body);
  background: var(--ink);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
canvas { display: block; }
::selection { background: rgb(var(--a)); color: var(--ink); }
:focus-visible { outline: 2px solid rgb(var(--a)); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.defs { position: absolute; }

.skip {
  position: fixed; left: var(--gut); top: -80px; z-index: 300;
  padding: .7rem 1rem; background: rgb(var(--a)); color: var(--ink);
  font: 500 .75rem var(--mono); text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Stage layers ---------- */

#field {
  position: fixed; left: 0; top: 0; z-index: 0;
  width: 100%; height: 100vh; height: 100lvh;
}

.lattice {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .032) 1px, transparent 1px);
  background-size: 8.333vw 8.333vw;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 78%);
}

main { position: relative; z-index: 2; }

/* ---------- Logo mark ---------- */

.mark { display: block; width: 28px; height: 28px; overflow: visible; }
.mark-line { fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.mark-fill { fill: rgb(var(--a)); }

/* ---------- Boot ---------- */

#boot {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end;
  background: var(--ink);
  padding: var(--gut);
  transition: clip-path 1s var(--ease);
  clip-path: inset(0 0 0 0);
  animation: bootFailsafe .5s 9s forwards;
}
#boot.is-out { clip-path: inset(0 0 100% 0); }
html:not(.js) #boot { display: none; }

@keyframes bootFailsafe { to { opacity: 0; visibility: hidden; } }

.boot-frame { width: 100%; }
.boot-mark { width: 44px; height: 44px; margin-bottom: 1.4rem; animation: bootPulse 1.2s ease-in-out infinite; }
@keyframes bootPulse { 50% { opacity: .45; } }

.boot-log {
  min-height: 7.5em;
  font: 300 clamp(.62rem, 1vw, .74rem)/1.9 var(--mono);
  color: var(--mute);
}
.boot-log p:last-child { color: rgb(var(--a)); }

.boot-meter { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 1rem; }
.boot-label { font: 400 clamp(.62rem, 1vw, .74rem) var(--mono); letter-spacing: .08em; padding-bottom: .9em; }
.boot-pct { font: 800 clamp(4rem, 15vw, 15rem)/.82 var(--display); font-stretch: 125%; font-variant-numeric: tabular-nums; }
.boot-bar { height: 2px; margin-top: 1rem; background: var(--line); }
.boot-bar i { display: block; height: 100%; background: rgb(var(--a)); transform: scaleX(0); transform-origin: left; }

/* ---------- Nav ---------- */

.nav {
  position: fixed; left: 0; right: 0; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(12px, 1.6vw, 22px) var(--gut);
  background: linear-gradient(rgba(5, 6, 10, .94) 35%, rgba(5, 6, 10, 0));
}

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; position: relative; z-index: 2; }
.brand-name { font: 400 .72rem var(--mono); letter-spacing: .02em; white-space: nowrap; }
.brand-name b { font-weight: 400; color: var(--mute); }

.nav-links { display: flex; gap: clamp(.9rem, 1.9vw, 2rem); }
.nav-links a {
  position: relative;
  font: 400 .66rem var(--mono);
  letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
  padding: .5rem 0;
}
.nav-links a span { color: rgb(var(--a)); margin-right: .45em; font-size: .85em; }
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: .2rem; height: 1px;
  background: rgb(var(--a)); transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-end { display: flex; align-items: center; gap: clamp(.9rem, 1.9vw, 2rem); }
@media (min-width: 900px) and (max-width: 1240px) {
  .nav-links a span { display: none; }
}

/* Language menu. A native <details>, so it opens without JavaScript. */
.lang { position: relative; z-index: 3; font: 400 .66rem var(--mono); }
.lang summary {
  display: flex; align-items: center; gap: .45em;
  padding: .5rem 0;
  list-style: none; cursor: pointer;
  letter-spacing: .04em; text-transform: uppercase;
}
.lang summary::-webkit-details-marker { display: none; }
.lang svg { width: 15px; height: 15px; fill: none; stroke: rgb(var(--a)); stroke-width: 1.5; }
.lang ul {
  position: absolute; right: 0; top: calc(100% + .4rem);
  display: grid; grid-template-columns: repeat(2, minmax(7.6em, 1fr));
  padding: .35rem;
  background: var(--ink-2);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}
.lang a { display: block; padding: .62rem .75rem; color: var(--copy); text-decoration: none; white-space: nowrap; }
.lang a:hover, .lang a:focus-visible { background: rgba(var(--a), .14); color: var(--paper); }
.lang a[aria-current] { color: rgb(var(--a)); }

.nav-toggle { display: none; position: relative; z-index: 2; width: 44px; height: 44px; }
.nav-toggle i {
  position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--paper);
  transition: transform .5s var(--ease), top .5s var(--ease);
}
.nav-toggle i:nth-of-type(1) { top: 18px; }
.nav-toggle i:nth-of-type(2) { top: 26px; }
.nav.is-open .nav-toggle i:nth-of-type(1) { top: 22px; transform: rotate(45deg); }
.nav.is-open .nav-toggle i:nth-of-type(2) { top: 22px; transform: rotate(-45deg); }

/* ---------- Side rail ---------- */

.rail {
  position: fixed; right: 12px; top: 50%; z-index: 40;
  display: none; flex-direction: column; align-items: center; gap: .7rem;
  transform: translateY(-50%);
  font: 400 .6rem var(--mono);
}
.rail-num { color: rgb(var(--a)); }
.rail-track { width: 1px; height: 22vh; background: var(--line); }
.rail-track i { display: block; width: 100%; height: 100%; background: rgb(var(--a)); transform: scaleY(0); transform-origin: top; }
.rail-name { writing-mode: vertical-rl; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
@media (min-width: 1180px) { .rail { display: flex; } }

/* ---------- Shared type ---------- */

.eyebrow {
  font: 400 .68rem var(--mono);
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--copy);
}
.eyebrow span { color: rgb(var(--a)); margin-right: .5em; }

.title {
  font: 800 clamp(2.9rem, 7.2vw, 8.6rem)/.92 var(--display);
  font-stretch: 118%;
  text-transform: uppercase;
  margin: .28em 0 .24em;
  font-variation-settings: 'wdth' 118, 'wght' 800;
}
.title .word {
  display: inline-block; overflow: hidden; vertical-align: top; white-space: nowrap;
  padding: .08em 0 .02em; margin: -.08em 0 -.02em;
}
.title .ch {
  display: inline-block;
  transition: transform 1.1s var(--ease), color .25s linear;
  transition-delay: calc(var(--i) * 28ms), 0s;
}
.title-md { font-size: clamp(2.1rem, 4.5vw, 5.4rem); }
[data-lang="zh"] .title, [data-lang="ja"] .title { line-height: 1.12; }
[data-lang="zh"] .manifesto, [data-lang="ja"] .manifesto { line-height: 1.35; }
[data-lang="zh"] .legal-head h1, [data-lang="ja"] .legal-head h1 { margin-top: 1rem; line-height: 1.2; }

/* Chinese and Japanese need more size than Latin at the small label sizes */
[data-lang="zh"] .eyebrow, [data-lang="ja"] .eyebrow,
[data-lang="zh"] .keys, [data-lang="ja"] .keys,
[data-lang="zh"] .toc, [data-lang="ja"] .toc,
[data-lang="zh"] .legal-nav nav, [data-lang="ja"] .legal-nav nav,
[data-lang="zh"] .footer-row, [data-lang="ja"] .footer-row,
[data-lang="zh"] .legal-foot, [data-lang="ja"] .legal-foot,
[data-lang="zh"] .specimen p, [data-lang="ja"] .specimen p,
[data-lang="zh"] .seg button, [data-lang="ja"] .seg button,
[data-lang="zh"] .btn, [data-lang="ja"] .btn { font-size: .8rem; }
@media (min-width: 900px) {
  [data-lang="zh"] .nav-links a, [data-lang="ja"] .nav-links a { font-size: .76rem; }
}

.stage-title, .layers h3, .step h3, .card h3, .contact-title, .legal-head h1, .prose h2 {
  overflow-wrap: anywhere;
  hyphens: auto;
}

.lede {
  max-width: 34em;
  font-size: clamp(1.02rem, 1.25vw, 1.22rem);
  line-height: 1.55;
  color: var(--copy);
  text-shadow: 0 0 22px rgba(5, 6, 10, .95), 0 0 6px rgba(5, 6, 10, .7);
}

/* ---------- Buttons ---------- */

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 1rem 1.5rem;
  font: 400 .68rem var(--mono);
  letter-spacing: .05em; text-transform: uppercase; text-decoration: none;
  color: var(--paper);
  border: 1px solid rgba(var(--a), .7);
  background: rgba(5, 6, 10, .35);
  overflow: hidden; isolation: isolate;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  transition: color .3s, translate .5s var(--ease), opacity .9s, transform .9s var(--ease);
}
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: rgb(var(--a));
  transform: scaleX(0); transform-origin: right;
  transition: transform .55s var(--ease);
}
.btn:hover { color: var(--ink); }
.btn:hover::before { transform: scaleX(1); transform-origin: left; }

.btn-solid { background: rgb(var(--a)); color: var(--ink); border-color: rgb(var(--a)); font-weight: 500; }
.btn-solid::before { background: var(--paper); }

.btn-small { padding: .72rem 1rem; font-size: .62rem; }

/* ---------- Scroll reveals (only when JS runs) ---------- */

.js .eyebrow, .js .lede, .js .btn, .js .layers, .js .step, .js .card, .js .specimen,
.js .stage, .js .contact-title, .js .mega-mail, .js .contact-grid {
  opacity: 0; transform: translateY(26px);
  transition: opacity .9s, transform 1.1s var(--ease), color .3s, translate .5s var(--ease);
}
.js .title .ch { transform: translateY(112%) rotate(7deg); }
.js .title.in .ch { transform: none; }
.js .in { opacity: 1; transform: none; }

.js .footer-mark { transform: translateY(30%); transition: transform 1.5s var(--ease); }
.js .footer-mark.in { transform: none; }

/* Hero is timed by the boot sequence */
.js .hero .btn, .js .hero-statement, .js .telemetry, .js .hero-hint { opacity: 0; transform: translateY(22px); transition: opacity 1s 1.5s, transform 1.2s 1.5s var(--ease), color .3s, translate .5s var(--ease); }
.booted .hero .btn, .booted .hero-statement, .booted .telemetry, .booted .hero-hint { opacity: 1; transform: none; }
.booted .hero .btn:hover { transition-delay: 0s; }

/* ---------- Hero ---------- */

.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; }

.lockup {
  position: absolute;
  left: var(--wb-left, 10vw);
  width: var(--wb-width, 80vw);
  top: calc(var(--wb-bottom, 54vh) + clamp(10px, 2.2vh, 26px));
  margin: 0;
  font: 800 1rem var(--display);
}
.lockup-fallback { display: none; }
.lockup-sub {
  display: flex; justify-content: space-between;
  font-size: clamp(1rem, 3vw, 3.4rem); line-height: 1;
  font-stretch: 125%;
  font-variation-settings: 'wdth' 125, 'wght' 700;
}
.lockup-sub u { width: .4em; }
.lockup-sub i {
  font-style: normal; display: inline-block;
}
.js .lockup-sub i {
  opacity: 0; transform: translateY(.5em);
  transition: opacity .8s, transform 1s var(--ease);
}
.booted .lockup-sub i { opacity: 1; transform: none; }
.lockup-sub i:nth-of-type(1) { transition-delay: 1.15s; }
.lockup-sub i:nth-of-type(2) { transition-delay: 1.2s; }
.lockup-sub i:nth-of-type(3) { transition-delay: 1.25s; }
.lockup-sub i:nth-of-type(4) { transition-delay: 1.3s; }
.lockup-sub i:nth-of-type(5) { transition-delay: 1.35s; }
.lockup-sub i:nth-of-type(6) { transition-delay: 1.4s; }
.lockup-sub i:nth-of-type(7) { transition-delay: 1.45s; }
.lockup-sub i:nth-of-type(8) { transition-delay: 1.5s; }
.lockup-sub i:nth-of-type(9) { transition-delay: 1.55s; }

.hero-foot {
  position: absolute; left: var(--gut); right: var(--gut); bottom: clamp(18px, 4.2vh, 44px);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem;
}
.hero-statement {
  max-width: 25em;
  font-size: clamp(1.08rem, 1.55vw, 1.55rem); line-height: 1.32;
  text-shadow: 0 0 22px rgba(5, 6, 10, .95);
}
.hero-actions { display: flex; gap: .7rem; flex-shrink: 0; }

.telemetry {
  position: absolute; right: var(--gut); top: clamp(70px, 11vh, 110px);
  display: grid; gap: .3rem;
  font: 300 .6rem var(--mono); color: var(--mute);
}
.telemetry div { display: flex; justify-content: flex-end; gap: .9em; }
.telemetry dd { color: var(--paper); min-width: 10.5em; text-align: right; font-variant-numeric: tabular-nums; }

.hero-hint {
  position: absolute; left: 0; right: 0;
  top: calc(var(--wb-bottom, 54vh) + clamp(46px, 11vh, 110px));
  text-align: center;
  font: 300 .6rem var(--mono); color: var(--mute);
}
.hint-touch, .k-touch { display: none; }
@media (hover: none) {
  .hint-fine, .k-fine { display: none; }
  .hint-touch { display: inline; }
  .k-touch { display: list-item; }
}

/* ---------- Lab manifesto ---------- */

.lab { height: 250vh; }
.lab-pin {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; flex-direction: column; justify-content: center; gap: 1.6rem;
  padding: 0 var(--gut);
}
.manifesto {
  max-width: min(62vw, 22em);
  font: 500 clamp(1.7rem, 3.9vw, 4.4rem)/1.12 var(--display);
  font-stretch: 96%;
  font-variation-settings: 'wdth' 96, 'wght' 500;
  text-shadow: 0 0 26px rgba(5, 6, 10, .85);
}
.manifesto em { font-style: normal; }
.manifesto .w { opacity: .14; transition: opacity .25s linear; }
.manifesto .hl { color: rgb(var(--a)); }

/* ---------- Pinned scene: Apps ---------- */

.scene { position: relative; }
.scene-apps { height: 360vh; }
.marker { position: absolute; left: 0; width: 1px; height: 1px; }
.marker-apps { top: 130vh; }

.scene-pin {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; align-items: center;
  padding: 0 var(--gut);
}
.scene-copy { width: min(46vw, 640px); }

.layers { margin-top: 1.8rem; border-top: 1px solid var(--line); }
.layers li {
  display: grid; grid-template-columns: 3.1em 1fr; gap: .4rem;
  padding: .72rem 0;
  border-bottom: 1px solid var(--line);
  opacity: .42;
  transition: opacity .5s;
}
.layers li > span { font: 400 .62rem/1.9 var(--mono); color: var(--mute); }
.layers h3 { font: 700 clamp(1rem, 1.5vw, 1.35rem)/1.2 var(--display); font-stretch: 110%; text-transform: uppercase; }
.layers p {
  display: grid; grid-template-rows: 0fr;
  font-size: .95rem; color: var(--copy);
  max-height: 0; overflow: hidden;
  transition: max-height .6s var(--ease), margin .6s var(--ease);
}
.layers .is-on { opacity: 1; }
.layers .is-on > span { color: rgb(var(--a)); }
.layers .is-on h3 { color: rgb(var(--a)); }
.layers .is-on p { max-height: 5em; margin-top: .3rem; }

/* ---------- Games and AI ---------- */

.scene-games, .scene-ai { position: relative; }

.split-intro {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 0 var(--gut);
  width: min(52vw, 760px);
  box-sizing: content-box;
}
.split-intro .btn { margin-top: 1.8rem; }

.stage {
  position: relative;
  display: grid; grid-template-columns: minmax(280px, 5fr) 7fr; gap: clamp(1.4rem, 4vw, 4rem);
  align-items: center;
  margin: 0 var(--gut);
  padding: clamp(1.2rem, 3vw, 3rem);
  background: rgba(8, 10, 15, .82);
  border: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.stage::before, .stage::after {
  content: ''; position: absolute; width: 18px; height: 18px; pointer-events: none;
  border: 1px solid rgb(var(--a));
}
.stage::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.stage::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }

.stage-title {
  margin: .7rem 0 .8rem;
  font: 800 clamp(1.7rem, 3.2vw, 3.3rem)/1 var(--display);
  font-stretch: 112%;
  text-transform: uppercase;
}
.stage-copy { color: var(--copy); max-width: 32em; }

.keys { margin: 1.4rem 0; display: grid; gap: .5rem; font: 300 .64rem var(--mono); color: var(--copy); }
kbd {
  display: inline-block; margin-right: .35em; padding: .22em .55em;
  font: inherit; color: var(--paper);
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
}

.cabinet {
  justify-self: center;
  width: min(100%, calc(84vh * .8));
  border: 1px solid rgba(var(--a), .45);
  box-shadow: 0 0 60px rgba(var(--a), .14);
}
.cabinet canvas { width: 100%; height: auto; touch-action: pan-y; cursor: none; }
.cabinet canvas:focus-visible { outline-offset: -3px; }

/* Playground */
.stage-wide { grid-template-columns: minmax(280px, 6fr) 7fr; }

.pg-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1.3rem 0 1rem; }
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button {
  padding: .68rem .8rem;
  font: 400 .6rem var(--mono); text-transform: uppercase;
  color: var(--copy);
  transition: background .25s, color .25s;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--paper); background: rgba(255, 255, 255, .06); }
.seg button.is-on { background: rgb(var(--a)); color: var(--ink); }

.pg-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pg-stats div { padding: .7rem 0; }
.pg-stats dt { font: 300 .58rem var(--mono); text-transform: uppercase; color: var(--mute); }
.pg-stats dd { font: 700 clamp(1.1rem, 1.9vw, 1.7rem)/1.3 var(--display); font-variant-numeric: tabular-nums; }

.pg-spark { width: 100%; height: 56px; margin-top: .7rem; }
.pg-net { width: 100%; height: auto; margin-top: .5rem; }
.pg-field { border: 1px solid rgba(var(--a), .45); box-shadow: 0 0 60px rgba(var(--a), .14); }
.pg-field canvas { width: 100%; height: auto; aspect-ratio: 1; touch-action: pan-y; cursor: crosshair; }

.scene-games { padding-bottom: 12vh; }
.scene-ai { padding-bottom: 8vh; }

/* ---------- Protocol ---------- */

.proto { position: relative; }
.wide .proto { height: 340vh; }
.proto-pin { padding: 12vh var(--gut) 8vh; }
.wide .proto-pin {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 11vh 0 5vh var(--gut);
  overflow: hidden;
}
.proto-head { max-width: 1100px; flex-shrink: 0; }

.proto-track { display: grid; gap: 1rem; margin-top: 1.4rem; }
.wide .proto-track {
  display: flex; gap: 1.2rem; flex-wrap: nowrap;
  width: max-content;
  margin-top: auto;
  padding-right: var(--gut);
  will-change: transform;
}

.step {
  position: relative;
  padding: clamp(1.2rem, 2vw, 2rem);
  background: rgba(8, 10, 15, .58);
  border: 1px solid var(--line);
}
.wide .step { width: clamp(330px, 31vw, 500px); min-height: 36vh; display: flex; flex-direction: column; justify-content: flex-end; }
.step-num {
  font: 800 clamp(3.4rem, 7vw, 7.4rem)/.9 var(--display);
  font-stretch: 125%;
  color: transparent;
  -webkit-text-stroke: 1px rgba(var(--a), .9);
  margin-bottom: auto;
}
.step h3 {
  margin: 1.2rem 0 .4rem;
  font: 800 clamp(1.3rem, 2.1vw, 2.2rem)/1.05 var(--display);
  font-stretch: 112%;
  text-transform: uppercase;
}
.step p { color: var(--copy); text-shadow: 0 0 14px rgba(5, 6, 10, .95); }

.proto-progress { display: none; }
.wide .proto-progress { display: block; flex-shrink: 0; height: 2px; margin: 1.6rem var(--gut) 0 0; background: var(--line); }
.proto-progress i { display: block; height: 100%; background: rgb(var(--a)); transform: scaleX(0); transform-origin: left; }

/* ---------- Ticker ---------- */

.ticker {
  position: relative; overflow: hidden;
  padding: clamp(.9rem, 2vw, 1.8rem) 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 10, .55);
}
.ticker-row {
  display: flex; width: max-content; white-space: nowrap;
  font: 800 clamp(2rem, 5.6vw, 6rem)/1.08 var(--display);
  font-stretch: 120%;
  text-transform: uppercase;
  will-change: transform;
}
.ticker-row span { padding-right: .7em; position: relative; }
.ticker-row span::after {
  content: ''; position: absolute; right: .23em; top: 50%;
  width: .22em; height: .22em; margin-top: -.11em;
  background: rgb(var(--a));
}
.ticker-row-b { color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .34); }

/* ---------- Rules ---------- */

.rules { padding: clamp(5rem, 14vh, 10rem) var(--gut); }
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; margin-top: 1.6rem; }
.card {
  position: relative; overflow: hidden;
  min-height: clamp(260px, 36vh, 380px);
  padding: clamp(1.3rem, 2.4vw, 2.4rem);
  background: rgba(10, 12, 18, .8);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: flex-end;
  --mx: 50%; --my: 50%;
}
.card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(var(--a), .17), transparent 65%);
  opacity: 0; transition: opacity .4s;
}
.card:hover::before { opacity: 1; }
.card-a, .card-d { grid-column: span 7; }
.card-b, .card-c { grid-column: span 5; }
.card-tag { position: absolute; left: clamp(1.3rem, 2.4vw, 2.4rem); top: clamp(1.3rem, 2.4vw, 2.4rem); font: 400 .62rem var(--mono); color: rgb(var(--a)); }
.card h3 {
  font: 800 clamp(1.5rem, 2.9vw, 3rem)/1 var(--display);
  font-stretch: 112%;
  text-transform: uppercase;
  margin-bottom: .55rem;
  max-width: 14em;
  position: relative;
}
.card p { color: var(--copy); max-width: 30em; position: relative; }

.viz { position: absolute; right: clamp(1.2rem, 2.4vw, 2.4rem); top: clamp(1.2rem, 2.4vw, 2.4rem); width: 96px; height: 96px; }
.viz i { position: absolute; display: block; }

.viz-lock i { inset: 0; border: 1px dashed rgba(var(--a), .8); border-radius: 50%; animation: spin 16s linear infinite; }
.viz-lock i:nth-child(2) { inset: 16px; animation-duration: 9s; animation-direction: reverse; }
.viz-lock i:nth-child(3) { inset: 36px; background: rgb(var(--a)); border: 0; animation: glow 2.4s ease-in-out infinite; }

.viz-bars { display: flex; align-items: flex-end; gap: 5px; }
.viz-bars i { position: static; flex: 1; height: 100%; background: rgb(var(--a)); transform-origin: bottom; animation: bar 1.5s ease-in-out infinite; }
.viz-bars i:nth-child(2) { animation-delay: -.2s; }
.viz-bars i:nth-child(3) { animation-delay: -.9s; }
.viz-bars i:nth-child(4) { animation-delay: -.4s; }
.viz-bars i:nth-child(5) { animation-delay: -1.2s; }
.viz-bars i:nth-child(6) { animation-delay: -.6s; }
.viz-bars i:nth-child(7) { animation-delay: -1.05s; }
.viz-bars i:nth-child(8) { animation-delay: -.3s; }

.viz-orbit { border: 1px solid var(--line); border-radius: 50%; }
.viz-orbit i { left: 50%; top: -5px; width: 10px; height: 10px; margin-left: -5px; background: rgb(var(--a)); transform-origin: 5px 53px; animation: spin 3.4s var(--ease) infinite; }
.viz-orbit i:nth-child(2) { width: 6px; height: 6px; margin-left: -3px; top: 16px; background: var(--paper); transform-origin: 3px 32px; animation-duration: 2.1s; animation-direction: reverse; }

.viz-loop i { inset: 0; border-radius: 50%; background: conic-gradient(rgb(var(--a)), transparent 72%); -webkit-mask-image: radial-gradient(circle, transparent 60%, #000 61%); mask-image: radial-gradient(circle, transparent 60%, #000 61%); animation: spin 2.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 50% { opacity: .35; transform: scale(.72); } }
@keyframes bar { 0%, 100% { transform: scaleY(.18); } 50% { transform: scaleY(1); } }

/* ---------- Brewing ---------- */

.brewing { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: flex-end; padding: 12vh var(--gut); }
.brew-copy { width: min(58vw, 860px); }
.specimens { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 2rem 0; }
.specimen {
  padding: 1.05rem;
  background: rgba(8, 10, 15, .78);
  border: 1px solid var(--line);
}
.specimen-id { font: 300 .56rem var(--mono); color: var(--mute); }
.specimen h3 { font: 700 clamp(.95rem, 1.35vw, 1.2rem)/1.4 var(--mono); margin: .6rem 0; overflow: hidden; white-space: nowrap; }
.classified { color: rgb(var(--a)); }
.specimen p { font: 300 .58rem var(--mono); color: var(--copy); }
.specimen .btn { margin-top: .9rem; }
.specimen-meter { height: 2px; margin-bottom: .7rem; background: var(--line); overflow: hidden; }
.specimen-meter i { display: block; height: 100%; background: rgb(var(--a)); transform-origin: left; animation: meter 5s ease-in-out infinite alternate; }
.specimen-meter .m1 { width: 74%; }
.specimen-meter .m2 { width: 52%; animation-delay: -2s; }
.specimen-meter .m3 { width: 36%; animation-delay: -3.5s; }
@keyframes meter { from { transform: scaleX(.72); } to { transform: scaleX(1); } }

/* ---------- Contact and footer ---------- */

.contact { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.contact-inner {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: 14vh var(--gut) 8vh;
}
.contact-title {
  max-width: 30em; margin-top: 1rem;
  font: 400 clamp(1.05rem, 1.7vw, 1.6rem)/1.35 var(--body);
  color: var(--paper);
  text-shadow: 0 0 24px rgba(5, 6, 10, .95);
}
.mega-mail {
  display: block; width: max-content; max-width: 100%;
  margin: clamp(1.4rem, 5vh, 3.6rem) 0;
  font: 800 clamp(1.7rem, 5.2vw, 6.4rem)/1.02 var(--display);
  font-stretch: 100%;
  text-decoration: none; text-transform: lowercase;
  overflow-wrap: anywhere;
  text-shadow: 0 0 34px rgba(5, 6, 10, .9);
  transition: color .3s, opacity .9s, transform 1.1s var(--ease), translate .5s var(--ease), font-stretch .5s var(--ease);
}
.mega-mail:hover { color: rgb(var(--a)); font-stretch: 106%; }

.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; border-top: 1px solid var(--line); padding-top: 1.2rem; max-width: 600px; }
.contact-grid dt { font: 300 .6rem var(--mono); text-transform: uppercase; color: var(--mute); margin-bottom: .4rem; }
.contact-grid dd { line-height: 1.45; text-shadow: 0 0 18px rgba(5, 6, 10, .95); }
.contact-grid a { text-decoration: none; border-bottom: 1px solid rgb(var(--a)); }
.contact-grid a:hover { color: rgb(var(--a)); }

.footer { position: relative; padding: 0 var(--gut) 1.2rem; }
.footer-mark {
  font: 900 20.5vw/.8 var(--display);
  font-stretch: 140%;
  font-variation-settings: 'wdth' 140, 'wght' 900;
  white-space: nowrap; text-align: center;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .16);
  overflow: hidden;
  user-select: none;
}
.footer-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem 2rem;
  padding-top: 1.1rem; margin-top: 1rem;
  border-top: 1px solid var(--line);
  font: 300 .64rem var(--mono); color: var(--copy);
}
.footer-row nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.footer-row a { text-decoration: none; padding: .35rem 0; }
.footer-row a:hover { color: rgb(var(--a)); }

/* ---------- Custom cursor ---------- */

.cursor { position: fixed; left: 0; top: 0; z-index: 200; width: 0; height: 0; pointer-events: none; display: none; mix-blend-mode: difference; }
.has-cursor .cursor { display: block; }
.cursor i {
  position: absolute; left: -17px; top: -17px; width: 34px; height: 34px;
  border: 1px solid #fff; border-radius: 50%;
  transition: transform .4s var(--ease), background .25s;
}
.cursor.is-hot i { transform: scale(1.55); background: rgba(255, 255, 255, .92); }
.cursor.is-off { opacity: 0; }

/* ---------- No WebGL / no JS ---------- */

html:not(.js) #field, .no-webgl #field { display: none; }
html:not(.js) body, .no-webgl body {
  background:
    radial-gradient(60vw 50vh at 72% 18%, rgba(var(--a), .13), transparent 70%),
    radial-gradient(50vw 50vh at 12% 62%, rgba(61, 214, 255, .1), transparent 70%),
    var(--ink);
  background-attachment: fixed;
}
html:not(.js) .lockup, .no-webgl .lockup { top: 20vh; left: var(--gut); width: calc(100% - var(--gut) * 2); }
html:not(.js) .lockup-fallback, .no-webgl .lockup-fallback {
  display: block; margin-bottom: .1em;
  font: 900 min(21vw, 44vh)/.86 var(--display);
  font-stretch: 125%;
  text-align: center;
  color: rgb(var(--a));
}
.no-webgl .hero-hint, .no-webgl .telemetry, html:not(.js) .hero-hint, html:not(.js) .telemetry, html:not(.js) .cursor { display: none; }

/* ---------- Tablet and phone ---------- */

@media (max-width: 899px) {
  body { font-size: 1rem; }

  .nav-toggle { display: block; }
  .nav-end { gap: .5rem; }
  .lang ul { position: fixed; left: var(--gut); right: var(--gut); top: 64px; }
  .nav-links {
    position: fixed; inset: 0; z-index: 1;
    display: flex; flex-direction: column; justify-content: center; gap: .1rem;
    padding: 0 var(--gut);
    background: rgba(5, 6, 10, .96);
    opacity: 0; visibility: hidden;
    transition: opacity .35s, visibility .35s;
  }
  .nav.is-open .nav-links { opacity: 1; visibility: visible; }
  .nav-links a {
    font: 800 clamp(2rem, 10vw, 3.4rem)/1.2 var(--display);
    font-stretch: 112%;
  }
  .nav-links a span { font: 300 .64rem var(--mono); vertical-align: super; }
  .nav-links a::after { display: none; }

  .title { font-size: 14.2vw; }
  .title-md { font-size: 9.6vw; }

  .telemetry { display: none; }
  .lockup-sub { font-size: 5.2vw; }
  .hero-foot { flex-direction: column; align-items: stretch; gap: 1rem; }
  .hero-actions .btn { flex: 1; padding: 1rem .6rem; }
  .hero-hint { display: none; }

  .lab { height: 220vh; }
  .manifesto { max-width: none; font-size: clamp(1.55rem, 7vw, 2.8rem); }

  .scene-apps { height: 340vh; }
  .scene-pin { align-items: flex-end; padding-bottom: 3vh; }
  .scene-copy { width: 100%; }
  .scene-copy .title { margin: .15em 0 .12em; }
  .scene-apps .lede { font-size: .95rem; }
  .layers { margin-top: .9rem; }
  .layers li { display: none; padding: .55rem 0; opacity: 1; }
  .layers li.is-on { display: grid; }
  .layers .is-on p { max-height: 6em; }

  .split-intro {
    width: auto; justify-content: flex-end;
    padding-bottom: 7vh;
    box-sizing: border-box;
  }

  .stage { grid-template-columns: 1fr; margin: 0 10px; padding: 1.1rem; }
  .cabinet { width: 100%; }

  .proto-pin { padding: 10vh var(--gut) 6vh; }
  .step { min-height: 0; }

  .bento { display: flex; flex-direction: column; }
  .card { min-height: 280px; }
  .viz { width: 72px; height: 72px; }
  .viz-orbit i { transform-origin: 5px 41px; }
  .viz-orbit i:nth-child(2) { top: 12px; transform-origin: 3px 24px; }

  .brewing { display: block; padding: 62vh var(--gut) 10vh; }
  .brew-copy { width: 100%; }
  .specimens { grid-template-columns: 1fr; }

  .contact-inner { padding: 40vh var(--gut) 5vh; }
  .contact-grid { grid-template-columns: 1fr; gap: 1rem; }
  .mega-mail { font-size: 8.4vw; }
  .footer-row { flex-direction: column; align-items: flex-start; }
}

/* ---------- Very short screens, such as phones in landscape: unpin the scenes ---------- */

@media (max-height: 520px) {
  .lab, .scene-apps { height: auto; }
  .lab-pin, .scene-pin { position: relative; height: auto; min-height: 100vh; padding-top: 16vh; padding-bottom: 8vh; align-items: flex-start; }
  .layers li { display: grid; opacity: 1; }
  .layers p { max-height: 6em; margin-top: .3rem; }
  .manifesto .w { opacity: 1 !important; }
  .split-intro { justify-content: center; padding-top: 16vh; }
  .hero-hint { display: none; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .eyebrow, .js .lede, .js .btn, .js .layers, .js .step, .js .card, .js .specimen,
  .js .stage, .js .contact-title, .js .mega-mail, .js .contact-grid,
  .js .hero .btn, .js .hero-statement, .js .telemetry, .js .hero-hint,
  .js .lockup-sub i, .js .title .ch, .js .footer-mark { opacity: 1; transform: none; }
  .manifesto .w { opacity: 1 !important; }
}

/* ---------- Legal pages ---------- */

.legal-page {
  background:
    radial-gradient(70vw 46vh at 80% -6%, rgba(var(--a), .15), transparent 70%),
    radial-gradient(50vw 40vh at 0% 12%, rgba(61, 214, 255, .08), transparent 70%),
    var(--ink);
  background-repeat: no-repeat;
}
.legal-nav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.4rem;
  padding: clamp(14px, 1.8vw, 24px) var(--gut);
  border-bottom: 1px solid var(--line);
}
.legal-end { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.4rem; }
.legal-nav nav { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font: 400 .64rem var(--mono); }
.legal-nav nav a { text-decoration: none; padding: .35rem 0; color: var(--copy); }
.legal-nav nav a:hover, .legal-nav nav a[aria-current] { color: rgb(var(--a)); }

.legal-head { padding: clamp(3rem, 9vh, 6rem) var(--gut) clamp(2rem, 5vh, 3.6rem); }
.legal-head h1 {
  margin-top: .6rem;
  font: 800 clamp(2.4rem, 7.4vw, 7rem)/.95 var(--display);
  font-stretch: 116%;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  animation: legalIn 1s var(--ease) both;
}
.legal-head p { margin-top: 1rem; color: var(--copy); max-width: 44em; }
.legal-updated { font: 300 .66rem var(--mono); color: var(--mute) !important; }
.legal-head .legal-note { font-size: .9rem; color: var(--mute); }
@keyframes legalIn { from { opacity: 0; transform: translateY(24px); } }

.legal-body {
  display: grid; grid-template-columns: minmax(200px, 3fr) 9fr; gap: clamp(1.5rem, 5vw, 5rem);
  padding: 0 var(--gut) clamp(4rem, 10vh, 7rem);
}
.toc { position: sticky; top: 1.4rem; align-self: start; font: 300 .64rem/1.5 var(--mono); }
.toc p { color: var(--mute); margin-bottom: .7rem; text-transform: uppercase; }
.toc ol { counter-reset: t; }
.toc li { counter-increment: t; padding: .22rem 0; }
.toc a { display: flex; gap: .7em; text-decoration: none; color: var(--copy); }
.toc a::before { content: counter(t, decimal-leading-zero); color: rgb(var(--a)); }
.toc a:hover { color: var(--paper); }

.prose { max-width: 46em; min-width: 0; color: var(--copy); counter-reset: s; }
.prose h2 {
  counter-increment: s;
  margin: 2.8rem 0 .8rem; padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font: 700 clamp(1.25rem, 2.1vw, 1.8rem)/1.15 var(--display);
  font-stretch: 108%;
  color: var(--paper);
  scroll-margin-top: 1rem;
}
.prose h2::before { content: counter(s, decimal-leading-zero); display: block; margin-bottom: .55rem; font: 400 .62rem var(--mono); color: rgb(var(--a)); }
.prose > :first-child { margin-top: 0; }
.prose h3 { margin: 1.5rem 0 .4rem; font: 600 1.05rem var(--body); color: var(--paper); }
.prose p, .prose ul, .prose ol, .prose dl { margin-bottom: 1rem; }
.prose ul { list-style: none; }
.prose ul li { position: relative; padding-left: 1.3em; margin-bottom: .45rem; }
.prose ul li::before { content: ''; position: absolute; left: 0; top: .68em; width: .5em; height: 1px; background: rgb(var(--a)); }
.prose a { color: var(--paper); text-decoration-color: rgb(var(--a)); text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose a:hover { color: rgb(var(--a)); }
.prose strong { color: var(--paper); font-weight: 600; }

.idcard {
  display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.5rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
}
.idcard dt { font: 300 .62rem/2 var(--mono); text-transform: uppercase; color: var(--mute); }
.idcard dd { color: var(--paper); overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; margin-bottom: 1rem; border: 1px solid var(--line); }
.prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .94rem; }
.prose th, .prose td { padding: .75rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { font: 400 .62rem var(--mono); text-transform: uppercase; color: var(--mute); background: rgba(255, 255, 255, .03); }
.prose tr:last-child td { border-bottom: 0; }

.steps-list { counter-reset: st; list-style: none; }
.steps-list > li { counter-increment: st; position: relative; padding: 0 0 1rem 3rem; }
.steps-list > li::before {
  content: counter(st); position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem; display: grid; place-items: center;
  font: 500 .72rem var(--mono); color: var(--ink); background: rgb(var(--a));
}

.legal-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem 2rem;
  padding: 1.2rem var(--gut);
  border-top: 1px solid var(--line);
  font: 300 .64rem var(--mono); color: var(--copy);
}
.legal-foot nav { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; }
.legal-foot a { text-decoration: none; padding: .35rem 0; }
.legal-foot a:hover { color: rgb(var(--a)); }

@media (max-width: 899px) {
  .legal-body { grid-template-columns: 1fr; }
  .toc { position: static; padding: 1rem; border: 1px solid var(--line); }
}

/* ---------- 404 ---------- */

.lost-page { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; overflow: hidden; }
.lost-page .lattice { position: absolute; }
.lost {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 4rem var(--gut);
}
.lost-code {
  position: relative; margin: .2em 0;
  font: 900 clamp(7rem, 34vw, 32rem)/.82 var(--display);
  font-stretch: 130%;
  color: rgb(var(--a));
}
.lost-code::before, .lost-code::after {
  content: attr(data-t); position: absolute; left: 0; top: 0; width: 100%;
  mix-blend-mode: screen; pointer-events: none;
}
.lost-code::before { color: #3dd6ff; animation: glitchA 2.6s steps(1) infinite; }
.lost-code::after { color: #ff3d81; animation: glitchB 2.1s steps(1) infinite; }
@keyframes glitchA {
  0%, 86%, 100% { transform: none; clip-path: inset(0 0 100% 0); }
  88% { transform: translate(-1.2%, .4%); clip-path: inset(12% 0 58% 0); }
  92% { transform: translate(1%, -.4%); clip-path: inset(62% 0 12% 0); }
  96% { transform: translate(-.6%, 0); clip-path: inset(34% 0 44% 0); }
}
@keyframes glitchB {
  0%, 78%, 100% { transform: none; clip-path: inset(0 0 100% 0); }
  80% { transform: translate(1.4%, -.3%); clip-path: inset(44% 0 30% 0); }
  85% { transform: translate(-1%, .5%); clip-path: inset(8% 0 72% 0); }
  90% { transform: translate(.8%, 0); clip-path: inset(70% 0 6% 0); }
}
.lost p { max-width: 34em; color: var(--copy); margin-bottom: 1.6rem; }
