/* Tokens, base styles, the page frame and the sections below the installer.
   The installer card itself is in wizard.css. */

@font-face {
  /* Mona Sans (SIL OFL 1.1, fonts/OFL.txt), cut to Latin at width 112 and
     renamed as the licence asks of modified versions. */
  font-family: "Scout Display";
  src: url("fonts/ScoutDisplay.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}

:root {
  --bg: #f9f8f5;
  --surface: #ffffff;
  --surface-2: #f2f0eb;
  --text: #17181c;
  --muted: #4c505a;
  --border: #dcdad3;
  --border-strong: #b9b6ad;
  --accent: #1e3a6e;
  --accent-text: #ffffff;
  --accent-soft: #e8edf6;
  --sky: #22c3e6;
  --sky-soft: rgba(34, 195, 230, 0.22);
  --warn-bg: #fff6e0;
  --warn-border: #c98a00;
  --warn-text: #6b4a00;
  --ok-bg: #e5f4ec;
  --ok-text: #1b5e3c;
  --danger: #a3261b;
  --danger-bg: #fbebe8;
  --code-bg: #efede7;
  --art-line: #4c505a;
  --art-fill: #f2f0eb;
  --art-module: #e4e1da;
  --led-cyan: #22d3ee;
  --led-yellow: #f5b800;
  --shadow: 0 1px 2px rgba(23, 24, 28, 0.04), 0 12px 32px rgba(23, 24, 28, 0.07);
  --display: "Scout Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121317;
    --surface: #1c1e23;
    --surface-2: #24272d;
    --text: #ecebe7;
    --muted: #b4b6bd;
    --border: #363941;
    --border-strong: #4c505a;
    --accent: #a9c1f5;
    --accent-text: #0d1730;
    --accent-soft: rgba(169, 193, 245, 0.12);
    --sky-soft: rgba(34, 195, 230, 0.28);
    --warn-bg: #2b2412;
    --warn-border: #e0a82e;
    --warn-text: #f3d48f;
    --ok-bg: #16291f;
    --ok-text: #8fdcb2;
    --danger: #ff9c8f;
    --danger-bg: #36201d;
    --code-bg: #2a2c32;
    --art-line: #b4b6bd;
    --art-fill: #24272d;
    --art-module: #2f3238;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.top, main, .foot {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 16px;
}

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.1; font-weight: 760; margin: 0 0 12px; }
h2 { font-size: 1.45rem; line-height: 1.25; font-weight: 700; margin: 0 0 8px; }
h3 { font-size: 1.1rem; line-height: 1.3; font-weight: 680; margin: 0 0 4px; }
h2:focus { outline: none; }
p { margin: 0 0 12px; }
ul, ol { padding-left: 1.3rem; margin: 0 0 12px; }
li + li { margin-top: 6px; }
b { font-weight: 650; }
code {
  font: 0.9em var(--mono);
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
}

a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 1; background: var(--surface); padding: 8px 12px; }
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
[hidden] { display: none !important; }

/* Header */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 28px;
}
.brand { display: block; line-height: 0; }
.lockup { display: block; width: 224px; max-width: 100%; height: auto; }
.product {
  margin: 0;
  font: 650 0.95rem var(--display);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.version {
  font: 600 0.8rem var(--mono);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.hero { margin: clamp(28px, 6vw, 48px) 0 28px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 36rem; margin: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 12px;
  border: 2px solid var(--accent);
  font: 650 1rem/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: filter 120ms, background-color 120ms;
}
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.secondary:hover { background: var(--accent-soft); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.big { min-height: 54px; padding: 12px 32px; font-size: 1.08rem; }
.btn.text {
  border-color: transparent;
  background: none;
  color: var(--accent);
  padding: 8px 10px;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

/* Sections below the card */
.below { margin-top: 56px; }
.below > p { color: var(--muted); }

.board-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 10px;
}
.board-list li + li { margin-top: 0; }
.board-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.board-card h3 { font-size: 1rem; }
.board-art { padding-top: 4px; }
.board-meta, .board-note { font-size: 0.92rem; color: var(--muted); margin: 0 0 6px; }
.board-note.blocked { color: var(--danger); }
.board-buy { font-size: 0.92rem; font-weight: 600; }

#help details {
  border-top: 1px solid var(--border);
  padding: 4px 0;
}
#help details:last-of-type { border-bottom: 1px solid var(--border); }
#help summary {
  cursor: pointer;
  font-weight: 650;
  padding: 12px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
#help summary::-webkit-details-marker { display: none; }
#help summary::after { content: "+"; font: 600 1.3rem/1 var(--display); color: var(--accent); }
#help details[open] summary::after { content: "\2212"; }
#help details > :not(summary) { color: var(--muted); }

.name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 8px; }
.status { color: var(--muted); font-size: 0.95rem; min-height: 1px; }
.board-name { font: 700 2.2rem/1.1 var(--mono); letter-spacing: 0.04em; }
.board-name.small { font-size: 1.6rem; }

.facts { padding-left: 1.1rem; }
.facts li { color: var(--muted); }
.facts b { color: var(--text); }

.foot {
  margin-top: 56px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 0.9rem;
}
.foot p { padding-top: 16px; border-top: 1px solid var(--border); }

@media (max-width: 520px) {
  .board-card { grid-template-columns: 80px 1fr; gap: 14px; }
}
