:root {
  --bg: #152e40;
  --panel: #1c384b;
  --ink: #e6edf0;
  --muted: #9bb0ba;
  --rule: #77919e;
  --accent: #c98a69;
  --dark: #0d2230;
  --serif: "STIX Two Text", Georgia, serif;
  --sans: "IBM Plex Sans", Arial, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
svg, canvas, img { display: block; max-width: 100%; }
.skip-link {
  position: fixed;
  z-index: 100;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
}
.skip-link:focus { top: 12px; }

.opening {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--bg);
  transition: transform .7s cubic-bezier(.76,0,.24,1);
}
.opening.is-gone { transform: translateY(-102%); visibility: hidden; }
.opening-top, .site-nav {
  min-height: 64px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.opening-top button, .site-nav button, .panel-label button {
  appearance: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  padding: 6px 0;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .08em;
  font: 500 11px/1 var(--mono);
}
.opening-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, .65fr) minmax(520px, 1.35fr);
  grid-template-rows: 1fr auto;
  gap: 26px;
  align-items: center;
  padding: 4vh 6vw 2vh;
}
.intro-copy h1 {
  max-width: 9ch;
  margin: 16px 0 18px;
  font: 500 clamp(48px, 6vw, 92px)/.93 var(--serif);
  letter-spacing: -.035em;
}
.intro-copy p:last-child { max-width: 47ch; color: var(--muted); }
.eyebrow {
  margin: 0;
  color: var(--accent);
  font: 500 11px/1.35 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.opening-fly { width: 100%; max-height: 72vh; }
.opening-fly .bci-cable path { stroke-dasharray: 860; animation: wire 2.6s ease both; }
.opening-fly .machine polyline { stroke-dasharray: 170; animation: wire 1.4s 1.8s ease both; }
.opening-fly .physical-fly { transform-origin: 360px 230px; animation: flyMount 1.4s cubic-bezier(.2,.8,.3,1) both; }
.opening-fly .wings { transform-origin: 360px 220px; animation: wing 1.8s ease-in-out infinite; }
.intro-rail {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--panel);
}
.intro-rail i { display: block; width: 0; height: 100%; background: var(--accent); }
@keyframes wire { from { stroke-dashoffset: 860; } to { stroke-dashoffset: 0; } }
@keyframes flyMount { from { opacity: 0; transform: translateX(-80px); } to { opacity: 1; transform: none; } }
@keyframes wing { 50% { fill-opacity: .12; } }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
}
.wordmark { display: flex; gap: 10px; align-items: center; text-decoration: none; font: 500 22px/1 var(--serif); letter-spacing: 0; text-transform: none; }
.wordmark img { border: 1px solid var(--rule); }
.site-nav nav { display: flex; gap: 24px; }
.site-nav nav a { text-decoration: none; }
.site-nav nav a:hover { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 18px; }
.primary {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
  color: var(--dark);
  padding: 0 18px;
  font: 600 13px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.primary:hover { background: var(--ink); }
.primary.small { min-height: 38px; }

.hero {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(520px, 1.22fr);
  border-bottom: 1px solid var(--rule);
}
.hero-heading {
  min-height: calc(100svh - 64px);
  padding: clamp(42px, 6vw, 92px) clamp(24px, 5vw, 76px);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.hero-heading h1 {
  margin: 22px 0;
  max-width: 10ch;
  font: 500 clamp(52px, 6.3vw, 100px)/.91 var(--serif);
  letter-spacing: -.05em;
}
.hero-deck { max-width: 52ch; color: var(--muted); margin: 0 0 32px; }
.rig {
  min-height: calc(100svh - 64px);
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: center;
  background: var(--panel);
}
.rig-caption, .panel-label, .field-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--muted);
  font: 500 10px/1.2 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}
