/* PicoD64 site: a C64 screen in a browser. Bescii Mono (CC0) for the screen text, a plain font for reading. */
@font-face { font-family: "Bescii"; src: url("fonts/Bescii-Mono.ttf") format("truetype"); font-display: swap; }

:root {
  --border: #6c5eb5;        /* the C64's light blue (border) */
  --screen: #352879;        /* blue (screen) */
  --text: #e4e0ff;          /* reading text: lighter than the C64's light blue, for contrast */
  --c64: #a69bf0;           /* the screen's light blue, a little brighter */
  --hi: #ffffff;
  --cyan: #70a4b2;
  --green: #6abf4a;
  --yellow: #e8e37a;
  --red: #c06a5a;
  --panel: #2a1f63;
  --rule: #5a4db0;
  --pixel: "Bescii", "Courier New", monospace;
  --read: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--border); color: var(--text);
  font: 17px/1.6 var(--read);
}
a { color: var(--hi); }
a:hover { color: var(--yellow); }

/* the screen inside the border */
.screen {
  max-width: 1040px; margin: 40px auto; background: var(--screen);
  padding: 0 0 32px; box-shadow: 0 0 0 4px #5a4da6;
}
@media (max-width: 700px) { .screen { margin: 16px; } body { font-size: 16px; } nav { font-size: 13px; padding: 12px 16px 0; } main { padding: 0 16px; } .prompt { padding: 14px 16px 0; } }

.pixel, h1, h2, h3, nav, .btn, .tag, th, .prompt { font-family: var(--pixel); letter-spacing: 0.02em; }

