@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-600.woff2") format("woff2"); }

:root {
  /* the page: cool aluminium and blue ink */
  --page: #e6e9ef;
  --ink: #14203a;
  --muted: #566280;
  --line: #c4cbdb;
  --field: #f6f7fa;
  --accent: #2d6ff0;
  --accent-strong: #1f56c6;
  --on-accent: #ffffff;
  --ok: #14804a;
  --error: #b42a32;
  /* the display: dark glass, ice-blue dots */
  --glass: #070d1c;
  --glass-top: #111c38;
  --bezel: #1b2746;
  --text-on-glass: #b4c2e6;
  --dot-off: #0e182f;
  --dot-on: #9be8ff;
  --dot-glow: rgba(143, 227, 255, .7);
  /* the four colour keys of the remote */
  --key-red: #e5484d;
  --key-green: #2fb457;
  --key-yellow: #e8b923;
  --key-blue: #3f8cff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0a1020;
    --ink: #e6ebfa;
    --muted: #94a1c4;
    --line: #27345c;
    --field: #0f1730;
    --accent: #5b8dff;
    --accent-strong: #7aa2ff;
    --on-accent: #08122b;
    --ok: #4cce8c;
    --error: #ff8085;
    --bezel: #2a3868;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 1rem/1.55 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1, h2, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---- frame */
.masthead, main { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; padding-block: 1.5rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .95rem; letter-spacing: .01em; }
.keys { display: inline-flex; gap: 3px; }
.keys i { width: 7px; height: 7px; border-radius: 2px; }
.keys i:nth-child(1) { background: var(--key-red); }
.keys i:nth-child(2) { background: var(--key-green); }
.keys i:nth-child(3) { background: var(--key-yellow); }
.keys i:nth-child(4) { background: var(--key-blue); }

.help-link { font-weight: 500; font-size: .95rem; color: var(--ink); text-underline-offset: .25em; }
.help-link:hover { color: var(--accent-strong); }

main { padding-block: clamp(2.5rem, 7vw, 5rem) 5rem; }
.intro { margin-bottom: clamp(2.5rem, 6vw, 4rem); }
h1 { font-size: clamp(2.25rem, 1.2rem + 4.2vw, 3.6rem); font-weight: 600; line-height: 1.02; letter-spacing: -.025em; }
.intro p { margin-top: 1rem; max-width: 34rem; font-size: 1.15rem; line-height: 1.5; color: var(--muted); }

/* ---- the form beside the display */
.workbench { display: grid; grid-template-columns: minmax(0, 27rem) minmax(0, 1fr); gap: clamp(2.5rem, 7vw, 6rem); align-items: start; }
.form { display: grid; gap: 1.5rem; }
.field { display: grid; gap: .4rem; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label, .label { font-weight: 500; font-size: .95rem; }
.hint { font-size: .85rem; color: var(--muted); }

input:not([type=radio]):not([type=checkbox]) {
  width: 100%; height: 2.9rem; padding: 0 .85rem; font: inherit; color: var(--ink);
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
}
input::placeholder { color: color-mix(in srgb, var(--muted) 65%, transparent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* two-way choice: a switch of two segments instead of radio buttons */
.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; background: var(--field); padding: 3px; gap: 3px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: grid; place-items: center; height: 2.55rem; border-radius: 7px; font-weight: 500; cursor: pointer; color: var(--muted); }
.segmented input:checked + label { background: var(--ink); color: var(--page); }
.segmented input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { height: 2.5rem; padding: 0 1rem; font: inherit; font-weight: 500; color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--ink); color: var(--page); border-color: var(--ink); }

button { font: inherit; cursor: pointer; }
.primary { justify-self: start; height: 3.1rem; padding: 0 1.8rem; font-weight: 600; color: var(--on-accent);
  background: var(--accent); border: 0; border-radius: 10px; }
.primary:hover { background: var(--accent-strong); }
.primary:disabled { opacity: .6; cursor: progress; }
.secondary { height: 2.7rem; padding: 0 1.3rem; font-weight: 500; color: var(--ink); background: transparent;
  border: 1px solid var(--ink); border-radius: 10px; }
.secondary:hover:not(:disabled) { background: var(--ink); color: var(--page); }
.secondary:disabled { opacity: .4; cursor: default; border-color: var(--line); }
.error { color: var(--error); font-weight: 500; }

/* ---- the display: the one thing that is not quiet */
.result { position: sticky; top: 2rem; display: grid; gap: 1rem; justify-items: start; }
.panel {
  position: relative; width: 100%; overflow: hidden; padding: clamp(1.25rem, 3.2vw, 2rem);
  color: var(--text-on-glass); border: 1px solid var(--bezel); border-radius: 22px;
  background: radial-gradient(130% 100% at 15% 0%, var(--glass-top) 0%, var(--glass) 60%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 28px 48px -30px rgba(7, 13, 28, .75);
}
.panel::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, .06) 0%, rgba(255, 255, 255, 0) 34%); }
.panel-title { font-size: .9rem; color: #8b9bcb; }
.readout { display: block; margin-block: 1.5rem 1.4rem; }
.digits { display: flex; justify-content: space-between; gap: clamp(.4rem, 1.8vw, 1.1rem); }
.digit { flex: 1 1 0; min-width: 0; max-width: 6rem; height: auto; aspect-ratio: 5 / 7; overflow: visible; }
.dot { fill: var(--dot-off); transition: fill .22s ease var(--delay, 0ms); }
.dot.on { fill: var(--dot-on); }
.panel[data-state=ready] .digits { filter: drop-shadow(0 0 5px var(--dot-glow)); }
.panel-note { display: grid; gap: .15rem; min-height: 3.1rem; font-size: .95rem; }
.panel-note strong { font-weight: 600; color: #e4ecff; }

/* ---- the packages: a table of facts, not a stack of cards */
.packages { margin-top: clamp(3.5rem, 8vw, 6rem); }
h2 { font-size: 1.6rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.15; }
.lead { margin-top: .5rem; max-width: 36rem; color: var(--muted); }
.package-list { margin: 1.5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.package { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem 4.5rem auto; gap: .75rem 1.25rem; align-items: center;
  padding-block: 1.1rem; border-bottom: 1px solid var(--line); }
.package-name { display: grid; }
.package-name strong { font-weight: 600; }
.package-name span { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.package-arch, .package-size { color: var(--muted); font-size: .95rem; }
.package-actions { display: flex; gap: .5rem; }
.link-button { display: inline-grid; place-items: center; height: 2.5rem; padding: 0 1.1rem; font-weight: 600; text-decoration: none;
  color: var(--on-accent); background: var(--accent); border-radius: 10px; }
.link-button:hover { background: var(--accent-strong); }
.package .secondary { height: 2.5rem; }

.terminal { margin-top: 2.25rem; display: grid; gap: .75rem; justify-items: start; }
.terminal h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.terminal p { max-width: 36rem; color: var(--muted); }
.command { width: 100%; margin: 0; padding: 1rem 1.1rem; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--text-on-glass);
  background: var(--glass); border: 1px solid var(--bezel); border-radius: 12px;
  font: .85rem/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* ---- help: question on the left, answer on the right, like the package table above */
html { scroll-behavior: smooth; }
.help { margin-top: clamp(3.5rem, 8vw, 6rem); scroll-margin-top: 1.5rem; }
.help-list { margin: 1.5rem 0 0; border-top: 1px solid var(--line); }
.help-list > div { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: .5rem 3rem;
  padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
.help-list dt { font-weight: 600; }
.help-list dd { margin: 0; max-width: 42rem; color: var(--muted); }

/* ---- narrow screens */
@media (max-width: 54rem) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .result { position: static; }
  .package { grid-template-columns: 1fr auto; }
  .package-arch, .package-size { display: none; }
  .package-actions { grid-column: 1 / -1; }
  .help-list > div { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 30rem) {
  .field-pair { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .dot { transition: none; }
  html { scroll-behavior: auto; }
}
