/* myc64u.com — bright Commodore style */
:root {
  --paper: #f5faff;
  --surface: #ffffff;
  --ink: #0e1a3a;
  --ink-soft: #44506e;
  --line: #d6e4f5;
  --blue: #1e4fd8;
  --blue-deep: #163aa6;
  --sky: #3db2ff;
  --sky-tint: #e6f2ff;
  --red: #e4002b;
  --orange: #ff7a00;
  --yellow: #ffc400;
  --screen: #1e4fd8;
  --screen-text: #d9eeff;
  --radius: 12px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); color: var(--ink); padding: 8px 14px; z-index: 100; font-weight: 700; }
.skip:focus { left: 8px; }

/* The stripe: Commodore's four-color band (no green) */
.stripe { display: grid; grid-template-rows: repeat(4, 4px); }
.stripe span:nth-child(1) { background: var(--red); }
.stripe span:nth-child(2) { background: var(--orange); }
.stripe span:nth-child(3) { background: var(--yellow); }
.stripe span:nth-child(4) { background: var(--sky); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1240px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-mark { display: grid; grid-template-columns: repeat(4, 5px); gap: 3px; height: 30px; transform: skewX(-18deg); }
.brand-mark i:nth-child(1) { background: var(--red); }
.brand-mark i:nth-child(2) { background: var(--orange); }
.brand-mark i:nth-child(3) { background: var(--yellow); }
.brand-mark i:nth-child(4) { background: var(--sky); }
.brand-name { font-weight: 900; font-size: 24px; letter-spacing: -0.01em; font-variation-settings: "wdth" 125; color: var(--blue); line-height: 1; }
.brand-sub { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); font-variation-settings: "wdth" 100; letter-spacing: 0; margin-top: 3px; }

.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { background: var(--sky-tint); color: var(--blue); }
.nav a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); border-radius: 8px 8px 0 0; }
.nav-toggle { display: none; margin-left: auto; background: var(--blue); color: #fff; border: 0; border-radius: 8px; font: 700 15px var(--font); padding: 9px 14px; cursor: pointer; }

@media (max-width: 1180px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--blue); border-radius: 0 8px 8px 0; }
}

/* Page head */
.page-head { max-width: 1240px; margin: 0 auto; padding: 56px 24px 28px; }
.page-head h1 { margin: 0; font-weight: 900; font-variation-settings: "wdth" 125; font-size: clamp(34px, 5.4vw, 60px); line-height: 1.02; letter-spacing: -0.02em; color: var(--blue); max-width: 18ch; }
.page-head .lead { font-size: 20px; line-height: 1.5; color: var(--ink-soft); max-width: 62ch; margin: 18px 0 0; }

/* Layout: TOC + content */
.layout { max-width: 1240px; margin: 0 auto; padding: 0 24px 80px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow: auto; padding-right: 8px; }
.toc-title { font-weight: 800; font-size: 14px; color: var(--ink-soft); margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--line); }
.toc li a { display: block; padding: 6px 0 6px 14px; margin-left: -3px; border-left: 3px solid transparent; text-decoration: none; color: var(--ink); font-size: 15px; line-height: 1.35; }
.toc li a:hover { color: var(--blue); }
.toc li a.active { border-left-color: var(--orange); color: var(--blue); font-weight: 700; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .toc { position: static; max-height: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
}

/* Filter */
.filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 2px solid var(--blue); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 32px; }
.filter label { font-weight: 700; font-size: 15px; }
.filter input { flex: 1 1 220px; min-width: 0; border: 0; background: var(--sky-tint); border-radius: 8px; padding: 10px 12px; font: 500 16px var(--font); color: var(--ink); }
.filter input:focus { outline: 3px solid var(--orange); }
.filter output { font-size: 14px; color: var(--ink-soft); min-width: 9ch; }
mark { background: var(--yellow); color: var(--ink); border-radius: 3px; padding: 0 2px; }

/* Content */
.content { max-width: 860px; min-width: 0; }
.content > p, .content > ul, .content > ol, .content h2, .content h3 { max-width: 72ch; }
.content h2 { font-weight: 900; font-variation-settings: "wdth" 118; font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); margin: 64px 0 14px; padding-top: 18px; border-top: 4px solid var(--blue); }
.content h2:first-of-type { margin-top: 0; }
.content h3 { font-weight: 800; font-size: 20px; margin: 34px 0 8px; color: var(--blue-deep); }
.content p { margin: 0 0 14px; }
.content ul, .content ol { padding-left: 24px; margin: 0 0 16px; }
.content li { margin: 4px 0; }
.content li::marker { color: var(--blue); font-weight: 700; }
.content strong { font-weight: 750; }

.table-wrap { overflow-x: auto; margin: 10px 0 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 9px 14px; border-bottom: 1px solid var(--line); }
thead th { background: var(--sky-tint); color: var(--blue-deep); font-weight: 800; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfdff; }
td:first-child { font-weight: 600; }

