:root {
  --bg: #fbfbf9; --fg: #1d1f21; --muted: #666a70; --line: #d9dad6; --link: #1456a8;
  --max: 46rem;
  /* type colors alternate even/odd by sorted position so hue-neighbors differ in intensity */
  --l-even: .42; --c-even: .17; --l-odd: .62; --c-odd: .13; --l-mid: .52; --c-mid: .15;
}
@media (prefers-color-scheme: dark) {
  :root {
    --l-even: .68; --c-even: .15; --l-odd: .86; --c-odd: .09; --l-mid: .77; --c-mid: .12;
    --bg: #15171a; --fg: #e6e7e8; --muted: #9a9fa6; --line: #2d3136; --link: #7db3f0;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--link); }
img { max-width: 100%; height: auto; }
.site-header { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: baseline; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--fg); }
.site-footer { padding: 1.5rem 1rem; border-top: 1px solid var(--line); display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: 3rem; }
.prose { max-width: var(--max); margin: 1.5rem auto; padding: 0 1rem; }
.prose h1 { line-height: 1.2; }
.prose pre { overflow-x: auto; background: color-mix(in srgb, var(--fg) 7%, transparent); padding: .8rem; border-radius: 6px; }
.prose code { font-size: .92em; }
.prose blockquote { margin-left: 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.align-left { float: left; margin: 0 1rem .5rem 0; }
.align-right { float: right; margin: 0 0 .5rem 1rem; }
.align-center { display: block; margin: 1rem auto; }
.banner { width: 100%; max-height: 14rem; object-fit: cover; border-radius: 6px; }
.meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; color: var(--muted); font-size: .9rem; margin-bottom: 0; }
.muted { color: var(--muted); font-size: .9rem; }
.tag { color: var(--muted); }
.chip { display: inline-block; padding: 0 .55em; border: 1px solid currentColor; border-radius: 999px; font-size: .78rem; line-height: 1.6; background: none; cursor: default; }
button.chip { cursor: pointer; font-family: inherit; }
button.chip[aria-pressed="true"] { background: color-mix(in srgb, currentColor 18%, transparent); }
/* --h per type comes from the generated /css/types.css */
[class*="type-"] { color: oklch(var(--tl, var(--l-even)) var(--tc, var(--c-even)) var(--h, 260)); }
.cards { list-style: none; padding: 0; }
.cards li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.cards li[hidden] { display: none; }
.cards a { text-decoration: none; }
.cards a:hover { text-decoration: underline; }
.timeline { list-style: none; padding: 0 0 0 1rem; border-left: 2px solid var(--line); }
.timeline > li { position: relative; padding-bottom: .5rem; }
.timeline > li::before { content: ""; position: absolute; left: -1.38rem; top: .9rem; width: 10px; height: 10px; border-radius: 50%; background: var(--fg); }
.timeline h2 { margin: .4rem 0 0; font-size: 1.15rem; }
.gallery { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }
.gallery figure { margin: 0; flex: 1 1 14rem; }
.gallery .caption { flex-basis: 100%; color: var(--muted); font-size: .9rem; margin: 0; }
input[type="search"] { width: 100%; padding: .5rem .7rem; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.hero { max-width: var(--max); margin: 1.5rem auto 0; padding: 0 1rem; }
.hero h1 { margin: 0 0 .2rem; }
.hero p { margin: .2rem 0; color: var(--muted); }
/* Graph */
.graph-wrap { max-width: 70rem; margin: 1rem auto; padding: 0 1rem; }
.graph-controls { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.graph-controls label { cursor: pointer; display: inline-flex; gap: .3em; align-items: center; }
#graph { width: 100%; height: 65vh; min-height: 360px; border: 1px solid var(--line); border-radius: 8px; touch-action: none; display: block; }
.graph-page #graph { height: 78vh; }
#graph .edges line { stroke: var(--muted); stroke-opacity: .55; stroke-width: 1.3; }
#graph .tag-edges { display: none; }
#graph .tag-edges.shown { display: inline; }
#graph .tag-edges line { stroke-dasharray: 3 4; stroke-opacity: .3; }
#graph .node { cursor: pointer; outline: none; }
#graph .node circle { fill: currentColor; stroke: var(--bg); stroke-width: 2; }
#graph .node .glyph { fill: var(--bg); text-anchor: middle; dominant-baseline: central; font-size: 11px; pointer-events: none; }
#graph .node text { fill: var(--fg); font-size: 12px; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
#graph .node:focus circle { stroke: var(--fg); }
#graph.hl .node:not(.on) { opacity: .25; }
#graph.hl .edges line:not(.on) { opacity: .15; }
#graph .hidden { display: none; }
@media (max-width: 600px) { body { font-size: 16px; } #graph .node text { font-size: 11px; } }
.media-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-weight: 600; }
.media-links a { text-decoration: none; }
.video { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 1rem 0; background: #000; border-radius: 8px; overflow: hidden; }
.video iframe, .video-play, .video-play img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { padding: 0; background: none; cursor: pointer; color: #fff; }
.video-play img { object-fit: cover; }
.video-play span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; text-shadow: 0 2px 12px #000; }
.video-play:hover span, .video-play:focus-visible span { transform: scale(1.1); }
.ext { font-size: .85em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Full-width home banner: height is capped so a wide image never takes over the screen. */
.hero-banner { max-width: none; margin: 0; padding: 0; background-size: cover; background-position: center 60%; height: clamp(10rem, 24vw, 16rem); display: flex; align-items: flex-end; position: relative; }
.hero-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .65), rgb(0 0 0 / .05) 70%); }
.hero-banner .hero-inner { position: relative; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1rem 1rem; color: #fff; }
.hero-banner h1, .hero-banner p { color: #fff; text-shadow: 0 1px 6px rgb(0 0 0 / .6); }
#graph marker path { fill: var(--muted); }
#graph .edge-label { display: none; fill: var(--fg); font-size: 11px; text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; pointer-events: none; }
#graph .edge-label.on { display: inline; }
#graph.hl .edges line.on { stroke-opacity: .95; stroke-width: 1.8; }
.connections h2 .dir { color: var(--muted); }
#graph .date-axis { display: none; }
#graph .date-axis.shown { display: inline; }
#graph .date-axis line { stroke: var(--line); stroke-width: 1; }
#graph .date-axis text { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.gallery .file a { display: block; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
