/* Benoit Saint-Moulin
   the Micro-8 site: black and white, one red (the red of the Micro-8 keys). Square corners, hairlines, monospace labels, screenshots kept sharp.
   No web font, no script: everything is on the page. */

/* white ground whatever the system theme (2026-11-21: white text on black is hard to read; the black version followed a dark Windows theme) */
:root {
    --ground: #fff;
    --panel: #f2f2f2;
    --edge: #cfcfcf;
    --ink: #000;
    --ink-2: #4d4d4d;
    --red: #B5202E;
    --red-solid: #B5202E;
    --on-red: #fff;
    --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace;
    --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --page: 1180px;
    color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--ground); color: var(--ink); font: 16px/1.62 var(--sans); -webkit-font-smoothing: antialiased; }

p, li { text-align: justify; hyphens: auto; }                    /* body text is justified; the footer, the notes under a block and the tables stay left */
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
code, kbd, pre { font-family: var(--mono); }
code, kbd { font-size: .86em; }
code { background: var(--panel); border: 1px solid var(--edge); padding: 0 5px; }
kbd { border: 1px solid var(--ink-2); border-bottom-width: 3px; padding: 0 6px; }
.page { max-width: var(--page); margin: 0 auto; padding: 0 24px; }

/* the bar at the top */
.top { position: sticky; top: 0; z-index: 20; background: var(--ground); border-bottom: 1px solid var(--edge); }
.top .page { display: flex; align-items: center; gap: 28px; height: 58px; }
.mark { display: flex; align-items: center; gap: 12px; color: var(--ink); font: 700 1rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }
.mark svg { width: 28px; height: 28px; }
.top nav { margin-left: auto; display: flex; gap: 22px; font: .8rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.top nav a { color: var(--ink-2); padding: 6px 0; border-bottom: 2px solid transparent; text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.top nav a[aria-current] { color: var(--ink); border-bottom-color: var(--red); }

/* the first screen */
.opening { border-bottom: 1px solid var(--edge); padding: 64px 0 56px; }
.opening .page { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.kicker { font: .78rem/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--red); margin-bottom: 18px; }
.opening h1 { font: 700 clamp(2.5rem, 5.4vw, 4.3rem)/1.02 var(--mono); letter-spacing: -.03em; }
.opening h1 em { font-style: normal; color: var(--red); }
.opening .lede { margin-top: 20px; color: var(--ink-2); font-size: 1.05rem; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-block; padding: 12px 22px; font: 700 .8rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink);
    border: 2px solid var(--ink); text-decoration: none; background: transparent; }
.button:hover { background: var(--ink); color: var(--ground); }
.button.main { background: var(--red-solid); border-color: var(--red-solid); color: var(--on-red); }
.button.main:hover { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.aside { margin-top: 14px; font: .78rem/1.5 var(--mono); color: var(--ink-2); text-align: left; }
.frame { position: relative; border: 1px solid var(--ink); }
.frame img { width: 100%; filter: grayscale(1) contrast(1.08); }
.frame::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px); }
.frame figcaption { position: absolute; left: 0; bottom: 0; background: var(--red-solid); color: var(--on-red); font: 700 .7rem/1 var(--mono); letter-spacing: .12em;
    text-transform: uppercase; padding: 7px 10px; z-index: 1; }

/* the blocks of a page: a numbered label on the left, the matter on the right */
.block { border-bottom: 1px solid var(--edge); padding: 58px 0; }
.block .page { display: grid; grid-template-columns: 220px 1fr; gap: 48px; }
.label { align-self: start; position: sticky; top: 82px; }
.label .no { display: block; font: 700 .8rem/1 var(--mono); letter-spacing: .14em; color: var(--red); margin-bottom: 12px; }
h2 { font: 700 1.55rem/1.15 var(--mono); letter-spacing: -.02em; }
h3 { font: 700 .86rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.intro { color: var(--ink-2); max-width: 44em; margin-bottom: 26px; }

.cards { display: grid; gap: 0; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--edge); border-left: 1px solid var(--edge); }
.tile { border-right: 1px solid var(--edge); border-bottom: 1px solid var(--edge); padding: 20px 20px 22px; }
.tile p { color: var(--ink-2); font-size: .95rem; }
.tile .gallery { grid-template-columns: 1fr; margin-top: 14px; }

