/* Cosmic / Space — antjanus.com redesign 095
   Deep-space default, "star atlas" day mode. Collections are colour-coded by
   Harvard stellar class (O blue → M red) instead of arbitrary brand hues. */

:root {
  /* primitives */
  --void: #03060f;
  --deep-1: #070d20;
  --deep-2: #0c1633;
  --deep-3: #132049;
  --deep-line: #26356a;
  --starlight: #eef2ff;
  --starlight-2: #c9d1ec;
  --haze: #a3aed3;
  --sun: #ffcf6e;
  --nebula-violet: #b0a3ff;
  --nebula-cyan: #86dcff;
  --slate-orbit: #6f92bd;

  --paper: #eef1f7;
  --paper-surface: #ffffff;
  --paper-2: #e2e7f1;
  --paper-line: #c3cbdc;
  --ink-deep: #0a1330;
  --ink-body: #26314f;
  --ink-dim: #47527a;
  --ochre: #855700;
  --indigo: #4b33c7;
  --teal: #0a6386;
  --brand: #364f6a;

  /* semantic (dark / space default) */
  --bg: var(--void);
  --bg-raised: var(--deep-1);
  --surface: rgba(12, 22, 51, 0.78);
  --surface-solid: var(--deep-2);
  --surface-2: var(--deep-3);
  --line: var(--deep-line);
  --text-strong: var(--starlight);
  --text: var(--starlight-2);
  --text-dim: var(--haze);
  --accent: var(--sun);
  --accent-ink: #1b1200;
  --accent-2: var(--nebula-violet);
  --accent-3: var(--nebula-cyan);
  --orbit: var(--slate-orbit);
  --star: #ffffff;
  --glow: 0 0 0 1px rgba(255, 207, 110, 0.25), 0 0 32px rgba(255, 207, 110, 0.18);
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8);

  /* stellar classes → collections */
  --class-o: #8fc3ff; /* AI */
  --class-b: #b7c8ff; /* Patterns */
  --class-a: #e9eeff; /* Projects */
  --class-g: #ffd978; /* Digital Garden */
  --class-k: #ffb26b; /* Demystifying Tools */
  --class-m: #ff9582; /* Stories */

  --code-bg: #050a1a;
  --code-text: #dfe6ff;

  --font-display: "Unbounded", "Avenir Next", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
  --font-code: "JetBrains Mono", ui-monospace, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --max: 1220px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: var(--paper);
  --bg-raised: #e7ebf4;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: var(--paper-surface);
  --surface-2: var(--paper-2);
  --line: var(--paper-line);
  --text-strong: var(--ink-deep);
  --text: var(--ink-body);
  --text-dim: var(--ink-dim);
  --accent: var(--ochre);
  --accent-ink: #ffffff;
  --accent-2: var(--indigo);
  --accent-3: var(--teal);
  --orbit: var(--brand);
  --star: #1b2750;
  --glow: 0 0 0 1px rgba(133, 87, 0, 0.3), 0 8px 24px -10px rgba(10, 19, 48, 0.25);
  --shadow: 0 16px 40px -24px rgba(10, 19, 48, 0.35);

  --class-o: #1c5bb0;
  --class-b: #3b4fd0;
  --class-a: #364f6a;
  --class-g: #7d5a00;
  --class-k: #9a4500;
  --class-m: #ad3019;

  --code-bg: #0a1330;
  --code-text: #e6ecff;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* ---------- starfield ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 85% 5%, rgba(110, 90, 255, 0.22), transparent 70%),
    radial-gradient(ellipse 55% 40% at 5% 35%, rgba(40, 120, 255, 0.16), transparent 70%),
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(255, 150, 90, 0.10), transparent 70%),
    var(--bg);
}
.sky::before,
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 23px 41px, var(--star) 50%, transparent 52%),
    radial-gradient(1px 1px at 131px 97px, var(--star) 50%, transparent 52%),
    radial-gradient(1px 1px at 77px 169px, var(--star) 50%, transparent 52%),
    radial-gradient(1px 1px at 171px 13px, var(--star) 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 211px 233px, var(--star) 50%, transparent 52%),
    radial-gradient(1px 1px at 297px 61px, var(--star) 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 43px 281px, var(--star) 50%, transparent 52%),
    radial-gradient(2px 2px at 331px 191px, var(--star) 50%, transparent 52%);
  background-size: 197px 197px, 197px 197px, 197px 197px, 197px 197px, 353px 353px, 353px 353px, 353px 353px, 419px 419px;
  opacity: 0.55;
}
.sky::after {
  background-image:
    radial-gradient(2px 2px at 101px 57px, var(--star) 50%, transparent 55%),
    radial-gradient(1.5px 1.5px at 263px 211px, #ffe3a8 50%, transparent 55%),
    radial-gradient(2px 2px at 389px 331px, #bcd8ff 50%, transparent 55%),
    radial-gradient(1.5px 1.5px at 19px 373px, var(--star) 50%, transparent 55%);
  background-size: 457px 457px, 457px 457px, 521px 521px, 521px 521px;
  opacity: 0.9;
  animation: twinkle 7s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.25; } to { opacity: 0.95; } }

:root[data-theme="light"] .sky {
  background:
    repeating-linear-gradient(0deg, transparent 0 119px, rgba(54, 79, 106, 0.07) 119px 120px),
    repeating-linear-gradient(90deg, transparent 0 119px, rgba(54, 79, 106, 0.07) 119px 120px),
    radial-gradient(ellipse 60% 45% at 85% 5%, rgba(75, 51, 199, 0.08), transparent 70%),
    var(--bg);
}
:root[data-theme="light"] .sky::before { opacity: 0.35; }
:root[data-theme="light"] .sky::after { opacity: 0.4; animation: none; }

/* ---------- base ---------- */
img { max-width: 100%; display: block; }
a { color: var(--accent-3); text-underline-offset: 3px; }
a:hover { color: var(--text-strong); }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 4rem); line-height: 1.05; }
h2 { font-size: clamp(1.55rem, 3vw, 2.25rem); }
h3 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 1rem;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}
.lede { font-size: clamp(1.15rem, 1.8vw, 1.35rem); color: var(--text); max-width: 62ch; }
.muted { color: var(--text-dim); }
.mono { font-family: var(--font-mono); }

