:root {
  --paper:        oklch(0.978 0.002 250);
  --paper-deep:   oklch(0.955 0.003 250);
  --paper-rule:   oklch(0.90  0.003 250);
  --ink:          oklch(0.22  0.005 250);
  --ink-soft:     oklch(0.40  0.005 250);
  --ink-faint:    oklch(0.58  0.005 250);
  --ink-rule:     oklch(0.80  0.005 250);

  /* Ghost expects themes to declare these so admin font settings can override.
     We bake Recursive in either way — the variables exist for gscan compliance. */
  --gh-font-heading: "Recursive", "Iowan Old Style", Georgia, serif;
  --gh-font-body:    "Recursive", -apple-system, BlinkMacSystemFont, "Inter", sans-serif;

  --serif: var(--gh-font-heading);
  --sans:  var(--gh-font-body);
  --mono:  "Recursive", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 64ch;
  --gutter: clamp(1.25rem, 3vw, 2.25rem);

  --fs-tiny:   12px;
  --fs-meta:   13.5px;
  --fs-body:   17.5px;
  --fs-lead:   19.5px;
  --fs-h2:     24px;
  --fs-title:  clamp(28px, 4.2vw, 44px);
  --fs-hero:   clamp(36px, 6vw, 62px);

  --rec-mono: 0;
  --rec-casl: 0;
  --rec-slnt: 0;
  --rec-wght: 400;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page-bg, var(--paper));
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-variation-settings: "MONO" var(--rec-mono), "CASL" var(--rec-casl), "wght" var(--rec-wght), "slnt" var(--rec-slnt);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: pretty;
  transition: background-color 500ms ease;
}

body::before { content: none; }

a { color: inherit; text-decoration: none; }
::selection { background: oklch(0.85 0.05 60); color: var(--ink); }

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0;
  z-index: 20;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gutter);
  padding: 18px var(--gutter);
  background: color-mix(in oklch, var(--page-bg, var(--paper)) 90%, transparent);
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid var(--paper-rule);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--fs-meta);
  letter-spacing: 0.01em;
  color: var(--ink);
  font-variation-settings: "MONO" 0.65, "CASL" 0, "wght" 500;
}
.brand-sub {
  color: var(--ink-faint);
  font-variation-settings: "MONO" 1, "CASL" 0, "wght" 430;
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.brand-mark {
  display: inline-grid;
  grid-template-columns: 6px 6px;
  grid-template-rows: 6px 6px;
  gap: 2px;
}
.brand-mark span {
  display: block;
  background: var(--ink);
}
.brand-mark .bm-a { background: var(--ink); }
.brand-mark .bm-b { background: oklch(0.55 0.13 35); }
.brand-mark span:nth-child(3) { background: oklch(0.50 0.10 235); }
.brand-mark span:nth-child(4) { background: oklch(0.49 0.14 320); }

.brand-name { font-variation-settings: "MONO" 0.7, "CASL" 0, "wght" 480; white-space: nowrap; }

.nav { display: flex; gap: 22px; }
.nav-item {
  font-size: var(--fs-meta);
  color: var(--ink-soft);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
  font-variation-settings: "MONO" 0.6, "CASL" 0, "wght" 430;
}
.nav-item:hover { color: var(--ink); }
.nav-item.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ---------- Main column ---------- */
.main {
  flex: 1;
  padding: clamp(36px, 6vw, 72px) var(--gutter) 80px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

/* ---------- Stream ---------- */
.stream-wrap { position: relative; }
.stream-header { margin-bottom: clamp(28px, 5vw, 48px); position: relative; z-index: 1; }
.sh-title {
  font-family: var(--sans);
  font-size: var(--fs-hero);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-variation-settings: "MONO" 0.4, "CASL" 0, "wght" 560;
  white-space: nowrap;
}
.sh-sub {
  color: var(--ink-soft);
  max-width: 52ch;
  font-size: var(--fs-lead);
  line-height: 1.5;
  margin: 0 0 32px;
  font-variation-settings: "MONO" 0, "CASL" 0.05, "wght" 380;
}

/* Plane legend */
.plane-legend {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--paper-rule);
  background: oklch(0.985 0.006 80);
  border-radius: 2px;
  max-width: 540px;
  margin-bottom: clamp(28px, 5vw, 48px);
}
.pl-plane {
  position: relative;
  width: 96px; height: 96px;
  border: 1px solid var(--ink-rule);
  background: var(--paper);
}
.pl-axis { position: absolute; background: var(--ink-rule); }
.pl-axis-x { left: 0; right: 0; bottom: 0; height: 1px; }
.pl-axis-y { left: 0; top: 0; bottom: 0; width: 1px; }
.pl-tick {
  position: absolute;
  font-size: 9px;
  color: var(--ink-faint);
  font-variation-settings: "MONO" 0.8, "wght" 460;
  letter-spacing: 0.04em;
}
.pl-tick-mono { bottom: -14px; left: 0; }
.pl-tick-casl { top: -2px; left: -20px; transform: rotate(-90deg); transform-origin: left top; }
.pl-dot {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  transform: translate(-50%, 50%);
  box-shadow: 0 0 0 2px var(--paper);
}
.pl-key {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  font-size: var(--fs-meta);
  color: var(--ink-soft);
}
.pl-key li { display: flex; align-items: center; gap: 8px; }
.pl-swatch { width: 8px; height: 8px; border-radius: 50%; }

/* Stream list */
.stream-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--paper-rule);
}
.stream-list > li { border-bottom: 1px solid var(--paper-rule); }

