@font-face {
  font-family: 'EightBit Atari';
  src: url('../fonts/eightbit-atari-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #191816;
  --paper: #f1eadb;
  --paper-deep: #ddd1b9;
  --red: #e74739;
  --red-dark: #a92f27;
  --red-on-blue: #ffb4aa;
  --gold: #e3a43b;
  --teal: #2e6e6a;
  --basic-blue: #244b9b;
  --basic-blue-deep: #193979;
  --basic-text: #f3f7ff;
  --basic-muted: #c9dcff;
  --basic-border: #080d1a;
  --line: rgba(25, 24, 22, 0.2);
  --shadow: 0 16px 40px rgba(25, 24, 22, 0.14);
  --display: 'EightBit Atari', 'Courier New', monospace;
  --body: 'Trebuchet MS', 'Avenir Next', sans-serif;
  --mono: 'Courier New', monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(rgba(62, 49, 29, 0.035) 1px, transparent 1px), var(--paper);
  background-size: 100% 4px;
  font-family: var(--body);
  line-height: 1.65;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  z-index: 99;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}
img {
  max-width: 100%;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: white;
  z-index: 110;
}
.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  color: #fff;
  background: rgba(25, 24, 22, 0.96);
  border-bottom: 3px solid var(--red);
  backdrop-filter: blur(10px);
}

.nav-shell {
  max-width: 1380px;
  margin: auto;
  min-height: 74px;
  padding: 0.75rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  line-height: 1;
}

.brand-mark {
  width: 34px;
  height: 34px;
  position: relative;
  display: inline-block;
}
.brand-mark::before,
.brand-mark::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 8px;
  height: 31px;
  border-radius: 50%;
  border: solid var(--red);
}
.brand-mark::before {
  left: 5px;
  border-width: 0 5px 0 0;
  transform: rotate(11deg);
}
.brand-mark::after {
  right: 5px;
  border-width: 0 0 0 5px;
  transform: rotate(-11deg);
}
.brand-mark span {
  position: absolute;
  left: 15px;
  top: 2px;
  width: 4px;
  height: 29px;
  border-radius: 4px;
  background: var(--red);
}