/* ---------- header / planetary nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 1.5rem; min-height: 76px;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.75rem;
  text-decoration: none; color: var(--text-strong); flex-shrink: 0;
}
.brand svg { width: 44px; height: 44px; }
.brand-words { display: flex; flex-direction: column; line-height: 1.05; }
.brand-words small {
  font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.16em;
  color: var(--text-dim); text-transform: uppercase;
}
.brand-words strong { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.02em; }

.orbit-nav { flex: 1; display: flex; justify-content: center; }
.orbit-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: clamp(0.4rem, 1.4vw, 1.4rem); position: relative;
}
.orbit-nav ul::before {
  /* the shared orbit every nav planet sits on */
  content: ""; position: absolute; left: -12px; right: -12px; top: 50%;
  height: 34px; transform: translateY(-50%);
  border: 1px dashed color-mix(in srgb, var(--orbit) 55%, transparent);
  border-radius: 50%;
  pointer-events: none;
}
.orbit-nav a {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.7rem; min-height: 44px;
  color: var(--text); text-decoration: none;
  font-family: var(--font-mono); font-size: 0.875rem; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--bg); border-radius: 999px;
  transition: color 150ms ease;
}
.orbit-nav a .planet { transition: transform 150ms ease, box-shadow 150ms ease; }
.orbit-nav a:hover { color: var(--text-strong); }
.orbit-nav a:hover .planet { transform: scale(1.3); }
.orbit-nav a[aria-current="page"] { color: var(--text-strong); }
.orbit-nav a[aria-current="page"] .planet {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px var(--c, var(--accent)), 0 0 14px var(--c, var(--accent));
}
.orbit-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0.7rem; right: 0.7rem; bottom: 4px; height: 2px;
  background: var(--c, var(--accent)); border-radius: 2px;
}

.planet {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 30% 30%, #fff 0 8%, var(--c, var(--accent)) 45%, color-mix(in srgb, var(--c, var(--accent)) 50%, #000) 100%);
  box-shadow: 0 0 10px color-mix(in srgb, var(--c, var(--accent)) 70%, transparent);
}
:root[data-theme="light"] .planet { box-shadow: none; background: var(--c, var(--accent)); }
.c-o { --c: var(--class-o); }
.c-b { --c: var(--class-b); }
.c-a { --c: var(--class-a); }
.c-g { --c: var(--class-g); }
.c-k { --c: var(--class-k); }
.c-m { --c: var(--class-m); }
.c-sun { --c: var(--accent); }

.header-tools { display: flex; align-items: center; gap: 0.5rem; }
.search-mini { display: flex; }
.search-mini input {
  width: 150px; min-height: 44px; padding: 0 0.9rem;
  background: var(--surface-solid); color: var(--text-strong);
  border: 1px solid var(--line); border-radius: 999px 0 0 999px; border-right: 0;
  font: inherit; font-size: 0.95rem;
}
.search-mini input::placeholder { color: var(--text-dim); }
.search-mini button {
  min-height: 44px; padding: 0 0.9rem; border: 1px solid var(--line);
  border-radius: 0 999px 999px 0; background: var(--surface-2); color: var(--text-strong);
  font: inherit; font-size: 0.9rem; cursor: pointer;
}
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface-solid); color: var(--text-strong); cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
.menu-btn { display: none; }

.mobile-menu {
  display: none;
  border-top: 1px solid var(--line);
  padding: 1rem var(--gutter) 1.5rem;
  background: var(--bg-raised);
}
.mobile-menu.open { display: block; }
.mobile-menu ol { list-style: none; margin: 0 0 1rem; padding: 0; position: relative; }
.mobile-menu ol::before {
  content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px;
  border-left: 1px dashed var(--orbit);
}
.mobile-menu a {
  position: relative; display: flex; align-items: center; gap: 1rem;
  min-height: 52px; padding: 0 0.75rem; color: var(--text-strong); text-decoration: none;
  font-family: var(--font-display); font-size: 1.1rem; border-radius: 12px;
}
.mobile-menu a .planet { width: 16px; height: 16px; outline: 4px solid var(--bg-raised); }
.mobile-menu a[aria-current="page"] { background: var(--surface-2); }
.mobile-menu a small { margin-left: auto; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-dim); }
.mobile-menu .search-mini input { flex: 1; width: auto; }

@media (max-width: 1180px) { .header-tools .search-mini { display: none; } }
@media (max-width: 960px) {
  .orbit-nav { display: none; }
  .menu-btn { display: inline-grid; }
  .header-tools { margin-left: auto; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 48px; padding: 0 1.4rem; border-radius: 999px;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.04em;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); }