.stream-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 22px 0;
  color: var(--ink);
  transition: background .15s ease;
}
.stream-item:hover {
  background: linear-gradient(to right, var(--accent-wash) 0%, transparent 70%);
}
.si-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-faint);
  font-size: var(--fs-meta);
  font-variation-settings: "MONO" 0.85, "wght" 430;
  letter-spacing: 0.02em;
}
.si-date { font-variant-numeric: tabular-nums; }
.si-mode-label {
  text-transform: lowercase;
  letter-spacing: 0.06em;
  font-variation-settings: "MONO" 0.9, "wght" 520;
}
.si-title {
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.18;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.005em;
  text-wrap: balance;
  font-variation-settings:
    "MONO" var(--t-mono, 0), "CASL" var(--t-casl, 0),
    "wght" var(--t-wght, 480), "slnt" var(--t-slnt, 0),
    "CRSV" var(--t-crsv, 0);
  transition: font-variation-settings 650ms cubic-bezier(.22,.7,.2,1);
  animation: title-reveal 2.6s var(--reveal-delay, 0.4s) ease-in-out 1 both;
}
.stream-item:hover .si-title,
.stream-item:active .si-title,
.stream-item:focus-visible .si-title {
  animation: none;
  font-variation-settings:
    "MONO" var(--th-mono, 0), "CASL" var(--th-casl, 0),
    "wght" var(--th-wght, 480), "slnt" var(--th-slnt, 0),
    "CRSV" var(--th-crsv, 0);
}
@keyframes title-reveal {
  0% {
    font-variation-settings:
      "MONO" var(--t-mono, 0), "CASL" var(--t-casl, 0),
      "wght" var(--t-wght, 480), "slnt" var(--t-slnt, 0),
      "CRSV" var(--t-crsv, 0);
  }
  45% {
    font-variation-settings:
      "MONO" var(--th-mono, 0), "CASL" var(--th-casl, 0),
      "wght" var(--th-wght, 480), "slnt" var(--th-slnt, 0),
      "CRSV" var(--th-crsv, 0);
  }
  100% {
    font-variation-settings:
      "MONO" var(--t-mono, 0), "CASL" var(--t-casl, 0),
      "wght" var(--t-wght, 480), "slnt" var(--t-slnt, 0),
      "CRSV" var(--t-crsv, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .si-title { animation: none; transition: none; }
}
.si-dek {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--fs-lead);
  line-height: 1.45;
  max-width: 60ch;
  font-variation-settings:
    "MONO" var(--dek-mono, 0), "CASL" var(--dek-casl, 0),
    "wght" 380, "slnt" 0;
}
.si-foot {
  display: flex;
  gap: 14px;
  color: var(--ink-faint);
  font-size: var(--fs-tiny);
  font-variation-settings: "MONO" 0.95, "wght" 440;
  letter-spacing: 0.04em;
}
.si-coord { color: var(--accent-strong); }

/* Thumbnail on the right when the post has a feature image */
.stream-item.has-thumb {
  grid-template-columns: minmax(0, 1fr) 168px;
  column-gap: 28px;
  align-items: start;
}
.stream-item.has-thumb > :not(.si-thumb) { grid-column: 1 / 2; }
.stream-item.signal-overt.has-thumb > :not(.si-thumb) { grid-column: 2 / 3; }
.si-thumb {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: start;
  margin-top: 2px;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--paper-deep);
  border: 1px solid var(--paper-rule);
  position: relative;
  overflow: hidden;
}
.si-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.stream-item.has-thumb:hover .si-thumb {
  border-color: var(--accent-strong);
}