.brand-copy strong {
  display: block;
  font: 800 1rem/1 var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.brand-copy small {
  color: #c8c0b1;
  font: 0.68rem/1 var(--mono);
  letter-spacing: 0.06em;
}

.nav-toggle {
  display: none;
  border: 1px solid #736e66;
  background: transparent;
  color: white;
  padding: 0.55rem 0.7rem;
  font: 700 0.78rem var(--mono);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.site-nav a,
.nav-dropdown summary {
  padding: 0.55rem 0.62rem;
  color: #d8d3ca;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  border-bottom: 2px solid transparent;
}
.nav-dropdown {
  position: relative;
}
.nav-dropdown summary {
  cursor: pointer;
  list-style: none;
}
.nav-dropdown summary::-webkit-details-marker {
  display: none;
}
.nav-dropdown summary::after {
  content: ' ▾';
}
.nav-dropdown[open] summary::after {
  content: ' ▴';
}
.nav-dropdown summary:hover,
.nav-dropdown.has-current summary {
  color: white;
  border-color: var(--red);
}
.nav-dropdown summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
.nav-submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  padding: 0.5rem;
  background: var(--ink);
  border: 1px solid #736e66;
  box-shadow: var(--shadow);
}
.nav-submenu a {
  display: block;
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a[aria-current='page'],
.site-nav a[aria-current='location'] {
  color: white;
  border-color: var(--red);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  color: white;
  background: var(--ink);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.23;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 4px, #000 5px);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  min-height: 320px;
  margin: auto;
  padding: 3rem 1.4rem 2.5rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 4rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--red);
  font: 800 0.78rem/1.2 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.12;
}

h1 {
  max-width: 850px;
  margin-bottom: 1.5rem;
  font-size: clamp(1.35rem, 2.4vw, 2.5rem);
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(0.95rem, 1.5vw, 1.5rem);
  letter-spacing: 0.01em;
}
h3 {
  font-size: 1.3rem;
}

.hero-lede {
  max-width: 650px;
  color: #d0cabe;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}
.button {
  display: inline-block;
  padding: 0.85rem 1.15rem;
  border: 2px solid var(--red);
  background: var(--red);
  color: white;
  font: 800 0.78rem var(--mono);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.button:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}
.button.secondary {
  background: transparent;
  border-color: #8f8a81;
}
.button.secondary:hover {
  border-color: white;
}

.computer-art {
  display: grid;
  place-items: center;
  min-height: 370px;
  margin: 0;
}
.hero-computer {
  display: block;
  width: min(77.88%, 448.8px);
  max-width: none;
  height: auto;
  filter: drop-shadow(0 28px 26px rgba(0, 0, 0, 0.58));
}

.section {
  padding: 6rem 1.4rem;
}

.hero + .section {
  padding-top: 3rem;
}

.section.dark {
  color: var(--basic-text);
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(4, 12, 32, 0.12) 4px 5px),
    var(--basic-blue);
  border-block: 10px solid var(--basic-border);
  box-shadow: inset 0 0 80px rgba(2, 8, 24, 0.28);
}
.section.red {
  color: white;
  background: var(--red-dark);
}
.section-inner {
  max-width: 1160px;
  margin: auto;
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: end;
  margin-bottom: 3rem;
}
.section-head p {
  max-width: 560px;
  margin: 0 0 0.7rem;
  color: #615c54;
}
.dark .section-head p {
  color: var(--basic-muted);
}
.dark .eyebrow {
  color: var(--basic-text);
}
.dark .card-num,
.dark .card-link,
.dark .timeline-year,
.dark .feature .icon {
  color: var(--red-on-blue);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.card {
  position: relative;
  min-height: 260px;
  padding: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: var(--shadow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 21px 45px rgba(25, 24, 22, 0.2);
}
.dark .card {
  border-color: rgba(243, 247, 255, 0.35);
  background: rgba(8, 20, 56, 0.24);
}
.card-photo {
  height: 145px;
  margin: -1.5rem -1.5rem 1.35rem;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.card-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.language-grid {
  grid-template-columns: repeat(3, 1fr);
}
.language-card {
  display: flex;
  min-height: 515px;
  flex-direction: column;
}
.language-card .card-photo {
  height: 230px;
  flex: 0 0 230px;
  background: #e9e1d2;
}
.language-card .card-photo img {
  object-fit: contain;
}
.st-language-grid .card-photo img {
  padding: 0.7rem;
}
.st-language-grid .image-credit {
  margin-top: 0;
  font-size: 0.72rem;
  color: var(--basic-muted);
}
.language-card .meta {
  margin-top: auto;
}
.card-num {
  color: var(--red);
  font: 800 3.5rem/1 var(--display);
  letter-spacing: -0.08em;
}
.card-num.compact {
  font-size: 2.15rem;
  letter-spacing: -0.03em;
}
.card .meta,
.meta {
  color: #777066;
  font: 0.75rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dark .card .meta {
  color: var(--basic-muted);
}
.card-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--red);
  font-weight: 800;
  text-underline-offset: 4px;
}

.timeline {
  position: relative;
  margin-top: 3rem;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 7rem;
  width: 2px;
  background: var(--red);
}
.timeline-item {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 4rem;
  padding: 0 0 3.2rem;
}
.timeline-year {
  color: var(--red);
  font: 800 1.35rem var(--display);
}
.timeline-copy {
  max-width: 760px;
}
.timeline-copy h3 {
  margin-bottom: 0.5rem;
}
.timeline-copy p {
  margin: 0;
  color: var(--basic-muted);
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.feature {
  padding: 2rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.feature .icon {
  color: var(--red);
  font: 800 2rem var(--mono);
}

.page-hero {
  padding: 3.25rem 1.4rem 2.5rem;
  color: var(--basic-text);
  background:
    radial-gradient(circle at 83% 20%, rgba(131, 171, 255, 0.28), transparent 29%),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(4, 12, 32, 0.12) 4px 5px),
    var(--basic-blue);
  border-bottom: 10px solid var(--basic-border);
  box-shadow: inset 0 0 90px rgba(2, 8, 24, 0.26);
}
.page-hero-inner {
  max-width: 1160px;
  margin: auto;
}
.page-hero h1 {
  font-size: clamp(1.4rem, 3vw, 2.7rem);
}
.page-hero p {
  max-width: 720px;
  color: var(--basic-muted);
  font-size: 1.2rem;
}
.page-hero .eyebrow {
  color: var(--basic-text);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.7fr);
  gap: 4rem;
}
.prose {
  max-width: 780px;
}
.prose h2 {
  margin-top: 3.6rem;
  font-size: 1.05rem;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose h3 {
  margin-top: 2.3rem;
}
.prose a {
  color: var(--red-dark);
}
.my-story .prose [id] {
  scroll-margin-top: 110px;
}
.story-ad {
  margin: 2rem 0;
}
.story-ad img {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
}
.story-ad figcaption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}
.microchess-screen {
  position: relative;
  display: block;
  width: 100%;
  max-width: 560px;
}
.microchess-screen::after {
  content: '';
  position: absolute;
  /* Cover only the photographed cursor, using a patch of the CRT just below it.
     Coordinates are relative to the original 1402 by 1122 image. */
  left: calc(891 / 1402 * 100%);
  top: calc(331 / 1122 * 100%);
  width: calc(22 / 1402 * 100%);
  height: calc(12 / 1122 * 100%);
  background-image: url('../images/computers/trs80-microchess-greeting.png');
  background-size: calc(1402 / 22 * 100%) calc(1122 / 12 * 100%);
  background-position: calc(891 / 1380 * 100%) calc(348 / 1110 * 100%);
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  animation: microchess-cursor-blink 1s steps(1, end) infinite;
}
@keyframes microchess-cursor-blink {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}
.microchess-viewer {
  width: min(1466px, 96vw);
  max-width: 96vw;
  max-height: 94vh;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  border: 3px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
}
.microchess-viewer::backdrop {
  background: rgba(0, 0, 0, 0.8);
}
.microchess-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.microchess-viewer-header h2 {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(0.5rem, 1vw, 0.7rem);
}
.microchess-viewer-header button {
  padding: 0.5rem 1rem;
  font: inherit;
  cursor: pointer;
}
.microchess-viewer .microchess-screen {
  max-width: 1402px;
  margin: auto;
}
.microchess-viewer img {
  display: block;
  width: 100%;
  height: auto;
}
.microchess-viewer > p {
  margin-bottom: 0;
  font-size: 0.9rem;
}
.sidebar-box {
  position: sticky;
  top: 100px;
  padding: 1.5rem;
  color: var(--basic-text);
  border: 7px solid var(--basic-border);
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(4, 12, 32, 0.1) 4px 5px),
    var(--basic-blue);
  box-shadow: inset 0 0 35px rgba(2, 8, 24, 0.22);
}
.sidebar-box h3 {
  font-size: 1rem;
  text-transform: uppercase;
}
.sidebar-box ul {
  margin: 0;
  padding-left: 1.1rem;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2.5rem;
}
.spec-table th,
.spec-table td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.spec-table th {
  width: 31%;
  font: 800 0.76rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.callout {
  margin: 2.5rem 0;
  padding: 1.5rem 1.7rem;
  color: var(--basic-text);
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(4, 12, 32, 0.1) 4px 5px),
    var(--basic-blue);
  border: 7px solid var(--basic-border);
  box-shadow: inset 0 0 35px rgba(2, 8, 24, 0.22);
}
.callout strong {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.callout code {
  font: 400 1.05rem/1.75 var(--mono);
}
.callout p:last-child {
  margin-bottom: 0;
}

/* Keep source text selectable, case-correct, and readable like an Atari screen. */
code {
  color: #fff;
  background: var(--basic-blue);
  font-family: var(--mono);
  padding: 0.12em 0.3em;
}
.code-example {
  margin: 1.8rem 0;
  min-width: 0;
}
.code-example figcaption {
  margin-bottom: 0.6rem;
  font: 700 0.8rem/1.5 var(--mono);
}
.code-screen {
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 1.4rem;
  border: 7px solid var(--basic-border);
  background: var(--basic-blue);
  color: #fff;
  font: 400 0.95rem/1.7 var(--mono);
  tab-size: 2;
  text-transform: none;
  box-shadow: inset 0 0 35px rgba(2, 8, 24, 0.22);
}
.code-screen code {
  padding: 0;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}
.code-screen:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
.language-detail .prose {
  min-width: 0;
}
.os-detail .prose {
  min-width: 0;
}
.os-detail .spec-table {
  overflow-wrap: anywhere;
}
.os-detail .prose h2,
.os-detail .prose h3 {
  scroll-margin-top: 110px;
}
.os-detail .key-terms {
  margin-top: 2.5rem;
}

.os-detail .key-terms h4 {
  margin: 1.5rem 0 0.75rem;
  font: 700 0.9rem/1.5 var(--body);
  color: var(--basic-muted);
}

.os-detail .sidebar-box li + li {
  margin-top: 0.55rem;
}
.language-detail .prose h2,
.language-detail .prose h3 {
  overflow-wrap: anywhere;
}
.programming-index h2,
.programming-index h3 {
  overflow-wrap: anywhere;
}
.programming-index .section-head > * {
  min-width: 0;
}
.language-detail h2[id],
.language-detail h3[id] {
  scroll-margin-top: 110px;
}
.language-detail .sidebar-box li + li {
  margin-top: 0.55rem;
}
.language-detail .sidebar-box a[aria-current='page'] {
  font-weight: 700;
}
.language-detail .page-hero h1 {
  max-width: 100%;
  font-size: clamp(0.675rem, 2.4vw, 2rem);
  overflow-wrap: anywhere;
}
.language-detail .section {
  padding-top: 4rem;
}
.language-detail .back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
}
.language-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
}

.docs-index .page-hero h1 {
  max-width: 100%;
  font-size: clamp(0.8rem, 2.5vw, 2rem);
}
.docs-index h2,
.docs-index h3 {
  overflow-wrap: anywhere;
}
.docs-index .section-head > * {
  min-width: 0;
}
.docs-index .section {
  padding-block: 3.5rem;
}
.docs-index .doc-subject {
  scroll-margin-top: 100px;
  border-top: 1px solid var(--line);
}
.doc-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.doc-jump a {
  display: block;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  text-underline-offset: 3px;
}
.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.3rem;
}
.doc-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.doc-card h3 {
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 0.7rem;
}
.doc-card p {
  margin-top: 0;
}
.doc-preview {
  display: block;
  margin: -1.5rem -1.5rem 0.5rem;
  padding: 1rem;
  background: #e9e1d2;
  border-bottom: 1px solid var(--line);
}
.doc-preview img {
  display: block;
  width: 100%;
  height: 270px;
  object-fit: contain;
}
.doc-preview-label {
  color: #615c54;
  font: 0.7rem/1.5 var(--mono);
}
.doc-card .doc-meta {
  margin-top: auto;
  padding-top: 0.75rem;
  color: #615c54;
  font: 0.75rem/1.5 var(--mono);
}
.doc-card .card-link {
  margin-top: 0.2rem;
}
@media (max-width: 1050px) {
  .doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .doc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-index h2 {
    font-size: 0.75rem;
  }
}

