/* AntJanus — Now / Stream. Every page is a reverse-chronological stream; the timestamp leads. */

:root {
  /* primitives */
  --paper-50: #fbf9f5;
  --paper-100: #f4f1ea;
  --paper-200: #e6e1d6;
  --paper-300: #d4cdbe;
  --ink-900: #16181d;
  --ink-700: #2d3139;
  --ink-500: #565c66;
  --slate-600: #364f6a;
  --slate-300: #8fb3d9;
  --ember-600: #b93d0b;
  --ember-300: #ff8f57;
  --night-950: #0f1115;
  --night-900: #161920;
  --night-800: #1e222b;
  --night-700: #2b313c;
  --night-200: #d3d8df;
  --night-100: #eef1f4;
  --night-400: #9ba4b0;

  /* semantic */
  --ground: var(--paper-100);
  --surface: var(--paper-50);
  --surface-sunk: var(--paper-200);
  --line: var(--paper-300);
  --ink: var(--ink-900);
  --text: var(--ink-700);
  --muted: var(--ink-500);
  --spine: var(--slate-600);
  --live: var(--ember-600);
  --action: var(--slate-600);
  --action-ink: #ffffff;
  --focus: #1d4ed8;
  --code-bg: #1a1d24;
  --code-ink: #e3e7ee;
  --code-dim: #97a1ae;
  --code-str: #b8d98a;
  --code-kw: #ffb07a;

  /* post types: colour is always paired with a shape glyph and a text label */
  --t-article: #364f6a;
  --t-ai: #6a3ea1;
  --t-story: #8a3a60;
  --t-pattern: #0e6a5a;
  --t-project: #7a5600;
  --t-milestone: #b93d0b;
  --t-note: #16181d;

  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-read: "Newsreader", Georgia, "Times New Roman", serif;

  --gutter: 9.5rem;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(22, 24, 29, 0.04), 0 8px 24px -16px rgba(22, 24, 29, 0.25);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: var(--night-950);
    --surface: var(--night-900);
    --surface-sunk: var(--night-800);
    --line: var(--night-700);
    --ink: var(--night-100);
    --text: var(--night-200);
    --muted: var(--night-400);
    --spine: var(--slate-300);
    --live: var(--ember-300);
    --action: var(--slate-300);
    --action-ink: #0f1115;
    --focus: #93c5fd;
    --code-bg: #0b0d11;
    --t-article: #8fb3d9;
    --t-ai: #bb9cf2;
    --t-story: #eb9cc2;
    --t-pattern: #5fd3ba;
    --t-project: #e3c05c;
    --t-milestone: #ff8f57;
    --t-note: #eef1f4;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 30px -18px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: var(--night-950);
  --surface: var(--night-900);
  --surface-sunk: var(--night-800);
  --line: var(--night-700);
  --ink: var(--night-100);
  --text: var(--night-200);
  --muted: var(--night-400);
  --spine: var(--slate-300);
  --live: var(--ember-300);
  --action: var(--slate-300);
  --action-ink: #0f1115;
  --focus: #93c5fd;
  --code-bg: #0b0d11;
  --t-article: #8fb3d9;
  --t-ai: #bb9cf2;
  --t-story: #eb9cc2;
  --t-pattern: #5fd3ba;
  --t-project: #e3c05c;
  --t-milestone: #ff8f57;
  --t-note: #eef1f4;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 30px -18px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code, kbd, pre, .mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--ground); padding: 0.6rem 1rem; z-index: 50; border-radius: 6px; }
.skip:focus { top: 1rem; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar-inner { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.mark { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.mark svg { width: 34px; height: 34px; }
.mark-word { font-family: var(--font-mono); font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.mark-word span { color: var(--muted); font-weight: 400; }
.nav { display: flex; gap: 0.25rem; margin-left: auto; }
.nav a {
  font-family: var(--font-mono); font-size: 0.9375rem; text-decoration: none; color: var(--muted);
  padding: 0.6rem 0.7rem; border-radius: 6px; min-height: 44px; display: inline-flex; align-items: center;
}
.nav a:hover { color: var(--ink); background: var(--surface-sunk); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--live); border-radius: 0; }
.nav a.nav-ai::before { content: "◆"; font-size: 0.7em; margin-right: 0.4em; color: var(--t-ai); }
.theme-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.theme-btn:hover { border-color: var(--muted); }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--live); display: inline-block; position: relative; flex-shrink: 0; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--live); opacity: 0; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(0.6); opacity: 0.8; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- page frame ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; }
.frame { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 3.5rem; align-items: start; padding: 2.5rem 0 4rem; }
.frame.single { grid-template-columns: minmax(0, 1fr); }
.aside { position: sticky; top: 5.5rem; display: grid; gap: 1.25rem; }

/* ---------- eyebrow / labels ---------- */
.eyebrow {
  font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.eyebrow b { color: var(--ink); font-weight: 600; }

/* ---------- page head (stream header) ---------- */
.head { padding: 1rem 0 2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); gap: 0 1.5rem; }
.head-stamp { font-family: var(--font-mono); color: var(--muted); font-size: 0.875rem; line-height: 1.4; padding-top: 0.5rem; }
.head-stamp strong { display: block; font-size: 1.5rem; color: var(--ink); font-weight: 600; letter-spacing: -0.02em; }
.head h1 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); letter-spacing: -0.03em; line-height: 1.05; margin: 0.6rem 0 0.9rem; max-width: 20ch; }
.head .lede { font-size: 1.25rem; line-height: 1.5; color: var(--text); max-width: 60ch; margin: 0; }
.head-media { margin-top: 1.5rem; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 5; background: var(--surface-sunk); }
.head-media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- NOW block (home) ---------- */
.now {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  padding: 2rem; display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1.75rem; margin-bottom: 2.5rem;
}
.now-portrait { width: 8rem; height: 8rem; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, var(--spine), var(--live)); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--live); }
.now-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 20%; }
.now h1 { font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -0.03em; line-height: 1.05; margin: 0.6rem 0 0.8rem; }
.now .lede { font-size: 1.1875rem; margin-bottom: 1.25rem; }
.now-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.55rem; }
.now-list li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.75rem; align-items: baseline; }
.now-list .k { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.stats-inline { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; font-family: var(--font-mono); font-size: 0.9375rem; color: var(--muted); margin-bottom: 1.5rem; }
.stats-inline b { color: var(--ink); font-weight: 600; font-size: 1.125rem; margin-right: 0.3rem; }
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; padding: 0.55rem 1.15rem;
  border-radius: 999px; font: 600 1rem/1.2 var(--font-ui); text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background 150ms, transform 150ms, border-color 150ms;
}
.btn-primary { background: var(--action); color: var(--action-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--action) 85%, var(--ink)); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.link-2 { font-weight: 600; color: var(--ink); text-decoration: underline; min-height: 44px; display: inline-flex; align-items: center; }
.link-3 { color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.link-3:hover { color: var(--ink); text-decoration: underline; }

/* ---------- filter chips ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; align-items: center; }
.chip {
  font: 500 0.9375rem/1 var(--font-mono); padding: 0 0.9rem; min-height: 40px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none;
}
.chip:hover { border-color: var(--muted); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.chip .n { opacity: 0.75; }
.search {
  width: 100%; font: 400 1.0625rem var(--font-ui); padding: 0.8rem 1rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); min-height: 48px;
}
.search::placeholder { color: var(--muted); }
.result-line { font-family: var(--font-mono); font-size: 0.9375rem; color: var(--muted); margin: 0 0 1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* ---------- the stream ---------- */
.stream { list-style: none; margin: 0; padding: 0; position: relative; }
.stream::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) + 0.75rem - 1px); width: 2px;
  background: linear-gradient(var(--spine), color-mix(in srgb, var(--spine) 25%, transparent));
}
.year {
  position: sticky; top: 4rem; z-index: 5; display: grid; grid-template-columns: var(--gutter) 1.5rem minmax(0, 1fr); gap: 0 1.25rem;
  background: var(--ground); padding: 0.6rem 0; margin: 0.75rem 0;
}
.year h2 { font-family: var(--font-mono); font-size: 1.75rem; font-weight: 600; letter-spacing: -0.03em; text-align: right; }
.year .year-knot { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--spine); align-self: center; box-shadow: 0 0 0 4px var(--ground); }
.year p { margin: 0; align-self: center; font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); }