/* Subtle: hide overt-only meta */
.stream-item.signal-subtle .si-mode-label,
.stream-item.signal-subtle .si-coord { display: none; }

/* Overt: accent stripe down the side */
.stream-item.signal-overt {
  grid-template-columns: 6px 1fr;
  column-gap: 18px;
  padding-left: 0;
  position: relative;
}
.stream-item.signal-overt::before {
  content: "";
  grid-row: 1 / span 4;
  background: linear-gradient(to bottom, var(--accent-strong), var(--accent) 50%, transparent);
  width: 3px;
  opacity: 0.7;
  margin-left: 2px;
}
.stream-item.signal-overt > * { grid-column: 2; }

.stream-item.signal-overt.has-thumb {
  grid-template-columns: 6px minmax(0, 1fr) 168px;
}
.stream-item.signal-overt.has-thumb::before { grid-column: 1 / 2; align-self: stretch; }
.stream-item.signal-overt.has-thumb .si-thumb { grid-column: 3; }

/* Index: compact, tabular */
.stream-item.signal-index {
  display: grid;
  grid-template-columns: 22px 102px 96px 1fr;
  grid-template-areas: "glyph date mode title";
  align-items: baseline;
  column-gap: 16px;
  padding: 10px 0;
}
.stream-item.signal-index .si-meta { display: contents; }
.stream-item.signal-index .si-meta > .mode-glyph {
  grid-area: glyph;
  align-self: center;
}
.stream-item.signal-index .si-date    { grid-area: date; }
.stream-item.signal-index .si-mode-label { grid-area: mode; font-size: var(--fs-meta); }
.stream-item.signal-index .si-title {
  grid-area: title;
  font-size: 16.5px;
  line-height: 1.35;
  text-wrap: pretty;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stream-item.signal-index:hover .si-title { white-space: normal; }
.stream-item.signal-index .si-dek,
.stream-item.signal-index .si-foot,
.stream-item.signal-index .si-thumb { display: none; }
.stream-item.signal-index.has-thumb { grid-template-columns: 22px 102px 96px 1fr; }

.stream-foot {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  font-size: var(--fs-meta);
  color: var(--ink-faint);
  font-variation-settings: "MONO" 0.85, "wght" 430;
  letter-spacing: 0.02em;
}
.stream-foot a:hover { color: var(--ink); }

/* Pagination */
.pagination {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: var(--fs-meta);
  color: var(--ink-soft);
  font-variation-settings: "MONO" 0.6, "wght" 460;
}
.pagination a:hover { color: var(--ink); }

/* ---------- Ambient canvas ---------- */
.ambient-canvas {
  position: absolute;
  inset: -200px -12vw -320px -12vw;
  width: auto; height: auto;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
}
.stream-wrap > *:not(.ambient-canvas) { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .ambient-canvas { display: none; }
}

/* ---------- Post page ---------- */
.post-view {
  max-width: 70ch;
  margin: 0 auto;
  padding-top: 8px;
  font-variation-settings:
    "MONO" var(--b-mono, 0), "CASL" var(--b-casl, 0),
    "wght" var(--b-wght, 400), "slnt" var(--b-slnt, 0);
}
.pv-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  color: var(--ink-soft);
  font-size: var(--fs-meta);
  font-variation-settings: "MONO" 0.85, "wght" 440;
}
.pv-back:hover { color: var(--ink); }
.pv-rail-mode {
  display: flex; align-items: center; gap: 10px;
  letter-spacing: 0.04em;
}
.pv-rail-coord {
  color: var(--ink-faint);
  font-size: var(--fs-tiny);
  font-variation-settings: "MONO" 1, "wght" 440;
}