.rig-caption { border-bottom: 1px solid var(--rule); }
.rig-fly { width: 100%; }
.rig-fly .wings { transform-origin: center; animation: wing 1.6s ease-in-out infinite; }
#signal-cable path { stroke-dasharray: 820; animation: signal 2.8s linear infinite; }
#port-wave { animation: pulse .9s steps(2) infinite; }
@keyframes signal { to { stroke-dashoffset: -820; } }
@keyframes pulse { 50% { opacity: .35; } }

.instrument {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rule);
  padding: 30px 24px 42px;
}
.instrument-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.instrument-head h2, .section-copy h2, .kit h2, dialog h2 {
  margin: 8px 0 0;
  font: 500 clamp(34px, 4vw, 58px)/1 var(--serif);
  letter-spacing: -.035em;
}
.run-state { display: flex; gap: 8px; align-items: center; font: 500 11px/1 var(--mono); letter-spacing: .08em; }
.run-state i { width: 9px; height: 9px; background: var(--rule); border-radius: 50%; }
.run-state i.on { background: var(--accent); }
.instrument-grid {
  display: grid;
  grid-template-columns: 1.35fr .8fr .72fr;
  grid-template-areas: "field neural controls" "field queue controls";
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.instrument-grid > div {
  min-width: 0;
  background: var(--panel);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.visual-field { grid-area: field; position: relative; }
.neural-panel { grid-area: neural; }
.control-panel { grid-area: controls; padding-bottom: 14px; }
.queue-panel { grid-area: queue; }
.panel-label { border-bottom: 1px solid var(--rule); }
#field-canvas { width: 100%; aspect-ratio: 15 / 7; background: var(--dark); }
.field-fly {
  position: absolute;
  z-index: 2;
  left: 2.2%;
  top: 19%;
  width: 22%;
  min-width: 130px;
  padding: 4px;
  background: rgb(13 34 48 / .9);
  border: 1px solid var(--rule);
  pointer-events: none;
}
.field-legend { border-top: 1px solid var(--rule); }
#spike-canvas { width: 100%; background: var(--dark); border-bottom: 1px solid var(--rule); }
.readouts { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.readouts div { padding: 10px 12px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.readouts div:nth-child(even) { border-right: 0; }
.readouts dt { color: var(--muted); font: 10px/1.2 var(--mono); }
.readouts dd { margin: 5px 0 0; font: 500 13px/1.2 var(--mono); }
.neural-route { display: flex; align-items: center; gap: 7px; padding: 12px; font: 9px/1 var(--mono); }
.neural-route i { flex: 1; height: 1px; background: var(--accent); }
fieldset { border: 0; padding: 14px; margin: 0; }
legend { padding: 0; font: 500 11px/1 var(--mono); color: var(--muted); text-transform: uppercase; }
.lot-options { display: grid; gap: 6px; margin-top: 10px; }
.lot-button {
  width: 100%;
  min-height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--rule);
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}
.lot-button span:last-child { color: var(--muted); font: 10px/1 var(--mono); }
.lot-button.active { background: var(--ink); color: var(--dark); border-color: var(--ink); }
.lot-button.active span:last-child { color: var(--dark); }
.file-drop { display: block; margin: 0 14px 14px; border: 1px dashed var(--rule); padding: 14px; cursor: pointer; }
.file-drop input { position: absolute; opacity: 0; pointer-events: none; }
.file-drop strong, .file-drop span { display: block; }
.file-drop strong { font-size: 13px; }
.file-drop span { color: var(--muted); font-size: 11px; }
.file-drop.drag { border-color: var(--accent); background: var(--dark); }
.button-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 0 14px; }
.button-row > button:not(.primary) {
  border: 1px solid var(--rule);
  background: transparent;
  padding: 0 13px;
  cursor: pointer;
}
.status-note { margin: 12px 14px 0; color: var(--muted); font-size: 12px; }
.playlist { min-height: 102px; list-style: none; padding: 5px 14px 10px; margin: 0; }
.playlist li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; border-bottom: 1px solid var(--rule); padding: 8px 0; font-size: 12px; }
.playlist li.empty { display: block; color: var(--muted); border: 0; }
.playlist code { color: var(--accent); font: 10px/1.5 var(--mono); }
.chain-button {
  width: calc(100% - 28px);
  margin: 0 14px 14px;
  min-height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0 12px;
  cursor: pointer;
}

.method, .honesty {
  display: grid;
  grid-template-columns: .3fr .7fr 1fr;
  gap: clamp(24px, 5vw, 80px);
  padding: 80px 24px;
  border-bottom: 1px solid var(--rule);
}
.section-index { color: var(--muted); font: 11px/1 var(--mono); letter-spacing: .08em; }
.section-copy p:last-child { color: var(--muted); max-width: 56ch; }
.method-steps { list-style: none; padding: 0; margin: 0; }
.method-steps li { display: grid; grid-template-columns: 42px 100px 1fr; gap: 14px; border-top: 1px solid var(--rule); padding: 14px 0; }
.method-steps span { color: var(--accent); font: 11px/1.5 var(--mono); }
.method-steps h3 { margin: 0; font: 500 20px/1.2 var(--serif); }
.method-steps p { margin: 0; color: var(--muted); font-size: 14px; }
.honesty { grid-template-columns: .3fr .7fr 1fr; }
.honesty-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.honesty article { padding: 18px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.honesty article > strong { color: var(--accent); font: 10px/1 var(--mono); letter-spacing: .07em; }
.honesty h3 { margin: 16px 0 8px; font: 500 22px/1.1 var(--serif); }
.honesty article p { margin: 0; color: var(--muted); font-size: 13px; }
.kit { display: flex; justify-content: space-between; align-items: end; gap: 28px; padding: 70px 24px; background: var(--panel); }
.kit h2 { max-width: 16ch; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px; color: var(--muted); font: 10px/1.3 var(--mono); letter-spacing: .08em; }

dialog {
  max-width: 540px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  padding: 38px;
}
dialog::backdrop { background: rgb(13 34 48 / .82); }
dialog p:not(.eyebrow) { color: var(--muted); }
.dialog-close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 24px; cursor: pointer; }
.kept { padding: 12px; border: 1px solid var(--rule); font: 11px/1.5 var(--mono); }
.noscript { padding: 14px; background: var(--accent); color: var(--dark); }

@media (max-width: 1100px) {
  .opening-stage { grid-template-columns: 1fr 1.2fr; }
  .hero { grid-template-columns: 1fr 1fr; }
  .instrument-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "field field" "neural controls" "queue controls"; }
  .method, .honesty { grid-template-columns: .25fr .75fr; }
  .method-steps, .honesty-grid { grid-column: 2; }
}
@media (max-width: 760px) {
  .site-nav { padding: 9px 14px; }
  .site-nav nav, .nav-actions button { display: none; }
  .opening-stage { display: block; padding: 36px 18px 14px; overflow: auto; }
  .intro-copy h1 { font-size: clamp(42px, 13vw, 64px); }
  .opening-fly { margin-top: 20px; }
  .intro-rail { margin-top: 18px; }
  .hero { display: block; }
  .hero-heading { min-height: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 50px 18px; }
  .hero-heading h1 { font-size: clamp(48px, 14vw, 72px); }
  .rig { min-height: auto; }
  .instrument { padding: 28px 14px 34px; }
  .instrument-head { align-items: start; gap: 14px; }
  .instrument-grid { display: block; border-left: 1px solid var(--rule); }
  .method, .honesty { display: block; padding: 60px 18px; }
  .section-copy { margin: 28px 0; }
  .method-steps, .honesty-grid { display: block; }
  .method-steps li { grid-template-columns: 34px 72px 1fr; }
  .honesty article { min-height: 160px; }
  .kit { display: block; padding: 54px 18px; }
  .kit .primary { margin-top: 26px; }
  footer { flex-direction: column; padding: 24px 18px; }
}
@media (max-height: 620px) and (min-width: 761px) {
  .opening-stage { grid-template-columns: .7fr 1fr; padding-top: 12px; }
  .intro-copy h1 { font-size: 48px; }
  .opening-fly { max-height: 68vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
