/* Daniel Brockwell: one hand-written stylesheet. Tokens from the design spec; all text pairings
   pass WCAG AA. Dark mode follows the device. */
:root {
  --bg: #F6F7F3; --surface: #FFFFFF; --ink: #1A1F1C; --muted: #56605A; --border: #D5DAD2;
  --accent: #1F6F5C; --on-accent: #FFFFFF; --warn: #8A5A00; --code-bg: #ECEFE8;
  --lcd-bg: #B4C0A6; --lcd-ink: #1E2A33; --bezel: #3A423D;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --pixel: "Matrix Sans", var(--mono);
  --radius: 6px; --gutter: 16px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614; --surface: #1A201D; --ink: #E7ECE6; --muted: #A3ADA5; --border: #2E3732;
    --accent: #6FCFB4; --on-accent: #121614; --warn: #E0B050; --code-bg: #1F2622; --bezel: #0B0E0C;
  }
}
@media (min-width: 600px) { :root { --gutter: 24px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 var(--font);
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; padding-bottom: 48px; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; font-weight: 600; margin: 1.6em 0 0.5em; }
h1 { font-size: 32px; margin-top: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
@media (min-width: 600px) { h1 { font-size: 40px; } h2 { font-size: 32px; } h3 { font-size: 24px; } }
.prose h2 { font-size: 24px; } .prose h3 { font-size: 20px; }
p, ul, ol, table, dl { margin: 0 0 1em; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: 15px; }
code { background: var(--code-bg); padding: 1px 4px; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); padding: 16px; border-radius: var(--radius); overflow-x: auto; }
pre code { background: none; padding: 0; }
kbd {
  display: inline-block; min-width: 1.8em; padding: 0 6px; text-align: center; line-height: 1.6;
  border: 1px solid var(--border); border-bottom-width: 3px; border-radius: 4px; background: var(--surface);
  white-space: nowrap;
}
.small { font-size: 15px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
hr, .rule { border: 0; border-top: 1px dotted var(--muted); margin: 32px 0; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: 68ch; }

.skip { position: absolute; left: 8px; top: -100px; background: var(--surface); padding: 8px 16px; z-index: 10; }
.skip:focus { top: 8px; }

/* header and footer */
.site-header { border-bottom: 1px dotted var(--muted); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 8px; padding-bottom: 8px; }
.wordmark { font-family: var(--pixel); font-size: 20px; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; letter-spacing: 0.02em; }
.cursor { display: inline-block; width: 0.6em; height: 1em; margin-left: 4px; background: var(--accent); animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } * { transition: none !important; } }
.nav { list-style: none; display: flex; flex-wrap: wrap; gap: 0 4px; margin: 0; padding: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; color: var(--accent); }
.site-footer { border-top: 1px dotted var(--muted); padding: 24px 0 32px; }
.site-footer p { margin: 0 0 8px; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0 24px; padding: 0; margin: 0 0 8px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px;
  border-radius: var(--radius); border: 2px solid var(--accent); background: var(--accent); color: var(--on-accent);
  font-weight: 600; text-decoration: none; transition: filter 150ms;
}
.button:hover { filter: brightness(1.1); }
.button-secondary { background: transparent; color: var(--accent); }
.buttons { display: flex; flex-wrap: wrap; gap: 16px; margin: 24px 0; }

/* LCD panel */
.lcd {
  background: var(--lcd-bg); color: var(--lcd-ink); border-radius: 4px; padding: 12px;
  border: 6px solid var(--bezel); box-shadow: inset 0 2px 6px rgb(0 0 0 / 0.35);
  display: inline-block; max-width: 100%;
}
.lcd-text { width: 20ch; height: 5.4em; margin: 0; padding: 0; background: none; font-family: var(--pixel); font-size: 16px; line-height: 1.35; white-space: pre; overflow: hidden; color: var(--lcd-ink); }
.lcd-shot { padding: 0; line-height: 0; }
.lcd-shot img { display: block; image-rendering: pixelated; image-rendering: crisp-edges; border-radius: 2px; }

/* badges and model strip */
.badge { display: inline-block; font-size: 14px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid transparent; line-height: 1.5; }
.badge-released { background: var(--accent); color: var(--on-accent); }
.badge-working-build { border-color: var(--accent); color: var(--accent); }
.badge-in-development { border-color: var(--ink); color: var(--ink); }
.badge-planned { border: 1px dashed var(--muted); color: var(--muted); }
.badge-exploring { color: var(--muted); padding-left: 0; padding-right: 0; }
.models { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 8px 0; }
.key { font-family: var(--mono); font-size: 13px; line-height: 1; padding: 5px 6px 4px; border-radius: 4px; border: 1px solid var(--muted); border-bottom-width: 2px; color: var(--muted); }
.key-works { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.key-no { text-decoration: line-through; }

/* cards */
.grid { display: grid; gap: 24px; grid-template-columns: 1fr; margin: 0 0 32px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card .lcd { align-self: flex-start; }
.card .lcd-text { font-size: 14px; }
.card-title { margin: 8px 0 0; font-size: 20px; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-summary { margin: 0; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: auto 0 0; padding-top: 8px; }
.count { font-family: var(--mono); font-size: 15px; color: var(--muted); }
.frame { border-radius: var(--radius); border: 1px solid var(--border); }

/* home */
.hero { display: grid; gap: 32px; align-items: center; padding: 32px 0 16px; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr 1fr; padding-top: 48px; } }
.hero h1 { margin-top: 0; }
.lede { font-size: 20px; max-width: 40ch; }
.hero .lcd-shot img { width: 500px; }
.jump { display: flex; flex-wrap: wrap; gap: 0 24px; padding: 0; list-style: none; }
.jump a { display: inline-flex; align-items: center; min-height: 44px; }

/* entry pages */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; padding: 0; margin: 16px 0 0; font-size: 15px; }
.breadcrumb li + li::before { content: "/"; margin: 0 8px; color: var(--muted); }
.breadcrumb a { display: inline-flex; min-height: 44px; align-items: center; }
.breadcrumb [aria-current] { color: var(--muted); text-decoration: none; }
.entry-head h1 { margin: 8px 0; }
.entry-badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.shots { display: flex; flex-wrap: wrap; gap: 24px; margin: 24px 0 32px; }
.shots figure { margin: 0; max-width: 100%; }
.shots figcaption { font-size: 15px; color: var(--muted); margin-top: 4px; }
.entry-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .entry-grid { grid-template-columns: minmax(0, 1fr) 400px; } .entry-side { order: 2; } }
.entry-body > h2:first-child { margin-top: 0; }
.download-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 4px; margin-bottom: 32px; }
.download-box h2 { margin-top: 0; font-size: 24px; }
.dl-file + .dl-file { border-top: 1px dotted var(--muted); padding-top: 16px; }
.dl-label { font-size: 18px; margin: 0 0 8px; }
.dl-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; font-size: 15px; }
.dl-facts dt { color: var(--muted); }
.dl-facts dd { margin: 0; }
.hash { font-size: 13px; word-break: break-all; user-select: all; }
.dl-needs { font-size: 15px; }
.older { font-size: 15px; padding-left: 20px; }

/* tables */
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--border); }
thead th { border-bottom: 1px dotted var(--muted); color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.compat .state-no td:nth-child(2) { color: var(--muted); }
.compat .state-untested td:nth-child(2) { color: var(--warn); }
.callout { border-left: 4px solid var(--warn); background: var(--surface); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 24px; }
.callout p:last-child { margin: 0; }
.draft { border: 1px dashed var(--warn); color: var(--warn); padding: 8px 12px; border-radius: var(--radius); font-size: 15px; }
.latest { list-style: none; padding: 0; max-width: 68ch; }
.latest li { margin-bottom: 16px; }

.pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px dotted var(--muted); margin-top: 48px; padding-top: 16px; }
.pager a { display: flex; flex-direction: column; min-height: 44px; text-decoration: none; }
.pager a[rel="next"] { text-align: right; }

@media print {
  .site-header nav, .site-footer, .skip, .button { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; }
  h1 { font-size: 22pt; margin-top: 0; } h2 { font-size: 14pt; margin-top: 12pt; }
  .prose { max-width: none; }
}