.pv-head { margin-bottom: 36px; }
.pv-date {
  display: block;
  color: var(--ink-faint);
  font-size: var(--fs-meta);
  letter-spacing: 0.04em;
  font-variation-settings: "MONO" 0.85, "wght" 440;
  margin-bottom: 14px;
}
.pv-title {
  font-size: var(--fs-title);
  line-height: 1.1;
  letter-spacing: -0.012em;
  margin: 0 0 18px;
  text-wrap: balance;
  color: var(--ink);
  font-variation-settings:
    "MONO" var(--t-mono, 0), "CASL" var(--t-casl, 0),
    "wght" var(--t-wght, 480), "slnt" var(--t-slnt, 0),
    "CRSV" var(--t-crsv, 0);
  transition: font-variation-settings 650ms cubic-bezier(.22,.7,.2,1);
  animation: title-reveal 2.6s 0.35s ease-in-out 1 both;
}
.pv-title:hover,
.pv-title:active,
.pv-title:focus-visible {
  animation: none;
  font-variation-settings:
    "MONO" var(--th-mono, 0), "CASL" var(--th-casl, 0),
    "wght" var(--th-wght, 480), "slnt" var(--th-slnt, 0),
    "CRSV" var(--th-crsv, 0);
}
@media (prefers-reduced-motion: reduce) {
  .pv-title { animation: none; transition: none; }
}
.pv-dek {
  color: var(--ink-soft);
  font-size: var(--fs-lead);
  line-height: 1.5;
  margin: 0;
  max-width: 60ch;
}

.pv-body p {
  font-size: var(--fs-body);
  line-height: 1.65;
  margin: 0 0 1.1em;
  color: var(--ink);
}
.pv-body p::selection { background: var(--accent-wash); }

.pv-body h2 {
  font-size: var(--fs-h2);
  line-height: 1.2;
  margin: 2em 0 0.5em;
  color: var(--accent-ink);
  font-variation-settings: "MONO" 0.85, "CASL" 0, "wght" 540;
  letter-spacing: -0.005em;
}
.pv-body h3 {
  font-size: 19px;
  margin: 1.6em 0 0.4em;
  color: var(--accent-ink);
  font-variation-settings: "MONO" 0.7, "wght" 540;
}
.pv-body a {
  color: var(--accent-ink);
  border-bottom: 1px dotted var(--accent-ink);
  padding-bottom: 1px;
}
.pv-body a:hover { background: var(--accent-wash); }
.pv-body blockquote {
  margin: 1.4em 0;
  padding: 4px 18px;
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
  font-style: italic;
}
.pv-body ul, .pv-body ol {
  font-size: var(--fs-body);
  line-height: 1.6;
  padding-left: 1.4em;
  margin: 0 0 1.1em;
}
.pv-body li { margin: 0.2em 0; }
.pv-body hr {
  border: none;
  border-top: 1px solid var(--paper-rule);
  margin: 2em 0;
}
.pv-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.8em auto;
  border: 1px solid var(--paper-rule);
}
.pv-body figure {
  margin: 2.4em 0;
}
.pv-body figure img { margin: 0; }
.pv-body figcaption {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  font-size: var(--fs-meta);
  color: var(--ink-soft);
  line-height: 1.5;
  font-variation-settings: "MONO" 0.55, "wght" 440;
}

