/* Fonts load from CSS, so every page gets them even when its HTML is an older cached copy. */
@import url("https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;600&family=Press+Start+2P&display=swap");
/* Game Boy LCD theme: four shades, pixel fonts, dithered ground, double-framed text boxes.
   Type: Press Start 2P for headings, labels, buttons and navigation; Pixelify Sans for all reading text. */
:root {
  --gb0: #e8e9e2; --gb1: #b9bbb1; --gb2: #6e7068; --gb3: #23241f; --hi: #f6f6f1;
  --ink: var(--gb3); --muted: #55574f; --line: var(--gb3); --accent: var(--gb3);
  --pixel: "Press Start 2P", "Courier New", monospace;
  --body: "Pixelify Sans", "Segoe UI", sans-serif;
  --fs-label: .625rem; --fs-ui: .75rem; --fs-h3: .875rem; --fs-h2: 1.125rem;
  --fs-small: .875rem; --fs-body: 1rem; --fs-lead: 1.125rem;
  --ground: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Crect width='24' height='24' fill='%23e8e9e2'/%3E%3Cg fill='%23b9bbb1'%3E%3Crect x='3' y='4' width='2' height='2'/%3E%3Crect x='15' y='15' width='2' height='2'/%3E%3Crect x='18' y='3' width='2' height='1'/%3E%3Crect x='7' y='17' width='1' height='2'/%3E%3C/g%3E%3C/svg%3E");
  --checker: repeating-conic-gradient(var(--gb1) 0 25%, transparent 0 50%) 0 0 / 4px 4px;
  /* Diagram "screens" stay dark in both themes so wire colors keep their contrast. */
  --scr-bg: #23241f; --scr-ink: #e8e9e2; --scr-muted: #b9bbb1; --scr-line: #6e7068; --scr-hover: #34352f;
  color-scheme: light;
  font-family: var(--body); font-size: 16px; color: var(--ink); background: var(--gb0); line-height: 1.55;
}
/* Dark theme: the same four shades, inverted like a backlit Game Boy screen.
   Follows the system setting unless the header toggle picked a theme. */
:root[data-theme=dark] {
  --gb0: #181915; --gb1: #34362f; --gb2: #858879; --gb3: #e4e6dc; --hi: #22231e; --muted: #a6a89d;
  --ground: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Crect width='24' height='24' fill='%23181915'/%3E%3Cg fill='%2334362f'%3E%3Crect x='3' y='4' width='2' height='2'/%3E%3Crect x='15' y='15' width='2' height='2'/%3E%3Crect x='18' y='3' width='2' height='1'/%3E%3Crect x='7' y='17' width='1' height='2'/%3E%3C/g%3E%3C/svg%3E");
  --scr-bg: #0e0f0c; --scr-line: #4a4c44; --scr-hover: #22231e;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --gb0: #181915; --gb1: #34362f; --gb2: #858879; --gb3: #e4e6dc; --hi: #22231e; --muted: #a6a89d;
    --ground: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Crect width='24' height='24' fill='%23181915'/%3E%3Cg fill='%2334362f'%3E%3Crect x='3' y='4' width='2' height='2'/%3E%3Crect x='15' y='15' width='2' height='2'/%3E%3Crect x='18' y='3' width='2' height='1'/%3E%3Crect x='7' y='17' width='1' height='2'/%3E%3C/g%3E%3C/svg%3E");
    --scr-bg: #0e0f0c; --scr-line: #4a4c44; --scr-hover: #22231e;
    color-scheme: dark;
  }
}
#site-theme { width: 40px; height: 40px; padding: 0; border: 3px solid var(--ink); border-radius: 0; background: var(--hi); color: var(--ink); font-size: 1rem; box-shadow: 3px 3px 0 var(--gb1); }
#site-theme:hover:not(:disabled) { transform: none; background: var(--ink); color: var(--hi); box-shadow: 3px 3px 0 var(--gb1); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--ground) var(--gb0); }
main { max-width: 1168px; padding: 0 32px; margin: auto; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 2px; }
::selection { background: var(--ink); color: var(--hi); }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 4px; }
.skip-link { position: absolute; left: 20px; top: -100px; background: var(--ink); color: var(--hi); padding: 12px; z-index: 30; font-family: var(--pixel); font-size: var(--fs-label); }
.skip-link:focus { top: 12px; }