.btn-primary:hover { color: var(--accent-ink); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { border-color: var(--line); color: var(--text-strong); background: var(--surface-solid); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text-strong); }
.link-quiet {
  color: var(--text-dim); font-family: var(--font-mono); font-size: 0.9rem;
  text-decoration: none; display: inline-flex; min-height: 44px; align-items: center;
}
.link-quiet:hover { color: var(--text-strong); text-decoration: underline; }
.link-under { color: var(--text-strong); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; min-height: 44px; display: inline-flex; align-items: center; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; position: relative; }
.section + .section { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }

.orbit-head {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0 1.25rem;
  align-items: end; margin-bottom: 2.25rem;
}
.orbit-head .orbit-mark { grid-row: span 2; width: 64px; height: 64px; align-self: center; }
.orbit-head .kicker {
  font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--c, var(--accent));
}
.orbit-head h2 { margin: 0.1rem 0 0; }
.orbit-head p { grid-column: 2; margin: 0.35rem 0 0; color: var(--text-dim); }
.orbit-head .more { grid-row: 1 / span 2; grid-column: 3; align-self: center; }
@media (max-width: 640px) {
  .orbit-head { grid-template-columns: auto 1fr; }
  .orbit-head .orbit-mark { width: 48px; height: 48px; }
  .orbit-head .more { grid-column: 1 / -1; grid-row: auto; justify-self: start; margin-top: 0.5rem; }
}
.orbit-mark circle.o { fill: none; stroke: var(--orbit); stroke-dasharray: 2 4; }
.orbit-mark circle.p { fill: var(--c, var(--accent)); }
.orbit-mark circle.s { fill: var(--accent); }

/* ---------- cards ---------- */
.grid { display: grid; gap: 1.25rem; }
.g-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.g-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.g-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.card:hover { border-color: var(--c, var(--accent)); transform: translateY(-3px); box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--c, var(--accent)) 30%, transparent); }
.card:focus-within { border-color: var(--c, var(--accent)); }
.card .shot { position: relative; aspect-ratio: 16 / 9; background: radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--c, var(--accent)) 35%, var(--deep-2)), var(--deep-1)); overflow: hidden; }
.card .shot img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.65) contrast(1.05); transition: filter 200ms ease, transform 400ms ease; }
.card .shot::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(3, 6, 15, 0.55)), linear-gradient(135deg, color-mix(in srgb, var(--c, var(--accent)) 22%, transparent), transparent 60%);
  pointer-events: none;
}
.card:hover .shot img { filter: saturate(1) contrast(1); transform: scale(1.03); }
.card .body { padding: 1.25rem 1.35rem 1.4rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.card h3 { margin: 0; }
.card h3 a { color: var(--text-strong); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card h3 a:focus-visible { outline: none; }
.card h3 a:focus-visible::after { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: var(--radius); }
.card p { margin: 0; color: var(--text); }
.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem;
  font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.05em; color: var(--text-dim); text-transform: uppercase;
}
.meta .planet { width: 8px; height: 8px; }
.card .ext { position: relative; z-index: 2; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.65rem;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent); text-decoration: none;
}
a.chip:hover { border-color: var(--accent); color: var(--text-strong); }
.badge {
  font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.1rem 0.55rem; border-radius: 6px; border: 1px solid currentColor;
}
.badge-new { color: var(--accent); }
.badge-upd { color: var(--accent-3); }

/* list rows (log entries) */
.log { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.log li { border-bottom: 1px solid var(--line); }
.log a {
  display: grid; grid-template-columns: 8.5rem 1fr auto; gap: 0.25rem 1.5rem; align-items: baseline;
  padding: 1.15rem 0.5rem; color: var(--text); text-decoration: none; border-radius: 8px;
  transition: background 150ms ease;
}
.log a:hover { background: var(--surface); }
.log .d { font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-dim); display: flex; align-items: center; gap: 0.6rem; }
.log .t { font-family: var(--font-display); font-weight: 500; color: var(--text-strong); font-size: 1.1rem; line-height: 1.3; }
.log .x { grid-column: 2; color: var(--text); }
.log .go { color: var(--c, var(--accent)); font-family: var(--font-mono); grid-row: 1; grid-column: 3; }
@media (max-width: 640px) {
  .log a { grid-template-columns: 1fr auto; }
  .log .d { grid-column: 1 / -1; }
  .log .x { grid-column: 1 / -1; }
  .log .go { grid-row: 2; grid-column: 2; }
}

