:root {
  color-scheme: dark;
  --ink: #070909;
  --panel: #0d1111;
  --panel-2: #121818;
  --line: #2d3839;
  --steel: #9eaaac;
  --white: #f3f4ef;
  --yellow: #ffd82f;
  --yellow-dim: #8b7518;
  --red: #d51f2c;
  --red-dark: #4b1015;
  --max: 1440px;
  --mono: "IBM Plex Mono", "DejaVu Sans Mono", Consolas, monospace;
  --display: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--ink);
  background-size: 28px 28px;
  color: var(--white);
  font-family: var(--mono);
  line-height: 1.6;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 14px; background: var(--yellow); color: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  padding: 8px max(18px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(7,9,9,.94);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand img { object-fit: contain; image-rendering: pixelated; }
.brand-copy { display: grid; line-height: 1.08; }
.brand-copy strong { color: var(--white); font-family: var(--display); font-size: 1.4rem; letter-spacing: .08em; }
.brand-copy .brand-number { color: var(--yellow) !important; }
.main-nav { justify-self: center; display: flex; gap: clamp(16px, 2.6vw, 40px); }
.main-nav a, .repo-link { color: var(--steel); font-size: .69rem; font-weight: 700; letter-spacing: .11em; text-decoration: none; text-transform: uppercase; }
.main-nav a:hover, .main-nav a[aria-current="true"], .repo-link:hover { color: var(--yellow); }
.language-nav { justify-self: end; display: flex; gap: 7px; white-space: nowrap; }
.language-nav a { color: var(--steel); font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-decoration: none; }
.language-nav a:hover, .language-nav a.active { color: var(--yellow); }
.repo-link { justify-self: end; padding: 8px 12px; border: 1px solid var(--yellow-dim); color: var(--yellow); white-space: nowrap; }
.nav-toggle { display: none; border: 1px solid var(--line); background: var(--panel); color: var(--white); font: 700 .7rem var(--mono); padding: 10px; }

.section, .hero { width: min(100% - 36px, var(--max)); margin-inline: auto; }
.section { padding-block: clamp(82px, 10vw, 154px); border-top: 1px solid var(--line); }
.section-grid { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); }
.section-label { color: var(--yellow); font-size: .67rem; letter-spacing: .18em; font-weight: 700; padding-top: 10px; }
.section-heading { max-width: 970px; margin-left: 230px; margin-bottom: 54px; }
.section-copy { max-width: 940px; }
.wide-copy { grid-column: 2; }
.eyebrow { margin: 0 0 18px; color: var(--yellow); font-size: .72rem; font-weight: 700; letter-spacing: .19em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--display); font-weight: 900; line-height: .94; text-transform: uppercase; letter-spacing: .018em; }
h1 { font-size: clamp(2.35rem, 3.9vw, 4.35rem); margin-bottom: 26px; }
h2 { font-size: clamp(1.8rem, 2.7vw, 3.1rem); margin-bottom: 22px; }
h3 { font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; }
.large-copy { color: #c4cbca; font-size: clamp(1rem, 1.35vw, 1.28rem); max-width: 920px; }

.hero { min-height: calc(100vh - 68px); grid-template-columns: minmax(0, 1.04fr) minmax(420px, .96fr); align-items: start; padding: clamp(34px, 4vw, 56px) 0 clamp(60px, 8vw, 120px); }
.hero-copy { min-width: 0; }
.hero-visual { min-width: 0; }
.hero-branding { display: flex; justify-content: flex-end; margin: 0 0 16px; }
.hero-wordmark { width: min(500px, 100%); margin: 0; }
.hero-lead { max-width: 720px; color: #cbd0cf; font-size: clamp(1rem, 1.35vw, 1.24rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 34px 0 46px; }
.button { display: inline-block; padding: 13px 17px; border: 1px solid var(--line); background: var(--panel); color: var(--white); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.button:hover { border-color: var(--yellow); }
.button-primary { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.release-strip { display: flex; gap: 1px; list-style: none; padding: 0; margin: 0; }
.release-strip li { flex: 1; padding: 12px; background: var(--panel); border-top: 2px solid var(--line); }
.release-strip span, .release-strip strong { display: block; }
.release-strip span { color: var(--steel); font-size: .58rem; letter-spacing: .15em; }
.release-strip strong { margin-top: 4px; font-size: .72rem; }

.hero-machine { position: relative; min-height: 610px; padding: 18px; border: 1px solid var(--line); background: linear-gradient(140deg, #121817, #090c0c); box-shadow: 24px 24px 0 rgba(213,31,44,.13); overflow: hidden; }
.hero-machine::before { content: ""; position: absolute; inset: 0; opacity: .08; background: repeating-linear-gradient(0deg, transparent 0 8px, #fff 9px); pointer-events: none; }
.machine-head, .safety { position: relative; display: flex; justify-content: space-between; gap: 12px; color: var(--steel); font-size: .58rem; font-weight: 700; letter-spacing: .12em; }
.machine-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.live-dot { color: var(--yellow); }
.live-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 13px var(--yellow); margin-right: 8px; animation: engine-pulse 2.8s ease-in-out infinite; }
.source { position: relative; margin-top: 20px; height: 82px; padding: 12px; border: 1px solid; overflow: hidden; }
.source small, .source b { position: relative; z-index: 2; display: block; }
.source small { font-size: .56rem; letter-spacing: .14em; }
.source b { margin-top: 12px; font-size: .72rem; }
.source-wave { position: absolute; z-index: 1; left: 12px; bottom: 8px; width: calc(100% - 24px); height: 30px; overflow: visible; }
.source-wave path { fill: none; stroke: currentColor; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.source-wave .wave-cut { stroke-width: 1; stroke-dasharray: 2 2; opacity: .9; }
.source-a { color: var(--yellow); background: rgba(255,216,47,.035); }
.source-b { color: #e84952; background: rgba(213,31,44,.045); }
.fragments { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 14px; }
.fragments span { --fragment-border: var(--line); padding: 11px 3px; border: 1px solid var(--fragment-border); color: var(--steel); text-align: center; font-size: .58rem; animation: fragment-response 7s ease-out infinite; }
.fragments span:nth-child(2), .fragments span:nth-child(5) { --fragment-border: var(--yellow-dim); color: var(--yellow); }
.fragments span:nth-child(2n) { animation-delay: .08s; }
.fragments span:nth-child(3n) { animation-delay: .16s; }
.gesture-map { position: relative; margin-top: 18px; height: 155px; border: 1px solid var(--red-dark); background: rgba(213,31,44,.05); }
.gesture-map svg { width: 100%; height: 100%; }
.gesture-map path { fill: none; stroke: var(--red); stroke-width: 2; }
.gesture-map circle { fill: var(--yellow); }
.gesture-map span { position: absolute; left: 10px; bottom: 8px; color: #e15d65; font-size: .55rem; letter-spacing: .13em; }
.safety { margin-top: 18px; padding: 13px; border: 1px solid var(--yellow-dim); color: var(--yellow); }

@keyframes engine-pulse {
  0%, 100% { opacity: .55; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes fragment-response {
  0%, 76%, 100% { background: transparent; border-color: var(--fragment-border); transform: translateY(0); }
  84% { background: rgba(255,216,47,.18); border-color: var(--yellow); transform: translateY(2px); }
  92% { background: transparent; border-color: var(--fragment-border); transform: translateY(0); }
}

.principles { grid-column: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 34px; background: var(--line); border: 1px solid var(--line); }
.principles article { min-height: 280px; padding: 25px; background: var(--panel); }
.principles p { color: var(--steel); font-size: .88rem; }
.card-number { display: block; min-height: 92px; color: var(--yellow); font-family: var(--display); font-size: 3.7rem; line-height: 1; }

.history-section { display: grid; grid-template-columns: 150px 1fr; gap: clamp(24px, 5vw, 80px); }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--yellow); }
.timeline article { position: relative; padding: 30px 28px 10px 0; }
.timeline article::before { content: ""; position: absolute; top: -8px; width: 14px; height: 14px; background: var(--yellow); }
.timeline time { display: block; margin: 9px 0 54px; color: var(--yellow); font-weight: 700; }
.timeline p { color: var(--steel); font-size: .86rem; }

.workflow-section, .technology-section, .status-section, .documentation-section, .interface-section { position: relative; }
.workflow-section > .section-label, .technology-section > .section-label, .status-section > .section-label, .documentation-section > .section-label, .interface-section > .section-label { position: absolute; top: clamp(82px, 10vw, 154px); left: 0; }
.workspace-map { display: grid; grid-template-columns: repeat(2, 1fr); margin-left: 230px; gap: 12px; }
.workspace { min-height: 330px; padding: 30px; border: 1px solid var(--line); background: var(--panel); }
.workspace > span { color: var(--yellow); font-size: .62rem; letter-spacing: .16em; }
.workspace h3 { margin: 75px 0 24px; font-family: var(--display); font-size: clamp(1.8rem, 3vw, 3.2rem); line-height: 1; }
.workspace ul { list-style: none; padding: 0; margin: 0; color: var(--steel); font-size: .84rem; }
.workspace li { padding: 6px 0; border-top: 1px solid #202728; }
.workspace.prepare { border-top: 3px solid var(--yellow); }
.workspace.compose, .workspace.perform { border-top: 3px solid var(--red); }
.workspace.master { border-top: 3px solid var(--steel); }

.learn-section .section-copy, .steps, .learn-note { grid-column: 2; }
.steps { list-style: none; padding: 0; margin: 40px 0 24px; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 110px 1fr; gap: 25px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.steps li > span { color: var(--yellow); font-family: var(--display); font-size: 2rem; }
.steps h3 { margin-bottom: 7px; }
.steps p { margin: 0; color: var(--steel); }
.learn-note { padding: 18px; border-left: 3px solid var(--yellow); background: rgba(255,216,47,.04); color: #d8dbd5; }
.takes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 48px; }
.takes-grid article { min-height: 250px; padding: 24px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255,216,47,.06), transparent 50%), var(--panel); }
.takes-grid h3 { margin: 44px 0 12px; }
.takes-grid p { color: var(--steel); font-size: .88rem; }
.takes-route { margin: 26px 0 0; color: var(--yellow); font-size: .72rem; font-weight: 700; letter-spacing: .14em; }
.takes-route i { padding: 0 8px; color: var(--red); font-style: normal; }

.interface-frame { margin-left: 230px; display: grid; grid-template-columns: 3.5fr 1fr; grid-template-areas: "nav nav" "transport transport" "wave library" "create mix"; gap: 6px; padding: 8px; border: 1px solid var(--line); background: #050707; font-size: .64rem; letter-spacing: .08em; }
.interface-frame > div { padding: 18px; border: 1px solid var(--line); background: var(--panel); }
.if-nav { grid-area: nav; color: var(--yellow); }
.if-transport { grid-area: transport; }
.if-wave { grid-area: wave; min-height: 220px; color: var(--yellow); }
.if-wave i { display: block; height: 40px; margin: 16px 0; border: 1px solid var(--yellow-dim); background: repeating-linear-gradient(90deg, transparent 0 13px, rgba(255,216,47,.14) 14px); }
.if-create { grid-area: create; min-height: 180px; border-left-color: var(--red) !important; color: #eb6d75; }
.if-library { grid-area: library; color: var(--yellow); }
.if-mix { grid-area: mix; }
.interface-screenshot { margin: 0 0 0 230px; border: 1px solid var(--yellow-dim); background: #050707; box-shadow: 18px 18px 0 rgba(213,31,44,.13); }
.interface-screenshot img { width: 100%; height: auto; }
.interface-screenshot figcaption { padding: 13px 16px; border-top: 1px solid var(--line); color: var(--steel); font-size: .67rem; letter-spacing: .06em; }

.tech-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 70px; margin-left: 230px; }
.spec-list { margin: 0; border-top: 1px solid var(--line); }
.spec-list div { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.spec-list dt { color: var(--steel); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.spec-list dd { margin: 0; font-size: .78rem; }
.signal-chain { display: flex; align-items: stretch; gap: 9px; margin: 70px 0 30px 230px; }
.signal-chain > div { flex: 1; min-width: 0; padding: 16px; border: 1px solid var(--line); background: var(--panel); }
.signal-chain span, .signal-chain b, .signal-chain small { display: block; }
.signal-chain span { color: var(--yellow); font-size: .6rem; }
.signal-chain b { margin: 24px 0 8px; font-size: .72rem; }
.signal-chain small { color: var(--steel); font-size: .6rem; }
.signal-chain > i { align-self: center; color: var(--yellow); font-style: normal; }
.evidence { margin-left: 230px; padding: 18px; border: 1px solid var(--yellow-dim); color: var(--steel); font-size: .8rem; }
.evidence strong { color: var(--yellow); }

.status-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-left: 230px; }
.status-columns article { padding: 25px; border: 1px solid var(--line); background: var(--panel); }
.status-columns ul { padding-left: 18px; color: var(--steel); font-size: .84rem; }
.status-columns li { margin: 10px 0; }
.status-tag { display: inline-block; padding: 5px 8px; font-size: .6rem; font-weight: 700; letter-spacing: .12em; }
.status-tag.done { background: var(--yellow); color: var(--ink); }
.status-tag.testing { background: var(--red); color: white; }
.status-tag.next { border: 1px solid var(--steel); color: var(--steel); }

.doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-left: 230px; background: var(--line); border: 1px solid var(--line); }
.doc-grid a { position: relative; min-height: 190px; padding: 24px; background: var(--panel); text-decoration: none; }
.doc-grid a:hover { background: var(--panel-2); }
.doc-grid span, .doc-grid strong { display: block; }
.doc-grid span { color: var(--yellow); font-size: .58rem; letter-spacing: .15em; }
.doc-grid strong { margin-top: 60px; font-size: .85rem; }
.doc-grid i { position: absolute; top: 22px; right: 22px; color: var(--steel); font-style: normal; }

.credits-section { display: grid; grid-template-columns: 150px 1fr; gap: clamp(24px, 5vw, 80px); padding-bottom: clamp(36px, 5vw, 64px); }
.credits-copy { max-width: 940px; }
.credits-copy p { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--steel); }
.credits-copy strong { color: var(--white); }
.license-note { margin-top: 32px; padding: 20px !important; border: 1px solid var(--line) !important; font-size: .78rem; }

.site-footer { width: min(100% - 36px, var(--max)); margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 18px; padding: 34px 0; border-top: 1px solid var(--line); }
.site-footer img { image-rendering: pixelated; }
.site-footer strong, .site-footer span { display: block; }
.site-footer strong { font-family: var(--display); font-size: 1.4rem; letter-spacing: .08em; }
.site-footer span, .site-footer small { color: var(--steel); font-size: .65rem; }
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--yellow); font-size: .68rem; text-decoration: none; }
.contact-dialog { width: min(100% - 40px, 380px); padding: 22px; border: 1px solid var(--line); background: var(--panel-2); color: var(--white); box-shadow: 9px 9px 0 rgba(213,31,44,.14); }
.contact-dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px); }
.contact-dialog h2 { margin: 0 0 10px; font-size: 1rem; letter-spacing: .12em; }
.contact-dialog p { margin-bottom: 0; color: #cbd0cf; font-size: .78rem; }
.contact-dialog code { display: block; margin: 14px 0 12px; padding: 10px; border: 1px solid var(--line); background: var(--ink); color: var(--yellow); font-size: .78rem; overflow-wrap: anywhere; }
.contact-dialog .button { padding: 10px 13px; font-size: .64rem; }
.contact-feedback { min-height: 1.4em; margin: 10px 0 0; font-size: .7rem; }
.dialog-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: var(--steel); font-size: 2rem; line-height: 1; cursor: pointer; }
.dialog-close:hover { color: var(--yellow); }

@media (max-width: 1120px) {
  .site-header { grid-template-columns: auto auto 1fr; }
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 67px; left: 0; right: 0; padding: 18px; background: var(--ink); border-bottom: 1px solid var(--line); }
  .main-nav.open { display: grid; grid-template-columns: repeat(5, 1fr); text-align: center; }
  .repo-link { justify-self: end; }
  .hero { grid-template-columns: 1fr; }
  .hero-machine { min-height: 560px; max-width: 780px; width: 100%; }
  .principles { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); row-gap: 45px; }
  .tech-grid { grid-template-columns: 1fr; }
  .signal-chain { display: grid; grid-template-columns: repeat(5, 1fr); }
  .signal-chain > i { display: none; }
}

@media (max-width: 780px) {
  .site-header { gap: 10px; }
  .brand-copy { display: none; }
  .repo-link { font-size: .58rem; }
  .main-nav.open { grid-template-columns: 1fr 1fr; gap: 16px; text-align: left; }
  .section, .hero { width: min(100% - 24px, var(--max)); }
  .section-grid, .history-section, .credits-section { grid-template-columns: 1fr; }
  .section-label { margin-bottom: 22px; }
  .wide-copy, .principles, .learn-section .section-copy, .steps, .learn-note { grid-column: 1; }
  .section-heading, .workspace-map, .interface-frame, .interface-screenshot, .tech-grid, .signal-chain, .evidence, .status-columns, .doc-grid { margin-left: 0; }
  .workflow-section > .section-label, .technology-section > .section-label, .status-section > .section-label, .documentation-section > .section-label, .interface-section > .section-label { position: static; }
  .hero { min-height: auto; padding-top: 28px; }
  .hero-branding { justify-content: flex-start; margin-bottom: 14px; }
  .hero-wordmark { width: min(460px, 100%); }
  .hero-machine { min-height: 520px; padding: 12px; box-shadow: 10px 10px 0 rgba(213,31,44,.13); }
  .release-strip { display: grid; grid-template-columns: 1fr; gap: 3px; }
  .principles, .workspace-map, .status-columns, .doc-grid, .takes-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .timeline article { padding-bottom: 35px; }
  .timeline time { margin-bottom: 24px; }
  .workspace { min-height: 280px; }
  .workspace h3 { margin-top: 50px; }
  .steps li { grid-template-columns: 54px 1fr; gap: 10px; }
  .interface-frame { grid-template-columns: 1fr; grid-template-areas: "nav" "transport" "wave" "create" "library" "mix"; }
  .tech-grid { gap: 35px; }
  .signal-chain { grid-template-columns: 1fr 1fr; }
  .site-footer { grid-template-columns: auto 1fr; }
  .site-footer nav, .site-footer small { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