/* Koenig editor width modifiers — required by gscan. The post body column is
   the natural width; .kg-width-wide breaks out a bit, .kg-width-full to the
   viewport edge. */
.kg-width-wide {
  position: relative;
  width: calc(100% + 120px);
  margin-left: -60px;
  margin-right: -60px;
  max-width: none;
}
.kg-width-full {
  position: relative;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  max-width: none;
}
@media (max-width: 800px) {
  .kg-width-wide,
  .kg-width-full {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    transform: none;
  }
}
.kg-width-wide img,
.kg-width-full img {
  width: 100%;
  height: auto;
  display: block;
}

/* Feature image at the top of a post / page, rendered outside .pv-body */
.post-view > .kg-card,
.page-view > .kg-card {
  margin: 1.8em 0;
}
.post-view > .kg-card img,
.page-view > .kg-card img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--paper-rule);
}
.post-view > .kg-card figcaption,
.page-view > .kg-card figcaption {
  margin-top: 12px;
  font-size: var(--fs-meta);
  color: var(--ink-soft);
  line-height: 1.5;
  font-variation-settings: "MONO" 0.55, "wght" 440;
}
.pv-body iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--paper-rule);
  margin: 1.8em 0;
}
.pv-body .kg-card,
.pv-body .kg-embed-card {
  margin: 1.8em 0;
}
.pv-body .kg-video-card video,
.pv-body video {
  display: block;
  width: 100%;
  border: 1px solid var(--paper-rule);
}

.pv-code,
.pv-body pre {
  background: var(--paper-deep);
  border-left: 2px solid var(--accent);
  padding: 14px 18px;
  margin: 1.4em 0;
  font-family: "Recursive", ui-monospace, monospace;
  font-variation-settings: "MONO" 1, "CASL" 0, "wght" 440;
  font-size: 14.5px;
  line-height: 1.6;
  overflow-x: auto;
}
.pv-body pre code {
  font-family: inherit;
  white-space: pre;
}
.pv-body p code,
.pv-body li code {
  font-family: "Recursive", ui-monospace, monospace;
  font-variation-settings: "MONO" 1, "wght" 480;
  font-size: 0.92em;
  background: var(--paper-deep);
  padding: 1px 5px;
  border-radius: 2px;
}

/* Syntax highlighting */
.pv-code code.hljs,
.pv-body pre code.hljs { background: transparent; padding: 0; color: var(--ink); }
.hljs-keyword,
.hljs-built_in       { color: var(--accent-ink, var(--ink)); font-variation-settings: "MONO" 1, "wght" 560; }
.hljs-string,
.hljs-literal,
.hljs-symbol         { color: oklch(0.46 0.10 30); }
.hljs-number,
.hljs-meta           { color: oklch(0.45 0.10 250); }
.hljs-comment,
.hljs-quote          { color: var(--ink-faint); font-style: italic; }
.hljs-function .hljs-title,
.hljs-title.function_,
.hljs-title          { color: oklch(0.42 0.11 285); font-variation-settings: "MONO" 1, "wght" 540; }
.hljs-type,
.hljs-class .hljs-title { color: oklch(0.45 0.09 200); }
.hljs-params,
.hljs-variable,
.hljs-attr           { color: var(--ink); }
.hljs-punctuation,
.hljs-operator       { color: var(--ink-soft); }

