@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Regular.woff2?v=5fedeecb") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-SemiBold.woff2?v=a6a1a4db") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Regular.woff2?v=13f9151f") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* Light palette on :root; the dark palette overrides it below. */
:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #ececea;
  --text: #141414;
  --muted: #5c5c5a;
  --line: #dcdcd8;
  --accent: #1f8f2e;
  --accent-ink: #ffffff;
  --render-bg: #000000;
  --radius: 14px;
  --wrap: 1120px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --surface: #141416;
    --surface-2: #1c1c1f;
    --text: #f2f2f0;
    --muted: #a3a3a0;
    --line: #2a2a2e;
    --accent: #50d950;
    --accent-ink: #0b0b0c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.sprite { position: absolute; width: 0; height: 0; }
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }
main:focus { outline: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code { font-family: var(--mono); font-size: 0.88em; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; margin: 0; }
p { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: max(20px, env(safe-area-inset-left, 0px));
}

/* Header */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-glyph { width: 30px; height: 30px; }
.brand-word { font-size: 21px; font-style: italic; font-family: Georgia, "Times New Roman", serif; letter-spacing: 0.01em; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a,
.nav-source {
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  padding: 6px 10px;
  border-radius: 8px;
}
.nav a:hover,
.nav-source:hover { color: var(--text); background: var(--surface-2); }
.nav-source { color: var(--text); border: 1px solid var(--line); }
/* Phones: the section links move to a second row that scrolls sideways if it
   must, and the Source link stays beside the brand. */
@media (max-width: 620px) {
  html { scroll-padding-top: 112px; }
  .bar-inner { flex-wrap: wrap; height: auto; gap: 0; padding-block: 10px 6px; }
  .nav {
    width: calc(100% + 16px);
    margin-inline: -8px;
    padding-top: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
    order: 1;
  }
  .nav a { flex: none; padding-inline: 8px; }
  .nav-source { margin-left: auto; }
}

/* Hero */
.hero { padding-top: clamp(48px, 9vw, 104px); }
.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
h1 { font-size: clamp(38px, 6.4vw, 68px); max-width: 15ch; }
.lede { font-size: clamp(18px, 2vw, 20px); color: var(--muted); max-width: 60ch; margin-top: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}
.button:hover { background: var(--surface-2); }
.button.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.button.primary:hover { opacity: 0.88; background: var(--text); }

.hero-figure { margin-top: clamp(36px, 6vw, 64px); margin-bottom: 0; }
.hero-figure img,
.gallery img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--render-bg);
}
figcaption, .note { font-size: 14px; color: var(--muted); margin-top: 10px; }

.status { margin-top: clamp(32px, 5vw, 48px); }
.status p {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 20px;
  font-size: 16px;
  color: var(--muted);
}
.status strong { color: var(--text); font-weight: 600; }

/* Sections */
.section { padding-block: clamp(64px, 10vw, 120px) 0; }
.section:last-of-type { padding-bottom: clamp(64px, 10vw, 120px); }
h2 { font-size: clamp(30px, 4.2vw, 44px); }
.section-lede { color: var(--muted); font-size: 18px; max-width: 62ch; margin-top: 14px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-top: 36px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
}
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p, .card li { color: var(--muted); font-size: 16px; }
.card ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }

.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-top: 36px; }
.shots figure { margin: 0; }
.shots img { border-radius: 10px; border: 1px solid var(--line); background: #000; }

.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; }
.gallery figure { margin: 0; }
.gallery .wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } }

.split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
  margin-top: 56px;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split h3 { font-size: 22px; margin-bottom: 16px; }
.specs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.specs li {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.specs span { color: var(--muted); font-family: var(--mono); font-size: 13px; padding-top: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
@media (max-width: 480px) { .specs li { grid-template-columns: 1fr; gap: 2px; } }
.board { margin: 0; }
.board img { border-radius: var(--radius); }

/* Architecture diagram */
.diagram {
  margin-top: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(16px, 3vw, 28px);
}
.lane { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: stretch; }
.node {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  padding: 14px 16px;
}
.node.accent { border-color: var(--accent); }
.node-title { font-weight: 600; margin-bottom: 6px; }
.node p:not(.node-title) { color: var(--muted); font-size: 14px; line-height: 1.5; }
.link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
}
.link::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 50%;
  border-top: 1px dashed var(--muted);
}
.link span {
  position: relative;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  padding: 2px 6px;
  white-space: nowrap;
}
.diagram-base {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 900px) {
  .lane { grid-template-columns: 1fr; }
  .link { min-height: 44px; }
  .link::before { left: 50%; right: auto; top: 4px; bottom: 4px; border-top: 0; border-left: 1px dashed var(--muted); }
}

/* Repository table */
.table-scroll { overflow-x: auto; margin-top: 28px; }
.repo { border-collapse: collapse; width: 100%; min-width: 440px; }
.repo td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 16px; }
.repo td:first-child { white-space: nowrap; width: 1%; padding-right: 32px; }
.repo td:last-child { color: var(--muted); }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.foot-glyph { width: 18px; height: 18px; vertical-align: -4px; color: var(--text); }

/* 404 page */
.missing { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding-block: 48px; }
.missing-glyph { width: 64px; height: 64px; margin-bottom: 24px; }
.missing .actions { margin-top: 28px; }

/* Devlog: the list (log/) and an entry (log/<slug>/), built by build_log.py */
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.post { max-width: calc(46rem + 40px); padding-block: clamp(40px, 7vw, 80px); }
.post .eyebrow a { text-decoration: none; }
.post .eyebrow a:hover { color: var(--text); }
.post h1 { font-size: clamp(32px, 5vw, 48px); max-width: none; }
.post .lede { margin-top: 16px; }
.post-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }

.entries { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid var(--line); }
.entries li { padding: 22px 0; border-bottom: 1px solid var(--line); }
.entries time { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.entries h2 { font-size: 22px; margin-top: 6px; }
.entries h2 a { text-decoration: none; }
.entries h2 a:hover { text-decoration: underline; text-decoration-color: currentColor; }
.entries p { color: var(--muted); font-size: 16px; margin-top: 6px; }
.entries-empty { margin-top: 40px; color: var(--muted); }

.prose { margin-top: 36px; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 26px; margin-top: 1.8em; }
.prose h3 { font-size: 20px; margin-top: 1.6em; }
.prose h4 { font-size: 17px; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose a { text-decoration-color: var(--muted); }
.prose a:hover { text-decoration-color: currentColor; }
.prose blockquote { margin-inline: 0; padding-left: 18px; border-left: 3px solid var(--line); color: var(--muted); }
.prose blockquote > * + * { margin-top: 0.8em; }
.prose pre {
  overflow-x: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 15px;
  line-height: 1.5;
}
.prose :not(pre) > code { padding: 0.1em 0.35em; border-radius: 5px; background: var(--surface-2); }
.prose figure { margin-inline: 0; }
.prose figure img { border-radius: 10px; border: 1px solid var(--line); }