/* ---------- hero: orbit system ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem); position: relative; overflow: hidden; }
.hero-nebula {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("assets/nebula-hero.webp") center / cover no-repeat;
  opacity: 0.55; mask-image: linear-gradient(180deg, #000 60%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
}
:root[data-theme="light"] .hero-nebula { opacity: 0.12; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { margin-bottom: 1.25rem; }
.hero h1 em { font-style: normal; color: var(--accent); }
.readouts { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 2rem; padding: 0; list-style: none; }
.readouts li {
  border: 1px solid var(--line); border-radius: 14px; padding: 0.7rem 1rem 0.75rem;
  background: var(--surface); min-width: 9.5rem;
}
.readouts b { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--text-strong); font-weight: 600; line-height: 1.1; }
.readouts span { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }

.system {
  --size: min(560px, 74vw);
  position: relative; width: var(--size); aspect-ratio: 1; margin: 0 auto;
}
.system .sun {
  position: absolute; inset: 33%; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 2px var(--accent), 0 0 60px 10px rgba(255, 190, 90, 0.35), 0 0 140px 30px rgba(255, 150, 60, 0.15);
  background: radial-gradient(circle, #ffd98a, #c96a1c);
}
:root[data-theme="light"] .system .sun { box-shadow: 0 0 0 2px var(--accent), 0 0 0 10px rgba(133, 87, 0, 0.1); }
.system .sun img { width: 100%; height: 100%; object-fit: cover; object-position: 28% 30%; }
.ring {
  --a: 0deg; --dur: 120s;
  position: absolute; border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--orbit) 70%, transparent);
  animation: spin var(--dur) linear infinite;
  transform: rotate(var(--a));
}
.ring.r1 { inset: 24%; --dur: 70s; --a: 200deg; }
.ring.r2 { inset: 15%; --dur: 110s; --a: 320deg; }
.ring.r3 { inset: 6.5%; --dur: 160s; --a: 70deg; }
.ring.r4 { inset: 0; --dur: 230s; --a: 150deg; border-style: solid; border-color: color-mix(in srgb, var(--orbit) 35%, transparent); }
.system:hover .ring,
.system:focus-within .ring,
.system:hover .ring .label,
.system:focus-within .ring .label { animation-play-state: paused; }
.ring .body {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
}
.ring .body.opp { left: 100%; }
.ring .label {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.45rem 0.9rem 0.45rem 0.5rem; min-height: 44px;
  background: var(--surface-solid); border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-strong); text-decoration: none; white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.875rem; letter-spacing: 0.05em; text-transform: uppercase;
  animation: counter var(--dur) linear infinite;
  transform: rotate(calc(-1 * var(--a)));
  box-shadow: var(--shadow);
  transition: border-color 150ms ease;
}
.ring .label:hover { border-color: var(--c); color: var(--text-strong); }
.ring .label .planet { width: 16px; height: 16px; }
@keyframes spin { from { transform: rotate(var(--a)); } to { transform: rotate(calc(var(--a) + 360deg)); } }
@keyframes counter { from { transform: rotate(calc(-1 * var(--a))); } to { transform: rotate(calc(-1 * var(--a) - 360deg)); } }
@media (max-width: 480px) {
  .ring .label { font-size: 0.8125rem; padding: 0.35rem 0.7rem 0.35rem 0.4rem; }
  .ring .label .planet { width: 12px; height: 12px; }
}

/* page heroes */
.page-hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem); position: relative; }
.page-hero .wrap { position: relative; }
.page-hero h1 { max-width: 18ch; }
.page-hero .arc {
  position: absolute; right: var(--gutter); top: -1rem; width: min(420px, 45vw); height: auto;
  pointer-events: none; opacity: 0.9;
}
@media (max-width: 760px) { .page-hero .arc { opacity: 0.35; right: -30px; } }
.arc .o { fill: none; stroke: var(--orbit); stroke-dasharray: 3 6; }
.arc .o2 { fill: none; stroke: color-mix(in srgb, var(--orbit) 50%, transparent); }
.arc .p { fill: var(--c, var(--accent)); }

.banner-img {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 21 / 8; background: var(--surface-2);
}
.banner-img img { width: 100%; height: 100%; object-fit: cover; }

/* jump-to rail */
.jump {
  position: sticky; top: 76px; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.jump ul { list-style: none; margin: 0 auto; padding: 0.6rem var(--gutter); display: flex; gap: 0.5rem; overflow-x: auto; max-width: var(--max); scrollbar-width: thin; }
.jump li:first-child { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); align-self: center; padding-right: 0.4rem; white-space: nowrap; }
.jump a {
  display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; min-height: 40px;
  padding: 0 0.9rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none;
  color: var(--text-strong); font-family: var(--font-mono); font-size: 0.875rem; background: var(--surface-solid);
}
.jump a:hover { border-color: var(--c, var(--accent)); }
.jump .planet { width: 8px; height: 8px; }

/* panels */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.panel-deep {
  background: radial-gradient(ellipse at 90% 0%, rgba(120, 100, 255, 0.25), transparent 60%), #060c22;
  color: #d3daf5; border-color: #22305e;
}
.panel-deep h2, .panel-deep h3 { color: #f2f5ff; }
.panel-deep .muted { color: #a5b0d6; }
.panel-deep a:not(.btn) { color: #9fdcff; }

/* stat strip (hairline, borrowed from the pattern library) */
.stats {
  display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; grid-template-columns: repeat(3, 1fr);
}
.stats > div { background: var(--surface-solid); padding: 1.25rem 1.4rem; }
.stats b { display: block; font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--text-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.stats span { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-raised) 85%, transparent); position: relative; overflow: hidden; }
.site-footer::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 1400px; height: 700px; transform: translate(-50%, -88%);
  border-radius: 50%; border: 1px solid color-mix(in srgb, var(--orbit) 40%, transparent);
  box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--accent-3) 40%, transparent);
  pointer-events: none;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.5fr; gap: 2rem; padding: 3.5rem 0 2rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h2 { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.9rem; font-weight: 700; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li a { display: inline-flex; min-height: 36px; align-items: center; color: var(--text); text-decoration: none; }
.footer-grid li a:hover { color: var(--text-strong); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--line); padding: 1.25rem 0 1.75rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-dim); }
.footer-bottom a { color: var(--text-dim); }