.entry {
  display: grid; grid-template-columns: var(--gutter) 1.5rem minmax(0, 1fr); grid-template-areas: "time spine body";
  gap: 0 1.25rem; padding: 1.1rem 0;
}
.entry[hidden] { display: none; }
.time { grid-area: time; text-align: right; font-family: var(--font-mono); line-height: 1.25; padding-top: 0.1rem; }
.time time, .time .t-main { display: block; font-size: 1.3rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; text-decoration: none; }
.time a:hover { text-decoration: underline; }
.time .t-sub { display: block; font-size: 0.8125rem; color: var(--muted); margin-top: 0.2rem; }
.time .rel { display: block; font-size: 0.8125rem; color: var(--live); margin-top: 0.1rem; }
.spine { grid-area: spine; display: flex; justify-content: center; padding-top: 0.35rem; }
.glyph { width: 1.1rem; height: 1.1rem; background: var(--tc, var(--spine)); box-shadow: 0 0 0 4px var(--ground); flex-shrink: 0; }
.g-article { border-radius: 50%; }
.g-ai { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); transform: scale(1.2); }
.g-story { clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); transform: scale(1.15); }
.g-pattern { border-radius: 2px; }
.g-project { clip-path: polygon(50% 0, 100% 100%, 0 100%); transform: scale(1.15); }
.g-milestone { border-radius: 50%; background: var(--ground); box-shadow: 0 0 0 3px var(--tc), 0 0 0 7px var(--ground); }
.g-note { border-radius: 50%; transform: scale(0.65); }
.t-article { --tc: var(--t-article); }
.t-ai { --tc: var(--t-ai); }
.t-story { --tc: var(--t-story); }
.t-pattern { --tc: var(--t-pattern); }
.t-project { --tc: var(--t-project); }
.t-milestone { --tc: var(--t-milestone); }
.t-note { --tc: var(--t-note); }

