@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-400-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-600.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Silkscreen';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/silkscreen-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Silkscreen';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/silkscreen-700.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Handheld design for the GP32 and GP2X sections and the 404 page. */

:root {
  --bg: #121317;
  --bg-raised: #1a1c22;
  --bg-sunk: #0b0c0f;
  --line: #2c3039;
  --line-strong: #3d424e;
  --text: #ece8e0;
  --text-muted: #a39e94;
  --accent: #f2c94c;
  --accent-ink: #15130c;
  --pixel: "Silkscreen", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --wrap: 1120px;
  --radius: 10px;
  color-scheme: dark;
}

/* Each console has its own colour. */
[data-section="gp32"] { --accent: #7c9cff; --accent-ink: #0b1230; }
[data-section="gp2x"] { --accent: #ff8f45; --accent-ink: #2a1203; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip {
  position: absolute; left: 16px; top: -48px;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: 6px; font-weight: 600; z-index: 10;
}
.skip:focus { top: 12px; }

/* Header and footer */

.masthead { border-bottom: 1px solid var(--line); }
.masthead__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }

.wordmark {
  font: 700 1.25rem/1 var(--pixel);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}
.wordmark span { color: var(--accent); }
.wordmark--small { font-size: 0.95rem; }

.nav { display: flex; gap: 4px; }
.nav a {
  font: 400 0.85rem/1 var(--pixel);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
}
.nav a:hover { color: var(--text); background: var(--bg-raised); }
.nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }

.footer { border-top: 1px solid var(--line); margin-top: 72px; color: var(--text-muted); font-size: 0.9rem; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; padding-bottom: 32px; flex-wrap: wrap; }

/* Section page */

.hero { padding: 56px 0 40px; }
.eyebrow {
  margin: 0 0 12px;
  font: 400 0.8rem/1 var(--pixel);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.hero__title {
  margin: 0;
  font: 700 clamp(3.5rem, 12vw, 7.5rem)/0.9 var(--pixel);
  letter-spacing: 0.02em;
  text-shadow: 6px 6px 0 var(--bg-sunk);
}
.hero__intro { margin: 20px 0 0; max-width: 40ch; font-size: 1.2rem; color: var(--text-muted); }

.shelf {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.card__link {
  display: flex; flex-direction: column; height: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: inherit;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}
.card__link:hover { border-color: var(--accent); transform: translateY(-2px); }
.card__text { padding: 16px 6px 6px; }
.card__title { margin: 0; font: 700 1.05rem/1.25 var(--pixel); letter-spacing: 0.02em; }
.card__link:hover .card__title { color: var(--accent); }
.card__meta { margin: 8px 0 0; font: 400 0.8rem/1.4 var(--mono); color: var(--text-muted); }
.card__excerpt { margin: 10px 0 0; font-size: 0.95rem; line-height: 1.55; color: var(--text-muted); }

/* Screens: screenshots shown in a console-style bezel */

.screen {
  background: var(--bg-sunk);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px;
  box-shadow: inset 0 0 0 1px #000;
}
.screen img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #000;
  border-radius: 3px;
}
.screen img.pixelated { image-rendering: pixelated; }
.screen--empty {
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.025) 3px 4px),
    var(--bg-sunk);
}
.screen--empty span { font: 700 1.6rem/1 var(--pixel); color: var(--line-strong); letter-spacing: 0.06em; }
.screen--large { padding: 10px; }

.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.thumbs .screen { padding: 4px; border-radius: 6px; }

/* Release page */

.release {
  display: grid; gap: 28px;
  padding-top: 40px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "side" "body";
}
@media (min-width: 900px) {
  .release {
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-areas: "head side" "body side";
    column-gap: 56px;
    align-items: start;
  }
  .release__side { position: sticky; top: 24px; }
}
.release__head { grid-area: head; }
.release__side { grid-area: side; display: grid; gap: 20px; }
.release__body { grid-area: body; }

.crumbs { margin: 0 0 14px; font: 400 0.8rem/1 var(--pixel); text-transform: uppercase; letter-spacing: 0.08em; }
.crumbs a { text-decoration: none; }
.crumbs a::before { content: "← "; }
.release__title { margin: 0; font: 700 clamp(2rem, 5vw, 3.2rem)/1.05 var(--pixel); letter-spacing: 0.01em; overflow-wrap: anywhere; }
.release__meta { margin: 14px 0 0; font: 400 0.85rem/1.4 var(--mono); color: var(--text-muted); }

.panel { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel__title { margin: 0 0 12px; font: 400 0.8rem/1 var(--pixel); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

.downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.download {
  display: flex; flex-direction: column; gap: 2px;
  padding: 11px 14px 11px 44px;
  position: relative;
  background: var(--bg-sunk);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.download::before {
  /* A pixel-style down arrow. */
  content: "";
  position: absolute; left: 14px; top: 50%;
  width: 16px; height: 16px; margin-top: -8px;
  background: var(--accent);
  clip-path: polygon(37.5% 0, 62.5% 0, 62.5% 50%, 87.5% 50%, 87.5% 62.5%, 75% 62.5%, 75% 75%, 62.5% 75%, 62.5% 87.5%, 37.5% 87.5%, 37.5% 75%, 25% 75%, 25% 62.5%, 12.5% 62.5%, 12.5% 50%, 37.5% 50%);
}
.download:hover { border-color: var(--accent); }
.download__label { font-weight: 600; line-height: 1.3; }
.download__file { font: 400 0.8rem/1.4 var(--mono); color: var(--text-muted); overflow-wrap: anywhere; }

/* Post text */

.prose { max-width: 68ch; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose pre, .prose table { margin: 0 0 1.1em; }
.prose h2 {
  margin: 2em 0 0.7em;
  font: 700 1.1rem/1.3 var(--pixel);
  letter-spacing: 0.03em;
  color: var(--accent);
}
.prose ul { padding-left: 1.3em; }
.prose li { margin: 0.25em 0; }
.prose li::marker { color: var(--accent); }
.prose strong { color: #fff; font-weight: 600; }
.prose code, .prose pre { font-family: var(--mono); font-size: 0.88rem; }
.prose pre {
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.5;
  white-space: pre;
}
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-raised); font-weight: 600; }

/* Older and newer releases */

.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.step { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.step:hover { border-color: var(--accent); }
.step--next { text-align: right; grid-column: 2; }
.step__label { font: 400 0.75rem/1 var(--pixel); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.step--prev .step__label::before { content: "← "; }
.step--next .step__label::after { content: " →"; }
.step__title { font-weight: 600; line-height: 1.3; }

/* 404 */

.lost { padding: 72px 0 24px; }
.lost__code {
  margin: 0;
  font: 700 clamp(6rem, 26vw, 13rem)/0.85 var(--pixel);
  color: var(--accent);
  text-shadow: 8px 8px 0 var(--bg-sunk);
}
.lost__title { margin: 28px 0 0; font: 700 clamp(1.6rem, 4vw, 2.2rem)/1.15 var(--pixel); }
.lost__links { display: flex; flex-wrap: wrap; gap: 10px; margin: 32px 0 0; }

.button {
  font: 400 0.9rem/1 var(--pixel);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--text);
  text-decoration: none;
}
.button:hover { border-color: var(--accent); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .card__link { transition: none; }
  .card__link:hover { transform: none; }
}