.sub-form { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sub-form input[type="email"] {
  flex: 1 1 180px; min-height: 48px; padding: 0 1rem; font: inherit; font-size: 1rem;
  background: var(--surface-solid); color: var(--text-strong); border: 1px solid var(--line); border-radius: 999px;
}
.sub-form input::placeholder { color: var(--text-dim); }
.sub-form .msg { flex-basis: 100%; margin: 0.25rem 0 0; min-height: 1.4em; font-size: 0.95rem; }
.sub-form .msg.ok { color: var(--accent-3); }
.sub-form .msg.err { color: var(--class-m); }
.sub-form input[aria-invalid="true"] { border-color: var(--class-m); }

/* ---------- article ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60; pointer-events: none;
}
.progress i {
  display: block; height: 100%; width: var(--p, 0%);
  background: linear-gradient(90deg, transparent, var(--accent-2) 40%, var(--accent));
  position: relative;
}
.progress i::after { /* comet head */
  content: ""; position: absolute; right: -4px; top: 50%; width: 10px; height: 10px; border-radius: 50%;
  transform: translateY(-50%); background: #fff; box-shadow: 0 0 12px 4px var(--accent);
}
.progress .pct {
  position: fixed; bottom: 14px; right: 14px; font-family: var(--font-mono); font-size: 0.8125rem;
  color: var(--text-dim); background: var(--surface-solid); border: 1px solid var(--line); padding: 0 0.5rem; border-radius: 6px;
}

.article-hero { position: relative; padding: clamp(2rem, 5vw, 4rem) 0 2.5rem; }
.article-hero .window {
  position: relative; border-radius: 28px; overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 21 / 9; background: var(--deep-2); margin-top: 2rem;
}
.article-hero .window img { width: 100%; height: 100%; object-fit: cover; }
.article-hero .window::after {
  content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 120px 30px rgba(3, 6, 15, 0.7); border-radius: inherit;
}
.crumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-dim); margin-bottom: 1.25rem; }
.crumbs a { color: var(--text); min-height: 44px; display: inline-flex; align-items: center; }
.article-hero h1 { max-width: 20ch; font-size: clamp(2rem, 4.6vw, 3.4rem); }
.article-hero .desc { font-size: clamp(1.15rem, 2vw, 1.35rem); max-width: 55ch; }

.article-layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem);
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
}
@media (max-width: 1080px) { .article-layout { grid-template-columns: minmax(0, 1fr); } }

.trajectory { position: sticky; top: 100px; align-self: start; }
.trajectory h2 { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.trajectory ol { list-style: none; margin: 0; padding: 0; position: relative; }
.trajectory ol::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; border-left: 1px dashed var(--orbit); }
.trajectory a {
  position: relative; display: flex; gap: 0.9rem; align-items: center; padding: 0.45rem 0; min-height: 40px;
  color: var(--text-dim); text-decoration: none; font-size: 0.975rem; line-height: 1.3;
}
.trajectory a::before {
  content: ""; width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg); border: 2px solid var(--orbit); transition: all 150ms ease;
}
.trajectory a:hover { color: var(--text-strong); }
.trajectory a.passed::before { background: var(--orbit); }
.trajectory a.active { color: var(--text-strong); font-weight: 700; }
.trajectory a.active::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent); }
.toc-mobile { display: none; }
@media (max-width: 1080px) {
  .trajectory { display: none; }
  .toc-mobile { display: block; margin-bottom: 2rem; }
}
.toc-mobile summary {
  cursor: pointer; min-height: 52px; display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-strong);
  padding: 0 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.toc-mobile ol { margin: 0.75rem 0 0; padding-left: 1.75rem; }
.toc-mobile li { padding: 0.3rem 0; }

