@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/atkinson-hyperlegible-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/atkinson-hyperlegible-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Doto'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/doto-latin-700-normal.woff2) format('woff2'); }

:root {
  --silver: #f1f2f0;      /* page */
  --silver-2: #e3e6e6;    /* quiet panels */
  --rule: #c9ced1;
  --ink: #1e2427;         /* gunmetal text */
  --muted: #5e676c;
  --blue: #2d5bd0;        /* remote arrow-key blue: links, buttons */
  --blue-dark: #1f44a8;
  --fascia: #23292c;      /* player front panel (hero only) */
  --vfd: #79f0dc;         /* display glow (hero only) */
  --key: #dfe2e3;
  --key-edge: #a9b0b4;

  --font: 'Atkinson Hyperlegible', system-ui, sans-serif;
  /* scale based on 1.25 */
  --s-1: 0.875rem; --s0: 1.0625rem; --s1: 1.33rem; --s2: 1.66rem; --s3: 2.07rem; --s4: 2.6rem;
  --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--silver); color: var(--ink);
  font-family: var(--font); font-size: var(--s0); line-height: 1.55;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: var(--s3); }
h2 { font-size: var(--s2); }
h3 { font-size: var(--s1); }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }
.prose { max-width: var(--measure); }
.small { font-size: var(--s-1); color: var(--muted); }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: #fff; padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; }

/* ---- header ---- */
.site-head { border-bottom: 1px solid var(--rule); background: var(--silver); }
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 0.9rem; }
.logo { display: flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: var(--s1); letter-spacing: -0.02em; }
.logo:hover { color: var(--ink); }
.site-head ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-head nav a { color: var(--ink); text-decoration: none; padding-block: 0.3rem; border-bottom: 2px solid transparent; }
.site-head nav a:hover, .site-head nav a[aria-current] { border-bottom-color: var(--blue); }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 1.25rem 0 0; padding: 0; font-size: var(--s-1); color: var(--muted); }
.crumbs li + li::before { content: '/'; margin-right: 0.35rem; color: var(--rule); }

main { padding-bottom: 4rem; }

/* ---- footer ---- */
.site-foot { border-top: 1px solid var(--rule); background: var(--silver-2); padding-block: 2.5rem; font-size: var(--s-1); }
.foot-inner { display: grid; gap: 1rem 3rem; grid-template-columns: 1fr; }
.foot-inner > p:first-child { max-width: 60ch; }
.foot-inner ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
@media (min-width: 48rem) { .foot-inner { grid-template-columns: 2fr 1fr; } .foot-inner .small { grid-column: 1 / -1; } }

/* ---- remote keys: the one loud thing ---- */
kbd.key {
  display: inline-block; min-width: 1.7em; padding: 0.05em 0.45em 0.1em; margin: 0.1em 0;
  font: 700 0.86em/1.45 var(--font); text-align: center; color: var(--ink);
  background: var(--key); border: 1px solid var(--key-edge); border-bottom-width: 3px;
  border-radius: 0.55em; white-space: nowrap; vertical-align: 0.05em;
}
kbd.key.digit { border-radius: 999px; min-width: 1.75em; padding-inline: 0.3em; }

/* ---- buttons & inputs ---- */
.btn {
  display: inline-block; font: 700 var(--s0)/1 var(--font); color: #fff; background: var(--blue);
  border: 0; border-radius: 0.5rem; padding: 0.8rem 1.2rem; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--blue-dark); color: #fff; }
label { font-weight: 700; display: block; margin-bottom: 0.35rem; }
input[type=search] {
  width: 100%; font: var(--s0)/1.4 var(--font); color: var(--ink); background: #fff;
  border: 1px solid var(--key-edge); border-radius: 0.5rem; padding: 0.7rem 0.85rem;
}

