/* SPDX-License-Identifier: GPL-3.0-only
   Copyright (C) 2026 Chris Farrell */
:root {
  --panel: #e3e7ea; --raised: #f1f4f6; --ink: #172029; --dim: #5a6772; --line: #c3ccd3;
  --screen: #0d1a21; --trace: #4fe8d0; --grid: rgba(79, 232, 208, .09); --led: #ffb020; --ok: #0b7a5a; --bad: #e5484d; --warn: #9a5b00;
  --lcd: #9ef5e6;
}
@media (prefers-color-scheme: dark) {
  :root { --panel: #12181d; --raised: #1a222a; --ink: #e4eaee; --dim: #8a99a5; --line: #2b3640; --screen: #070e12; --ok: #4fe8b0; --warn: #ffb74d; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--panel); color: var(--ink); font: 16px/1.55 "Bricolage Grotesque", system-ui, sans-serif; }
main { max-width: 760px; margin: 0 auto; padding: 0 16px 96px; }
a { color: inherit; }
code { font-family: "VT323", ui-monospace, monospace; font-size: 1.15em; }
:focus-visible { outline: 2px solid var(--led); outline-offset: 2px; }
[hidden] { display: none !important; }

/* the scope */
header { padding-top: 28px; }
.mark { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
h1 { margin: 0; font-size: clamp(34px, 7vw, 52px); font-weight: 800; letter-spacing: -.035em; font-stretch: 75%; line-height: 1; }
.tag { color: var(--dim); margin: 0; }
.about { margin: 22px 0 0; max-width: 64ch; }
.crt { position: relative; background: var(--screen); border-radius: 10px; box-shadow: inset 0 0 0 1px #000, inset 0 0 40px rgba(0, 0, 0, .6), 0 1px 0 var(--line); overflow: hidden; }
#scope { display: block; width: 100%; height: clamp(140px, 26vw, 210px); }
#lcd { position: absolute; left: 14px; bottom: 8px; font: 22px/1 "VT323", ui-monospace, monospace; color: var(--lcd); text-shadow: 0 0 8px rgba(79, 232, 208, .6); }

/* the rail: one stage after another, joined by a line that lights up */
.stage { position: relative; padding: 26px 0 8px 46px; }
.stage::before { content: ""; position: absolute; left: 11px; top: 0; bottom: -8px; width: 2px; background: var(--line); }
.stage:last-of-type::before { bottom: auto; height: 38px; }
.stage::after { content: ""; position: absolute; left: 3px; top: 32px; width: 18px; height: 18px; border-radius: 50%; background: var(--raised); border: 2px solid var(--line); }
.stage[data-state="now"]::after { background: var(--led); border-color: var(--led); box-shadow: 0 0 12px var(--led); }
.stage[data-state="done"]::after { background: var(--trace); border-color: var(--trace); box-shadow: 0 0 10px var(--trace); }
.stage[data-state="done"]::before { background: var(--trace); }
h2 { margin: 0 0 10px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h3 { margin: 18px 0 6px; font-size: 15px; font-weight: 600; }
p { margin: 0 0 12px; }
.dim, .small { color: var(--dim); }
.small { font-size: 14px; }
.lead { max-width: 56ch; }

button { font: inherit; font-weight: 600; background: var(--ink); color: var(--panel); border: 0; border-radius: 6px; padding: 9px 20px; cursor: pointer; }
button:hover:not(:disabled) { background: var(--led); color: #1a1100; }
button:disabled { opacity: .35; cursor: default; }
button.small { padding: 3px 11px; font-size: 14px; font-weight: 500; background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.small:hover:not(:disabled) { background: var(--raised); color: var(--ink); border-color: var(--ink); }

#drop { border: 2px dashed var(--line); border-radius: 10px; padding: 18px; background: var(--raised); transition: border-color .15s, background .15s; }
#drop.over { border-color: var(--trace); background: var(--panel); }
#drop p { margin-bottom: 8px; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 16px; margin: 14px 0 6px; font-size: 14px; }
dt { color: var(--dim); } dd { margin: 0; word-break: break-all; }
dd#f-id { font: 22px/1.1 "VT323", ui-monospace, monospace; }

.dev { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 12px; margin-bottom: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.dev.sel { border-color: var(--trace); box-shadow: 0 0 0 1px var(--trace); }
.dname { font-weight: 600; }
.lcdtxt { font: 20px/1 "VT323", ui-monospace, monospace; color: var(--dim); }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.chips { list-style: none; padding: 0; margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 1px 12px; font-size: 14px; background: var(--raised); }
.chip.fixed { color: var(--dim); }
.chip.mine { border-color: var(--trace); padding-right: 4px; }
.chip input { font: inherit; border: 0; background: transparent; color: var(--ink); padding: 2px 0; min-width: 4ch; }
.chip .x { background: transparent; color: var(--dim); padding: 0 6px; font-size: 18px; line-height: 1; }
.chip .x:hover:not(:disabled) { background: transparent; color: var(--bad); }
form#add-name { display: flex; gap: 8px; flex-wrap: wrap; }
form#add-name input { font: inherit; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); color: var(--ink); min-width: 0; flex: 1 1 180px; }
details { margin-top: 14px; }
summary { cursor: pointer; font-weight: 600; }

/* the write: a row of segments, like the meter on the hardware */
#bar { display: grid; grid-template-columns: repeat(40, 1fr); gap: 2px; height: 14px; margin: 16px 0 0; }
#bar i { background: var(--line); border-radius: 1px; transition: background .12s; }
#bar i.on { background: var(--led); box-shadow: 0 0 6px rgba(255, 176, 32, .55); }
#status { min-height: 1.6em; margin-top: 10px; max-width: 62ch; }
.ok { color: var(--ok); } .err { color: var(--bad); } .warn { color: var(--warn); }
pre { color: var(--dim); font: 14px/1.3 "VT323", ui-monospace, monospace; white-space: pre-wrap; max-height: 200px; overflow: auto; margin: 8px 0 0; }
footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); }
.trust { color: var(--warn); }

@media (max-width: 520px) { .stage { padding-left: 38px; } #bar { grid-template-columns: repeat(24, 1fr); } #bar i:nth-child(n+25) { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