.prose { max-width: 700px; font-size: 1.1875rem; line-height: 1.72; color: var(--text); }
.prose > * + * { margin-top: 1.3em; }
.prose p { margin-bottom: 0; }
.prose h2 {
  margin-top: 2.6em; font-size: clamp(1.45rem, 3vw, 1.9rem); scroll-margin-top: 100px;
  display: flex; align-items: center; gap: 0.75rem;
}
.prose h2::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); flex-shrink: 0; }
.prose a { color: var(--accent-3); }
.prose strong { color: var(--text-strong); }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--accent); font-family: var(--font-mono); }
.prose :not(pre) > code {
  font-family: var(--font-code); font-size: 0.88em; background: var(--surface-2); color: var(--text-strong);
  padding: 0.1em 0.4em; border-radius: 6px; border: 1px solid var(--line);
}
.prose blockquote {
  margin-left: 0; margin-right: 0; padding: 1rem 1.25rem 1rem 1.4rem;
  border-left: 3px solid var(--orbit); background: var(--surface); border-radius: 0 14px 14px 0;
}
.prose blockquote p + p { margin-top: 0.6em; }
.prose .callout {
  position: relative; padding: 1.1rem 1.3rem 1.1rem 1.3rem; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface); border-left-width: 1px;
}
.callout .ch {
  display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.4rem;
  font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.callout .ch svg { width: 18px; height: 18px; }
.callout-why { --c: var(--accent-3); border-color: color-mix(in srgb, var(--accent-3) 45%, var(--line)); }
.callout-why .ch { color: var(--accent-3); }
.callout-ask { --c: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line)); background: color-mix(in srgb, var(--accent-2) 8%, var(--surface)); }
.callout-ask .ch { color: var(--accent-2); }
.callout-note { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.callout-note .ch { color: var(--accent); }
.callout-skill { border-color: color-mix(in srgb, var(--class-o) 45%, var(--line)); background: color-mix(in srgb, var(--class-o) 8%, var(--surface)); }
.callout-skill .ch { color: var(--class-o); }

.codebox { margin-left: -1rem; margin-right: -1rem; border-radius: 16px; overflow: hidden; border: 1px solid #1f2b55; background: var(--code-bg); }
@media (min-width: 1200px) { .codebox { margin-right: -5rem; } }
@media (max-width: 640px) { .codebox { margin-left: 0; margin-right: 0; } }
.codebox .bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.35rem 0.5rem 0.35rem 1rem; border-bottom: 1px solid #1f2b55; background: #0a1330;
  font-family: var(--font-mono); font-size: 0.8125rem; color: #aab6de; letter-spacing: 0.08em;
}
.codebox .bar .dots { display: inline-flex; gap: 6px; margin-right: 0.75rem; }
.codebox .bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: #2b3a6e; }
.codebox .bar .dots i:first-child { background: #ffcf6e; }
.copy-btn {
  min-height: 36px; padding: 0 0.85rem; border-radius: 999px; border: 1px solid #2b3a6e; background: #0f1a3d; color: #e6ecff;
  font-family: var(--font-mono); font-size: 0.8125rem; cursor: pointer;
}
.copy-btn:hover { border-color: #ffcf6e; }
.codebox pre { margin: 0; padding: 1.1rem 1.25rem 1.3rem; overflow-x: auto; font-family: var(--font-code); font-size: 0.9rem; line-height: 1.65; color: var(--code-text); tab-size: 2; }
.tok-c { color: #8e9bc8; font-style: italic; }
.tok-s { color: #ffd98a; }
.tok-k { color: #b7a8ff; }
.tok-f { color: #86dcff; }

.article-end { max-width: 700px; }
.tags-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 3rem 0 2rem; }
.share { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.dock {
  margin-top: 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}
@media (max-width: 760px) { .dock { grid-template-columns: 1fr; } }

/* stories */
.story-card .shot { aspect-ratio: 4 / 3; }
.coming { opacity: 0.85; border-style: dashed; }
.coming .shot { display: grid; place-items: center; }

/* patterns */
.three-ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.three-ways > div { background: var(--surface-solid); padding: 1.4rem; }
@media (max-width: 760px) { .three-ways { grid-template-columns: 1fr; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; margin: 2rem 0 1.25rem; }
.searchbox { flex: 1 1 420px; position: relative; }
.searchbox input {
  width: 100%; min-height: 52px; padding: 0 1rem 0 2.8rem; font: inherit; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-solid); color: var(--text-strong);
}
.searchbox input::placeholder { color: var(--text-dim); }
.searchbox svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-dim); }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filters button {
  min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-solid);
  color: var(--text); font-family: var(--font-mono); font-size: 0.875rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.45rem;
}
.filters button:hover { border-color: var(--c, var(--accent)); color: var(--text-strong); }
.filters button[aria-pressed="true"] { background: var(--text-strong); color: var(--bg); border-color: var(--text-strong); }
.filters button[aria-pressed="true"] .planet { box-shadow: 0 0 0 2px var(--bg); }
.select {
  min-height: 44px; padding: 0 0.8rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-solid); color: var(--text-strong); font: inherit; font-size: 0.95rem;
}
.result-line { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-dim); }
.result-line button { background: none; border: 0; color: var(--accent-3); font: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; }

.pcard .scope {
  position: relative; height: 150px; border-bottom: 1px solid var(--line); overflow: hidden;
  background-image: radial-gradient(1px 1px at 17px 23px, var(--star) 50%, transparent 52%), radial-gradient(1px 1px at 61px 71px, var(--star) 50%, transparent 52%), radial-gradient(1px 1px at 97px 37px, var(--star) 50%, transparent 52%);
  background-size: 113px 89px;
}
.pcard .scope::before {
  content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--c) 18%, transparent), transparent 65%); z-index: 0;
}
.pcard .scope { background-color: var(--bg-raised); }
.pcard .scope svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pcard .scope .cat-no {
  position: absolute; left: 1rem; top: 0.8rem; font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.1em; color: var(--text-dim);
}
.pcard .scope .badge { position: absolute; right: 0.9rem; top: 0.7rem; background: var(--surface-solid); }
.pcard .good { font-size: 0.95rem; color: var(--text-dim); }
.pcard .good b { color: var(--text-strong); }
.empty-state { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state svg { width: 90px; height: 90px; color: var(--text-dim); margin: 0 auto 1rem; }

/* pattern detail */
.panes { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-solid); }
.panes-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; border-bottom: 1px solid var(--line); padding: 0.4rem; background: var(--surface-2); }
.panes-bar [role="tablist"] { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.panes-bar [role="tab"] {
  min-height: 44px; padding: 0 1rem; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text);
  font-family: var(--font-mono); font-size: 0.875rem; cursor: pointer;
}
.panes-bar [role="tab"]:hover { color: var(--text-strong); border-color: var(--line); }
.panes-bar [role="tab"][aria-selected="true"] { background: var(--surface-solid); color: var(--text-strong); border-color: var(--line); box-shadow: inset 0 -2px 0 var(--accent); }
.panes-actions { display: flex; gap: 0.4rem; }
.panes-actions button {
  min-height: 44px; padding: 0 0.9rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-solid); color: var(--text-strong);
  font-family: var(--font-mono); font-size: 0.8125rem; cursor: pointer;
}
.panes-actions button:hover { border-color: var(--accent); }
.pane { padding: clamp(1rem, 3vw, 2rem); }
.pane[hidden] { display: none; }
.pane pre { margin: 0; overflow-x: auto; font-family: var(--font-code); font-size: 0.9rem; line-height: 1.6; color: var(--code-text); background: var(--code-bg); padding: 1.2rem; border-radius: 12px; }
.pane .note { font-size: 1rem; color: var(--text-dim); margin-bottom: 1rem; }
.pane .prompt { max-width: 70ch; font-size: 1.05rem; }
.stage { border: 1px dashed var(--line); border-radius: 14px; padding: clamp(1rem, 3vw, 1.75rem); background: var(--bg-raised); }