/* Pokémon-style text box: thick outline, inner rule, flat drop shadow. */
.installer, .connection-panel, .model-shell, .circuit, .explore-grid > a, .warning, #status, .safety-grid p {
  background: var(--hi); border: 3px solid var(--ink); border-radius: 6px;
  box-shadow: inset 0 0 0 3px var(--hi), inset 0 0 0 5px var(--ink), 6px 6px 0 var(--gb1);
}

header { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; min-height: 84px; padding: 14px 0; background: var(--gb0); border-bottom: 4px solid var(--ink); box-shadow: 0 4px 0 var(--gb1); }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; font-family: var(--pixel); font-size: var(--fs-ui); letter-spacing: .02em; }
.brand b { font-weight: 400; background: var(--ink); color: var(--hi); padding: 3px 5px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--ink); color: var(--hi); font-family: var(--pixel); font-size: 1.125rem; box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 5px var(--hi), 4px 4px 0 var(--gb1); }
.brand:hover .brand-mark { animation: hop .4s steps(2) 1; }
@keyframes hop { 50% { transform: translateY(-4px); } }
header nav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; font-family: var(--pixel); font-size: var(--fs-label); }
header nav a { display: flex; align-items: center; gap: 6px; padding: 10px 12px; text-decoration: none; }
header nav a::before { content: "▶"; visibility: hidden; font-size: .5rem; }
header nav a:hover::before, header nav a[aria-current=page]::before { visibility: visible; }
header nav a[aria-current=page] { background: var(--ink); color: var(--hi); }
#site-language { width: auto; max-width: 100%; padding: 8px 28px 8px 10px; border: 3px solid var(--ink); border-radius: 0; background: var(--hi); color: var(--ink); font-family: var(--pixel); font-size: var(--fs-label); cursor: pointer; box-shadow: 3px 3px 0 var(--gb1); }

.eyebrow, .header-label { font-family: var(--pixel); font-size: var(--fs-label); letter-spacing: .08em; color: var(--muted); line-height: 1.8; text-transform: uppercase; }
.eyebrow { margin: 0 0 14px; }
dt, .panel-number { font-family: var(--pixel); }
h1, h2 { font-family: var(--pixel); font-weight: 400; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); line-height: 1.35; letter-spacing: 0; margin: 0 0 16px; }
h1 em { font-style: normal; background: var(--ink); color: var(--hi); padding: 0 .15em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
h2 { font-size: var(--fs-h2); line-height: 1.6; letter-spacing: 0; margin: 0; }
.page-heading { padding: 36px 0 28px; }
.page-heading > p:last-child { margin: 0; color: var(--muted); font-size: var(--fs-lead); }

/* Installer */
.install-intro { margin: 8px 0 26px; }
.install-intro > p:last-child { color: var(--muted); margin: 12px 0 0; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.installer { padding: 30px; scroll-margin-top: 110px; }
.panel-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.panel-heading .eyebrow { margin-bottom: 10px; }
.panel-number { font-size: var(--fs-h2); color: var(--gb1); line-height: 1; }
.specs { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 12px; margin: 24px 0 0; padding: 18px 0; border-top: 3px dotted var(--ink); border-bottom: 3px dotted var(--ink); }
dt { font-size: var(--fs-label); color: var(--muted); letter-spacing: .06em; margin-bottom: 8px; }
dd { margin: 0; font-size: var(--fs-body); font-weight: 600; }
.release { padding: 18px 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 14px; color: var(--muted); }
.release strong { font-family: var(--pixel); font-size: var(--fs-ui); font-weight: 400; color: var(--ink); overflow-wrap: anywhere; text-align: right; }
#status { padding: 14px 18px; margin: 0 0 20px; font-size: var(--fs-body); box-shadow: inset 0 0 0 3px var(--hi), inset 0 0 0 5px var(--ink); }
#status::after { content: " ▼"; font-size: .625rem; animation: blink 1s steps(1) infinite; }
#status[data-error="true"] { background: var(--ink); color: var(--hi); box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 5px var(--hi); }
@keyframes blink { 50% { opacity: 0; } }
.warning { display: flex; align-items: start; gap: 14px; padding: 18px; background: var(--checker), var(--hi); box-shadow: inset 0 0 0 3px var(--hi), inset 0 0 0 5px var(--ink); }
.warning > div { background: var(--hi); padding: 2px 6px; }
.warning-mark { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; background: var(--ink); color: var(--hi); font-family: var(--pixel); font-size: var(--fs-ui); }
.warning strong { font-size: var(--fs-body); }
.warning p { margin: 5px 0 0; color: var(--muted); font-size: var(--fs-small); }
.consent { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0; color: var(--muted); cursor: pointer; }
input[type=checkbox] { appearance: none; width: 22px; height: 22px; flex-shrink: 0; margin: 1px 0 0; border: 3px solid var(--ink); background: var(--hi); display: grid; place-items: center; cursor: pointer; }
input[type=checkbox]:checked::after { content: ""; width: 10px; height: 10px; background: var(--ink); }
input[type=checkbox]:disabled { border-color: var(--gb2); background: var(--gb1); cursor: not-allowed; }

button { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; padding: 16px 20px; border: 3px solid var(--ink); border-radius: 4px; font-family: var(--pixel); font-size: var(--fs-ui); line-height: 1.5; color: var(--hi); background: var(--ink); cursor: pointer; box-shadow: 4px 4px 0 var(--gb2); transition: transform .08s steps(1), box-shadow .08s steps(1); }
button span { font-size: var(--fs-ui); }
button:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--gb2); }
button:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--gb2); }
button:disabled { background: var(--gb1); border-color: var(--gb2); color: var(--gb2); box-shadow: none; cursor: not-allowed; border-style: dashed; }
.browser-note { font-size: var(--fs-small); color: var(--muted); text-align: center; margin: 16px 0 0; }
.browser-note span { margin: 0 4px; }