.pv-foot {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--paper-rule);
}
.pv-foot-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  font-size: var(--fs-meta);
  color: var(--ink-soft);
  font-variation-settings: "MONO" 0.6, "wght" 460;
}
.pv-foot-row a:hover { color: var(--accent-ink); }
.pv-foot-note {
  font-size: var(--fs-tiny);
  color: var(--ink-faint);
  margin: 0;
  font-variation-settings: "MONO" 0.85, "wght" 440;
  letter-spacing: 0.02em;
}
.pv-comments {
  margin-top: 24px;
}
.pv-comments-toggle {
  font-size: var(--fs-meta);
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--paper-rule);
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--sans);
  font-variation-settings: "MONO" 0.6, "wght" 460;
}
.pv-comments-toggle:hover { color: var(--ink); border-color: var(--ink-rule); }
.pv-comments[data-open="true"] .pv-comments-toggle { display: none; }
.pv-comments-body { display: none; margin-top: 20px; }
.pv-comments[data-open="true"] .pv-comments-body { display: block; }

/* Mode-specific body adjustments */
.post-view.mode-science .pv-body p,
.post-view.mode-emergence .pv-body p {
  max-width: 62ch;
}
.post-view.mode-arts .pv-title { letter-spacing: -0.005em; }
.post-view.mode-emergence .pv-title { font-feature-settings: "ss01"; }

/* ---------- Generic page wrapper (About / Now / Workshops / others) ---------- */
.page-view {
  max-width: 64ch;
  margin: 0 auto;
  font-variation-settings:
    "MONO" var(--b-mono, 0), "CASL" var(--b-casl, 0),
    "wght" var(--b-wght, 400), "slnt" var(--b-slnt, 0);
}
.pg-head { margin-bottom: 48px; padding-bottom: 28px; border-bottom: 1px solid var(--paper-rule); }
.pg-title {
  font-size: var(--fs-hero);
  line-height: 1.0;
  letter-spacing: -0.018em;
  margin: 0 0 16px;
  text-wrap: balance;
  font-variation-settings:
    "MONO" var(--t-mono, 0), "CASL" var(--t-casl, 0),
    "wght" var(--t-wght, 480), "slnt" var(--t-slnt, 0),
    "CRSV" var(--t-crsv, 0);
}
.pg-sub {
  color: var(--ink-soft);
  font-size: var(--fs-lead);
  line-height: 1.5;
  margin: 0;
  max-width: 52ch;
}
.pg-body h2 {
  font-size: var(--fs-h2);
  line-height: 1.2;
  margin: 2.2em 0 0.6em;
  font-variation-settings: "MONO" 0.85, "CASL" 0, "wght" 540;
  letter-spacing: -0.005em;
  color: var(--accent-ink);
}
.pg-body p { font-size: var(--fs-body); line-height: 1.65; margin: 0 0 1em; max-width: 62ch; }
.pg-body ul {
  padding: 0; margin: 0.4em 0 0;
  list-style: none;
}
.pg-body ul li {
  font-size: var(--fs-body);
  line-height: 1.55;
  padding: 6px 0;
  border-bottom: 1px dashed var(--paper-rule);
}
.pg-body ul li::before {
  content: "—";
  margin-right: 10px;
  color: var(--accent-ink);
}
.pg-body a {
  color: var(--accent-ink);
  border-bottom: 1px dotted var(--accent-ink);
}
.pg-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.8em auto;
  border: 1px solid var(--paper-rule);
}
.pg-foot {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--paper-rule);
  font-size: var(--fs-tiny);
  color: var(--ink-faint);
  font-variation-settings: "MONO" 0.85, "wght" 440;
  letter-spacing: 0.02em;
}

