@font-face {
  font-family: "Plex Mono";
  src: url("ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0c0e;
  --panel: #141518;
  --fg: #ecedef;
  --muted: #8d9097;
  --dim: #4a4d54;
  --line: #2a2c31;
  --hot: #ffd21a;
  --red: #ff3b3b;
  --green: #62d63a;
  --blue: #3f8cff;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.65 var(--mono);
  overflow-x: hidden;
}
/* faint scanlines */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
  z-index: 10;
}

a { color: var(--hot); text-decoration: none; }
a:hover, a:focus-visible { background: var(--hot); color: var(--bg); outline: none; }
::selection { background: var(--hot); color: var(--bg); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
header { padding: 28px 0 8px; }
.logo {
  margin: 0;
  /* figlet art is 58 columns; 1ch of Plex Mono = 0.6em */
  font-size: min(15px, calc((100vw - 32px) / 35.5));
  line-height: 1.15;
  color: var(--fg);
  white-space: pre;
  overflow: hidden;
}
.logo { padding-top: 2px; }
.logo.stack { display: none; font-size: min(15px, calc((100vw - 32px) / 19)); }
@media (max-width: 560px) {
  .logo.wide { display: none; }
  .logo.stack { display: block; }
}
.logo:hover { background: none; color: var(--fg); }
.tag { color: var(--muted); margin: 10px 0 0; }

nav {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  margin: 18px 0 0;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}
nav a { color: var(--muted); }
nav a::before { content: "["; color: var(--dim); }
nav a::after { content: "]"; color: var(--dim); }
nav a[aria-current="page"] { color: var(--fg); }
nav a[aria-current="page"]::before { content: "[*"; color: var(--hot); }
nav { align-items: baseline; }
.more { position: relative; }
.more summary { list-style: none; cursor: pointer; color: var(--muted); }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "["; color: var(--dim); }
.more summary::after { content: "]"; color: var(--dim); }
.more summary.cur { color: var(--fg); }
.more summary.cur::before { content: "[*"; color: var(--hot); }
.more summary:hover, .more summary:focus-visible { background: var(--hot); color: var(--bg); outline: none; }
.more summary:hover::before, .more summary:hover::after, .more summary:focus-visible::before, .more summary:focus-visible::after { color: inherit; }
.more[open] summary span { display: inline-block; transform: rotate(180deg); }
.more .menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 15ch; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 4px 4px 0 var(--bg), 5px 5px 0 var(--line);
}
.more .menu a { white-space: nowrap; }
nav a:hover::before, nav a:hover::after { color: inherit; }

/* ---------- content ---------- */
main { padding: 26px 0 40px; }

h1, h2, h3 { font-weight: 500; margin: 0; line-height: 1.3; }
h1 { font-size: 15px; color: var(--hot); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 4px; }
h1::before { content: "== "; color: var(--dim); }
h1::after { content: " =="; color: var(--dim); }
h2 { font-size: 15px; margin: 32px 0 8px; text-transform: uppercase; }
h2::before { content: "## "; color: var(--hot); }
h3 { font-size: 15px; margin: 18px 0 4px; color: var(--fg); }
h3::before { content: "> "; color: var(--dim); }
p, ul, ol { margin: 0 0 12px; }
.meta { color: var(--muted); margin-bottom: 22px; }
ul { list-style: none; padding-left: 0; }
ul li { padding-left: 2ch; position: relative; }
ul li::before { content: "-"; position: absolute; left: 0; color: var(--dim); }
ol { padding-left: 3ch; }
ol li::marker { color: var(--hot); }
strong { font-weight: 500; color: var(--hot); }
.muted { color: var(--muted); }
hr { border: 0; margin: 28px 0; height: 1.65em; color: var(--dim); overflow: hidden; }
hr::before { content: "--------------------------------------------------------------------------------------------------------"; display: block; white-space: nowrap; }

/* ASCII box: + corners drawn with pseudo elements */
.box {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px 18px;
  margin: 18px 0;
}
.box::before, .box::after, .box > .c1, .box > .c2 {
  content: "+"; position: absolute; color: var(--muted);
  line-height: 1; font-size: 15px; width: 1ch; text-align: center;
}
.box::before { top: -8px; left: -5px; }
.box::after { top: -8px; right: -5px; }
.box > .c1 { bottom: -7px; left: -5px; }
.box > .c2 { bottom: -7px; right: -5px; }
.box .label {
  position: absolute; top: -.85em; left: 14px;
  background: var(--bg); padding: 0 6px; color: var(--muted);
  font-size: 13px;
}

/* terminal block */
.term { white-space: pre-wrap; word-break: break-word; margin: 0; }
.term .p { color: var(--green); }
.term .c { color: var(--fg); }
.term .o { color: var(--muted); }
.cursor {
  display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em;
  background: var(--hot); animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* controller art */
.pad {
  margin: 6px 0 0;
  white-space: pre;
  font-size: min(15px, calc((100vw - 72px) / 26.4));
  line-height: 1.2;
  color: var(--muted);
  overflow: hidden;
}
.pad .k { color: var(--fg); transition: color .08s, background .08s; }
.pad .k.on { background: var(--hot); color: var(--bg); }
.combo { margin: 10px 0 0; color: var(--muted); min-height: 1.65em; }
.combo b { font-weight: 500; color: var(--dim); }
.combo b.done { color: var(--fg); }
.combo b.now { color: var(--bg); background: var(--hot); }

.grid { display: grid; grid-template-columns: 1fr; gap: 0 24px; }
.grid > .box { margin: 18px 0; }
.grid > .box h3 { margin-top: 0; }
.grid > .box p:last-child, .box > p:last-child, .box ul:last-child { margin-bottom: 0; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }

dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) {
  dl { grid-template-columns: 1fr; }
  dd { margin-bottom: 8px; }
}

.small { font-size: 13px; color: var(--muted); }

/* ---------- footer ---------- */
footer {
  border-top: 1px dashed var(--line);
  padding: 20px 0 40px;
  color: var(--muted);
  font-size: 13px;
}
footer .who { margin: 0; }
footer .row { display: flex; flex-wrap: wrap; gap: 4px 14px; }

.todo { background: var(--red); color: #fff; padding: 0 4px; }

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  .pad .k { transition: none; }
}

/* email links read as links */
a[href^="mailto:"] { text-decoration: underline dashed; text-underline-offset: 3px; }

/* drop-down arrow uses the bracket grey */
.more summary span { color: var(--dim); }
.more summary:hover span, .more summary:focus-visible span { color: inherit; }

/* visible to screen readers and search engines only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
