:root {
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  /* Type scale: status bar / terminal + cards / intro line. */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 1rem;
  --green: #9dffb0;
  --green-bright: #d7ffdd;
  --green-dim: #5bbf6d;
  --red: #ff6b6b;
  --orange: #ffa94d;
  --bg: #030806;
  --bg-glow: #0b2815;
  --fg: #f0fff2;
  --fg-muted: #b2dcb8;
  --line: rgba(157, 255, 176, 0.42);
  --line-soft: rgba(157, 255, 176, 0.18);
  --glow: 0 0 4px rgba(157, 255, 176, 0.35);
  --hover: rgba(157, 255, 176, 0.06);
  /* Spacing scale (0.25rem grid). */
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  /* The content column is centred (720px) on wide screens, 5vw on narrow
     ones; the full-width header and footer keep a smaller edge. */
  --gutter: max(5vw, calc(50vw - 360px));
  --edge: clamp(var(--space-4), 5vw, var(--space-8));
  color-scheme: dark;
}
/* High-contrast light (GitHub Light High Contrast palette), picked up from
   the visitor's OS setting. Dark stays the default so browsers without the
   media query keep the original look. */
@media (prefers-color-scheme: light) {
  :root {
    --green: #055d20;
    --green-bright: #0e1116;
    --green-dim: #4b535d;
    --red: #a0111f;
    --orange: #9a4500;
    --bg: #ffffff;
    --bg-glow: #eef1f4;
    --fg: #0e1116;
    --fg-muted: #2f3742;
    --line: rgba(14, 17, 22, 0.7);
    --line-soft: rgba(14, 17, 22, 0.3);
    --glow: none;
    --hover: rgba(5, 93, 32, 0.06);
    color-scheme: light;
  }
}
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  color: var(--fg);
}
body {
  margin: 0;
  background: radial-gradient(circle at 50% 0, var(--bg-glow), var(--bg) 38rem);
  font: var(--text-md)/1.7 var(--font-mono);
  overflow-wrap: anywhere;
}
/* Header and footer span the viewport; the footer sits on the bottom edge
   of short pages. */
.site-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
a {
  color: var(--green);
  text-underline-offset: 0.2em;
}
a:hover {
  color: var(--fg);
}
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}
.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: center;
  padding: var(--space-6) var(--edge);
  border-bottom: 1px solid var(--line);
  font-size: var(--text-xs);
}
.site-mark {
  font-weight: 700;
  text-decoration: none;
}
.site-nav {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.site-main {
  flex: 1;
  margin-inline: var(--gutter);
  padding-block: var(--space-12);
}
article {
  max-width: 65ch;
  font-size: 1.0625rem;
  line-height: 1.7;
}
.prose {
  font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.04em;
  line-height: 1.12;
  color: var(--fg);
}
h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  margin: var(--space-6) 0 var(--space-8);
}
.prose h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: var(--space-4);
}
.subtitle {
  margin: 0 0 var(--space-6);
  color: var(--fg-muted);
  font-style: italic;
}
h2 {
  font-size: 2rem;
  margin-top: var(--space-12);
}
h3 {
  font-size: 1.5rem;
  margin-top: var(--space-8);
}
h4 {
  font-size: 1.2rem;
}
.section-emoji {
  display: inline-block;
  font-size: 1.5rem;
  vertical-align: middle;
  letter-spacing: 0;
}
.lede {
  color: var(--fg-muted);
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin-block: var(--space-10);
}
/* Literature page: poems and stories side by side on wide screens, wider
   than the content column and centred on the viewport. */
