/* namedsmall — anodized 1px schematic console */
:root {
  --stage: #111215;
  --console: #141619;
  --face: #17191d;
  --face-hi: #1c1f24;
  --rule: #272a30;
  --rule-hi: #3a3e46;
  --ink: #eceff2;
  --ink-2: #c4c9d0;
  --muted: #a7aeb8;   /* labels      · ≈ 8:1 on console */
  --dim: #969da7;     /* inactive    · ≈ 6.5:1 on every dark surface */
  --signal: #ff4d1c;
  --phos: #00e599;

  --brand: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  --sans: "IBM Plex Sans", "Pretendard", system-ui, -apple-system, sans-serif;
  --ko: "Pretendard", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Pretendard", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --bar-h: 48px;
  --console-h: 276px;
  --stage-col: 424px;
  --pad: 32px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--stage);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}
html[lang="ko"] body, [lang="ko"]:not(html) { font-family: var(--ko); word-break: keep-all; }
[lang="en"]:not(html) { font-family: var(--sans); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
kbd { font-family: var(--mono); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lbl, .ch-num, kbd, .strip, .modes button, .lang-btn, .keycap-state, .fader-scale, .note-kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
html[lang="ko"] .lbl, html[lang="ko"] .fader-scale, html[lang="ko"] .note-kicker,
html[lang="ko"] .strip, html[lang="ko"] .modes button, html[lang="ko"] .keycap-state { letter-spacing: 0.02em; }
.lbl { color: var(--muted); }

/* ---------- layout ---------- */
.deck {
  display: grid;
  grid-template-rows: var(--bar-h) minmax(0, 1fr) var(--console-h);
  height: 100vh;
  height: 100dvh;
  min-height: 700px;
  overflow: hidden;
}

/* ---------- band 1 · bar ---------- */
.bar {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr) 104px 328px;
  border-bottom: 1px solid var(--rule);
  background: var(--stage);
}
.cell {
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-right: 1px solid var(--rule);
  min-width: 0;
}
.cell:last-child { border-right: 0; }

.brand { gap: 10px; padding-left: var(--pad); height: 100%; }
.brand-emblem { width: 20px; height: 20px; flex: none; shape-rendering: crispEdges; transition: transform 100ms ease-out; }
.brand-wordmark {
  font-family: var(--brand);
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.wm-a { font-weight: 600; color: var(--ink); }
.wm-b { font-weight: 400; color: #9ea5b0; }
.brand:hover .brand-emblem { transform: translateY(1px); }

.bar-line { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; }

.lang { gap: 2px; justify-content: center; padding: 0 10px; }
.lang-btn {
  min-width: 30px;
  padding: 5px 7px;
  color: var(--dim);
  border: 1px solid transparent;
}
.lang-btn[lang="ko"] { font-family: var(--ko); font-size: 12.5px; letter-spacing: 0; }
.lang-btn[aria-pressed="true"] { color: var(--ink); border-color: var(--rule-hi); }
.lang-btn:hover { color: var(--ink); }

.copycell { padding: 0 var(--pad) 0 14px; justify-content: flex-end; }
.keycap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px 0 12px;
  background: var(--face);
  border: 1px solid var(--rule-hi);
  border-bottom-width: 2px;
  border-radius: 3px;
  transition: transform 60ms ease-out, border-color 120ms;
}
.keycap:hover { border-color: #565c66; }
.keycap:hover .keycap-state { color: var(--ink); }
.keycap:active, .keycap.pressed { transform: translateY(1px); border-bottom-width: 1px; margin-top: 1px; }
.keycap-addr { font-family: var(--mono); font-size: 13px; letter-spacing: 0.01em; white-space: nowrap; }
.keycap-state {
  color: var(--muted);
  padding-left: 10px;
  border-left: 1px solid var(--rule-hi);
  width: 82px;
  text-align: left;
  white-space: nowrap;
}

.led {
  width: 6px; height: 6px; border-radius: 50%;
  background: #2b2f35;
  box-shadow: inset 0 0 0 1px #474c54;
  flex: none;
  transition: background 80ms;
}
[data-state="ok"] .led { background: var(--phos); box-shadow: 0 0 0 3px rgba(0, 229, 153, .14), 0 0 8px rgba(0, 229, 153, .6); }
[data-state="ok"] [data-copy-state] { color: var(--phos); }
[data-state="err"] .led { background: var(--signal); }
[data-state="err"] [data-copy-state] { color: var(--ink); }

/* ---------- band 2 · stage ---------- */
.stage {
  display: grid;
  grid-template-columns: var(--stage-col) minmax(0, 1fr);
  min-height: 0;
}
.stage-copy {
  display: flex;
  flex-direction: column;
  padding: 34px 32px 26px var(--pad);
  border-right: 1px solid var(--rule);
  min-height: 0;
}

/* hero brand lockup: 16x16 unit-lattice emblem + tight Space Grotesk wordmark */
.hero-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  align-self: flex-start;
  text-align: left;
}
.hero-emblem {
  width: 40px;
  height: 40px;
  flex: none;
  shape-rendering: crispEdges;
  display: block;
}
.hero-wordmark {
  font-family: var(--brand);
  font-size: 46px;
  line-height: 0.92;
  letter-spacing: -0.05em;
  display: inline-block;
  transform: translateY(-1px);
}
.hero-lockup:hover .hero-emblem { transform: translateY(1px); }

.lede { margin-top: 32px; }
.headline {
  font-size: 40px;
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.024em;
  margin: 0;
  color: var(--ink);
}
html[lang="ko"] .headline {
  font-family: var(--ko);
  font-size: 31px;
  line-height: 1.3;
  letter-spacing: -0.03em;
  font-weight: 600;
}

/* identity on top, instrument state anchored at the foot of the column */
.channel-note { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--rule); }
.note-kicker { margin: 0 0 6px; color: var(--muted); }
.note-kicker #noteCh { color: var(--ink); }
.note-sep { color: var(--muted); padding: 0 4px; }
.note-body { margin: 0; font-size: 14.5px; line-height: 1.48; color: var(--ink-2); max-width: 25em; height: 3em; overflow: hidden; }

.viewport {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 40px;
  padding: 22px var(--pad) 0 28px;
  min-height: 0;
}
.screen {
  position: relative;
  min-height: 0;
  border: 1px solid var(--rule-hi);
  background: var(--stage);
}
.screen-in { position: absolute; inset: 0; overflow: hidden; }
#signal {
  position: absolute; left: 0; top: 0;
  image-rendering: pixelated;
  display: block;
}
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 160ms steps(3); }
.is-mark .overlay { opacity: 1; transition-delay: 180ms; }
.reg { position: absolute; width: 9px; height: 9px; border-color: var(--ink); border-style: solid; border-width: 0; }
.reg-tl { top: -5px; left: -5px; border-top-width: 1px; border-left-width: 1px; }
.reg-tr { top: -5px; right: -5px; border-top-width: 1px; border-right-width: 1px; }
.reg-bl { bottom: -5px; left: -5px; border-bottom-width: 1px; border-left-width: 1px; }
.reg-br { bottom: -5px; right: -5px; border-bottom-width: 1px; border-right-width: 1px; }

.strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 40px; color: var(--muted); }
.strip-cell { display: flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; }
.strip-title { color: var(--ink-2); }
.dot-sig { width: 6px; height: 6px; background: var(--signal); flex: none; }
.strip-right { justify-content: flex-end; }
.modes { display: none; gap: 2px; }
.modes button { height: 26px; padding: 0 9px; color: var(--dim); border: 1px solid transparent; }
.modes button[aria-checked="true"] { color: var(--ink); border-color: #5a606a; }
.modes button:hover:not([aria-checked="true"]) { color: var(--ink); }
.is-mark .modes { display: flex; }
.is-mark .strip-meta { display: none; }

/* overlay drawing (mark channel) */
.ov-grid { stroke: #252930; stroke-width: 1; fill: none; shape-rendering: crispEdges; }
.ov-grid-major { stroke: #353a43; stroke-width: 1; fill: none; shape-rendering: crispEdges; }
.ov-wire { stroke: var(--ink); stroke-width: 1.25; fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: miter; }
.ov-node { fill: var(--stage); stroke: var(--ink); stroke-width: 1; shape-rendering: crispEdges; }
.ov-node.sig { fill: var(--signal); stroke: var(--signal); }
.ov-cons { stroke: var(--signal); stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.ov-dim { stroke: var(--ink-2); stroke-width: 1; fill: none; shape-rendering: crispEdges; }
.ov-txt { font-family: var(--mono); font-size: 11px; letter-spacing: .07em; fill: var(--ink-2); text-transform: uppercase; }
html[lang="ko"] .ov-txt { letter-spacing: .02em; }
.ov-txt.hi { fill: var(--ink); }
.ov-wm-a { font-family: var(--brand); font-weight: 600; letter-spacing: -0.045em; }
.ov-wm-b { font-family: var(--brand); font-weight: 400; letter-spacing: -0.045em; }
.ov-px { shape-rendering: crispEdges; }
.ov-plate { fill: #1a1c21; stroke: var(--rule-hi); stroke-width: 1; shape-rendering: crispEdges; }

/* ---------- band 3 · console ---------- */
.console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px 368px;
  background: var(--console);
  border-top: 1px solid var(--rule-hi);
}
.channels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 20px 0 22px var(--pad);
  gap: 0;
}
.ch {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  text-align: left;
  padding: 0 18px 0 0;
  margin-right: 18px;
  border-right: 1px solid var(--rule);
  color: var(--muted);
  transition: color 120ms;
  min-width: 0;
}
.ch:last-child { border-right: 0; }
.ch-top { display: flex; align-items: center; gap: 8px; }
.ch-num { color: var(--ink-2); }
.phos { width: 9px; height: 9px; border-radius: 50%; border: 1px solid #50555e; transition: background 60ms, border-color 60ms; }
.ch kbd {
  margin-left: auto;
  min-width: 20px; height: 20px; line-height: 18px; text-align: center;
  border: 1px solid var(--rule-hi); border-bottom-width: 2px; border-radius: 2px;
  color: var(--dim); font-size: 11px; letter-spacing: 0;
}
.ch-icon {
  width: 100%; max-width: 148px; height: 86px; align-self: center; justify-self: start;
  margin: 10px 0;
  fill: none; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke;
  overflow: visible;
  transition: transform 60ms ease-out;
}
.ch-icon * { vector-effect: non-scaling-stroke; }
.ch-label { font-size: 14px; line-height: 1.3; color: var(--ink-2); font-weight: 500; }
html[lang="ko"] .ch-label { font-family: var(--ko); white-space: nowrap; }
.m-br { display: none; }
.ch:hover { color: var(--ink-2); }
.ch:hover .ch-label { color: var(--ink); }
.ch:active .ch-icon { transform: translateY(1px); }
.ch[aria-checked="true"] { color: var(--ink); }
.ch[aria-checked="true"] .ch-label { color: var(--ink); }
.ch[aria-checked="true"] .ch-num { color: var(--ink); }
.ch[aria-checked="true"] .phos { background: var(--ink); border-color: var(--ink); }
.ch[aria-checked="true"] kbd { color: var(--ink); border-color: #50555e; transform: translateY(1px); border-bottom-width: 1px; margin-top: 1px; }

.density {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 20px 24px 20px;
  border-left: 1px solid var(--rule-hi);
  border-right: 1px solid var(--rule-hi);
  background: var(--face);
}
.dens-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dens-idle { display: none; font: 11px/1 var(--mono); letter-spacing: .04em; color: var(--muted); }
.dens-body {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  column-gap: 16px; row-gap: 12px;
  align-items: center;
}
.dens-read { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dens-val { font-family: var(--mono); font-size: 19px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.01em; }
.fader-wrap { grid-column: 1 / -1; align-self: end; }
.bayer {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: 64px;
  aspect-ratio: 1;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.density .bayer, .density .dens-read, .density .fader-wrap { transition: opacity 120ms; }
.density.is-idle .bayer, .density.is-idle .dens-read, .density.is-idle .fader-wrap { opacity: .32; }
.density.is-idle .fader { pointer-events: none; cursor: default; }
.density.is-idle .dens-idle { display: inline; }
.bayer i { display: block; background: var(--console); transition: background 60ms; }

.fader { position: relative; height: 50px; touch-action: none; cursor: ew-resize; }
.fader-track { position: absolute; left: 0; right: 0; top: 19px; height: 1px; background: var(--rule-hi); }
.fader-ticks { position: absolute; inset: 0; }
.fader-ticks span {
  position: absolute; top: 10px; width: 1px; height: 19px; background: var(--rule-hi);
  transform: translateX(-0.5px);
  pointer-events: none;
}
.fader-ticks span.on { background: var(--ink-2); }
.fader-ticks .tick-btn {
  position: absolute; top: 35px; transform: translateX(-50%);
  padding: 4px 5px;
  font: 500 10.5px/1 var(--mono); color: var(--dim); letter-spacing: 0;
  cursor: pointer;
}
.fader-ticks .tick-btn:hover { color: var(--ink); }
.fader-ticks .tick-btn.on { color: var(--ink); }
.fader-thumb {
  position: absolute; top: 4px; width: 22px; height: 30px; margin-left: -11px;
  background: var(--face-hi);
  border: 1px solid #5f6570;
  border-bottom-width: 2px;
  border-radius: 2px;
  transition: left 70ms cubic-bezier(.3, 1.6, .5, 1);
  pointer-events: none;
}
.fader-thumb span { position: absolute; left: 10px; top: 5px; width: 1px; height: 18px; background: var(--ink); }
.fader.dragging .fader-thumb { transition: none; border-color: var(--ink-2); }
.fader:focus-visible { outline-offset: 6px; }
.fader-scale { display: flex; justify-content: space-between; margin-top: 6px; color: var(--dim); font-size: 10.5px; }

.operator {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  padding: 20px var(--pad) 20px 24px;
  font-size: 13px;
}
.op-head { display: flex; flex-direction: column; gap: 4px; }
.op-name { font-weight: 500; color: var(--ink); font-size: 14px; }
.op-name span { color: var(--muted); font-weight: 400; margin-left: 6px; }
.op-addr { font-style: normal; color: var(--muted); line-height: 1.5; }
.legal { align-self: end; display: flex; flex-wrap: wrap; row-gap: 4px; padding-top: 12px; border-top: 1px solid var(--rule); }
.legal a {
  padding: 4px 10px 4px 0; margin-right: 10px;
  border-right: 1px solid var(--rule);
  text-decoration: none; color: var(--ink-2); font-size: 13px; white-space: nowrap;
}
.legal a:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.legal a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- mid widths ---------- */
@media (max-width: 1280px) {
  .bar { grid-template-columns: 260px minmax(0, 1fr) 96px 320px; }
  :root { --stage-col: 372px; }
  .hero-emblem { width: 34px; height: 34px; }
  .hero-wordmark { font-size: 40px; }
  .headline { font-size: 36px; }
  .console { grid-template-columns: minmax(0, 1fr) 256px 352px; }
}

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  :root { --pad: 16px; --legal-h: 44px; }
  html, body { height: auto; min-height: 100%; }
  body { padding-bottom: calc(var(--legal-h) + env(safe-area-inset-bottom)); }
  .deck { display: block; height: auto; min-height: 0; overflow: visible; }

  .bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 46px 48px;
  }
  .bar-line { display: none; }
  .brand { padding-left: var(--pad); padding-right: 12px; gap: 9px; border-right: 0; }
  .brand-emblem { width: 18px; height: 18px; }
  .brand-wordmark { display: none; }
  .lang { padding: 0 var(--pad) 0 8px; border-right: 0; }
  .copycell {
    grid-column: 1 / -1;
    padding: 0 var(--pad);
    border-top: 1px solid var(--rule);
    justify-content: stretch;
  }
  .keycap { width: 100%; height: 34px; padding: 0 0 0 12px; }
  .keycap-addr { flex: 1; text-align: left; font-size: 13.5px; }
  .keycap-state { width: 88px; padding-left: 12px; align-self: stretch; display: flex; align-items: center; color: var(--ink); }

  .stage { display: flex; flex-direction: column; }
  .stage-copy { display: block; padding: 14px var(--pad) 0; border-right: 0; }
  .hero-lockup { gap: 10px; }
  .hero-emblem { width: 28px; height: 28px; }
  .hero-wordmark { font-size: 32px; }
  .lede { margin-top: 10px; }
  .headline { font-size: 24px; line-height: 1.12; }
  html[lang="ko"] .headline { font-size: 21px; line-height: 1.28; }
  .channel-note { display: none; }

  .viewport { padding: 12px var(--pad) 0; grid-template-rows: auto auto; }
  .screen { height: 222px; }
  .strip { height: 36px; }
  .strip-meta { display: none; }
  .strip-title { font-size: 11px; }

  .console { display: flex; flex-direction: column; border-top: 0; }
  .density { order: -1; }
  .channels {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0;
    border-bottom: 1px solid var(--rule);
  }
  .ch {
    margin: 0; padding: 9px 8px 10px 10px;
    border-right: 1px solid var(--rule);
    grid-template-rows: auto auto auto;
    align-content: start;
  }
  .ch:first-child { padding-left: var(--pad); }
  .ch:last-child { border-right: 0; }
  .ch-icon { height: 32px; max-width: 60px; margin: 6px 0 5px; }
  .ch-label { font-size: 12px; line-height: 1.28; }
  html[lang="ko"] .ch-label { white-space: normal; }
  .m-br { display: inline; }
  .ch kbd { display: none; }

  .density {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 12px; row-gap: 4px;
    padding: 9px var(--pad) 10px;
    border: 0;
    border-top: 1px solid var(--rule-hi);
    border-bottom: 1px solid var(--rule);
  }
  .dens-body { display: contents; }
  .bayer { display: none; }
  .dens-read { grid-column: 2; grid-row: 1; align-self: baseline; }
  .dens-val { font-size: 13px; }
  .fader-wrap { grid-row: 2; }
  .fader-scale { display: none; }

  .operator { padding: 12px var(--pad) 14px; gap: 6px; grid-template-rows: auto auto; }
  .op-addr { font-size: 12.5px; line-height: 1.45; }

  .legal {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    height: calc(var(--legal-h) + env(safe-area-inset-bottom));
    padding: 0 var(--pad) env(safe-area-inset-bottom);
    flex-wrap: nowrap; justify-content: space-between; align-items: center;
    background: var(--console);
    border-top: 1px solid var(--rule-hi);
  }
  .legal a { padding: 10px 0; margin: 0; border-right: 0; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
