/* ZX TRACK's page: dark, with the Spectrum's four stripes */
:root {
  --bg: #0c0c0e; --panel: #151518; --line: #2a2a30; --fg: #e9e9ec; --dim: #9b9ba3;
  --red: #e2231a; --yellow: #f6d10b; --green: #32b34a; --cyan: #1eb7e9; --link: #5fd3ff;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
section { padding: 36px 0; scroll-margin-top: 64px; }
h1, h2, h3 { font-family: var(--mono); font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0 0 14px; }
h2 { font-size: 1.3rem; margin: 0 0 14px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.lead { font-size: 1.12rem; color: #cfcfd5; max-width: 62ch; }
.lead.small { font-size: 1rem; }
.dim { color: var(--dim); }
.small { font-size: 0.9rem; }
code, kbd { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
kbd { display: inline-block; min-width: 1.7em; padding: 0 6px; text-align: center; border: 1px solid #3a3a42;
  border-bottom-width: 2px; border-radius: 5px; background: #1c1c21; line-height: 1.5; }

/* header: the wordmark and the stripes under it */
header.top { position: sticky; top: 0; z-index: 5; background: rgba(12, 12, 14, 0.92); backdrop-filter: blur(8px); }
header.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--fg); text-decoration: none; }
.brand b { font-family: var(--mono); font-size: 1.15rem; letter-spacing: 0.06em; }
.brand small { color: var(--dim); font-size: 0.85rem; }
header nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
header nav a { color: var(--dim); text-decoration: none; font-size: 0.92rem; }
header nav a:hover { color: var(--fg); }
.rainbow { display: flex; height: 4px; }
.rainbow i { flex: 1; }
.rainbow i:nth-child(1) { background: var(--red); }
.rainbow i:nth-child(2) { background: var(--yellow); }
.rainbow i:nth-child(3) { background: var(--green); }
.rainbow i:nth-child(4) { background: var(--cyan); }

.hero { padding: 48px 0 8px; }

/* the emulator */
.emu-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.emu-head h2 { margin: 0; }
.say { margin: 0; color: var(--dim); font-size: 0.95rem; flex: 1; min-width: 240px; }
.say[data-state="playing"] { color: #7fe08f; }
.say[data-state="start"] { color: var(--yellow); }
.say[data-state="error"] { color: #ff7a70; }
button { font: inherit; font-size: 0.9rem; color: var(--fg); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 14px; cursor: pointer; }
button:hover { border-color: #4a4a54; }
.midi-say { margin: -4px 0 12px; font-family: var(--mono); font-size: 0.85rem; color: var(--dim); }
.midi-say b { color: var(--cyan); font-weight: 600; }
#midi-btn.on { border-color: var(--cyan); color: var(--cyan); }
.emu-frame { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #18191b; aspect-ratio: 1280 / 900; }
.emu-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.note { margin-top: 12px; color: var(--dim); font-size: 0.92rem; max-width: 80ch; }

/* text in two columns */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; gap: 24px; } header nav { display: none; } }
.steps { padding-left: 1.3em; margin: 0; }
.steps li { margin-bottom: 10px; }
.steps li::marker { font-family: var(--mono); color: var(--yellow); }

table.keys { width: 100%; border-collapse: collapse; font-size: 0.93rem; margin-bottom: 12px; }
table.keys th { text-align: left; font-weight: 600; color: var(--dim); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.keys th, table.keys td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.keys td:nth-child(2) { font-family: var(--mono); font-size: 0.85rem; color: #cfcfd5; white-space: nowrap; }
table.keys kbd { margin: 1px 0; }
table.keys td:first-child { white-space: nowrap; }

/* the three players */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card:nth-child(1) { border-top: 3px solid var(--red); }
.card:nth-child(2) { border-top: 3px solid var(--yellow); }
.card:nth-child(3) { border-top: 3px solid var(--cyan); }
.card h3 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0; }
.card p { margin: 0; color: #cfcfd5; font-size: 0.95rem; flex: 1; }
.tag { font-family: system-ui, sans-serif; font-weight: 500; font-size: 0.8rem; color: var(--dim); }
.card audio { width: 100%; }
.dl { font-family: var(--mono); font-size: 0.88rem; }
.dl::before { content: "↓ "; }

.warn { border-left: 3px solid var(--yellow); padding: 6px 0 6px 14px; color: #d8d8dd; font-size: 0.93rem; }

footer { padding: 28px 0 48px; border-top: 1px solid var(--line); color: var(--dim); font-size: 0.88rem; }

/* the manual (manual.html) */
.manual section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.manual section.hero { padding-top: 44px; }
.manual h3 { margin-top: 0; }
.manual ol, .manual ul { padding-left: 1.4em; margin: 0 0 12px; }
.manual li { margin-bottom: 6px; }
.manual li > ul { margin-top: 6px; }
.manual ol > li::marker { font-family: var(--mono); color: var(--yellow); }
.manual table.keys { margin: 8px 0 16px; }
.manual table.keys td:first-child { white-space: normal; }
.toc { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 0.9rem; color: var(--dim); margin-top: 18px; }
.toc a { color: var(--link); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.shot-row { display: grid; grid-template-columns: 360px 1fr; gap: 28px; align-items: start; margin: 8px 0 12px; }
@media (max-width: 860px) { .shot-row { grid-template-columns: 1fr; } }
.shot { margin: 0; }
.shot img { width: 100%; max-width: 360px; height: auto; image-rendering: pixelated; border-radius: 10px; border: 1px solid var(--line); display: block; }
.shot figcaption { color: var(--dim); font-size: 0.85rem; margin-top: 8px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 16px; }
@media (max-width: 860px) { .cols3 { grid-template-columns: 1fr; } }
.cols3 > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 6px; }
.table-scroll { overflow-x: auto; }
table.grid td:first-child { font-family: var(--mono); font-size: 0.85rem; color: #cfcfd5; white-space: nowrap; }
table.grid td, table.grid th { padding-right: 14px; }
pre.code { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto;
  font: 0.82rem/1.6 var(--mono); color: #d8d8dd; }
header nav a[aria-current="page"] { color: var(--fg); }
.manual table.keys td:nth-child(2) { font-family: inherit; font-size: inherit; color: inherit; white-space: normal; }
.manual table.btns td:nth-child(2) { font-family: var(--mono); font-size: 0.85rem; color: #cfcfd5; }
