/* StackMoore — instrument stylesheet. No frameworks. */

:root {
  --bg: #04050a;
  --ink: #f3f5fa;
  --mute: rgba(243, 245, 250, .66);
  --faint: rgba(243, 245, 250, .42);
  --line: rgba(255, 255, 255, .12);
  --line2: rgba(255, 255, 255, .03);
  --glass: rgba(6, 8, 16, .56);
  --blue: #1b6cff;
  --purple: #8438ff;
  --red: #ff1f3d;
  --team: #be80ff;
  --pad: clamp(16px, 3.2vw, 48px);
  --bar: 52px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --sans: "Neue Haas Grotesk Display Pro", "Helvetica Neue", Helvetica, "Inter", "Arimo", "Liberation Sans", Arial, sans-serif;
  --prog: 0;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
  scrollbar-width: thin;
}
html.no-gl {
  background:
    radial-gradient(60% 50% at 72% 38%, rgba(132, 56, 255, .35), transparent 70%),
    radial-gradient(50% 40% at 20% 80%, rgba(27, 108, 255, .22), transparent 70%),
    linear-gradient(#04050a 0 52%, #0a0f24 52% 100%);
  background-attachment: fixed;
}
body {
  font: 400 16px/1.5 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #fff; color: #000; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }

.mono {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* The canvas sits below everything, inside the root stacking context,
   so mix-blend-mode: difference on the type blends against live pixels. */
#gl {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; display: block;
}

/* 12-column hairline guides */
.guides { position: fixed; inset: 0; padding: 0 var(--pad); pointer-events: none; }
.guides i {
  display: block; height: 100%;
  border-right: 1px solid var(--line2);
  background: linear-gradient(to right, var(--line2) 1px, transparent 1px) 0 0 / calc(100% / 12) 100%;
}

.skip {
  position: fixed; left: var(--pad); top: -80px; z-index: 100;
  background: #fff; color: #000; padding: 10px 14px; font: 12px var(--mono);
}
.skip:focus { top: 8px; }

.g {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  padding: 0 var(--pad);
}

.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--line);
}
/* corner registration ticks */
.glass::before, .glass::after {
  content: ""; position: absolute; width: 9px; height: 9px;
  border: 1px solid rgba(255, 255, 255, .7); pointer-events: none;
}
.glass::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.glass::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* kinetic type: each word is its own loose spring, set wobbling by scroll velocity (transforms come from site.js) */
.kin .w { display: inline-block; }

/* ───────────── top bar ───────────── */
.bar {
  position: fixed; inset: 0 0 auto 0; height: var(--bar); z-index: 50;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center;
  padding: 0 var(--pad);
  background: rgba(4, 5, 10, .6);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--line);
  font: 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.brand { grid-column: 1 / 4; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .16em; font-size: 12px; }