/* ---- method blocks (brand + model pages) ---- */
.method p { margin: 0 0 0.35em; max-width: var(--measure); }
.method .para { margin-bottom: 1em; }
.method + .method { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px dashed var(--rule); }
.method h3 { font-size: var(--s0); color: var(--muted); margin-bottom: 0.6rem; }
.incomplete-note { background: var(--silver-2); border-left: 4px solid var(--key-edge); padding: 0.75rem 1rem; max-width: var(--measure); font-size: var(--s-1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- search box ---- */
.search { position: relative; max-width: 40rem; }
.search-row { display: flex; gap: 0.5rem; }
.search-row input { flex: 1; min-width: 0; }
.search.large input { font-size: var(--s1); padding: 0.85rem 1rem; }
.search.large .btn { font-size: var(--s1); padding-inline: 1.4rem; }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; margin: 0.35rem 0 0; padding: 0.35rem 0;
  list-style: none; background: #fff; border: 1px solid var(--key-edge); border-radius: 0.5rem;
  box-shadow: 0 10px 30px -12px rgb(30 36 39 / 0.45); z-index: 5; max-height: 22rem; overflow-y: auto;
}
.suggest li { margin: 0; }
.suggest a { display: block; padding: 0.5rem 0.9rem; color: var(--ink); text-decoration: none; }
.suggest a b { font-weight: 700; }
.suggest a span { color: var(--muted); }
.suggest [aria-selected=true] a, .suggest a:hover { background: var(--silver-2); }
.suggest .empty { padding: 0.5rem 0.9rem; color: var(--muted); }

/* ---- brand A–Z ---- */
.letters { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 2rem; }
.letters a {
  display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 999px;
  background: var(--key); border: 1px solid var(--key-edge); border-bottom-width: 3px;
  color: var(--ink); text-decoration: none; font-weight: 700;
}
.letters a:hover { background: #fff; color: var(--blue); }
.groups { columns: 15rem auto; column-gap: 2.5rem; }
.group { break-inside: avoid; margin-bottom: 1.6rem; scroll-margin-top: 1rem; }
.group h3 { font-size: var(--s1); margin: 0 0 0.35rem; padding-bottom: 0.2rem; border-bottom: 2px solid var(--ink); }
.group ul { list-style: none; margin: 0; padding: 0; }
.group li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; border-bottom: 1px solid var(--rule); }
.count { color: var(--muted); font-size: var(--s-1); font-variant-numeric: tabular-nums; }

/* ---- "no luck" box ---- */
.rf-box { background: var(--silver-2); border-radius: 0.75rem; padding: 1.25rem 1.4rem; max-width: var(--measure); }
.rf-box h2 { font-size: var(--s1); }
.rf-box .small { margin: 0.6rem 0 0; }

/* ---- home: player front panel ---- */
.fascia { background: var(--fascia); color: #e9eeee; padding-block: 3rem 3.25rem; border-bottom: 4px solid #151a1c; }
.fascia-inner { display: grid; gap: 2rem 4rem; align-items: center; }
.intro { display: grid; gap: 1.1rem; }
.fascia h1 { font-size: clamp(var(--s3), 5vw, var(--s4)); max-width: 20ch; margin: 0; color: #fff; }
.lede { font-size: var(--s1); line-height: 1.4; max-width: 46ch; color: #c9d1d3; margin: 0; }
.fascia label { color: #c9d1d3; font-weight: 400; }
.stats { font-size: var(--s-1); color: #9aa5a9; margin: 0; }
.panel { display: grid; gap: 1rem; justify-items: start; }
.vfd {
  width: fit-content; padding: 0.55rem 1.1rem 0.45rem; border-radius: 0.4rem;
  background: #0d1214; box-shadow: inset 0 2px 10px rgb(0 0 0 / 0.7), 0 0 0 1px #3a4246;
}
.vfd-text {
  font-family: 'Doto', monospace; font-weight: 700; font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  letter-spacing: 0.06em; color: var(--vfd); text-shadow: 0 0 6px rgb(121 240 220 / 0.6), 0 0 18px rgb(121 240 220 / 0.25);
  display: inline-block; min-width: 11ch; white-space: pre;
}
.tray, .panel-keys { display: none; }
@media (min-width: 62rem) {
  .fascia-inner { grid-template-columns: 1.15fr 1fr; }
  .panel { order: 2; justify-items: stretch; padding: 1.5rem; border-radius: 0.75rem; background: #2b3236; box-shadow: inset 0 1px 0 #3d464a, 0 0 0 1px #171c1e; }
  .tray { display: block; height: 0.9rem; border-radius: 0.3rem; background: #161b1d; box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.8); }
  .vfd { width: auto; text-align: center; padding-block: 1.1rem 0.9rem; }
  .vfd-text { font-size: 2.6rem; }
  .panel-keys { display: flex; gap: 0.7rem; justify-content: flex-end; }
  .panel-keys span { width: 1.6rem; height: 1.6rem; border-radius: 999px; background: #3a4246; box-shadow: inset 0 -2px 0 #1b2023, 0 0 0 1px #4a5458; }
  .panel-keys .play { background: #2d5bd0; box-shadow: inset 0 -2px 0 #1f44a8; }
}
.how { padding-block: 3rem 1rem; }
.steps { margin: 0 0 1rem; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 1rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.steps li { counter-increment: s; position: relative; padding-left: 2.6rem; max-width: 34ch; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -0.1rem;
  display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 999px;
  background: var(--key); border: 1px solid var(--key-edge); border-bottom-width: 3px; font-weight: 700;
}
.steps strong { display: block; }
.home-brands { padding-top: 2rem; }

/* ---- page heads ---- */
.page-head { padding-block: 1.5rem 2rem; }
.simple-page, .search-page { padding-top: 1.5rem; }

/* ---- brand page ---- */
.brand-page .page-head { padding-block: 1.5rem 1rem; }
.model-jump { margin-bottom: 1rem; }
.model-jump ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.entry { padding-block: 2rem; border-top: 2px solid var(--ink); scroll-margin-top: 1rem; }
.entry h2 { font-size: var(--s2); }
.entry h2 a { color: var(--ink); text-decoration: none; }
.entry h2 a:hover { color: var(--blue); text-decoration: underline; }
.brand-page .rf-box { margin-top: 2rem; }

/* ---- model page ---- */
.model-page { display: grid; gap: 2.5rem 4rem; padding-top: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 62rem) {
  .model-page { grid-template-columns: minmax(0, 1fr) 20rem; }
  .others { grid-column: 1 / -1; }
}
.model-page .page-head { padding: 0; margin-bottom: 1.5rem; }
.model-page .page-head h1 { max-width: 24ch; }
.covers { color: var(--muted); max-width: var(--measure); }
.after { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule); max-width: var(--measure); }
.side { display: grid; gap: 1.5rem; align-content: start; }
.tips h2 { font-size: var(--s1); }
.tips ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.4rem; font-size: var(--s-1); }
.others { border-top: 2px solid var(--ink); padding-top: 1.5rem; }
.others h2 { font-size: var(--s1); }
.others ul { list-style: none; margin: 0; padding: 0; columns: 12rem auto; column-gap: 2rem; }
.others li { padding: 0.15rem 0; break-inside: avoid; }

/* ---- search results ---- */
#results { margin-top: 2rem; max-width: var(--measure); }
#results ul { list-style: none; padding: 0; margin: 0; }
#results li { padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
#results span { color: var(--muted); }

/* ---- region codes ---- */
.region-page h2 { margin-top: 2.2rem; }
.region-page h3 { margin-top: 1.5rem; font-size: var(--s0); }
.codes { border-collapse: collapse; width: 100%; margin-bottom: 1rem; }
.codes th, .codes td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--rule); }
.codes thead th { font-size: var(--s-1); color: var(--muted); border-bottom: 2px solid var(--ink); }
.codes tbody th { width: 4rem; }