/* the start-up banner */
header.banner { text-align: center; padding: 36px 20px 8px; color: var(--c64); }
header.banner h1 { font-size: clamp(16px, 3.4vw, 30px); font-weight: normal; margin: 0 0 10px; color: var(--c64); text-transform: uppercase; }
header.banner p { margin: 0; font-family: var(--pixel); font-size: clamp(13px, 2.2vw, 17px); text-transform: uppercase; }
.prompt { color: var(--c64); padding: 18px 28px 0; text-transform: uppercase; font-size: 17px; }
.cursor { display: inline-block; width: 0.62em; height: 1.05em; background: var(--c64); vertical-align: -0.15em; animation: blink 1.07s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* the menu: LOAD"...",8 */
nav { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 14px 28px 4px; font-size: 15px; }
nav a { color: var(--c64); text-decoration: none; text-transform: uppercase; }
nav a:hover, nav a:focus { background: var(--c64); color: var(--screen); outline: none; }

main { padding: 0 28px; }
section { padding-top: 34px; }
h2 { font-weight: normal; color: var(--hi); font-size: 22px; margin: 0 0 14px; text-transform: uppercase; }
h2::before { content: "> "; color: var(--cyan); }
h3 { font-weight: normal; color: var(--yellow); font-size: 16px; margin: 26px 0 8px; text-transform: uppercase; }
p, li { max-width: none; }   /* full width of the screen (Carl: span or centre, not a ragged right gap) */
code, kbd { font-family: var(--pixel); color: var(--hi); background: var(--panel); padding: 1px 6px; font-size: 0.95em; }
pre { font-family: var(--pixel); background: var(--panel); color: var(--c64); padding: 12px 16px; overflow-x: auto; margin: 10px 0; }

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; margin-top: 0; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }
#what { padding-top: 20px; }   /* the first section close under the menu */
.hero .lead { margin-top: 0; }
.hero img { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 14px rgba(0,0,0,0.35)); }
figure img.board { background: #f4f2ff; image-rendering: auto; width: 100%; max-width: 100%; }
.lead { font-size: 1.15em; color: var(--hi); }

/* buttons, as reverse-video text */
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 4px; }
.btn { display: inline-block; background: var(--c64); color: var(--screen); text-decoration: none; padding: 10px 16px; text-transform: uppercase; font-size: 15px; }
.btn:hover, .btn:focus { background: var(--hi); color: var(--screen); }
.btn.alt { background: transparent; color: var(--c64); box-shadow: inset 0 0 0 2px var(--c64); }
.btn.alt:hover { color: var(--hi); box-shadow: inset 0 0 0 2px var(--hi); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.card { background: var(--panel); padding: 14px 16px; border-left: 4px solid var(--cyan); }
.card h3 { margin-top: 0; }
.card p { margin: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; display: flex; align-items: center; gap: 18px; min-height: 38px; margin: 0 0 18px; }   /* the number centred on its text, however many lines */
.steps > li::before { content: counter(step); flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; background: var(--c64); color: var(--screen); font-family: var(--pixel); font-size: 18px; }
.steps strong { color: var(--hi); }

figure { margin: 16px 0; }
figure img { max-width: min(100%, 820px); height: auto; display: block; image-rendering: pixelated; }
figcaption { font-size: 0.9em; color: var(--c64); margin-top: 6px; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.oled img { background: #000; width: 100%; }

table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 0.95em; }
.tablewrap { overflow-x: auto; }
th { text-align: left; font-weight: normal; color: var(--yellow); text-transform: uppercase; font-size: 13px; padding: 8px 10px; border-bottom: 2px solid var(--rule); }
td { padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
td.ok { color: var(--green); font-family: var(--pixel); white-space: nowrap; }

.note { background: var(--panel); border-left: 4px solid var(--yellow); padding: 10px 16px; margin: 14px 0; }
details { background: var(--panel); margin: 8px 0; padding: 10px 16px; }
summary { cursor: pointer; color: var(--hi); font-weight: 600; }

footer { margin-top: 40px; padding: 18px 28px 0; border-top: 2px solid var(--rule); color: var(--c64); font-size: 0.9em; }
footer p { max-width: none; }
.rainbow { height: 8px; margin: 26px 28px 0; background: linear-gradient(to bottom, var(--red) 0 25%, #d0904a 25% 50%, var(--yellow) 50% 75%, var(--green) 75%); }

/* the Ko-fi panel: Ko-fi's own button, centred */
.support { text-align: center; background: var(--panel); margin-top: 40px; padding: 24px 20px 10px; border-top: 4px solid var(--yellow); }
.support h2::before { content: ""; }
.support p { margin-left: auto; margin-right: auto; max-width: 60ch; }
.kofi { height: 44px; width: auto; border: 0; display: inline-block; }

/* the build guide (build.html, made by make_build.py from hardware/BUILD-NOTES.md) */
.build h2.bhead { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.build h2.bhead::before { content: none; }
.stepno { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; background: var(--c64); color: var(--screen); font-size: 18px; }
.build ol { padding-left: 1.4em; }
.build ol > li { margin: 0 0 10px; }
.build ul > li { margin: 0 0 10px; }
.build table code { white-space: nowrap; }
.tick { width: 22px; height: 22px; margin: 0 10px 0 0; vertical-align: -5px; accent-color: var(--green); cursor: pointer; flex: 0 0 22px; }
.build h2 .tick { margin: 0; }
.done > :not(.tick):not(h2) { opacity: 0.55; }
li.done { opacity: 0.55; }
.bintro .btns { margin-top: 4px; }
.tickinfo { color: var(--c64); font-size: 0.95em; }
.tickinfo button { font: inherit; font-family: var(--pixel); background: transparent; color: var(--c64); border: 2px solid var(--c64); padding: 2px 10px; margin-left: 8px; cursor: pointer; text-transform: uppercase; font-size: 13px; }
.tickinfo button:hover { color: var(--hi); border-color: var(--hi); }
.build p code, .build li code, .build a { overflow-wrap: anywhere; }   /* long paths and the bare link wrap on a phone */
@media (max-width: 700px) { h2 { font-size: 18px; } }
/* in the build guide a linked file name is a plain link, not big pixel type; other code a size down */
.build a code { font-family: var(--read); font-size: 1em; background: none; padding: 0; color: inherit; letter-spacing: 0; }
.build code { font-size: 0.8em; }
/* links in running text: the text's own colour and weight, a thin underline (Carl: links "oversized and overemphasised") */
.build p a, .build li a, .build td a { color: var(--text); font-weight: inherit; text-decoration: underline; text-decoration-color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.build p a:hover, .build li a:hover, .build td a:hover { color: var(--hi); }
/* code in the build guide: a plain monospace in the text's colour, not the big pixel font */
.build code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.88em; color: var(--text); background: var(--panel); padding: 1px 5px; letter-spacing: 0; }
/* links: a clear C64 cyan, normal weight, underlined: plain to spot, not shouting (Carl, 2026-11-20) */
.build p a, .build li a, .build td a { color: #9ad7e6; text-decoration-color: #9ad7e6; text-decoration-thickness: 1px; }
.build p a:hover, .build li a:hover, .build td a:hover { color: var(--hi); text-decoration-color: var(--hi); }
/* generated document pages (parts.html, guide.html) and the folded ROM ways on the main page */
.doc img { max-width: min(100%, 820px); height: auto; display: block; margin: 12px 0; image-rendering: pixelated; }
.doc h2 { margin-top: 30px; }
.romways { margin-top: 10px; }
.romways ul { margin: 8px 0; }
.romways pre { white-space: pre-wrap; }
.romways code, .doc code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.88em; color: var(--text); background: var(--panel); padding: 1px 5px; letter-spacing: 0; }
.romways pre code, .doc pre code { background: none; padding: 0; }
.doc p a, .doc li a, .doc td a, .romways a { color: #9ad7e6; text-decoration-color: #9ad7e6; text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* the banner's title, a link home on the subpages: looks as on the home page */
header.banner h1 a.home { color: inherit; text-decoration: none; }
header.banner h1 a.home:hover, header.banner h1 a.home:focus { text-decoration: underline; }
