/* one tube, one phosphor. layout: the whole page is a plot; range arcs from the scope centre run down through every section */
:root { --tube: #0b0703; --face: #150c05; --amb: #ffb224; --hot: #ffe6ae; --mid: #d08b25; --dim: #6b3f12; --line: #3a220b; --pad: clamp(18px, 3.4vw, 56px); }
* { box-sizing: border-box; }
html { background: var(--tube); color: var(--amb); font: 400 15px/1.35 "Quantico", ui-monospace, "SF Mono", Menlo, monospace; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; position: relative; overflow-x: clip; -webkit-font-smoothing: antialiased; }
p, h1, h2, dl, dd, ol, fieldset { margin: 0; padding: 0; border: 0; }
ol { list-style: none; }
a { color: inherit; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
canvas { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--amb); color: var(--tube); }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
.txt { text-decoration: underline; text-underline-offset: 3px; min-height: 28px; padding: 0 4px; color: var(--amb); }
.key { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 13px; border: 1px solid var(--dim); background: rgba(11, 7, 3, .72); color: var(--amb); text-decoration: none; font-size: 14px; white-space: nowrap; transition: background .14s, color .14s, border-color .14s; }
.key:hover, .key[aria-pressed="true"] { background: var(--amb); border-color: var(--amb); color: var(--tube); }
.key:active { transform: translateY(1px); }
.note { color: var(--mid); font-size: 14px; }
.say { color: var(--mid); font-size: 17px; }

.arcs { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: -1; overflow: hidden; pointer-events: none; }
.arcs circle { fill: none; stroke: #24150a; stroke-width: 1; }
.arcs text { fill: #96621f; font: 400 13px "Quantico", monospace; }

/* hero */
.hero { position: relative; min-height: max(100svh, 720px); padding: 0 var(--pad) 22px; display: grid; grid-template-columns: minmax(0, min(500px, 38vw)) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; column-gap: 28px; }
#tube { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.bar { grid-column: 1 / -1; grid-row: 1; position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand canvas { width: 34px; height: 34px; }
.brand b { font-size: 22px; letter-spacing: .02em; text-transform: uppercase; }
.bar nav { display: flex; align-items: center; gap: 18px; }
.bar nav a { text-underline-offset: 4px; padding: 8px; }
.hook { grid-column: 1; grid-row: 2; padding-top: 6px; }
#hook { width: calc(100% + 32px); margin-left: -16px; height: clamp(230px, 41svh, 384px); }
.sub { margin-top: 16px; font-size: 19px; }
#scope { grid-column: 2; grid-row: 1 / -1; justify-self: end; align-self: center; width: min(100% + var(--pad) * .55, 100svh - 34px, 1000px); min-width: 0; aspect-ratio: 1; margin-right: calc(var(--pad) * -.55); border-radius: 50%; cursor: crosshair; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
#scope:focus-visible { outline: 1px dashed var(--mid); outline-offset: -3px; }
.lock { grid-column: 1; grid-row: 3; align-self: end; padding: 14px 0 18px; max-width: 470px; }
.lk-top { display: flex; gap: 14px; align-items: center; color: var(--mid); font-size: 14px; min-height: 28px; }
.lk-name { display: flex; align-items: baseline; gap: 12px; min-height: 40px; overflow: hidden; }
.lk-name b { font-size: 31px; line-height: 1.2; white-space: nowrap; max-width: 62%; overflow: hidden; text-overflow: ellipsis; }
.lk-name span { color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lock dl { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 26px; margin-top: 6px; }
.lock dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; border-bottom: 1px dotted var(--line); padding: 2px 0; }
.lock dt { color: var(--mid); }
.lock dd { text-align: right; white-space: nowrap; }
.lock dd.bad { color: var(--tube); background: var(--amb); padding: 0 6px; }
.lk-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ctl { grid-column: 1 / -1; grid-row: 4; position: relative; z-index: 1; pointer-events: none; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; min-height: 48px; }
.ctl > * { pointer-events: auto; }
.seg { display: flex; align-items: center; }
.seg legend { float: left; margin-right: 12px; color: var(--mid); }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-width: 46px; min-height: 36px; border: 1px solid var(--dim); margin-left: -1px; background: rgba(11, 7, 3, .72); }
.seg input:checked + span { background: var(--amb); color: var(--tube); border-color: var(--amb); }
.seg input:focus-visible + span { outline: 2px solid var(--hot); outline-offset: 3px; position: relative; z-index: 1; }
.feed { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--mid); font-size: 14px; text-align: right; }

/* a-scope */
section:not(.hero) { padding: 84px var(--pad) 0; }
[data-beam] { font-size: 0; line-height: 0; }
[data-beam] canvas { max-width: 100%; }
[data-beam] + .say { margin-top: 18px; }
.trace { margin: 26px calc(var(--pad) * -1) 0; height: clamp(190px, 30vw, 330px); touch-action: pan-y; cursor: ew-resize; }
.trace canvas { width: 100%; height: 100%; }
.slides { display: flex; flex-wrap: wrap; gap: 14px 40px; margin-top: 18px; }
.slides label { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; flex: 1 1 280px; color: var(--mid); }
.slides output { color: var(--amb); text-align: right; }
.slides input { grid-column: 1 / -1; appearance: none; -webkit-appearance: none; width: 100%; height: 30px; background: linear-gradient(var(--dim), var(--dim)) center / 100% 1px no-repeat; margin: 0; cursor: pointer; }
.slides input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 28px; background: var(--amb); border: 0; border-radius: 0; }
.slides input::-moz-range-thumb { width: 14px; height: 28px; background: var(--amb); border: 0; border-radius: 0; }
.rows { margin-top: 16px; min-height: 152px; }
.rows li { border-bottom: 1px dotted var(--line); }
.rows button, .rows .row { display: grid; grid-template-columns: 54px minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 10px; align-items: center; width: 100%; min-height: 38px; text-align: left; font-variant-numeric: tabular-nums; }
.rows button:hover { background: #24150a; }
.rows span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows span:nth-child(1), .rows span:nth-child(n+3) { color: var(--mid); }
.rows .empty { color: var(--mid); padding: 9px 0; }

/* bytes */
.bytes { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 40px; align-items: end; }
#byForm { display: flex; gap: 8px; margin: 22px 0 12px; }
#by { flex: 1; min-width: 0; min-height: 46px; padding: 0 14px; background: rgba(11, 7, 3, .72); border: 1px solid var(--dim); border-radius: 0; font-size: 16px; }
#by::placeholder { color: var(--mid); opacity: 1; }
#byForm .key { min-height: 46px; padding: 0 22px; background: var(--amb); color: var(--tube); border-color: var(--amb); }
#byForm .key:hover { background: var(--hot); }
#byNote { min-height: 42px; }
#dial { width: 100%; height: 400px; }

/* burn */
.burn { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
#burnTube { width: 100%; aspect-ratio: 1; max-width: 560px; justify-self: center; cursor: crosshair; touch-action: pan-y; }
.burn .rows { min-height: 120px; }
.burn .rows .row { grid-template-columns: 46px minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 72px; }
.burn .rows .row span:last-child { color: var(--amb); text-align: right; }
.bu-act { display: flex; gap: 8px; margin: 18px 0 10px; }

/* how: one bearing line, three stops */
.how { position: relative; }
#strip { width: calc(100% + var(--pad) * 2); margin: 0 calc(var(--pad) * -1); height: clamp(240px, 25vw, 360px); }
.how ol { display: grid; grid-template-columns: 30% 1fr 34%; gap: 0 24px; font-size: 19px; }

.foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 40px; align-items: end; padding: 100px var(--pad) max(44px, env(safe-area-inset-bottom)); }
#sign { width: 100%; height: clamp(90px, 15vw, 210px); }
.fo-links { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 16px; }
.foot .note + .note { margin-top: 6px; }
.ca { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) {
  .hero { display: flex; flex-direction: column; padding: 0 16px 14px; min-height: 100svh; }
  .bar { height: 54px; width: 100%; }
  .brand canvas { width: 28px; height: 28px; } .brand b { font-size: 18px; }
  .bar nav { gap: 6px; } .bar .key { min-height: 34px; padding: 0 10px; font-size: 13px; }
  .hook { padding: 0; width: 100%; } #hook { height: 84px; width: 100%; margin: 0; } .sub { margin-top: 2px; font-size: 15px; }
  #scope { width: calc(100% + 16px); max-width: 560px; align-self: center; margin: 2px -8px 0; }
  .arcs text { display: none; }
  .lock { padding: 2px 0 8px; max-width: none; width: 100%; align-self: auto; }
  .lk-top { min-height: 22px; font-size: 13px; } .lk-top .txt { min-height: 22px; }
  .lk-name { min-height: 30px; } .lk-name b { font-size: 23px; }
  .lock dl { gap: 0 16px; margin-top: 0; } .lock dl div { font-size: 13px; padding: 1px 0; }
  .lk-act { margin-top: 8px; gap: 6px; flex-wrap: nowrap; } .lk-act .key { padding: 0 8px; font-size: 13px; flex: 1 1 auto; }
  .ctl { gap: 8px 10px; min-height: 0; width: 100%; } .seg legend { margin-right: 8px; font-size: 13px; line-height: 36px; } .seg span { min-width: 40px; font-size: 13px; }
  .feed { width: 100%; margin: 0; justify-content: space-between; font-size: 13px; text-align: left; min-height: 26px; }
  section:not(.hero) { padding: 70px 16px 0; }
  .trace { margin: 20px -16px 0; }
  .rows button, .rows .row { grid-template-columns: 38px minmax(0, 1.3fr) 44px minmax(0, 1fr); font-size: 14px; gap: 8px; }
  #rows span:nth-child(5) { display: none; }
  .bytes, .burn, .foot { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  #dial { height: 420px; }
  .burn .rows .row { grid-template-columns: 34px minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 60px; font-size: 13px; }
  .how { display: grid; grid-template-columns: 46% 1fr; } #strip { width: 100%; margin: 0; height: 480px; } .how ol { grid-template-columns: 1fr; grid-template-rows: 25% 37% 38%; align-items: center; gap: 0; font-size: 17px; }
  .foot { padding: 72px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