.guide { padding: 22px 0; }
.guide h2 { line-height: 1.7; }
ol { padding: 0; margin: 30px 0; list-style: none; counter-reset: steps; }
li { position: relative; padding: 0 0 24px 50px; counter-increment: steps; }
li:last-child { padding-bottom: 0; }
li::before { content: "0" counter(steps); position: absolute; top: 0; left: 0; width: 32px; height: 32px; display: grid; place-items: center; font: var(--fs-label) var(--pixel); background: var(--ink); color: var(--hi); }
li:not(:last-child)::after { content: ""; position: absolute; top: 38px; bottom: 6px; left: 14px; width: 0; border-left: 4px dotted var(--ink); }
li strong { display: block; padding-top: 4px; font-size: var(--fs-body); }
li p { color: var(--muted); margin: 8px 0 0; }
.compatibility { border-top: 3px dotted var(--ink); padding-top: 20px; }
.compatibility p { color: var(--muted); margin-bottom: 8px; }

.help { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; border-top: 4px solid var(--ink); margin-top: 56px; padding: 32px 0; }
details { border-bottom: 3px dotted var(--ink); }
summary { padding: 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; font-weight: 600; font-size: var(--fs-body); list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "▶"; font-size: .625rem; visibility: hidden; margin-right: -8px; }
summary:hover::before { visibility: visible; }
summary span { font-family: var(--pixel); font-size: var(--fs-ui); margin-left: auto; }
details[open] summary span { transform: rotate(45deg); }
details p { color: var(--muted); margin: 0 0 18px; }

footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; border-top: 4px solid var(--ink); padding: 24px 0 36px; color: var(--muted); font-family: var(--pixel); font-size: var(--fs-label); line-height: 2; }
footer a { text-decoration: none; } footer a:hover { background: var(--ink); color: var(--hi); }
.footer-divider { margin: 0 9px; }

@media (max-width: 850px) { .workspace { gap: 28px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } .installer { padding: 24px; } .panel-number { display: none; } }
/* Medium widths: brand, language and theme on one row, navigation below. */
@media (max-width: 960px) { header nav { order: 3; width: 100%; margin: 0 -12px; } #site-language { margin-left: auto; } }
@media (max-width: 680px) {
  main { padding: 0 16px; } header { min-height: 0; padding: 10px 0; gap: 10px; } .header-label { display: none; }
  header nav { order: 3; width: 100%; margin: 0 -12px; }
  .workspace, .help { grid-template-columns: 1fr; gap: 24px; } .guide { padding: 12px 4px 0; } .guide h2 br { display: none; }
  .help { margin-top: 32px; } .installer { padding: 22px; } .specs { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } #status::after, .brand:hover .brand-mark { animation: none; } }