.body { grid-area: body; min-width: 0; }
.kind { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--tc); font-weight: 600; display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-bottom: 0.35rem; }
.kind .sep { color: var(--muted); font-weight: 400; }
.kind .muted { color: var(--muted); font-weight: 500; }
.entry h3 { font-size: 1.375rem; line-height: 1.25; margin-bottom: 0.4rem; letter-spacing: -0.015em; }
.entry h3 a { text-decoration: none; }
.entry h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.entry p { margin: 0 0 0.6rem; max-width: 64ch; }
.entry .note-text { font-family: var(--font-read); font-size: 1.3125rem; line-height: 1.5; color: var(--ink); }
.post {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem 1rem;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; transition: border-color 150ms, transform 150ms;
}
.post:hover { border-color: color-mix(in srgb, var(--tc) 60%, var(--line)); }
.post.plain { display: block; background: transparent; border-color: transparent; padding-left: 0; padding-right: 0; }
.post.plain:hover { border-color: transparent; }
.thumb { width: 8.5rem; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 50%, var(--surface-sunk)), var(--surface-sunk)); align-self: start; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.term { background: #0d0f13; }
.media { margin-top: 0.75rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-sunk); aspect-ratio: 2 / 1; max-width: 40rem; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); margin-top: 0.4rem; }
.tags a { text-decoration: none; }
.tags a:hover { color: var(--ink); text-decoration: underline; }
.pillset { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 0.25rem; }
.pill {
  font-family: var(--font-mono); font-size: 0.875rem; padding: 0.3rem 0.7rem; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 34px;
}
a.pill:hover { border-color: var(--tc, var(--muted)); }
.badge { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 4px; border: 1px solid currentColor; }
.badge.new { color: var(--live); }
.badge.upd { color: var(--muted); }
.pinned { color: var(--live); }