.steps { display: grid; gap: 0; grid-template-columns: repeat(4, 1fr); counter-reset: n; list-style: none; border-top: 1px solid var(--edge); border-left: 1px solid var(--edge); }
.steps li { counter-increment: n; border-right: 1px solid var(--edge); border-bottom: 1px solid var(--edge); padding: 18px 18px 20px; color: var(--ink-2); font-size: .94rem; }
.steps li::before { content: "0" counter(n); display: block; color: var(--red); font: 700 .78rem/1 var(--mono); letter-spacing: .12em; margin-bottom: 12px; }
.steps li b { display: block; color: var(--ink); font: 700 .86rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }

.gallery { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-top: 22px; }
.gallery img, .split img { border: 1px solid var(--edge); }

.split { display: grid; gap: 40px; grid-template-columns: 1fr 1fr; align-items: center; }
.split + .split { margin-top: 44px; }
.split p { color: var(--ink-2); margin-bottom: 12px; }
.split h3 { font-size: 1.05rem; text-transform: none; letter-spacing: -.01em; }

/* the two tutorials, side by side */
.lessons { display: grid; gap: 0; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--edge); border-left: 1px solid var(--edge); }
.lesson { display: flex; flex-direction: column; border-right: 1px solid var(--edge); border-bottom: 1px solid var(--edge); color: var(--ink); text-decoration: none; }
.lesson img { width: 100%; image-rendering: pixelated; border-bottom: 1px solid var(--edge); }
.lesson .copy { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lesson .no { font: 700 .72rem/1 var(--mono); letter-spacing: .14em; color: var(--red); text-transform: uppercase; }
.lesson h3 { font-size: 1.2rem; text-transform: none; letter-spacing: -.01em; margin: 0; }
.lesson p { color: var(--ink-2); font-size: .95rem; }
.lesson .go { margin-top: auto; padding-top: 6px; font: 700 .78rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.lesson:hover { background: var(--panel); color: var(--ink); }
.lesson:hover .go { color: var(--red); }
.lessons.wide { grid-template-columns: 1fr; }
.lessons.wide .lesson { flex-direction: row; }
.lessons.wide .lesson img { width: 40%; border-bottom: 0; border-right: 1px solid var(--edge); object-fit: cover; }

.ticklist { list-style: none; }
.ticklist li { padding: 12px 0 12px 34px; position: relative; color: var(--ink-2); border-bottom: 1px solid var(--edge); }
.ticklist li:first-child { border-top: 1px solid var(--edge); }
.ticklist li::before { content: ""; position: absolute; left: 4px; top: 21px; width: 10px; height: 10px; background: var(--red-solid); }
.ticklist li b { color: var(--ink); }

.warning { border-left: 3px solid var(--red); background: var(--panel); padding: 13px 17px; color: var(--ink-2); margin: 16px 0; }
.warning b { color: var(--ink); }

table { width: 100%; border-collapse: collapse; font-size: .94rem; margin: 14px 0; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--edge); vertical-align: top; color: var(--ink-2); }
th { color: var(--ink); font: 700 .74rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; border-bottom: 1px solid var(--ink); }
td b { color: var(--ink); font-family: var(--mono); font-size: .86rem; letter-spacing: .04em; }

/* the guide and the questions */
.manual { display: grid; grid-template-columns: 230px 1fr; gap: 48px; padding: 46px 24px 90px; max-width: var(--page); margin: 0 auto; }
.contents { position: sticky; top: 80px; align-self: start; font: .8rem/1.4 var(--mono); max-height: calc(100vh - 100px); overflow-y: auto; border-left: 1px solid var(--edge); padding-left: 16px; }
.contents a { display: block; padding: 5px 0; color: var(--ink-2); text-decoration: none; }
.contents a:hover { color: var(--red); }
.contents b { display: block; margin: 16px 0 4px; color: var(--ink); }
.text { min-width: 0; max-width: 56rem; }
.text h2 { margin-top: 52px; padding-top: 16px; border-top: 1px solid var(--ink); }
.text h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.text h3 { margin-top: 28px; }
.text p, .text li { color: var(--ink); }
.text p { margin: 11px 0; }
.text ul, .text ol { margin: 10px 0 10px 22px; }
.text li { margin: 4px 0; }
.text li::marker { color: var(--red); }
.text code { word-break: break-word; }
.text pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel); border: 1px solid var(--edge); padding: 14px 16px; overflow-x: auto; margin: 14px 0; }
.text pre code { background: none; border: 0; padding: 0; }
.text h2, .text h3 { scroll-margin-top: 76px; }
.manual .text h1 { font: 700 clamp(2rem, 4vw, 2.9rem)/1.05 var(--mono); letter-spacing: -.03em; margin: 0 0 16px; }
.questions { max-width: 880px; padding: 60px 24px 90px; }
.questions h1 { font: 700 clamp(2rem, 4vw, 2.9rem)/1.05 var(--mono); letter-spacing: -.03em; margin-bottom: 14px; }
.questions h2 { font: 700 1.05rem/1.3 var(--mono); letter-spacing: -.01em; margin: 38px 0 10px; padding-top: 14px; border-top: 1px solid var(--edge); }
.questions p { margin-bottom: 12px; }