code { font-family: var(--mono); font-size: 0.88em; background: var(--sky-tint); color: var(--blue-deep); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
td code { white-space: normal; word-break: break-word; }

.code { position: relative; margin: 12px 0 22px; }
pre { margin: 0; background: var(--screen); color: var(--screen-text); border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; border: 6px solid #7fc4ff; }
pre code { background: none; color: inherit; padding: 0; font-size: 15px; line-height: 1.6; white-space: pre; }
.copy { position: absolute; top: 12px; right: 12px; background: var(--yellow); color: var(--ink); border: 0; border-radius: 7px; font: 700 13px var(--font); padding: 6px 10px; cursor: pointer; }
.copy:hover { background: #ffd43b; }

.checklist { list-style: none; padding-left: 0 !important; }
.checklist li { padding-left: 30px; position: relative; }
.checklist input { position: absolute; left: 0; top: 4px; width: 18px; height: 18px; accent-color: var(--blue); }

.no-match { display: none; background: var(--surface); border: 1px dashed var(--blue); border-radius: var(--radius); padding: 16px; }
.no-match.show { display: block; }
.is-hidden { display: none !important; }

/* Home */
.hero { max-width: 1240px; margin: 0 auto; padding: 48px 24px 24px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero h1 { margin: 0; font-weight: 900; font-variation-settings: "wdth" 125; font-size: clamp(38px, 5.6vw, 68px); line-height: 1; letter-spacing: -0.025em; color: var(--blue); }
.hero p { font-size: 20px; color: var(--ink-soft); max-width: 46ch; margin: 18px 0 26px; }
.btn { display: inline-block; background: var(--blue); color: #fff; text-decoration: none; font-weight: 800; padding: 13px 20px; border-radius: 10px; margin: 0 10px 10px 0; }
.btn:hover { background: var(--blue-deep); color: #fff; }
.btn.alt { background: var(--yellow); color: var(--ink); }
.btn.alt:hover { background: #ffd43b; color: var(--ink); }

.screen { background: var(--screen); border: 22px solid #7fc4ff; border-radius: 18px; padding: 22px 20px; min-height: 330px; box-shadow: 0 18px 40px -18px rgba(30, 79, 216, 0.55); font-family: var(--mono); color: var(--screen-text); font-size: clamp(12px, 1.35vw, 15.5px); line-height: 1.55; text-transform: uppercase; white-space: pre-wrap; }
.screen .cursor { display: inline-block; width: 0.62em; height: 1.1em; background: var(--screen-text); vertical-align: -0.18em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .screen .cursor { animation: none; } }

@media (max-width: 880px) { .hero { grid-template-columns: 1fr; gap: 28px; } .screen { border-width: 14px; min-height: 0; font-size: 2.9vw; padding: 16px 12px; } }

.home { max-width: 1240px; margin: 0 auto; padding: 32px 24px 80px; }
.five { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: five; border-top: 4px solid var(--blue); }
.five li { counter-increment: five; padding: 18px 18px 6px 0; border-right: 1px solid var(--line); margin-right: 18px; }
.five li:last-child { border-right: 0; margin-right: 0; }
.five li::before { content: counter(five); display: block; font-weight: 900; font-variation-settings: "wdth" 125; font-size: 44px; line-height: 1; color: var(--orange); margin-bottom: 8px; }
.five strong { display: block; font-size: 18px; line-height: 1.25; margin-bottom: 6px; color: var(--ink); }
.five span { color: var(--ink-soft); font-size: 15.5px; }
@media (max-width: 960px) { .five { grid-template-columns: 1fr 1fr; } .five li { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--line); } }
@media (max-width: 560px) { .five { grid-template-columns: 1fr; } }

.section-title { font-weight: 900; font-variation-settings: "wdth" 118; font-size: 30px; margin: 64px 0 6px; }
.section-note { color: var(--ink-soft); margin: 0 0 18px; }

.pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 32px; }
.pages a { display: block; text-decoration: none; color: var(--ink); padding: 16px 0 14px 18px; border-left: 6px solid var(--c, var(--blue)); }
.pages a:hover h3 { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
.pages h3 { margin: 0 0 4px; font-size: 21px; font-weight: 850; font-variation-settings: "wdth" 112; }
.pages p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }
@media (max-width: 960px) { .pages { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .pages { grid-template-columns: 1fr; } }

.about { margin-top: 64px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 860px; color: var(--ink-soft); }
.about h2 { margin: 0 0 8px; font-size: 20px; color: var(--ink); }
.about p { margin: 0 0 8px; }

/* Footer (Thomas Brothers trailer) */
.site-footer { background: var(--blue); color: #fff; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 40px 24px 32px; display: grid; gap: 14px; }
.footer-brand { font-weight: 900; font-variation-settings: "wdth" 125; font-size: 26px; margin: 0; }
.footer-tag { margin: 0; font-size: 17px; }
.footer-tag small { display: block; opacity: 0.85; font-size: 15px; }
.footer-sites-title { margin: 10px 0 0; font-weight: 800; color: var(--yellow); }
.footer-sites { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.footer-sites a { display: inline-block; color: #fff; text-decoration: none; font-weight: 600; padding: 6px 12px; border: 2px solid rgba(255,255,255,0.45); border-radius: 999px; }
.footer-sites a:hover, .footer-sites a[aria-current="true"] { background: #fff; color: var(--blue); border-color: #fff; }
.site-footer a.mail { color: #fff; font-weight: 700; }
.footer-legal { margin: 10px 0 0; font-size: 14px; opacity: 0.9; }

/* Header search */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.site-search { display: flex; align-items: center; margin-left: 8px; }
.site-search input { width: 150px; border: 2px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; padding: 7px 10px; font: 500 15px var(--font); color: var(--ink); background: var(--paper); }
.site-search input:focus { border-color: var(--blue); outline: none; background: #fff; }
.site-search button { border: 0; background: var(--blue); color: #fff; font: 700 14px var(--font); padding: 9px 12px; border-radius: 0 8px 8px 0; cursor: pointer; }
.site-search button:hover { background: var(--blue-deep); }
@media (max-width: 1180px) { .site-search { margin: 10px 0 0; } .site-search input { flex: 1; width: auto; } }

/* Page tools */
.page-tools { margin: 18px 0 0; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tool-btn { background: var(--surface); color: var(--blue); border: 2px solid var(--blue); border-radius: 8px; font: 700 15px var(--font); padding: 8px 14px; cursor: pointer; }
.tool-btn:hover { background: var(--blue); color: #fff; }
.tool-link { font-weight: 600; font-size: 15px; }

/* Search page */
.search-page { max-width: 860px; margin: 0 auto 80px; padding: 0 24px; }
.big-search { display: flex; border: 3px solid var(--blue); border-radius: var(--radius); overflow: hidden; background: #fff; }
.big-search input { flex: 1; min-width: 0; border: 0; padding: 14px 16px; font: 500 19px var(--font); color: var(--ink); }
.big-search input:focus { outline: none; background: var(--sky-tint); }
.big-search button { border: 0; background: var(--blue); color: #fff; font: 800 17px var(--font); padding: 0 22px; cursor: pointer; }
.search-status { color: var(--ink-soft); margin: 14px 0; }
.results { list-style: none; padding: 0; margin: 0; }
.results li { padding: 16px 0 16px 18px; border-left: 5px solid var(--sky); margin-bottom: 14px; background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; padding-right: 16px; }
.results a.res-title { font-weight: 800; font-size: 19px; text-decoration: none; }
.results a.res-title:hover { text-decoration: underline; }
.results .res-page { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 4px; }
.results p { margin: 6px 0 0; color: var(--ink); font-size: 15.5px; }

/* Full guide */
.all-wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px 80px; display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 48px; align-items: start; }
.all-toc { position: sticky; top: 100px; }
.all-toc ol { margin: 0; padding-left: 20px; }
.all-toc li { margin: 6px 0; }
.all-title { font-weight: 900; font-variation-settings: "wdth" 125; font-size: 44px; color: var(--blue); margin: 72px 0 6px; line-height: 1.05; }
.all-part:first-child .all-title { margin-top: 0; }
@media (max-width: 960px) { .all-wrap { grid-template-columns: 1fr; } .all-toc { position: static; } }

.footer-credit { margin: 6px 0 0; }
.footer-credit a { color: #fff; font-weight: 700; }

@media print {
  @page { margin: 14mm; }
  .site-header, .toc, .all-toc, .filter, .copy, .nav-toggle, .page-tools, .skip, .no-match, .site-footer .footer-sites, .site-footer .stripe, .footer-sites-title { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .layout, .all-wrap { display: block; padding: 0; max-width: none; }
  .page-head { padding: 0 0 10pt; }
  .page-head h1, .all-title { font-size: 26pt; color: #1e4fd8; }
  .all-part { break-before: page; }
  .all-part:first-child { break-before: auto; }
  .content { max-width: none; }
  .content h2 { font-size: 16pt; margin: 18pt 0 6pt; border-top: 2pt solid #1e4fd8; break-after: avoid; }
  .content h3 { font-size: 12.5pt; break-after: avoid; }
  .table-wrap { border: 1px solid #999; overflow: visible; break-inside: auto; }
  table { font-size: 9.5pt; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  thead th { background: #e6f2ff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  pre { background: #fff; color: #000; border: 1px solid #999; white-space: pre-wrap; break-inside: avoid; }
  pre code { white-space: pre-wrap; }
  code { background: none; color: #000; border: 0; }
  a { color: #000; text-decoration: none; }
  .site-footer { background: #fff; color: #000; border-top: 1px solid #999; }
  .site-footer a, .footer-credit a { color: #000; }
  .footer-inner { padding: 8pt 0 0; gap: 2pt; }
  .footer-brand { font-size: 12pt; }
}