/* hairline stat strip demo */
.hss-caption { font-size: 1rem; color: var(--text-dim); margin: 0 0 0.75rem; }
.hss-strip { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; grid-template-columns: 1fr; margin-bottom: 2rem; }
@container stage (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, 1fr); } }
@container stage (min-width: 42rem) { .hss-strip { grid-template-columns: repeat(4, 1fr); } .hss-strip.five { grid-template-columns: repeat(5, 1fr); } }
.stage { container: stage / inline-size; }
.hss-tile { background: var(--surface-solid); padding: 1rem 1.1rem; min-width: 0; text-align: left; border: 0; font: inherit; color: var(--text); }
.hss-tile .l { display: block; font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); overflow-wrap: anywhere; }
.hss-tile .v { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.hss-tile .u { display: block; font-size: 0.9rem; color: var(--text-dim); }
.hss-tile .v.none { color: var(--text-dim); }
button.hss-tile { cursor: pointer; min-height: 44px; }
button.hss-tile:hover { background: color-mix(in srgb, var(--accent) 7%, var(--surface-solid)); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--surface-solid)); box-shadow: inset 0 3px 0 var(--accent); }
.hss-list { list-style: none; margin: 0 0 0.75rem; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.hss-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 1rem; background: var(--surface-solid); border-top: 1px solid var(--line); }
.hss-list li:first-child { border-top: 0; }
.hss-list li[hidden] { display: none; }
.hss-list .st { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); white-space: nowrap; }

/* about: timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; border-left: 1px dashed var(--orbit); }
.timeline > li { position: relative; padding: 0 0 2.5rem 3.5rem; }
.timeline > li::before {
  content: ""; position: absolute; left: 8px; top: 6px; width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0 8%, var(--c) 45%, color-mix(in srgb, var(--c) 45%, #000));
  box-shadow: 0 0 0 5px var(--bg), 0 0 18px var(--c);
}
.timeline .period { font-family: var(--font-mono); font-size: 0.875rem; color: var(--c); letter-spacing: 0.08em; }
.timeline h3 { margin: 0.2rem 0 0.4rem; font-size: 1.35rem; }
.timeline .roles { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; gap: 0.4rem; }
.timeline .roles li { padding-left: 1rem; border-left: 2px solid var(--line); }
.career-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.5rem 0 2.5rem; list-style: none; padding: 0; }
.career-bar li { font-family: var(--font-mono); font-size: 0.875rem; padding: 0.4rem 0.8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-solid); }
.career-bar li b { color: var(--text-strong); }
.principles { list-style: none; counter-reset: p; margin: 0; padding: 0; display: grid; gap: 1rem; }
.principles li { counter-increment: p; display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; align-items: baseline; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: #f2f5ff; line-height: 1.35; }
.principles li::before { content: "0" counter(p); font-family: var(--font-mono); font-size: 0.875rem; color: #ffcf6e; }
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: #22305e; border-radius: 14px; overflow: hidden; border: 1px solid #22305e; }
.skill-groups > div { background: #081030; padding: 1.4rem; }
@media (max-width: 760px) { .skill-groups { grid-template-columns: 1fr; } }
.skill-groups h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 0.6rem; }
.skill-groups .chip { color: #dfe6ff; border-color: #2b3a6e; background: #0d1840; }

.portrait-orbit { position: relative; width: min(360px, 80vw); aspect-ratio: 1; margin: 0 auto; }
.portrait-orbit img { position: absolute; inset: 12%; width: 76%; height: 76%; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--accent), 0 0 60px rgba(255, 190, 90, 0.3); }
.portrait-orbit .r { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--orbit); }
.portrait-orbit .r.b { inset: 5%; border-style: solid; border-color: color-mix(in srgb, var(--orbit) 40%, transparent); }
.portrait-orbit .moon { position: absolute; width: 18px; height: 18px; border-radius: 50%; top: 13%; right: 13%; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.photo-round { border-radius: 50% 50% var(--radius) var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 5; }
.photo-round img { width: 100%; height: 100%; object-fit: cover; }

.hidden-by-default[hidden] { display: none; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .ring { transform: rotate(var(--a)); }
  .ring .label { transform: rotate(calc(-1 * var(--a))); }
}

/* ---------- page-specific components ---------- */
/* home: brightest-stars shelf */
.bright { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.bright a {
  display: grid; grid-template-columns: 5.5rem auto 1fr; gap: 1.25rem; align-items: center;
  padding: 1.4rem 1.5rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-decoration: none; color: var(--text);
  transition: border-color 150ms ease, transform 150ms ease;
}
.bright a:hover { border-color: var(--c); transform: translateX(4px); color: var(--text); }
.bright .mag { font-size: 1.5rem; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.bright .planet { width: 26px; height: 26px; justify-self: center; }
.bright li:nth-child(2) .planet { width: 20px; height: 20px; }
.bright li:nth-child(3) .planet { width: 15px; height: 15px; }
.bright .t { display: block; font-family: var(--font-display); font-weight: 500; font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--text-strong); line-height: 1.25; margin: 0.25rem 0 0.4rem; }
.bright .x { display: block; }
@media (max-width: 640px) {
  .bright a { grid-template-columns: 1fr; gap: 0.5rem; }
  .bright .mag { display: flex; align-items: center; gap: 0.75rem; font-size: 1rem; }
  .bright a > .planet { display: none; }
}

.plain-links { list-style: none; margin: 0; padding: 0; }
.plain-links li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); }
.plain-links li:last-child { border-bottom: 0; }
.plain-links a { display: inline-flex; align-items: center; min-height: 48px; color: var(--text-strong); font-weight: 700; text-decoration: none; }
.plain-links a:hover { text-decoration: underline; }
.plain-links span { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-dim); }

