/* SPDX-License-Identifier: GPL-3.0-or-later */
/* The explorer's language (viewer/style.css): the page follows the keyboard's theme through the same
   tokens, set by live/page.js from viewer/home/tokens.js. Shared by Firmware and Demo. */
@font-face { font-family: Fraunces; src: url('/assets/fonts/Fraunces-latin.woff2') format('woff2'); font-weight: 300 500; font-display: swap; }
@font-face { font-family: Inter; src: url('/assets/fonts/Inter-latin.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url('/assets/fonts/JetBrainsMono-latin.woff2') format('woff2'); font-weight: 400 500; font-display: swap; }
@property --bg0 { syntax: "<color>"; inherits: true; initial-value: #3a344d; }
@property --bg1 { syntax: "<color>"; inherits: true; initial-value: #2b253b; }
@property --bg2 { syntax: "<color>"; inherits: true; initial-value: #1f1a2c; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #f4f2fb; }
@property --muted { syntax: "<color>"; inherits: true; initial-value: #b9b3cf; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #f28f1f; }
@property --on { syntax: "<color>"; inherits: true; initial-value: #1b1923; }
:root { --bg0: #3a344d; --bg1: #2b253b; --bg2: #1f1a2c; --ink: #f4f2fb; --muted: #b9b3cf; --accent: #f28f1f; --on: #1b1923;
  --line: color-mix(in srgb, var(--ink) 12%, transparent); --soft: color-mix(in srgb, var(--ink) 7%, transparent);
  --sel: color-mix(in srgb, var(--accent) 15%, transparent); --card: color-mix(in srgb, var(--on) 52%, transparent); --field: color-mix(in srgb, var(--on) 74%, transparent);
  --warn: #f3c46b; --serif: Fraunces, Georgia, "Times New Roman", serif; --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  transition: --bg0 .6s ease-out, --bg1 .6s ease-out, --bg2 .6s ease-out, --ink .6s ease-out, --muted .6s ease-out, --accent .6s ease-out, --on .6s ease-out;
  color-scheme: dark; }
:root[data-scheme=light] { color-scheme: light; --warn: #8a5a12; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { color: var(--ink); font: 400 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background: radial-gradient(1100px 820px at 34% 30%, var(--bg0) 0, var(--bg1) 58%, var(--bg2) 100%) var(--bg1) fixed; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: 999px; }
button:disabled { opacity: .38; cursor: not-allowed; }
button, a, summary, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.micro { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.micro:empty { display: none; }
.lab { margin: 0; font: 500 11px/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.error { color: var(--warn) !important; }

/* top bar: the lockup back home, the site's sections, then this page's own link */
.bar { position: relative; z-index: 5; display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); align-items: center; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 4px max(30px, env(safe-area-inset-left)); }
.nav-home { justify-self: start; display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--ink); text-decoration: none; border-radius: 12px; }
.nav-home .mark { width: 36px; height: 30px; }
.nav-home .word, .nav-home .kbd { font-family: var(--serif); font-variation-settings: "SOFT" 100, "opsz" 144; line-height: 1; white-space: nowrap; }
.nav-home .word { font-size: 29px; font-weight: 400; letter-spacing: -.01em; transform: translateY(-1px); }
.nav-home .kbd { font-size: 26px; font-weight: 300; transform: translateY(1px); }
.app-nav { display: flex; gap: 4px; justify-self: center; }
.app-nav a { position: relative; display: grid; place-items: center; min-width: 64px; min-height: 44px; padding: 0 14px; border-radius: 999px; font-size: 15.5px; font-weight: 500; color: var(--muted); text-decoration: none; }
.app-nav a::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: transparent; }
.app-nav a:hover { color: var(--ink); }
.app-nav a[aria-current=page] { color: var(--ink); font-weight: 600; }
.app-nav a[aria-current=page]::after { background: var(--accent); }
.bar-tools { justify-self: end; display: flex; align-items: center; gap: 2px; min-width: 0; }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--card); color: var(--ink); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.chip:hover { background: var(--field); }

/* choices and actions, as in Build */
.segments { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; max-width: 100%; }
.segments button { min-height: 40px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: 12.5px; font-weight: 500; line-height: 1.4; }
.segments button:hover:not(:disabled) { color: var(--ink); }
.segments button[aria-pressed=true] { border-color: var(--ink); background: var(--bg0); color: var(--ink); }
.primary { min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--ink); color: var(--bg0); font-size: 13px; font-weight: 500; }
.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 86%, var(--accent)); }
.soft { min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--soft); font-size: 13px; font-weight: 500; }
.soft:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.link { color: var(--accent); font-size: 12.5px; font-weight: 500; padding: 0 2px; border-radius: 6px; }
/* The taller tap area is for links on their own line; one inside a sentence keeps the paragraph's line spacing. */
.link { min-height: 32px; }
p .link, .hint .link { min-height: 0; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.go { color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.go:hover { text-decoration: underline; text-underline-offset: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.field input, .field select { min-height: 40px; min-width: 0; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-size: 13px; }
details { border-top: 1px solid var(--line); }
summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 12px 0; font-size: 13px; font-weight: 500; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; margin-left: auto; font-size: 18px; font-weight: 400; color: var(--muted); }
details[open] > summary::after { content: "−"; }
details[open] { padding-bottom: 12px; }

/* the nice!view as it is: 68 × 160 firmware pixels at a whole-number scale, in the Flan frame */
.bezel { padding: 6px; border-radius: 8px; background: linear-gradient(145deg, #ded0af, #aa916c); box-shadow: 0 3px 10px #0002, inset 0 0 0 1px #c9b58b; }
.bezel canvas { display: block; width: calc(68px * var(--scale, 1)); height: calc(160px * var(--scale, 1)); image-rendering: pixelated; background: #111; outline: 1px solid #342e23; }
figure { margin: 0; min-width: 0; text-align: center; }
figcaption { margin-top: 8px; font-size: 12px; font-weight: 500; }
figcaption small { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: var(--muted); }

@media (max-width: 760px) {
  .bar { grid-template-columns: 1fr auto; padding-inline: 16px; }
  .app-nav { grid-row: 2; grid-column: 1 / -1; justify-self: start; gap: 0; margin-left: -10px; }
  .app-nav a { font-size: 15px; padding: 0 10px; }
  .nav-home .kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) { :root { transition: none; } * { scroll-behavior: auto !important; } }

/* Shared catalog navigation: no floating panels and no horizontal strip to discover. */
.pagination{display:flex;align-items:center;justify-content:center;gap:4px;padding:10px 0;flex:none;flex-wrap:wrap;color:var(--muted);font-size:11px}.pagination .page-range{margin-right:auto;white-space:nowrap;font-variant-numeric:tabular-nums}.pagination button{min-width:30px;min-height:32px;padding:5px 8px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--ink);font:inherit;cursor:pointer}.pagination button[aria-current=page]{background:var(--ink);color:var(--bg0)}.pagination button:disabled{opacity:.3;cursor:default}.pagination button:hover:not(:disabled):not([aria-current]){background:var(--soft)}
input[type=search]{width:100%;min-width:0;min-height:36px;padding:8px 10px;border:1px solid var(--line);border-radius:7px;background:var(--field,var(--surface));color:var(--ink);font:12px var(--sans,Inter,sans-serif)}
@media(max-width:480px){.pagination .page-range{width:100%;text-align:center;margin-right:0}.pagination button{min-width:32px;min-height:36px}}

.game-controls{display:flex;flex-wrap:wrap;gap:.5rem;padding:.75rem;border:1px solid var(--line);border-radius:.75rem;outline-offset:3px}.game-controls p{flex-basis:100%;margin:0 0 .25rem}.game-controls button{touch-action:none}

#game-controls{width:100%;min-width:0}.game-controls{gap:.6rem}.game-controls p{font-size:12px;line-height:1.5}.game-buttons{display:flex;gap:6px;width:100%}.game-buttons button{flex:1;min-width:0;min-height:36px;padding:6px 8px;border:1px solid var(--line);border-radius:7px;background:var(--field);font-size:12px;touch-action:none}.game-buttons button:hover,.game-buttons button:active{background:var(--soft);border-color:var(--accent)}.game-controls [data-game-status]{flex-basis:100%;font-size:11px;color:var(--muted)}