@media (min-width: 64rem) {
  .tell-kinds {
    --tell-width: min(60rem, 100vw - 2 * var(--edge));
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-10);
    width: var(--tell-width);
    margin-left: calc(50vw - var(--gutter) - var(--tell-width) / 2);
  }
}
.link-card {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: var(--space-4);
  border: 1px solid var(--line);
  font-size: var(--text-sm);
  text-decoration: none;
}
.link-card:hover {
  background: var(--hover);
  border-color: var(--green);
}
.draft-badge,
.wip-badge {
  color: var(--red);
  font-size: var(--text-xs);
}
.wip-badge {
  color: var(--orange);
}
.page-meta,
.breadcrumb,
.page-navigation,
.page-list time {
  font: var(--text-xs)/1.7 var(--font-mono);
  color: var(--fg-muted);
}
.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
}
.breadcrumb a {
  text-decoration: none;
}
.page-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  border-top: 1px solid var(--line-soft);
  margin-top: var(--space-12);
  padding-top: var(--space-6);
}
.page-list {
  padding-left: var(--space-6);
}
.page-list li {
  padding-block: var(--space-2);
}
pre {
  overflow: auto;
  padding: var(--space-4);
  border: 1px solid var(--line-soft);
  font-size: var(--text-sm);
}
code {
  font-family: var(--font-mono);
}
blockquote {
  margin-inline: 0;
  border-left: 2px solid var(--green);
  padding-left: var(--space-6);
  color: var(--fg-muted);
}
/* GitHub-style alerts (`> [!NOTE]`). Zola emits only the class, so the
   label comes from CSS; warnings and cautions take the alert colours. */
[class^='markdown-alert-'] {
  --alert: var(--green);
  border-left-color: var(--alert);
}
[class^='markdown-alert-']::before {
  display: block;
  color: var(--alert);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
}
.markdown-alert-note::before {
  content: 'Note';
}
.markdown-alert-tip::before {
  content: 'Tip';
}
.markdown-alert-important::before {
  content: 'Important';
}
.markdown-alert-warning {
  --alert: var(--orange);
}
.markdown-alert-warning::before {
  content: 'Warning';
}
.markdown-alert-caution {
  --alert: var(--red);
}
.markdown-alert-caution::before {
  content: 'Caution';
}
/* Tables keep their natural width and scroll sideways when wider than the
   column, rather than squeezing words onto several lines. */