/* Expected program output is separate from the editable source listings. */
.example-result {
  margin: -0.5rem 0 2.5rem;
  min-width: 0;
}
.example-result > figcaption {
  margin-bottom: 0.7rem;
  font: 700 0.85rem/1.5 var(--mono);
}
.result-label {
  display: block;
  color: #615c54;
  font-size: 0.75rem;
  font-weight: 400;
}
.result-frame {
  overflow: hidden;
  border: 7px solid var(--basic-border);
  background: var(--basic-blue);
  color: #fff;
}
.result-terminal {
  margin: 0;
  padding: 1.2rem;
  min-height: 150px;
  max-width: 100%;
  overflow-x: auto;
  color: #fff;
  background: var(--basic-blue);
  font: 400 0.95rem/1.6 var(--mono);
  text-transform: none;
}
.result-terminal:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}
.result-frame.st-output {
  background: #fff;
  color: #111;
  border-color: #242424;
}
.st-output .result-terminal {
  color: #111;
  background: #fff;
}
.result-titlebar {
  padding: 0.35rem 0.7rem;
  border-bottom: 2px solid #222;
  background: #ddd;
  color: #111;
  font: 700 0.8rem/1.4 var(--mono);
}
.example-result .result-note {
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
}
.result-variants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.75rem;
}
.result-variant-label {
  margin: 0;
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid #fff6;
  font: 700 0.8rem/1.4 var(--mono);
}
.result-variants .result-terminal {
  min-height: 115px;
}
.result-graphics {
  display: block;
  width: 100%;
  height: auto;
}
.result-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1.3rem;
  background: #fff6;
  border: 1px solid var(--line);
}
.result-file-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 66px;
  border: 2px solid var(--ink);
  font: 700 0.8rem var(--mono);
}
.result-file-name {
  font: 700 1rem var(--mono);
  overflow-wrap: anywhere;
}
.result-file small {
  display: block;
}
.gem-desktop {
  padding: clamp(0.8rem, 4vw, 2rem);
  background: repeating-conic-gradient(#649b66 0% 25%, #78a77a 0% 50%) 0 / 4px 4px;
}
.gem-alert {
  padding: 1.3rem 1rem;
  border: 3px double #111;
  background: #fff;
  color: #111;
  box-shadow: 5px 5px 0 #222;
  font: 400 0.95rem/1.5 var(--mono);
  text-align: center;
}
.gem-alert-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}
.gem-alert-icon {
  flex-shrink: 0;
  border: 2px solid #111;
  padding: 0.1rem 0.5rem;
  font-weight: 700;
}
.gem-alert-ok {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.1rem 2rem;
  border: 3px double #111;
  font-weight: 700;
}