.foot { padding: 40px 0 46px; color: var(--ink-2); font-size: .88rem; }
.foot .page { display: grid; gap: 12px; }
.foot p { text-align: left; hyphens: manual; }
.foot a { color: var(--ink-2); }
.foot a:hover { color: var(--red); }
.foot p:last-child { font: .78rem/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; }

@media (max-width: 920px) {
    .opening .page, .split, .manual, .cards, .steps, .gallery, .lessons { grid-template-columns: 1fr; }
    .block .page { grid-template-columns: 1fr; gap: 22px; }
    .label { position: static; }
    .contents { position: static; max-height: 12rem; border: 1px solid var(--edge); padding: 4px 14px 8px; }
    .lessons.wide .lesson { flex-direction: column; }
    .lessons.wide .lesson img { width: 100%; border-right: 0; border-bottom: 1px solid var(--edge); }
    .top nav { gap: 14px; font-size: .72rem; }
}
@media (max-width: 560px) {
    .mark span { display: none; }
    .block { padding: 40px 0; }
    .opening { padding: 40px 0 36px; }
    .top .page { height: auto; flex-wrap: wrap; gap: 6px 14px; padding-top: 10px; padding-bottom: 4px; }
    .top nav { margin-left: 0; width: 100%; gap: 6px 16px; flex-wrap: wrap; letter-spacing: .06em; }
}

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--edge) var(--ground); }

/* a two-column spec table keeps a readable label column; others become cards when the room is short */
.text table[data-cols="2"] td:first-child, table[data-cols="2"] td:first-child { width: 32%; }
@media (max-width: 640px) {
    table[data-cols="2"], table[data-cols="2"] tbody, table[data-cols="2"] tr, table[data-cols="2"] td { display: block; width: 100%; }
    table[data-cols="2"] tr { border-bottom: 1px solid var(--edge); padding: 8px 0; }
    table[data-cols="2"] td { border: 0; padding: 2px 0; }
    table[data-cols="2"] td:first-child { width: 100%; color: var(--ink); }
}

/* the tutorial pages: pictures with captions, code, a sub-list in the contents */
.text figure { margin: 20px 0 24px; }
.text figure img { border: 1px solid var(--edge); }
.text figcaption { margin-top: 8px; font: .78rem/1.5 var(--mono); color: var(--ink-2); }
.text pre { tab-size: 4; font-size: .88rem; line-height: 1.5; }
.text .warning p { margin: 0; }
.contents a.sub { padding-left: 14px; font-size: .74rem; }
.text table { display: block; overflow-x: auto; }
.text.tutorial pre { white-space: pre; overflow-wrap: normal; }
.text.tutorial figure img[src*="t_game"], .text.tutorial figure img[src^="images/g_"] { image-rendering: pixelated; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.steps p, .steps li { text-align: left; hyphens: manual; }     /* four columns of ~170px: justified, the word gaps open into rivers */