.prose table {
  display: block;
  overflow-x: auto;
  width: max-content;
  max-width: 100%;
  margin-block: var(--space-6) var(--space-8);
  border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1.5;
}
.prose th,
.prose td {
  padding: var(--space-2) var(--space-3);
  overflow-wrap: normal;
  vertical-align: baseline;
}
.prose th {
  border-bottom: 1px solid var(--line);
  color: var(--fg-muted);
  font: 700 var(--text-xs) / 1.4 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.prose td {
  border-bottom: 1px solid var(--line-soft);
}
.prose tbody tr:last-child td {
  border-bottom-color: var(--line);
}
.prose tbody tr:hover {
  background: var(--hover);
}
.prose td code {
  color: var(--green);
  font-size: 0.875em;
}
/* Highlights a cell that differs from its neighbour, e.g. a proposed form. */
.prose td strong {
  color: var(--green);
}
.mermaid {
  overflow: auto;
  border: 1px solid var(--line-soft);
  padding: var(--space-4);
}
.mermaid svg {
  max-width: 100%;
  height: auto;
}
.bottom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-6);
  padding: var(--space-6) var(--edge);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
}
.terminal {
  flex: 1;
  min-width: 0;
}
.terminal-prompt {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5ch;
}
.terminal-form {
  display: flex;
  flex: 1;
  min-width: 10ch;
  gap: 1ch;
}
.terminal input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font: inherit;
}
.terminal button {
  background: transparent;
  border: 0;
  color: var(--green);
  cursor: pointer;
  font: inherit;
}
.terminal-history {
  max-height: 16rem;
  overflow: auto;
  white-space: pre-wrap;
  margin-bottom: var(--space-4);
}
.terminal-entry {
  margin-bottom: var(--space-3);
}
.terminal-help {
  color: var(--fg-muted);
  margin: var(--space-2) 0 0;
}
.status-bar {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  color: var(--green-dim);
}
.status-bar a {
  color: inherit;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: var(--glow);
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip-link {
  position: absolute;
  top: -5rem;
}
.skip-link:focus {
  top: 0;
  background: var(--bg);
}
@media (max-width: 560px) {
  .cards {
    grid-template-columns: 1fr;
  }
  .bottom-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .site-main {
    padding-top: var(--space-8);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Topic timeline on the think, code and speak pages (templates/partials/topic-chart.html).
   Colours follow the topic order in data/topics.yaml and are checked for
   colour-blind separation on both themes. */
.topic-chart {
  --topic-1: #3987e5;
  --topic-2: #199e70;
  --topic-3: #d95926;
  --topic-4: #c94fb0;
  margin: var(--space-6) 0 var(--space-10);
  font-size: var(--text-xs);
  color: var(--fg-muted);
}
@media (prefers-color-scheme: light) {
  .topic-chart {
    --topic-1: #2a78d6;
    --topic-2: #0f7a55;
    --topic-3: #c94a1a;
    --topic-4: #b83a9e;
  }
}
.topic-1 {
  --topic: var(--topic-1);
}
.topic-2 {
  --topic: var(--topic-2);
}
.topic-3 {
  --topic: var(--topic-3);
}
.topic-4 {
  --topic: var(--topic-4);
}
.topic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  padding: 0;
  margin: 0 0 var(--space-4);
  list-style: none;
}
.topic-swatch {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  margin-right: var(--space-2);
  border-radius: 50%;
  background: var(--topic);
}
/* Lane labels in the first column, a dashed track per topic, then the axis. */
.topic-plot {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  column-gap: var(--space-4);
}
.topic-lane,
.topic-axis {
  position: relative;
  margin-inline: var(--space-3);
}
.topic-lane {
  height: 2rem;
  background: linear-gradient(var(--line-soft), var(--line-soft)) center / 100% 1px no-repeat;
}
.topic-axis {
  height: 1.5rem;
}
.topic-axis span {
  position: absolute;
  top: 0.25rem;
  left: var(--x);
  transform: translateX(-50%);
  white-space: nowrap;
}
/* The link is a larger hit target; the dot is drawn by ::before, with a ring
   in the page colour so neighbours stay apart. Same-day posts step right. */
.topic-dot {
  position: absolute;
  top: 50%;
  left: calc(var(--x) + var(--stack) * 0.875rem);
  width: max(1.5rem, var(--size));
  height: max(1.5rem, var(--size));
  transform: translate(-50%, -50%);
}
.topic-dot::before {
  position: absolute;
  inset: 50% auto auto 50%;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--topic);
  box-shadow: 0 0 0 2px var(--bg);
  content: '';
  transform: translate(-50%, -50%);
}
.topic-dot.is-ai::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: calc(var(--size) + 0.5rem);
  height: calc(var(--size) + 0.5rem);
  border: 1.5px dotted var(--fg-muted);
  border-radius: 50%;
  content: '';
  transform: translate(-50%, -50%);
}
.topic-dot:hover {
  z-index: 2;
}
.topic-dot:hover::before {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 3px var(--topic);
}
.topic-tip {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  display: none;
  width: max-content;
  max-width: 16rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line-soft);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.4;
}
.topic-dot.tip-left .topic-tip {
  right: 0;
  left: auto;
}
.topic-dot:hover .topic-tip {
  display: block;
}
.topic-tip strong {
  display: block;
  color: var(--green);
}
.topic-share {
  display: flex;
  gap: 2px;
  margin: var(--space-4) 0 var(--space-2);
}
.topic-share span {
  flex-basis: 0;
  min-width: max-content;
  padding: 0.125rem var(--space-2);
  border-radius: 0.25rem;
  background: var(--topic);
  color: var(--bg);
  font-weight: 700;
}
.topic-chart figcaption {
  font-size: var(--text-xs);
}