.more-row { display: grid; grid-template-columns: var(--gutter) 1.5rem minmax(0, 1fr); gap: 0 1.25rem; padding: 1.5rem 0 0.5rem; }
.more-row .body { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.more-row .spine span { width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px dashed var(--spine); background: var(--ground); }
.stream-end { font-family: var(--font-mono); color: var(--muted); font-size: 0.9375rem; }
.empty {
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.5rem; text-align: left; background: var(--surface);
}
.empty h3 { font-size: 1.25rem; margin-bottom: 0.3rem; }

/* thread (I, AI) */
.thread { list-style: none; margin: 0; padding: 0; }
.thread li { position: relative; padding: 0 0 1.25rem 2.25rem; }
.thread li::before { content: ""; position: absolute; left: 0.55rem; top: 0.9rem; bottom: -0.4rem; width: 2px; background: var(--t-story); }
.thread li:last-child::before { display: none; }
.thread li::after { content: ""; position: absolute; left: 0.1rem; top: 0.35rem; width: 1.1rem; height: 1.1rem; background: var(--t-story); clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }
.thread li.draft::after { background: transparent; clip-path: none; border: 2px dashed var(--t-story); border-radius: 50%; }
.thread li.draft::before { background: repeating-linear-gradient(var(--t-story) 0 6px, transparent 6px 12px); }
.thread li.draft { color: var(--muted); }

/* ---------- side cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.card h2, .card h3 { font-size: 1.0625rem; margin-bottom: 0.75rem; font-family: var(--font-mono); font-weight: 600; letter-spacing: 0; text-transform: uppercase; font-size: 0.875rem; color: var(--muted); letter-spacing: 0.07em; }
.card p { font-size: 1rem; }
.card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.15rem; }
.card li a { display: flex; justify-content: space-between; gap: 0.75rem; min-height: 40px; align-items: center; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.card li:last-child a { border-bottom: 0; }
.card li a:hover { color: var(--action); text-decoration: underline; }
.card li a span { font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); }
.card.dark { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.card.dark h2, .card.dark h3 { color: color-mix(in srgb, var(--ground) 70%, var(--ink)); }
.card.dark p { color: var(--ground); }
.card.dark .btn-primary { background: var(--ground); color: var(--ink); }
.legend { display: grid; gap: 0.5rem; }
.legend div { display: flex; align-items: center; gap: 0.75rem; font-size: 1rem; }
.legend .glyph { box-shadow: none; }
.legend .g-milestone { box-shadow: inset 0 0 0 3px var(--tc); }

/* newsletter */
.nl { display: grid; gap: 0.6rem; }
.nl label { font-size: 0.9375rem; color: var(--muted); }
.nl-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.nl input[type="email"] { flex: 1 1 12rem; min-width: 0; min-height: 44px; padding: 0.5rem 0.9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--ground); color: var(--ink); font: 400 1rem var(--font-ui); }
.nl input::placeholder { color: var(--muted); }
.nl-msg { font-size: 0.9375rem; margin: 0; min-height: 1.4em; }
.nl-msg.err { color: var(--live); }
.nl-msg.ok { color: var(--t-pattern); font-weight: 600; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 2rem; }
.foot-inner { max-width: 1240px; margin: 0 auto; padding: 3rem 1.5rem 2rem; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.5fr; gap: 2rem; }
.foot h2 { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.75rem; font-weight: 600; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li a { text-decoration: none; color: var(--ink); display: inline-flex; min-height: 36px; align-items: center; }
.foot li a:hover { text-decoration: underline; }
.foot-base { max-width: 1240px; margin: 0 auto; padding: 1.25rem 1.5rem 2rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); }
.end-of-stream { display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-mono); color: var(--muted); font-size: 0.9375rem; }