.machine-list {
  display: grid;
  gap: 1.5rem;
}
.machine {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  padding: 2rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}
.machine-year {
  color: var(--red);
  font: 800 3rem var(--display);
  letter-spacing: -0.06em;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}
.tag {
  padding: 0.28rem 0.55rem;
  border: 1px solid #a9a08f;
  font: 0.7rem var(--mono);
  text-transform: uppercase;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}
.game-card {
  min-height: 360px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  color: white;
  background: #242320;
  border-top: 7px solid var(--red);
}
.game-card:nth-child(3n + 2) {
  border-color: var(--gold);
}
.game-card:nth-child(3n) {
  border-color: var(--teal);
}
.game-art {
  display: grid;
  place-items: center;
  margin: -1.5rem -1.5rem 1.4rem;
  padding: 1.5rem;
  background: #171715;
}
.game-art img {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: contain;
}
.game-card h3 {
  margin-bottom: 0.5rem;
}
.game-year {
  font-size: 0.75em;
  color: #c7c0b5;
  white-space: nowrap;
}
.game-card p {
  color: #c7c0b5;
}
.game-card .meta {
  margin-top: 0;
}
.game-links {
  margin-top: auto;
}
.game-links .card-link {
  color: var(--gold);
}
.game-card .game-sources {
  font-size: 0.8rem;
  line-height: 1.6;
  margin-bottom: 0;
}
.game-sources a {
  text-underline-offset: 3px;
}