/* ---------- Footer ---------- */
.site-foot {
  padding: 24px var(--gutter);
  border-top: 1px solid var(--paper-rule);
  color: var(--ink-faint);
  font-size: var(--fs-tiny);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  font-variation-settings: "MONO" 0.85, "wght" 440;
  letter-spacing: 0.02em;
}
.site-foot a:hover { color: var(--ink); }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  :root {
    --fs-body: 17px;
    --fs-lead: 18px;
    --fs-title: 30px;
    --fs-hero: 38px;
  }
  .topbar { padding: 14px 18px; }
  .nav { gap: 14px; }
  .nav-item { font-size: 13px; }
  .brand-sub { display: none; }
  .main { padding: 32px 18px 56px; }
  .plane-legend { grid-template-columns: 1fr; }
  .pl-plane { margin: 0 auto; }
  .pl-key { grid-template-columns: 1fr 1fr; }
  .pv-rail-coord { display: none; }
  .pv-foot-row { flex-direction: column; gap: 10px; }
  .stream-item.signal-index {
    grid-template-columns: 18px 1fr;
    grid-template-areas:
      "glyph date"
      "glyph title";
    row-gap: 2px;
  }
  .stream-item.signal-index .si-mode-label { display: none; }
  .stream-item.signal-index .si-title { white-space: normal; }
  .stream-item.has-thumb,
  .stream-item.signal-overt.has-thumb {
    grid-template-columns: 1fr;
  }
  .stream-item.signal-overt.has-thumb {
    grid-template-columns: 6px 1fr;
  }
  .si-thumb {
    grid-column: 1 !important;
    grid-row: auto !important;
    max-width: 100%;
    order: -1;
    margin-bottom: 8px;
  }
  .stream-item.signal-overt.has-thumb .si-thumb {
    grid-column: 2 !important;
  }
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-ink, var(--ink));
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- Gallery ---------- */
.offaxis-gallery {
  margin: 2em 0;
}
.og-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.og-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper-deep);
  border: 1px solid var(--paper-rule);
  cursor: zoom-in;
  padding: 0;
  margin: 0;
  display: block;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s ease;
}
.og-thumb:hover {
  border-color: var(--accent-strong, var(--ink-rule));
}
.og-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  object-fit: cover;
  display: block;
}
.og-thumb-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 14px;
  padding-left: 3px;
}
.og-paginator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  font-size: var(--fs-meta);
  color: var(--ink-soft);
}
.og-paginator:empty { display: none; }
.og-paginator button {
  background: none;
  border: 1px solid var(--paper-rule);
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: var(--fs-meta);
  cursor: pointer;
  color: var(--ink-soft);
  font-variation-settings: "MONO" 0.6, "wght" 460;
}
.og-paginator button:disabled {
  opacity: 0.35;
  cursor: default;
}
.og-paginator button:not(:disabled):hover {
  color: var(--ink);
  border-color: var(--ink-rule);
}
.og-page-info {
  font-variation-settings: "MONO" 0.85, "wght" 460;
  letter-spacing: 0.02em;
}

/* ---------- Gallery lightbox ---------- */
.og-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}
.og-lightbox-media-wrap {
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.og-lightbox img,
.og-lightbox video {
  display: block;
  max-width: 95vw;
  max-height: 90vh;
  width: auto;
  height: auto;
}
.og-lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  width: 48px;
  height: 48px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
}
.og-lightbox-nav:hover { background: rgba(0, 0, 0, 0.85); }
.og-lightbox-prev { left: clamp(8px, 2vw, 24px); }
.og-lightbox-next { right: clamp(8px, 2vw, 24px); }
.og-lightbox-close {
  position: fixed;
  top: clamp(8px, 2vw, 24px);
  right: clamp(8px, 2vw, 24px);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
}
.og-lightbox-close:hover { background: rgba(0, 0, 0, 0.85); }
.og-lightbox-counter {
  position: fixed;
  bottom: clamp(8px, 2vw, 24px);
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: var(--fs-meta);
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 14px;
  border-radius: 14px;
  font-variation-settings: "MONO" 0.95, "wght" 460;
  letter-spacing: 0.03em;
}

@media (max-width: 640px) {
  .og-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
  }
  .og-lightbox-nav {
    width: 40px; height: 40px;
    font-size: 18px;
  }
}