.mark { width: 24px; height: 24px; flex: none; }
.mark .m1 { fill: var(--blue); }
.mark .m2 { fill: var(--purple); fill-opacity: .92; }
.mark .m3 { fill: var(--red); fill-opacity: .92; transition: transform .5s cubic-bezier(.2, .9, .2, 1.3); }
.brand:hover .m3 { transform: translate(-4px, 0); }
.nav { grid-column: 4 / 9; display: flex; gap: clamp(14px, 2.4vw, 36px); }
.nav a { color: var(--mute); padding: 8px 0; position: relative; transition: color .2s; }
.nav a b { color: var(--faint); font-weight: 400; margin-right: 6px; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.nav a:hover, .nav a.on { color: #fff; }
.nav a:hover::after, .nav a.on::after { transform: scaleX(1); }
.bar-right { grid-column: 9 / 13; display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: var(--mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-right #clock { margin-right: 8px; }
.bar-btn { padding: 7px 10px; border: 1px solid var(--line); color: var(--mute); letter-spacing: .1em; text-transform: uppercase; transition: background .2s, color .2s, border-color .2s; }
.bar-btn #hud-fps { color: var(--team); }
.bar-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .5); }
.bar-btn[aria-expanded="true"] { background: #fff; color: #000; border-color: #fff; }
.bar-btn[aria-expanded="true"] #hud-fps { color: #000; }
.bar-prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: #fff; transform: scaleX(var(--prog)); transform-origin: left; }

/* ───────────── hero ───────────── */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: 1fr;
  padding: calc(var(--bar) + 22px) var(--pad) 132px;
}
.hero-main { align-self: end; }
.eyebrow { color: var(--mute); margin-bottom: clamp(10px, 1.6vw, 22px); }
.wordmark {
  font-size: clamp(4.2rem, 15.4vw, 19rem);
  line-height: .8; letter-spacing: -.055em; font-weight: 800; text-transform: uppercase;
  color: #fff; mix-blend-mode: difference;
  margin-left: -.045em;
}
.wordmark > span { display: block; }
.hero-foot {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end;
  margin-top: clamp(20px, 3vw, 44px); padding-top: 18px;
  border-top: 1px solid var(--line);
}
.slogan {
  grid-column: 1 / 6;
  font-size: clamp(1.5rem, 2.9vw, 2.9rem); line-height: 1.02; letter-spacing: -.03em; font-weight: 700;
  color: #fff; mix-blend-mode: difference;
}
.hero-side { grid-column: 6 / 10; }
.lede { color: var(--ink); font-size: clamp(.95rem, 1.15vw, 1.1rem); line-height: 1.45; max-width: 40ch; text-shadow: 0 1px 18px rgba(0, 0, 0, .7); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 13px 18px; border: 1px solid rgba(255, 255, 255, .5);
  font: 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  background: rgba(4, 5, 10, .35);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  transition: background .2s, color .2s, border-color .2s;
}
.btn span { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.btn:hover { background: #fff; color: #000; border-color: #fff; }
.btn:hover span { transform: translate(4px, 0); }
.btn-solid { background: #fff; color: #000; border-color: #fff; }
.btn-solid:hover { background: var(--team); border-color: var(--team); }

/* ───────────── sections ───────────── */
.sec { padding: 0 0 clamp(120px, 22vh, 260px); scroll-margin-top: calc(var(--bar) + 18px); }
.sec-rule {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  margin: 0 var(--pad) clamp(40px, 9vh, 110px);
  padding-top: 12px; border-top: 1px solid var(--line);
  color: var(--mute);
}
.sec-rule span:nth-child(1) { grid-column: 1 / 2; color: #fff; }
.sec-rule span:nth-child(2) { grid-column: 2 / 7; color: #fff; }
.sec-rule span:nth-child(3) { grid-column: 7 / 13; text-align: right; }

.h2 {
  font-size: clamp(2.5rem, 6.6vw, 7rem);
  line-height: .9; letter-spacing: -.045em; font-weight: 700;
  color: #fff; mix-blend-mode: difference;
}
.card { padding: clamp(20px, 2.4vw, 34px); }
.card p { color: var(--mute); max-width: 58ch; }
.card p + p { margin-top: 14px; }
.card strong { color: #fff; font-weight: 600; }

/* 01 origin: stack sits left, copy right */
.origin-h { grid-column: 6 / 13; margin-bottom: clamp(28px, 5vh, 60px); }
.origin-card { grid-column: 7 / 13; }
.origin-card p { font-size: clamp(1rem, 1.25vw, 1.18rem); line-height: 1.5; }
.origin-card p:first-child { color: #fff; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 28px calc(clamp(20px, 2.4vw, 34px) * -1) calc(clamp(20px, 2.4vw, 34px) * -1); border-top: 1px solid var(--line); }
.stats div { padding: 14px 16px 16px; border-left: 1px solid var(--line); }
.stats div:first-child { border-left: 0; }
.stats dt { color: var(--faint); font-size: 9.5px; }
.stats dd { font: 700 clamp(1.8rem, 3vw, 2.8rem)/1 var(--sans); letter-spacing: -.04em; margin-top: 10px; color: #fff; }
.stats small { font: 400 10px var(--mono); letter-spacing: .1em; margin-left: 4px; color: var(--mute); }

/* 02 the stack: layer names left, one detail pane right, the stack beyond */
.stack-h { grid-column: 1 / 9; margin-bottom: clamp(28px, 5vh, 60px); }
.layers { grid-column: 1 / 9; }
.layer {
  display: grid; grid-template-columns: 52px 1fr; align-items: baseline;
  padding: 15px 20px 16px;
  border-top: 1px solid var(--line);
  transition: background .25s, box-shadow .25s;
}
.layer:first-child { border-top: 0; }
.layer.on { background: rgba(255, 255, 255, .06); box-shadow: inset 3px 0 0 var(--c, #fff); }
.layer-id { color: var(--c, #fff); font-size: 11px; }
.layer-name { font-size: clamp(1.25rem, 2vw, 1.9rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; color: var(--mute); transition: color .25s, transform .4s cubic-bezier(.2, .8, .2, 1); }
.layer.on .layer-name { color: #fff; transform: translateX(6px); }
.layer-desc { grid-column: 2; color: var(--mute); font-size: .9rem; line-height: 1.5; margin-top: 6px; }
/* with scripting on a wide screen, the eight descriptions share one pane and only the current one shows */
@media (min-width: 861px) {
  .js .layer { width: 44%; border-right: 1px solid var(--line); }
  .js .layer-desc {
    position: absolute; left: 44%; right: 0; top: 0; margin: 0;
    padding: clamp(22px, 2.4vw, 34px);
    font-size: clamp(1rem, 1.3vw, 1.2rem); line-height: 1.5; color: var(--ink);
    opacity: 0; transform: translateY(8px); pointer-events: none;
    transition: opacity .3s, transform .45s cubic-bezier(.2, .8, .2, 1);
  }
  .js .layer.show .layer-desc { opacity: 1; transform: none; }
  .js .layer-desc::before {
    content: attr(data-k); display: block; margin-bottom: 18px;
    font: 10.5px/1.5 var(--mono); letter-spacing: .09em; color: var(--c, #fff);
  }
}

/* 03 wired in */
.wire-h { grid-column: 1 / 10; margin-bottom: clamp(28px, 5vh, 60px); }
.wires { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(6, 1fr); }
.wires li { padding: 16px 16px 20px; border-left: 1px solid var(--line); min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; transition: background .25s; }
.wires li:first-child { border-left: 0; }
.wires li:hover { background: rgba(255, 255, 255, .06); }
.wires span { color: var(--faint); font-size: 9.5px; }
.wires b { font-size: clamp(1.15rem, 1.8vw, 1.7rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.steps { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: clamp(20px, 3vw, 44px); }
.steps li + li { border-left: 0; }
.steps span { color: var(--team); }
.steps h3 { font-size: clamp(1.4rem, 2.2vw, 2.1rem); letter-spacing: -.035em; line-height: 1; margin: 34px 0 12px; }
.steps p { font-size: .95rem; }

/* 04 contact */
.sec-contact { padding-bottom: clamp(140px, 24vh, 280px); }
.mega { grid-column: 1 / 13; font-size: clamp(4rem, 17vw, 21rem); line-height: .8; letter-spacing: -.06em; margin-left: -.045em; }
.contact-side { grid-column: 1 / 7; margin-top: clamp(28px, 5vh, 60px); }
.contact-side .lede { font-size: clamp(1.05rem, 1.5vw, 1.4rem); }

.foot {
  display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between;
  margin: 0 var(--pad); padding: 14px 0 118px;
  border-top: 1px solid var(--line); color: var(--mute);
}
.foot a:hover { color: #fff; }

/* ───────────── telemetry HUD ───────────── */
.hud {
  position: fixed; top: calc(var(--bar) + 12px); right: var(--pad); z-index: 40;
  width: 236px; font-size: 10px; letter-spacing: .06em;
  background: rgba(6, 8, 16, .66);
}
.hud-head {
  width: 100%; display: grid; grid-template-columns: 1fr 14px; gap: 10px; align-items: center;
  padding: 9px 11px; text-align: left; letter-spacing: .12em;
}
.chev { text-align: center; color: var(--mute); }
.hud-body { border-top: 1px solid var(--line); padding: 8px 11px 10px; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.hud-body dt { color: var(--faint); }
.hud-body dd { text-align: right; color: #fff; white-space: nowrap; overflow: hidden; }
.hud-body .sep { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 5px -11px; }
.hud-body .bar-cell { grid-column: 1 / -1; height: 22px; display: flex; align-items: flex-end; gap: 1px; margin-top: 4px; }
.hud-body .bar-cell i { flex: 1; background: rgba(255, 255, 255, .55); min-height: 1px; }
.hud[data-open="false"], .dock[data-open="false"] { display: none; }

/* ───────────── control dock ───────────── */
.dock {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 45;
  transform: translateX(-50%);
  display: flex; align-items: stretch;
  max-width: calc(100vw - 24px);
  font-size: 9.5px; letter-spacing: .1em;
  background: rgba(6, 8, 16, .74);
}
.dock-head { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 13px; border-right: 1px solid var(--line); letter-spacing: .14em; }
.dock-head:hover, .hud-head:hover { background: rgba(255, 255, 255, .06); }
.dock-body { display: flex; align-items: stretch; }
.ctl { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px 8px; width: 116px; padding: 10px 13px 9px; border-right: 1px solid var(--line); cursor: ew-resize; }
.ctl span { color: var(--mute); }
.ctl output { color: #fff; }
.ctl input { grid-column: 1 / -1; }
.dock-acts { display: flex; }
.dock-acts button { padding: 0 15px; letter-spacing: .14em; border-right: 1px solid var(--line); transition: background .2s, color .2s; }
.dock-acts button:last-child { border-right: 0; }
.dock-acts button:hover { background: #fff; color: #000; }
.dock-acts button[aria-pressed="true"] { background: var(--team); color: #000; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; background: transparent; cursor: ew-resize; display: block; }
input[type=range]::-webkit-slider-runnable-track { height: 1px; background: rgba(255, 255, 255, .4); }
input[type=range]::-moz-range-track { height: 1px; background: rgba(255, 255, 255, .4); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 7px; height: 13px; margin-top: -6px; background: #fff; border: 0; border-radius: 0; }
input[type=range]::-moz-range-thumb { width: 7px; height: 13px; background: #fff; border: 0; border-radius: 0; }
.ctl-team input::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--blue), var(--purple), var(--red)); }
.ctl-team input::-moz-range-track { height: 2px; background: linear-gradient(90deg, var(--blue), var(--purple), var(--red)); }
.ctl-team input::-webkit-slider-thumb { margin-top: -5.5px; }

/* ───────────── arrival label: names a layer while it flies in ───────────── */
.tag {
  position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none; white-space: nowrap;
  padding: 5px 8px 5px 18px; color: #fff; font-size: 10px;
  background: rgba(4, 5, 10, .5); border: 1px solid var(--line);
  opacity: 0; transition: opacity .35s;
}
.tag::before { content: ""; position: absolute; left: 8px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; background: var(--c, #fff); }
.tag.on { opacity: 1; }

/* ───────────── responsive ───────────── */
@media (max-width: 1100px) {
  #clock { display: none; }
  .dock { flex-direction: column; width: min(560px, calc(100vw - 24px)); }
  .dock-head { flex-direction: row; padding: 9px 13px; border-right: 0; justify-content: flex-start; }
  .dock-body { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
  .ctl { width: auto; border-top: 0; }
  .ctl:nth-child(3n) { border-right: 0; }
  .ctl:nth-child(n+4) { border-top: 1px solid var(--line); }
  .dock-acts { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .dock-acts button { flex: 1; padding: 11px 0; }
  .wires { grid-template-columns: repeat(3, 1fr); }
  .wires li:nth-child(4) { border-left: 0; }
  .wires li:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  :root { --glass: rgba(6, 8, 16, .74); }
  .nav { display: none; }
  .wordmark { font-size: clamp(4.2rem, 23vw, 12rem); }
  .sec-rule span:nth-child(3) { grid-column: 2 / 13 !important; text-align: left; margin-top: 3px; }
  .brand { grid-column: 1 / 7; }
  .bar-right { grid-column: 7 / 13; }
  #clock, .bar-btn .long { display: none; }
  .hero-foot { display: block; }
  .hero-side { margin-top: 18px; }
  .origin-h, .origin-card, .stack-h, .layers, .wire-h, .contact-side { grid-column: 1 / 13; }
  .layer { grid-template-columns: 44px 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; }
  .steps li + li { border-left: 1px solid var(--line); border-top: 0; }
  .steps h3 { margin-top: 18px; }
  .sec-rule span:nth-child(2) { grid-column: 2 / 6; }
  .sec-rule span:nth-child(3) { grid-column: 6 / 13; }
  .hud { top: calc(var(--bar) + 8px); right: 12px; }
  .tag { display: none; }
  /* on a narrow screen the stack sits behind the headlines, so they stay solid instead of inverting against it */
  .wordmark, .h2, .slogan { mix-blend-mode: normal; }
}
@media (max-width: 520px) {
  .wires { grid-template-columns: repeat(2, 1fr); }
  .wires li:nth-child(4) { border-left: 1px solid var(--line); }
  .wires li:nth-child(odd) { border-left: 0; }
  .wires li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .wires li { min-height: 104px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* drag on the scene to look around */
.looking, .looking * { cursor: grabbing !important; -webkit-user-select: none !important; user-select: none !important; }
.hint { margin-top: 22px; font-size: 10px; letter-spacing: .14em; color: rgba(255, 255, 255, .42); }
@media (hover: none), (max-width: 860px), (prefers-reduced-motion: reduce) { .hint { display: none; } }