/* series track: parts as bodies on one orbit */
.series-track {
  list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; position: relative;
}
.series-track::before { content: ""; position: absolute; left: 2%; right: 2%; top: 26px; border-top: 1px dashed var(--orbit); }
.series-track li > a, .series-track li > span {
  position: relative; display: flex; flex-direction: column; gap: 0.3rem; padding: 0 0.25rem;
  text-decoration: none; color: var(--text);
}
.series-track .planet { width: 22px; height: 22px; margin: 15px 0 0.6rem; outline: 6px solid var(--bg); }
.series-track b { font-family: var(--font-display); font-weight: 500; color: var(--text-strong); line-height: 1.3; }
.series-track a:hover b { text-decoration: underline; }
.series-track .mono { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; }
.series-track .soon { opacity: 0.8; }
.series-track .soon .planet { background: transparent; border: 2px dashed var(--text-dim); box-shadow: none; }
@media (max-width: 760px) {
  .series-track { grid-template-columns: 1fr; gap: 0; }
  .series-track::before { left: 11px; right: auto; top: 20px; bottom: 20px; border-top: 0; border-left: 1px dashed var(--orbit); }
  .series-track li > a, .series-track li > span { display: grid; grid-template-columns: 22px 1fr; column-gap: 1rem; padding: 0.5rem 0; }
  .series-track .planet { grid-row: span 3; margin: 0.2rem 0 0; }
}

.consult { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.consult p { flex: 1 1 320px; }
.original { border-color: color-mix(in srgb, var(--class-m) 50%, var(--line)); max-width: 760px; }

/* projects */
.flagship {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: 28px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow);
}
.flag-img { position: relative; min-height: 320px; background: var(--deep-2); }
.flag-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flag-body { padding: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 860px) { .flagship { grid-template-columns: 1fr; } .flag-img { min-height: 220px; } }

.sat-list { display: grid; gap: 1.5rem; }
.card.sat { display: grid; grid-template-columns: 1.1fr 1fr; }
.card.sat .shot { aspect-ratio: auto; min-height: 280px; background: #0b0f1a; }
.card.sat .shot img { object-fit: contain; }
.card.sat.flip .shot { order: 2; }
.card.sat .body { padding: clamp(1.25rem, 3vw, 2.25rem); justify-content: center; }
.card.sat h3 { font-size: 1.5rem; }
@media (max-width: 800px) { .card.sat { grid-template-columns: 1fr; } .card.sat.flip .shot { order: 0; } .card.sat .shot { min-height: 200px; aspect-ratio: 16 / 9; } }
.star-count { color: var(--accent); font-size: 0.95rem; margin-top: auto !important; }

/* about */
.history > summary { list-style: none; width: fit-content; }
.history > summary::-webkit-details-marker { display: none; }
.history[open] > summary { margin-bottom: 0.5rem; }
.history[open] > summary::after { content: " (showing)"; font-weight: 400; color: var(--text-dim); }
.highlights { margin: 1rem 0 0; padding-left: 1.2rem; color: var(--text); }
.highlights li + li { margin-top: 0.4rem; }
.highlights li::marker { color: var(--c); }
.moons { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1.5rem; }
.moons li { display: grid; grid-template-columns: 26px 1fr; gap: 1rem; }
.moons .planet { width: 20px; height: 20px; margin-top: 0.3rem; }
.moons h3 { margin: 0 0 0.25rem; }
.moons p { margin: 0; }

/* article newsletter band */
.newsletter-band { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center; }
.newsletter-band .sub-form input[type="email"] { background: #0d1840; color: #f2f5ff; border-color: #2b3a6e; }
.newsletter-band .sub-form input::placeholder { color: #a5b0d6; }
.newsletter-band .btn-primary { background: #ffcf6e; color: #1b1200; }
.newsletter-band .msg.ok { color: #9fdcff; }
.newsletter-band .msg.err { color: #ffab9a; }
@media (max-width: 760px) { .newsletter-band { grid-template-columns: 1fr; } }

/* pattern detail */
.uses { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; }
.uses li { display: flex; gap: 0.7rem; align-items: center; padding: 0.35rem 0; break-inside: avoid; }
@media (max-width: 640px) { .uses { columns: 1; } }
.panel > h2.eyebrow { font-weight: 400; }

/* gallery article */
.prose .prose-window { margin: 1.75em 0; }
.prose .prose-window img { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
.prose code { overflow-wrap: anywhere; }