/* ---------- article permalink ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--live); z-index: 30; }
.permalink { display: grid; grid-template-columns: 14rem minmax(0, 42rem) 15rem; gap: 3rem; justify-content: center; padding: 2rem 0 4rem; align-items: start; }
.toc { position: sticky; top: 5.5rem; }
.toc h2 { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.75rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 0.4rem 0 0.4rem 0.9rem; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; color: var(--muted); font-size: 0.9375rem; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--live); font-weight: 600; }
.toc-mobile { display: none; }
.stamp-hero { border-bottom: 1px solid var(--line); padding-bottom: 1.75rem; margin-bottom: 1.75rem; }
.stamp-big { font-family: var(--font-mono); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; color: var(--muted); font-size: 0.9375rem; margin: 0.75rem 0 1rem; }
.stamp-big time { font-size: clamp(2rem, 5vw, 3rem); font-weight: 600; color: var(--ink); letter-spacing: -0.04em; line-height: 1; }
.stamp-hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: -0.03em; line-height: 1.08; margin-bottom: 0.8rem; }
.stamp-hero .lede { font-family: var(--font-read); font-size: 1.375rem; line-height: 1.45; color: var(--text); }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-family: var(--font-mono); font-size: 0.9375rem; color: var(--muted); align-items: center; }
.meta-row a { color: var(--ink); }
.prose { font-family: var(--font-read); font-size: 1.1875rem; line-height: 1.7; color: var(--text); }
.prose h2 { font-family: var(--font-ui); font-size: 1.75rem; margin: 2.5rem 0 0.9rem; letter-spacing: -0.02em; display: flex; gap: 0.75rem; align-items: baseline; }
.prose h2 .hnum { font-family: var(--font-mono); font-size: 0.9375rem; color: var(--live); font-weight: 500; }
.prose p, .prose ol, .prose ul { margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.35em; }
.prose a { color: var(--ink); text-decoration-color: var(--live); }
.prose code { font-size: 0.88em; background: var(--surface-sunk); padding: 0.1em 0.35em; border-radius: 4px; color: var(--ink); }
.prose em { font-style: italic; }
.codeblock { margin: 1.6rem 0; border-radius: var(--radius); overflow: hidden; background: var(--code-bg); border: 1px solid var(--line); }
.codebar { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0.5rem 0.35rem 1rem; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--code-dim); border-bottom: 1px solid #2a2f38; text-transform: uppercase; letter-spacing: 0.08em; }
.copy { font: 500 0.875rem var(--font-mono); color: var(--code-ink); background: transparent; border: 1px solid #3a414d; border-radius: 6px; padding: 0 0.75rem; min-height: 36px; cursor: pointer; }
.copy:hover { border-color: var(--code-ink); }
.codeblock pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; font-size: 0.9rem; line-height: 1.6; color: var(--code-ink); tab-size: 2; }
.codeblock pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.c-com { color: var(--code-dim); font-style: italic; }
.c-str { color: var(--code-str); }
.c-kw { color: var(--code-kw); }
.callout { font-family: var(--font-ui); font-size: 1.0625rem; line-height: 1.6; border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.5rem 0; border: 1px solid var(--line); background: var(--surface); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.9rem; }
.callout p { margin: 0; }
.callout .ck { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; padding-top: 0.2rem; min-width: 6.5rem; }
.callout.why .ck { color: var(--t-article); }
.callout.q { border-style: dashed; }
.callout.q .ck { color: var(--live); }
.callout.q .reply { display: inline-block; margin-top: 0.5rem; font-family: var(--font-mono); font-size: 0.875rem; color: var(--live); }
.callout.upd { background: color-mix(in srgb, var(--t-pattern) 9%, var(--surface)); }
.callout.upd .ck { color: var(--t-pattern); }
.callout.nt .ck { color: var(--muted); }
.side { position: sticky; top: 5.5rem; display: grid; gap: 1.25rem; }
.neighbor { display: block; text-decoration: none; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.neighbor:last-child { border-bottom: 0; }
.neighbor .eyebrow { font-size: 0.75rem; }
.neighbor strong { display: block; color: var(--ink); line-height: 1.3; margin-top: 0.2rem; font-size: 1rem; }
.neighbor:hover strong { text-decoration: underline; }
.share { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.after { border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 2rem; display: grid; gap: 1.5rem; }
.related { display: grid; gap: 0.75rem; }

/* ---------- grids used on projects / about ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.section { margin: 3rem 0 1rem; }
.section-head { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); gap: 0 1.5rem; align-items: baseline; margin-bottom: 1rem; }
.section-head .count { font-family: var(--font-mono); text-align: right; color: var(--muted); font-size: 0.9375rem; }
.section-head h2 { font-size: 1.75rem; letter-spacing: -0.02em; }
.section-head p { grid-column: 2; margin: 0.25rem 0 0; color: var(--muted); }
.jump { position: sticky; top: 4rem; z-index: 6; background: var(--ground); padding: 0.75rem 0; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.jump .filters { margin: 0; }

.hairline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.hairline > div { background: var(--surface); padding: 0.9rem 1rem; }
.hairline .lbl { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); display: block; }
.hairline .fig { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); box-shadow: var(--shadow);
}
.feature-body { padding: 1.75rem; display: grid; gap: 1rem; align-content: start; }
.feature-body h2, .feature-body h3 { font-size: 1.75rem; letter-spacing: -0.02em; }
.feature-media { background: #0c1f33; min-height: 16rem; }
.feature-media img { width: 100%; height: 100%; object-fit: cover; }

.quote-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.quote-list li { font-family: var(--font-read); font-size: 1.375rem; line-height: 1.4; color: var(--ink); font-style: italic; }

.cap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.cap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.cap h3 { font-size: 1.1875rem; margin-bottom: 0.35rem; }
.cap p { color: var(--muted); font-size: 1rem; margin-bottom: 0.75rem; }

.portrait-band { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 2rem; align-items: center; }
.portrait-band .ph { aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, var(--spine), var(--surface-sunk)); }
.portrait-band .ph img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- pattern detail ---------- */
.revlog { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.9375rem; }
.revlog li { display: flex; gap: 0.6rem; align-items: center; }
.uses { columns: 2; column-gap: 2rem; padding-left: 1.2rem; margin: 0.5rem 0 1rem; }
.uses li { margin-bottom: 0.3rem; break-inside: avoid; }
.panes { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); margin-top: 1.5rem; }
.panes-bar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.5rem; border-bottom: 1px solid var(--line); background: var(--surface-sunk); }
.tablist { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.tab { font: 500 0.9375rem var(--font-mono); padding: 0 0.9rem; min-height: 42px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); }
.pane-actions { display: flex; gap: 0.5rem; }
.pane-actions button { font: 500 0.875rem var(--font-mono); min-height: 40px; padding: 0 0.8rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.pane-actions button:hover { border-color: var(--muted); }
.pane { padding: 1.5rem; }
.pane[hidden] { display: none; }
.pane pre { margin: 0; background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); padding: 1rem; overflow-x: auto; font-size: 0.9rem; line-height: 1.6; }
.pane .prompt { font-family: var(--font-read); font-size: 1.1875rem; line-height: 1.65; max-width: 62ch; }
.pane-note { font-size: 1rem; color: var(--muted); margin-bottom: 1rem; }