.download-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.download-row h3,
.download-row p {
  margin: 0;
}
.download-row p {
  color: #6a655d;
}
.status {
  padding: 0.3rem 0.5rem;
  color: white;
  background: var(--teal);
  font: 0.7rem var(--mono);
  text-transform: uppercase;
  white-space: nowrap;
}
.status.soon {
  background: #817969;
}

.memory-form {
  display: grid;
  gap: 1rem;
  max-width: 680px;
  padding: 2rem;
  background: #ded4c0;
}
.memory-form label {
  font: 800 0.75rem var(--mono);
  text-transform: uppercase;
}
.memory-form input,
.memory-form textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #9d9587;
  background: #f8f2e6;
  font: inherit;
}
.memory-form textarea {
  min-height: 150px;
  resize: vertical;
}
.form-note {
  font-size: 0.85rem;
  color: #6d675e;
}

.site-footer {
  padding: 3.5rem 1.4rem;
  color: #aaa49a;
  background: #10100f;
}
.footer-inner {
  max-width: 1160px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
}
.footer-inner strong {
  color: white;
  font-family: var(--display);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-end;
}
.footer-nav a {
  color: #cac4ba;
  font-size: 0.82rem;
}
.legal {
  max-width: 720px;
  font-size: 0.75rem;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .microchess-screen::after {
    animation: none;
    opacity: 0;
  }
}

