/* Last Gen Labs. Colors and type are in DESIGN.md; each color has one job. */
:root {
  --ink: #E8E6E1;
  --ink-soft: #A2A6AC;
  --paper: #14161B;
  --shade: #212428;
  --edge: #2E3237;
  --screen: #111214;
  --screen-cell: #2A2E33;
  --screen-text: #E4E6E8;
  --red: #E0362C;
  --link: #9DB9E8;
  --head: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --pixel: "Silkscreen", "Courier New", monospace;
  --bevel-hi: #DFDFDF;
  --bevel-face: #C0C0C0;
  --bevel-lo: #808080;
  --bevel-dark: #404040;
  --title-bar: #0A246A;
  --text: "Source Serif 4", Georgia, serif;
  --measure: 40rem;
  --wide: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0;
  background-color: var(--paper);
  /* A faint tiled starfield, the way homepages did it: one small tile, repeated. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='%23fff'%3E%3Crect x='14' y='22' width='1' height='1' opacity='.35'/%3E%3Crect x='71' y='9' width='1' height='1' opacity='.2'/%3E%3Crect x='103' y='58' width='2' height='2' opacity='.18'/%3E%3Crect x='39' y='87' width='1' height='1' opacity='.3'/%3E%3Crect x='88' y='101' width='1' height='1' opacity='.25'/%3E%3Crect x='5' y='64' width='1' height='1' opacity='.15'/%3E%3Crect x='57' y='47' width='1' height='1' opacity='.12'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--ink);
  font: 400 1.1875rem/1.6 var(--text);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: 1.9rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.55rem; margin-bottom: 0.6rem; }
p { margin: 0 0 1rem; }

/* Header and footer, shared by every page */
.top {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--head);
  font-size: 1.1rem;
}
.mark { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.25rem; }
.mark svg { width: 1.6rem; height: 1.6rem; }
.top nav { display: flex; gap: 1.4rem; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.top nav a:hover, .top nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.bottom { max-width: var(--wide); margin: 0 auto; padding: 1rem 1.5rem 2.5rem; color: var(--ink-soft); font-size: 0.95rem; }

/* Home page */
main > section { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }
.opening { padding-top: 3.5rem !important; padding-bottom: 2rem !important; }
.opening h1 { max-width: 15em; margin-bottom: 1rem; }
.lede { max-width: 34em; font-size: 1.3rem; color: var(--ink-soft); }

.made { padding-bottom: 2.5rem !important; }
.projects { list-style: none; margin: 0; padding: 0; max-width: 60rem; }
.projects li { display: grid; grid-template-columns: 20rem minmax(0, 1fr); gap: 0 2rem; align-items: start; padding: 1.75rem 0; }
.thumb { display: block; background: var(--screen); overflow: hidden; border: 2px solid; border-color: var(--bevel-lo) var(--bevel-hi) var(--bevel-hi) var(--bevel-lo); }

/* The 90s nods (DESIGN.md): an old desktop window around each screenshot, grooved rules, and 88x31 buttons. */
.win { background: var(--bevel-face); padding: 3px; border: 2px solid; border-color: var(--bevel-hi) var(--bevel-dark) var(--bevel-dark) var(--bevel-hi); box-shadow: inset -1px -1px 0 var(--bevel-lo); }
.win-bar { display: flex; align-items: center; gap: 2px; height: 1.25rem; padding: 0 3px 0 6px; margin-bottom: 3px; background: linear-gradient(90deg, var(--title-bar), #3A6EA5); color: #fff; font: 0.7rem/1 var(--pixel); }
.win-bar span { flex: 1; white-space: nowrap; overflow: hidden; }
.win-bar i { width: 0.95rem; height: 0.8rem; background: var(--bevel-face); border: 1px solid; border-color: var(--bevel-hi) var(--bevel-dark) var(--bevel-dark) var(--bevel-hi); }
hr { border: 0; border-top: 2px groove #5A5F66; margin: 0; max-width: 60rem; }
.projects .rule { display: block; padding: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 1.5rem 0 1.25rem; }
.badge { width: 88px; height: 31px; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 0.72rem/1 var(--pixel); text-decoration: none; border: 1px solid; border-color: #9A9A9A #3A3A3A #3A3A3A #9A9A9A; letter-spacing: 0.02em; }
.badge small { font-size: 0.55rem; margin-top: 2px; }
.b-kabl { background: #111; color: #fff; box-shadow: inset 0 -3px 0 #E0362C; }
.b-cl { background: #1B1B1B; color: #F47521; }
.b-cl b { font-weight: 400; color: #fff; font-size: 0.6rem; margin-top: 2px; }
/* Hazard stripes along the top and bottom edges, with the words on plain yellow between them. */
.b-build { color: #111; background-color: #F2C200; background-image: repeating-linear-gradient(135deg, #111 0 5px, transparent 5px 10px), repeating-linear-gradient(135deg, #111 0 5px, transparent 5px 10px); background-size: 100% 5px; background-repeat: no-repeat; background-position: top, bottom; font-size: 0.6rem; }
.b-build small { font-size: 0.5rem; }
.b-cookie { background: #C0C0C0; color: #111; }
.updated { font: 0.7rem/1.6 var(--pixel); color: var(--ink-soft); }
.thumb img { width: 100%; height: auto; }
.projects h3 { font-size: 1.45rem; margin-bottom: 0.35rem; }
.projects h3 a { color: var(--ink); text-decoration: none; }
.projects h3 a:hover { text-decoration: underline; }
.projects p { margin-bottom: 0.5rem; max-width: 36em; }
.projects .more { font-size: 1rem; color: var(--ink-soft); }

.writing { padding-top: 1rem !important; padding-bottom: 3rem !important; }
.posts { list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.posts li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0 1.25rem; padding: 0.9rem 0; }
.posts time { font-family: var(--head); font-size: 1.05rem; color: var(--ink-soft); padding-top: 0.15rem; }
.posts a { font-family: var(--head); font-weight: 600; font-size: 1.35rem; color: var(--ink); text-decoration: none; line-height: 1.2; }
.posts a:hover { text-decoration: underline; }
.posts p { grid-column: 2; margin: 0.25rem 0 0; font-size: 1.05rem; color: var(--ink-soft); }

.hello { padding-top: 2.5rem !important; padding-bottom: 1rem !important; background: var(--shade); max-width: none !important; }
.hello > * { max-width: calc(var(--wide) - 3rem); margin-left: auto; margin-right: auto; }
.hello p { padding-bottom: 2rem; }

/* KABL's guide: tools/guide.html, drawn by tools/guide.mjs from KABL's real schedule. It is pictured on the home
   page (img/kabl-guide.png) and in the link-preview card (tools/og.html). */
.guide { margin: 0; }
.g-screen { position: relative; background: var(--screen); color: var(--screen-text); border-radius: 6px; padding: 0.75rem 0.75rem 0.9rem; font-family: var(--head); overflow: hidden; }
.g-row, .g-times { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); align-items: center; }
.g-times { height: 1.6rem; font-size: 0.85rem; color: #A9AEB4; }
.g-row { height: 2.35rem; }
.g-ch { font-weight: 600; font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 0.6rem; }
.g-ch b { display: inline-block; min-width: 1.5em; color: #A9AEB4; font-weight: 500; }
.g-slots { position: relative; height: 100%; }
.g-times .g-slots span { position: absolute; top: 0.2rem; transform: translateX(0.3rem); }
.g-show, .g-break { position: absolute; top: 0.18rem; bottom: 0.18rem; border-radius: 3px; }
.g-show { background: var(--screen-cell); padding: 0 0.45rem; font-size: 0.92rem; font-weight: 500; line-height: 1.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 2px 0 0 var(--screen); }
.g-break { background: repeating-linear-gradient(135deg, #24272B 0 4px, #1C1F22 4px 8px); box-shadow: inset 2px 0 0 var(--screen); }
.g-nowline { position: absolute; top: 0.6rem; bottom: 0.4rem; left: calc(0.75rem + 9.5rem + (100% - 1.5rem - 9.5rem) * var(--now)); width: 2px; background: var(--red); }

/* Blog post */
.post { max-width: var(--measure); margin: 0 auto; padding: 3rem 1.5rem 1rem; }
.post-head { margin-bottom: 2.25rem; }
.post-head time { display: block; font-family: var(--head); font-size: 1.05rem; color: var(--ink-soft); margin-top: 1rem; }
.post h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.post h2 { font-size: 1.6rem; margin: 2.5rem 0 0.9rem; }
.post h3 { font-size: 1.3rem; margin: 2rem 0 0.7rem; }
.post ul, .post ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.post li { margin-bottom: 0.4rem; }
.post hr { border: 0; height: 2.5rem; margin: 0; }
.post code { font-size: 0.9em; background: var(--shade); padding: 0.1em 0.3em; border-radius: 3px; }
.post .refs { font-size: 1rem; color: var(--ink-soft); }
.series { font-size: 1rem; color: var(--ink-soft); }

/* Blog index */
.blog-index { max-width: var(--wide); margin: 0 auto; padding: 3rem 1.5rem 1rem; }
.blog-index h1 { margin-bottom: 2rem; }

@media (max-width: 760px) {
  body { font-size: 1.125rem; }
  .top { padding: 1rem; flex-wrap: wrap; }
  .top nav { gap: 1rem; font-size: 1.05rem; }
  main > section, .post, .blog-index { padding-left: 1rem; padding-right: 1rem; }
  .opening { padding-top: 1.75rem !important; padding-bottom: 2rem !important; }
  .lede { font-size: 1.15rem; }
  .projects li { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; padding: 1.25rem 0; }
  .win { max-width: 24rem; }
  .posts li { grid-template-columns: minmax(0, 1fr); }
  .posts p { grid-column: 1; }
  .hello > * { max-width: none; }
}