/* the live demo: hairline stat strip */
.hss-cap { font-size: 1rem; color: var(--muted); margin: 0 0 0.75rem; }
.hss-strip { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; grid-template-columns: 1fr; margin-bottom: 1.75rem; }
@container demo (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container demo (min-width: 42rem) { .hss-strip.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hss-strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.demo { container: demo / inline-size; }
.hss-tile { background: var(--surface); padding: 0.9rem 1rem; display: grid; gap: 0.15rem; text-align: left; border: 0; font: inherit; color: inherit; min-width: 0; }
button.hss-tile { cursor: pointer; min-height: 44px; }
button.hss-tile:hover { background: color-mix(in srgb, var(--action) 7%, var(--surface)); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--action) 14%, var(--surface)); box-shadow: inset 0 -3px 0 var(--action); }
.hss-lbl { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); overflow-wrap: anywhere; }
.hss-fig { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.hss-fig.none { color: var(--muted); font-weight: 400; }
.hss-sub { font-size: 0.875rem; color: var(--muted); }
.dl-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.dl-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dl-list li:last-child { border-bottom: 0; }
.dl-list li[hidden] { display: none; }
.dl-state { font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); }
.dl-status { font-family: var(--font-mono); font-size: 0.9375rem; color: var(--muted); margin: 0.75rem 0 0; }