@media (max-width: 1380px) {
  .nav-toggle {
    display: block;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    padding: 1rem 1.4rem 1.4rem;
    flex-direction: column;
    align-items: stretch;
    background: #191816;
    border-bottom: 3px solid var(--red);
  }
  .site-nav.open {
    display: flex;
  }
  .site-nav {
    max-height: calc(100dvh - 74px);
    overflow-y: auto;
  }
  .site-nav a,
  .nav-dropdown summary {
    padding: 0.7rem 0;
  }
  .nav-submenu {
    position: static;
    min-width: 0;
    margin: 0.25rem 0 0.5rem;
    padding: 0.25rem 1rem;
    border-left: 2px solid var(--red);
    box-shadow: none;
  }
  .hero-grid {
    grid-template-columns: 1fr 420px;
    gap: 1.5rem;
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .language-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .nav-shell {
    gap: 0.75rem;
    padding-inline: 1rem;
  }
  .brand-copy strong {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
  }
  .brand-copy small {
    display: none;
  }
  .hero,
  .hero-grid {
    min-height: auto;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    padding-top: 2.25rem;
  }
  .computer-art {
    min-height: 320px;
    max-width: 430px;
    width: 100%;
    margin: auto;
  }
  .hero-computer {
    width: 66%;
    max-width: 100%;
  }
  .section {
    padding: 4.5rem 1.1rem;
  }

  .hero + .section {
    padding-top: 2.25rem;
  }

  .section-head,
  .content-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .section-head {
    align-items: start;
  }
  .sidebar-box {
    position: static;
    margin-top: 2rem;
  }
  .feature-strip,
  .game-grid {
    grid-template-columns: 1fr;
  }
  .machine {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .footer-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .brand-copy strong {
    font-size: 0.62rem;
  }
  .language-detail .prose h2,
  .programming-index h2 {
    font-size: clamp(0.6rem, 2.5vw, 0.8rem);
  }
  .brand-copy small {
    display: none;
  }
  h1,
  .page-hero h1 {
    font-size: clamp(0.75rem, 3.75vw, 1.25rem);
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .language-grid {
    grid-template-columns: 1fr;
  }
  .timeline::before {
    left: 0;
  }
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding-left: 1.5rem;
  }
  .download-row {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
}

/* Browser emulator */
.emulator-section {
  padding-top: 2rem;
}
.emulator-frame {
  display: block;
  width: 100%;
  height: 860px;
  border: 3px solid var(--red);
  background: #ddd1b9;
  border-radius: 8px;
}
.st-emulator-frame {
  height: 1040px;
}
@media (max-width: 600px) {
  .emulator-frame {
    height: 740px;
  }
}
@media (max-width: 600px) {
  .st-emulator-frame {
    height: 980px;
  }
}
.emulator-section ~ .section pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  background: #123a9e;
  color: #fff;
}
.emulator-section ~ .section pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}
