@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&display=swap");

:root {
  --bg: #15132a; --bg2: #1c1938; --panel: #221f42; --line: #37325f; --line2: #4a4478;
  --text: #eceaf6; --muted: #a8a4c8; --faint: #6f6a99;
  --amber: #ffb23e; --amber-2: #ffc970; --amber-ink: #2b1a00;
  --cyan: #3fd8ff; --pink: #ff5fa8; --green: #39d98a; --red: #ff6b6b;
  --r-bezel: 18px; --r-ctl: 10px; --r-box: 14px;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background: radial-gradient(1200px 600px at 80% -10%, #262052 0%, transparent 60%), var(--bg); }
a { color: var(--amber-2); text-underline-offset: 3px; }
a:hover { color: var(--amber); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .88rem; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.1rem var(--display); color: var(--text); text-decoration: none; }
.brand .dots { display: grid; grid-template-columns: repeat(3, 6px); gap: 2px; }
.brand .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.brand .dots i:nth-child(2n) { background: var(--cyan); } .brand .dots i:nth-child(5) { background: var(--pink); }
nav.top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
main { padding-bottom: 80px; }

/* ---------- controls ---------- */
button, .btn { font: 700 .95rem var(--body); border: 1px solid var(--line2); background: var(--panel); color: var(--text);
  padding: 10px 16px; border-radius: var(--r-ctl); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
button:hover, .btn:hover { border-color: var(--muted); color: var(--text); }
.btn.primary, button.primary { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.btn.primary:hover, button.primary:hover { background: var(--amber-2); color: var(--amber-ink); }
.btn.ghost, button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover, button.ghost:hover { color: var(--text); border-color: var(--line); }
button.danger { color: var(--red); border-color: #5a2d45; background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-ctl);
  padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--amber); outline: none; }
label.field { display: block; margin: 0 0 14px; }
label.field > span { display: block; font-size: .88rem; color: var(--muted); margin-bottom: 6px; }
.help { font-size: .82rem; color: var(--faint); margin-top: 5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked + span { background: var(--amber); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--amber-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- the LED display (the star of the show) ---------- */
.bezel { background: linear-gradient(#0c0b18, #07060f); border: 1px solid #2c284f; border-radius: var(--r-bezel); padding: 14px;
  box-shadow: 0 30px 80px -30px #000, inset 0 1px 0 #3a3566; }
.bezel img, .bezel canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; border-radius: 4px; background: #121212; }
.bezel.w64 { max-width: 320px; } .bezel.w64x32 { max-width: 320px; }
.bezel .cap { display: flex; justify-content: space-between; font-size: .78rem; color: var(--faint); margin-top: 10px; }
.bezel.loading img { opacity: .35; }

/* ---------- splash ---------- */
.hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; padding: 40px 0 30px; }
.hero .lede { font-size: 1.15rem; color: var(--muted); }
.paths { display: grid; gap: 12px; margin-top: 28px; }
.path { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; text-align: left; width: 100%;
  padding: 16px 18px; border-radius: var(--r-box); background: var(--bg2); border: 1px solid var(--line); color: var(--text); font-weight: 400; }
.path:hover { border-color: var(--amber); }
.path .ic { font-size: 1.6rem; text-align: center; }
.path strong { font: 700 1.05rem var(--display); display: block; }
.path small { color: var(--muted); font-size: .9rem; }
.auth { max-width: 420px; margin: 10px auto 0; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-box); padding: 26px; }
.google { width: 100%; justify-content: center; background: #fff; color: #1f1f1f; border-color: #fff; }
.google:hover { background: #f1f1f1; color: #1f1f1f; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: .85rem; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 4px; margin-bottom: 18px; }
.tabs button { flex: 1; justify-content: center; border: 0; background: transparent; color: var(--muted); padding: 8px; }
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--text); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 16px; } .hero .bezel { order: -1; } }

/* ---------- wizard ---------- */
.wizard { display: grid; grid-template-columns: 1fr 380px; gap: 36px; align-items: start; margin-top: 10px; }
.wizard aside { position: sticky; top: 20px; }
.steps { display: flex; gap: 6px; margin: 6px 0 26px; }
.steps i { height: 4px; flex: 1; border-radius: 4px; background: var(--line); }
.steps i.done { background: var(--amber); }
.wiz-nav { display: flex; justify-content: space-between; margin-top: 28px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.choice { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--r-box); border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); text-align: left; font-weight: 400; align-items: flex-start; }
.choice[aria-pressed="true"] { border-color: var(--amber); background: #2a2340; box-shadow: inset 0 0 0 1px var(--amber); }
.choice .shape { background: #0c0b18; border: 1px solid var(--line2); border-radius: 3px; background-image: radial-gradient(var(--amber) 0.9px, transparent 1.2px); background-size: 6px 6px; }
.choice b { font-family: var(--display); }
.choice small { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.tag { font-size: .72rem; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line2); color: var(--muted); }
.results { border: 1px solid var(--line); border-radius: var(--r-ctl); margin-top: 6px; overflow: hidden; }
.results button { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: var(--bg2); font-weight: 400; }
.results button:last-child { border-bottom: 0; }
.results button:hover { background: var(--panel); }
@media (max-width: 900px) { .wizard { grid-template-columns: 1fr; } .wizard aside { position: static; order: -1; } }

/* ---------- dashboard ---------- */
.grid2 { display: grid; grid-template-columns: 400px 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.box { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-box); padding: 20px; margin-bottom: 18px; }
.box > h3:first-child { margin-top: 0; }
.dev-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.subnav button { border: 0; border-radius: 0; background: none; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid transparent; }
.subnav button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--amber); }
.applist { list-style: none; margin: 0; padding: 0; }
.applist > li { border: 1px solid var(--line); border-radius: var(--r-ctl); margin-bottom: 8px; background: var(--bg); }
.applist .head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.applist .emoji { font-size: 1.3rem; width: 28px; text-align: center; }
.applist .name { font-weight: 700; }
.applist .order button { padding: 4px 8px; font-size: .8rem; }
.applist .body { padding: 4px 14px 14px 50px; }
.applist li.off .name, .applist li.off .emoji { opacity: .45; }
.secs { width: 70px; }
.sched { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 14px; margin-bottom: 10px; background: var(--bg); }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days button { padding: 6px 9px; font-size: .82rem; border-radius: 8px; }
.days button[aria-pressed="true"] { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.code-input { font: 800 2rem var(--display); letter-spacing: .35em; text-align: center; text-transform: uppercase; padding: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px;
  border-radius: 99px; font-weight: 700; z-index: 50; box-shadow: 0 10px 30px #0008; }
.toast.err { background: var(--red); color: #fff; }
.banner { border: 1px solid #6a4a1a; background: #2b2215; color: var(--amber-2); padding: 12px 16px; border-radius: var(--r-ctl); margin-bottom: 16px; }
.empty { text-align: center; padding: 40px 20px; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: .88em; background: var(--bg); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }

/* ---------- guide ---------- */
.guide { max-width: 760px; }
.guide section { padding: 26px 0; border-top: 1px solid var(--line); }
.guide ol, .guide ul { padding-left: 1.3em; } .guide li { margin-bottom: .45em; }
.parts { width: 100%; border-collapse: collapse; margin: 10px 0 6px; }
.parts td, .parts th { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.parts th { color: var(--muted); font-weight: 400; font-size: .88rem; }
.flasher { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-box); padding: 20px; }
pre { background: #0c0b18; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 14px; overflow-x: auto; font-size: .85rem; }
.toc { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }

/* ---------- guide layout (sticky contents + numbered steps) ---------- */
.guide-head { padding: 10px 0 6px; }
.guide-layout { display: grid; grid-template-columns: 210px 1fr; gap: 40px; align-items: start; }
.toc-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.toc-title { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 0 0 8px; }
.toc-side a { color: var(--muted); text-decoration: none; font-size: .92rem; padding: 7px 10px; border-radius: 8px; border-left: 2px solid transparent; }
.toc-side a:hover { color: var(--text); background: var(--bg2); }
.toc-side a[aria-current] { color: var(--amber); border-left-color: var(--amber); background: var(--bg2); }
.guide h2 { display: flex; align-items: center; gap: 12px; }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--amber); color: var(--amber-ink);
  font-size: .95rem; font-weight: 800; display: grid; place-items: center; }
.guide section:first-child { border-top: 0; padding-top: 6px; }
.guide h3 { margin-top: 22px; }
.guide details { border: 1px solid var(--line); border-radius: var(--r-ctl); margin-bottom: 8px; background: var(--bg2); }
.guide details summary { padding: 12px 14px; cursor: pointer; font-weight: 700; }
.guide details summary::marker { color: var(--amber); }
.guide details[open] summary { border-bottom: 1px solid var(--line); }
.guide details > *:not(summary) { padding: 0 14px; }
.guide details > p { margin: 12px 0; }
.guide details ol { padding: 14px 14px 14px 34px; }
@media (max-width: 800px) { .guide-layout { grid-template-columns: 1fr; gap: 16px; } .toc-side { position: static; flex-direction: row; flex-wrap: wrap; } .toc-side .toc-title { width: 100%; margin-bottom: 2px; } }

/* ---------- preview: the screens in rotation ---------- */
.preview .frames { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: .8rem; padding: 5px 10px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); font-weight: 400; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-selected="true"] { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 700; }