.three-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1.5rem 0 0.75rem; }
.three-ways > div { background: var(--surface); padding: 1.1rem 1.2rem; }
.three-ways h3 { font-size: 1.125rem; margin-bottom: 0.3rem; }
.three-ways p { margin: 0; font-size: 1rem; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .permalink { grid-template-columns: minmax(0, 42rem) 15rem; }
  .permalink .toc { display: none; }
  .toc-mobile { display: block; }
}
@media (max-width: 1040px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
  .foot-inner { grid-template-columns: 1fr 1fr; }
  .feature { grid-template-columns: 1fr; }
  .feature-media { min-height: 12rem; aspect-ratio: 16 / 7; }
  .nav a { padding: 0.6rem 0.5rem; }
}
@media (max-width: 860px) {
  .permalink { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .bar-inner { flex-wrap: wrap; gap: 0 1rem; padding: 0 1rem; }
  .nav { order: 3; width: 100%; margin: 0 -0.25rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.25rem; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .nav::-webkit-scrollbar { display: none; }
  .theme-btn { margin-left: auto; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  :root { --gutter: 0rem; }
  .wrap { padding: 0 1rem; }
  body { font-size: 1.0625rem; }
  .stream::before { left: 0.75rem; }
  .entry, .year, .more-row { grid-template-columns: 1.5rem minmax(0, 1fr); grid-template-areas: "spine time" "spine body"; gap: 0 0.9rem; }
  .year h2 { text-align: left; grid-column: 2; grid-row: 1; }
  .year .year-knot { grid-column: 1; grid-row: 1; }
  .year p { grid-column: 2; }
  .more-row .spine { grid-column: 1; }
  .more-row .body { grid-column: 2; }
  .time { text-align: left; display: flex; flex-wrap: wrap; gap: 0 0.6rem; align-items: baseline; margin-bottom: 0.3rem; }
  .time time, .time .t-main { font-size: 1.0625rem; }
  .time .t-sub, .time .rel { margin: 0; }
  .spine { grid-row: 1 / span 2; }
  .post { grid-template-columns: 1fr; padding: 1rem; }
  .thumb { width: 100%; aspect-ratio: 2 / 1; order: -1; }
  .head, .section-head { grid-template-columns: 1fr; }
  .head-stamp { padding: 0 0 0.25rem; }
  .head-stamp strong { display: inline; font-size: 1.0625rem; margin-right: 0.5rem; }
  .section-head .count { text-align: left; order: -1; }
  .section-head p { grid-column: 1; }
  .now { grid-template-columns: 1fr; padding: 1.25rem; }
  .now-portrait { width: 5.5rem; height: 5.5rem; }
  .now-list li { grid-template-columns: 1fr; gap: 0; }
  .foot-inner { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .cap-grid, .three-ways { grid-template-columns: 1fr; }
  .hairline { grid-template-columns: 1fr 1fr 1fr; }
  .hairline .fig { font-size: 1.25rem; }
  .portrait-band { grid-template-columns: 1fr; }
  .portrait-band .ph { max-width: 16rem; }
  .uses { columns: 1; }
  .callout { grid-template-columns: 1fr; gap: 0.3rem; }
  .prose { font-size: 1.125rem; }
  .pane { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
[hidden]{display:none !important}
