
:root {
  --accent: #4a5d8a;            /* overridden per-tenant via inline style */
  /* Links etc. use --accent-link, derived from --accent, so tenant colors
     picked against a light background stay legible in dark mode too. */
  --accent-link: var(--accent);
  --bg: #fdfdfb;
  --fg: #1c1c1a;
  --muted: #6e6e68;
  --rule: #e4e4de;
  --serif: 'Iowan Old Style', 'Charter', 'Georgia', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    /* Blend any accent 45% toward white: keeps the tenant's hue, fixes
       contrast on the dark background automatically. */
    --accent-link: color-mix(in srgb, var(--accent) 55%, white);
    --bg: #161614;
    --fg: #e8e6e1;
    --muted: #97958e;
    --rule: #2e2e2a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  max-width: 42rem;              /* ~65ch at article size */
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.7;
}

a { color: var(--accent-link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4 { font-family: var(--sans); line-height: 1.25; letter-spacing: -0.01em; }

.site-header { margin: 1.5rem 0 2.5rem; }
.site-header h1 { font-size: 1.5rem; margin: 0; }
.site-header h1 a { color: var(--fg); text-decoration: none; }
.site-header .intro { color: var(--muted); margin-top: .5rem; }

/* ------- the stream (tenant index) ------- */
.profile-links { font-family: var(--sans); font-size: .9rem; margin-top: .6rem; display: flex; flex-wrap: wrap; gap: .35rem .6rem; }
.profile-links .dot { color: var(--muted); }

.pills { display: flex; gap: .5rem; margin: 1.5rem 0 1rem; font-family: var(--sans); font-size: .85rem; }
.pill { padding: .25rem .85rem; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; color: var(--muted); }
.pill:hover { border-color: var(--accent-link); }
.pill.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pill .count { opacity: .65; margin-left: .15rem; }

.stream { list-style: none; margin: 0; padding: 0; }
.stream > li { padding: 2.5rem 0; border-bottom: 1px solid var(--rule); }
.stream h2 { font-size: 1.35rem; margin: .25rem 0 .5rem; }
.stream h2 a { color: var(--fg); text-decoration: none; }
.stream h2 a:hover { color: var(--accent-link); }
.stream .fold { margin: .5rem 0 .75rem; }
.stream .continue { font-family: var(--sans); font-size: .85rem; margin: 0; }
.stream .article-body figure { margin: 1.25rem 0; }

/* Small-caps metadata line: date · source · original link */
.entry-meta {
  font-family: var(--sans); font-size: .75rem;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .75rem;
  display: flex; gap: 1.1rem;
}
.entry-meta a { color: var(--muted); text-decoration: none; }
.entry-meta a:hover { color: var(--accent-link); }

.pagination { display: flex; justify-content: space-between; margin-top: 2rem; font-family: var(--sans); font-size: .9rem; }

/* ------- article pages ------- */
.article-header { margin: 2.5rem 0 2rem; }
.article-header h1 { font-size: 1.75rem; margin: 0 0 .5rem; }
.article-header time { font-family: var(--sans); font-size: .85rem; color: var(--muted); }

.article-body { overflow-wrap: break-word; }
.article-body img { max-width: 100%; height: auto; border-radius: 3px; }
.article-body figure { margin: 2rem 0; }
.article-body figcaption { text-align: center; font-family: var(--sans); font-size: .8rem; color: var(--muted); margin-top: .5rem; }
.article-body blockquote {
  margin: 1.5rem 0; padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--accent-link);
  color: var(--muted); font-style: italic;
}
.article-body hr { border: none; border-top: 1px solid var(--rule); margin: 2.5rem auto; width: 6rem; }
.article-body pre { overflow-x: auto; padding: 1rem; background: color-mix(in srgb, var(--fg) 5%, transparent); border-radius: 4px; font-size: .85rem; }

.original-link { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: .85rem; color: var(--muted); }

.site-footer { margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: .8rem; color: var(--muted); }

/* ------- brand accents (engine product site ONLY, via <html class="brand">).
   Background/text stay on the neutral light/dark theme. Tenant archives are
   untouched — the archive should look like the writer's site, not ours.
   One highlight color for links AND platform names: #FCBF49 gold, darkened
   toward black in light mode so it stays readable on the near-white bg.
   Links remain distinguishable by their underline. (#D62828 reserved) */
html.brand {
  --brand-gold: color-mix(in srgb, #fcbf49 55%, black);
  --accent: var(--brand-gold);
  --accent-link: var(--brand-gold);
}
@media (prefers-color-scheme: dark) {
  html.brand { --brand-gold: #fcbf49; }
}
html.brand .platform { color: var(--brand-gold); }
