@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&family=Source+Serif+4:ital,wght@0,500;1,500&display=swap");

:root {
  --bg: #152e40;
  --panel: #1c384b;
  --text: #e6edf0;
  --rule: #77919e;
  --accent: #c98a69;
  --ink: #0d2130;
  --paper: #edf2f5;
  --red: #b96054;
  --green: #9aaa86;
  font-family: "IBM Plex Sans", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { margin: 0; min-width: 300px; }
body.intro-open { overflow: hidden; }
button, input { font: inherit; }
button, a { color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; font-weight: 500; line-height: .98; margin: 0; }
h1 { font-size: clamp(48px, 6.5vw, 92px); letter-spacing: -.035em; }
h2 { font-size: clamp(40px, 5vw, 70px); letter-spacing: -.03em; }
h1 em, h2 em { color: var(--accent); font-weight: 500; }
.kicker, .panel-label { margin: 0 0 14px; font: 500 11px/1.2 "IBM Plex Mono", monospace; letter-spacing: .12em; }
.button {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 32px;
  min-height: 48px; padding: 12px 16px; background: var(--accent); color: var(--ink);
  border: 1px solid var(--accent); font-size: 13px; font-weight: 600;
}
.text-button, nav a { font-size: 12px; border-bottom: 1px solid transparent; padding: 3px 0; }
.text-button:hover, nav a:hover { border-color: currentColor; }

header {
  height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 3.5%; position: sticky; top: 0; z-index: 10; background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 12px; font: 500 12px/1 "IBM Plex Mono", monospace; letter-spacing: .2em; }
.brand img { border: 1px solid var(--rule); }
nav { display: flex; gap: 26px; }

.intro {
  position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: .78fr 1.22fr;
  grid-template-rows: 52px 1fr 46px; padding: 20px 3.5%; background: var(--bg); overflow: hidden;
  transition: transform .7s cubic-bezier(.7,0,.2,1), visibility .7s;
}
.intro.is-done { transform: translateY(-105%); visibility: hidden; }
.intro::before {
  content: ""; position: absolute; inset: 20px 3.5%; border: 1px solid var(--rule); pointer-events: none;
}
.intro-top { grid-column: 1/-1; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; font: 11px "IBM Plex Mono", monospace; }
.intro-top button { font: inherit; }
.intro-copy { z-index: 2; align-self: center; padding: 30px 0 80px 28px; max-width: 600px; }
.intro-copy p:last-child { max-width: 430px; font-size: 15px; line-height: 1.55; }
.intro-fly { width: 112%; align-self: center; justify-self: end; color: var(--rule); overflow: visible; }
.intro-sequence { grid-column: 1/-1; display: flex; justify-content: space-between; padding: 14px 18px 0; border-top: 1px solid var(--rule); font: 10px "IBM Plex Mono", monospace; }
.enter-button {
  position: absolute; right: 5%; bottom: 84px; z-index: 4; padding: 14px 18px;
  background: var(--accent); color: var(--ink); font-weight: 600; opacity: 0;
  animation: reveal-enter .4s 8.4s forwards;
}
@keyframes reveal-enter { to { opacity: 1; } }

.diagram-rules { opacity: .45; }
.machine rect, .machine circle, .machine path { fill: none; stroke: var(--text); stroke-width: 1.5; }
.machine text, .labels text { fill: var(--text); font: 10px "IBM Plex Mono", monospace; letter-spacing: .08em; }
.labels { fill: none; stroke: var(--rule); stroke-width: 1; }
.fly .legs, .fly .antennae { stroke: var(--text); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.fly .wings path { fill: var(--panel); stroke: var(--rule); stroke-width: 2.3; }
.fly .abdomen { fill: var(--accent); stroke: var(--text); stroke-width: 2.5; }
.fly .body > path:not(.abdomen) { stroke: var(--ink); stroke-width: 1.6; }
.fly .thorax { fill: #8da0a8; stroke: var(--text); stroke-width: 2.5; }
.fly .head { fill: #b6a994; stroke: var(--text); stroke-width: 2.5; }
.fly .eye { fill: var(--red); stroke: var(--text); stroke-width: 2; }
.fly .eye-grid { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.interface > path:first-child { fill: var(--ink); stroke: var(--accent); stroke-width: 2; }
.interface circle { fill: var(--accent); stroke: var(--text); stroke-width: 1.5; }
.interface > path { stroke: var(--accent); stroke-width: 2; }
.interface .brain { fill: var(--panel); stroke: var(--accent); }
.cable-base { stroke: var(--text); stroke-width: 5; }
.signal { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 8 18; animation: cable-pulse 1.8s linear infinite; }
.signal-b { animation-delay: -.9s; }
@keyframes cable-pulse { to { stroke-dashoffset: -52; } }
.intro .fly { transform-origin: 390px 240px; animation: fly-arrive 2.4s both; }
.intro .machine { opacity: 0; animation: machine-on 1s 2.2s forwards; }
.intro .cable { opacity: 0; animation: machine-on .6s 3.1s forwards; }
.intro .labels { opacity: 0; animation: machine-on .5s 4.5s forwards; }
.intro-copy .kicker { opacity: 0; animation: machine-on .4s 5.3s forwards; }
.intro-copy h1 { opacity: 0; animation: title-up .7s 5.8s forwards; }
.intro-copy p:last-child { opacity: 0; animation: machine-on .5s 6.8s forwards; }
@keyframes fly-arrive { from { transform: translateX(-260px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes machine-on { to { opacity: 1; } }
@keyframes title-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.hero {
  min-height: calc(100svh - 68px); display: grid; grid-template-columns: .78fr 1.22fr;
  border-bottom: 1px solid var(--rule);
}
.hero-copy { padding: clamp(46px, 7vw, 104px) 4vw; border-right: 1px solid var(--rule); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.hero-copy .lede { max-width: 600px; line-height: 1.65; margin: 24px 0; }
.hero-facts { width: 100%; margin: 48px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); }
.hero-facts div { padding: 12px 8px 0 0; }
.hero-facts dt { font: 9px "IBM Plex Mono", monospace; color: var(--rule); }
.hero-facts dd { margin: 5px 0 0; font-size: 12px; }
.hero-machine { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 24px 2.5%; background: var(--panel); }
.hero-machine svg { width: 100%; max-height: 68vh; }
.machine-status { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 13px; border: 1px solid var(--rule); font: 10px "IBM Plex Mono", monospace; }
.machine-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.machine-status b { color: var(--accent); font-weight: 500; }

.workspace, .kept, .method, .closing { padding: clamp(68px, 8vw, 120px) 4vw; }
.section-heading { display: grid; grid-template-columns: 1.2fr .8fr; gap: 6vw; align-items: end; margin-bottom: 50px; }
.section-heading > p { max-width: 520px; line-height: 1.65; margin: 0; }
.bench-grid { display: grid; grid-template-columns: minmax(270px, .65fr) minmax(0, 1.35fr); border: 1px solid var(--rule); }
.operator-panel { padding: 20px; border-right: 1px solid var(--rule); background: var(--panel); }
.operator-panel > svg { width: 100%; background: var(--ink); border: 1px solid var(--rule); }
.operator-panel > p:not(.panel-label) { font-size: 12px; line-height: 1.5; }
#trace { width: 100%; height: auto; border: 1px solid var(--rule); background: var(--ink); }
.live-stats { margin: 12px 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; }
.live-stats div { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 5px; border-bottom: 1px solid var(--rule); font-size: 11px; }
.live-stats dd { margin: 0; font-family: "IBM Plex Mono", monospace; color: var(--accent); }
.neural-route { list-style: none; margin: 0; padding: 0; }
.neural-route li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 11px; }
.neural-route b { color: var(--rule); font-family: "IBM Plex Mono", monospace; }
.neural-route li.active { color: var(--accent); }
.neural-route li.active b { color: var(--accent); }
.field-panel { padding: 20px; background: var(--paper); color: var(--ink); }
.field-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.field-tools label { margin-right: auto; font: 10px "IBM Plex Mono", monospace; }
input[type="date"] { display: block; margin-top: 6px; padding: 9px; border: 1px solid var(--rule); background: transparent; color: var(--ink); }
.field-tools button, .kept-actions button, .kept-actions label, .cell-actions button { padding: 9px 11px; border: 1px solid var(--rule); font-size: 11px; }
.legend { display: flex; gap: 12px; font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 10px; height: 10px; border: 1px solid var(--rule); }
.legend .free { background: #f9fbfc; }.legend .busy { background: var(--ink); }.legend .kept { background: var(--accent); }
.hour-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 20px 0; }
.hour { min-height: 72px; padding: 8px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; border: 1px solid var(--rule); background: #f9fbfc; color: var(--ink); }
.hour .label { font: 10px "IBM Plex Mono", monospace; }
.hour .name { font: 500 16px "Source Serif 4", serif; }
.hour.busy { background: var(--ink); color: var(--text); }
.hour.kept { background: var(--accent); color: var(--ink); }
.hour.gaze { outline: 3px solid var(--red); outline-offset: -3px; }
.hour.nominated { outline: 4px solid var(--accent); outline-offset: -4px; }
.peck-console { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 16px; border-top: 1px solid var(--rule); }
.peck-console div { display: grid; gap: 5px; }
.peck-console span { font: 9px "IBM Plex Mono", monospace; color: #526b78; }
.peck-console strong { font-size: 12px; font-weight: 500; }

.kept { background: var(--paper); color: var(--ink); }
.kept-actions { display: flex; gap: 10px; align-items: center; }
.kept-actions label { position: relative; cursor: pointer; }
.kept-actions input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kept-list { margin: 0; padding: 0; list-style: none; }
.kept-list li { display: grid; grid-template-columns: 150px 1fr auto; gap: 20px; align-items: center; padding: 18px 0; border-top: 1px solid var(--rule); }
.kept-list .when { font: 11px "IBM Plex Mono", monospace; }
.kept-list h3 { font-size: 26px; }
.kept-list p { margin: 5px 0 0; font-size: 12px; }
.cell-actions { display: flex; gap: 8px; }
.cell-actions .button { color: var(--ink); }
.empty { grid-template-columns: 1fr !important; text-align: center; padding: 46px !important; border: 1px dashed var(--rule) !important; }

.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--rule); }
.method-grid article { padding: 24px; border-right: 1px solid var(--rule); }
.method-grid article:last-child { border: 0; }
.method-grid span { color: var(--accent); font: 11px "IBM Plex Mono", monospace; }
.method-grid h3 { font-size: 24px; margin: 38px 0 14px; }
.method-grid p { font-size: 13px; line-height: 1.65; margin: 0; }
.closing { display: grid; grid-template-columns: 1fr 1fr; align-items: center; border-top: 1px solid var(--rule); }
.closing svg { width: 100%; color: var(--rule); }
.closing .button { margin-top: 24px; }
.download { display: inline-block; margin: 24px 0 0 18px; border-bottom: 1px solid currentColor; font-size: 12px; }
footer { min-height: 78px; display: flex; flex-wrap: wrap; align-items: center; gap: 22px; padding: 20px 3.5%; border-top: 1px solid var(--rule); font-size: 11px; }
footer p { margin: 0 auto 0 0; }

dialog { width: min(560px, 92vw); padding: 28px; border: 1px solid var(--rule); background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(13,33,48,.82); }
dialog h2 { font-size: 42px; margin: 8px 0 16px; }
dialog p:not(.kicker) { line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.dialog-actions > button:not(.button) { border: 1px solid var(--rule); padding: 12px 15px; }
#toast { display: none; position: fixed; z-index: 120; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: 90vw; padding: 12px 16px; background: var(--accent); color: var(--ink); font-size: 12px; }

@media (max-width: 1000px) {
  .intro { grid-template-columns: 1fr; grid-template-rows: 52px auto 1fr 46px; }
  .intro-copy { padding: 20px 28px 0; }
  .intro-copy p:last-child { display: none; }
  .intro-fly { width: min(100%, 820px); justify-self: center; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { border-right: 0; border-bottom: 1px solid var(--rule); }
  .hero-machine svg { max-height: none; }
  .method-grid { grid-template-columns: 1fr 1fr; }
  .method-grid article:nth-child(2) { border-right: 0; }
  .method-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 760px) {
  nav { display: none; }
  .text-button { font-size: 10px; }
  .intro { padding: 10px; }
  .intro::before { inset: 10px; }
  .intro-top { padding: 0 12px; }
  .intro-copy { padding: 10px 16px 0; }
  .intro-copy h1 { font-size: 42px; }
  .intro-fly { width: 130%; margin-left: -25%; }
  .enter-button { right: 24px; bottom: 62px; }
  .hero-copy { padding: 52px 24px; }
  .hero-facts { grid-template-columns: 1fr; }
  .hero-facts div { border-bottom: 1px solid var(--rule); padding: 9px 0; }
  .hero-machine { padding: 20px 0; overflow: hidden; }
  .hero-machine svg { width: 125%; margin-left: -18%; }
  .machine-status { margin: 0 16px; }
  .workspace, .kept, .method, .closing { padding: 70px 20px; }
  .section-heading { grid-template-columns: 1fr; gap: 24px; }
  .bench-grid { grid-template-columns: 1fr; }
  .operator-panel { border-right: 0; border-bottom: 1px solid var(--rule); }
  .hour-grid { grid-template-columns: repeat(3, 1fr); }
  .field-tools { align-items: center; }
  .field-tools label { width: 100%; }
  .peck-console { align-items: stretch; flex-direction: column; }
  .peck-console .button { justify-content: center; }
  .kept-list li { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid article { border-right: 0; border-bottom: 1px solid var(--rule); }
  .closing { grid-template-columns: 1fr; }
  .closing svg { margin-bottom: 26px; }
  .download { margin-left: 0; display: block; width: max-content; }
}
@media (max-height: 640px) {
  .intro-copy p:last-child, .intro-sequence { display: none; }
  .intro { grid-template-rows: 42px 1fr; }
  .enter-button { bottom: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .enter-button { opacity: 1; }
}
