/* Idan Horowitz portfolio. One stylesheet. System fonts only, no external requests. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #fcfcfb;
  --surface-2: #f0efea;
  --text: #161614;
  --text-2: #4a4946;
  --muted: #64625d;
  --border: rgba(11, 11, 11, 0.11);
  --border-strong: rgba(11, 11, 11, 0.22);
  --accent: #1c5cab;
  --accent-hover: #104281;
  --accent-wash: rgba(42, 120, 214, 0.10);
  --focus: #1c5cab;
  --grid: #e1e0d9;
  --axis: #b9b8ae;
  --series-level: #2a78d6;
  --series-change: #eb6834;
  --mark-bg: #ffe600;
  --mark-text: #000;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 8px 24px -12px rgba(11, 11, 11, 0.18);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  --font-serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, Cambria, serif;
  --measure: 66ch;
  --page: 1120px;
  --radius: 14px;
}

/* Dark: OS setting (unless the viewer chose light) */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0f0f0e;
    --surface: #1a1a19;
    --surface-2: #232321;
    --text: #f0efec;
    --text-2: #c9c8bf;
    --muted: #a3a198;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.22);
    --accent: #86b6ef;
    --accent-hover: #b7d3f6;
    --accent-wash: rgba(57, 135, 229, 0.16);
    --focus: #86b6ef;
    --grid: #2c2c2a;
    --axis: #4a4a46;
    --series-level: #3987e5;
    --series-change: #d95926;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
  }
}
/* Dark: explicit toggle */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0e;
  --surface: #1a1a19;
  --surface-2: #232321;
  --text: #f0efec;
  --text-2: #c9c8bf;
  --muted: #a3a198;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.22);
  --accent: #86b6ef;
  --accent-hover: #b7d3f6;
  --accent-wash: rgba(57, 135, 229, 0.16);
  --focus: #86b6ef;
  --grid: #2c2c2a;
  --axis: #4a4a46;
  --series-level: #3987e5;
  --series-change: #d95926;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-wash); }

.skip-link {
  position: absolute; left: 1rem; top: -10rem; z-index: 100;
  padding: 0.5rem 0.9rem; background: var(--surface); color: var(--accent);
  border: 2px solid var(--focus); border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

.container { max-width: var(--page); margin: 0 auto; padding: 0 1.25rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 3.6rem; }
.brand {
  font-family: var(--font-serif); font-size: 1.12rem; font-weight: 600;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em; margin-right: auto;
}
.brand:hover { color: var(--text); }
.site-nav { display: flex; align-items: center; gap: 0.25rem; }
.site-nav a {
  color: var(--text-2); text-decoration: none; font-size: 0.9rem;
  padding: 0.35rem 0.6rem; border-radius: 8px;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

.theme-toggle {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer; padding: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .theme-toggle .icon-sun { display: block; }
  :root:where(:not([data-theme="light"])) .theme-toggle .icon-moon { display: none; }
}
.no-js .theme-toggle { display: none; }

@media (max-width: 520px) {
  .site-nav a.hide-sm { display: none; }
}

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.6rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.85rem); margin: 3rem 0 0.9rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.6rem; }
p { margin: 0 0 1.1rem; }
.eyebrow {
  display: inline-block; margin: 0 0 0.75rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.lede { font-size: 1.15rem; color: var(--text-2); max-width: var(--measure); }

/* ---------- Home: hero ---------- */
.hero { padding-top: clamp(3rem, 8vw, 6.5rem); padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.hero h1 { max-width: 16ch; }
.hero-role { font-size: 1.25rem; color: var(--text-2); margin: -0.25rem 0 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.05rem; border-radius: 999px; font-size: 0.95rem; font-weight: 600;
  text-decoration: none; border: 1px solid var(--border-strong); color: var(--text); background: var(--surface);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.button:hover { color: var(--text); border-color: var(--text-2); text-decoration: none; transform: translateY(-1px); }
.button.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.button.primary:hover { color: var(--bg); background: var(--text-2); border-color: var(--text-2); }

/* ---------- Home: work grid ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin: 1rem 0 1.25rem; }
.section-head h2 { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.no-js .filters { display: none; }
.chip {
  font: inherit; font-size: 0.85rem; cursor: pointer;
  padding: 0.35rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

.work-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.1rem; grid-template-columns: 1fr;
}
@media (min-width: 46rem) { .work-grid { grid-template-columns: 1fr 1fr; } }
.work-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.25rem; box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.work-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.work-card:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.work-card[hidden] { display: none; }
.card-index { font-family: var(--font-serif); font-size: 0.95rem; color: var(--muted); margin: 0 0 0.6rem; }
.work-card h3 { margin: 0 0 0.6rem; font-size: 1.3rem; }
.work-card h3 a { color: var(--text); text-decoration: none; }
.work-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.work-card h3 a:focus-visible { outline: none; }
.work-card p { color: var(--text-2); font-size: 0.95rem; margin: 0 0 1rem; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.tags li {
  font-size: 0.75rem; padding: 0.15rem 0.55rem; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
}
.card-arrow { color: var(--muted); transition: transform 0.2s ease, color 0.2s ease; flex: none; }
.work-card:hover .card-arrow { transform: translateX(3px); color: var(--text); }
.filter-status { margin: 0.75rem 0 0; font-size: 0.85rem; color: var(--muted); min-height: 1.4em; }

.contact { padding-top: 3.5rem; padding-bottom: 1rem; }
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------- Project pages ---------- */
.project-hero { padding: clamp(2.25rem, 6vw, 4.5rem) 0 1.5rem; border-bottom: 1px solid var(--border); }
.back-link { display: flex; width: fit-content; gap: 0.4rem; font-size: 0.9rem; margin-bottom: 1.5rem; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.project-hero h1 { max-width: 22ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1.25rem 0 0; padding: 0; list-style: none; font-size: 0.9rem; color: var(--muted); }
.meta-row a { font-weight: 600; }

.project-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; padding-top: 1rem; padding-bottom: 2rem; }
@media (min-width: 70rem) {
  .project-layout { grid-template-columns: minmax(0, 1fr) 14rem; }
}
.prose > * { max-width: var(--measure); }
.prose > .wide { max-width: 100%; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: 0.35rem 0; }

.toc { display: none; }
@media (min-width: 70rem) {
  .toc { display: block; position: sticky; top: 5rem; align-self: start; padding-top: 3rem; font-size: 0.88rem; }
}
.toc p { font-weight: 600; margin: 0 0 0.5rem; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a {
  display: block; padding: 0.3rem 0 0.3rem 0.9rem; margin-left: -1px;
  color: var(--text-2); text-decoration: none; border-left: 2px solid transparent; line-height: 1.35;
}
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--text); border-left-color: var(--text); font-weight: 600; }

/* Figures */
figure { margin: 2.25rem 0; }
.figure-frame {
  display: block; background: #ffffff; border-radius: 12px; padding: 0.75rem;
  border: 1px solid var(--border); cursor: zoom-in;
}
.figure-frame img { border-radius: 4px; }
figcaption { margin-top: 0.7rem; font-size: 0.85rem; line-height: 1.55; color: var(--muted); max-width: var(--measure); }

dialog.lightbox {
  border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 92vh;
}
dialog.lightbox::backdrop { background: rgba(10, 10, 10, 0.82); }
dialog.lightbox img { background: #fff; border-radius: 10px; max-height: 86vh; width: auto; margin: 0 auto; }
dialog.lightbox button {
  display: block; margin: 0.6rem auto 0; font: inherit; font-size: 0.9rem; cursor: pointer;
  padding: 0.4rem 1rem; border-radius: 999px; border: 0; background: #fff; color: #111;
}

/* Stat tiles */
.stats { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); margin: 2rem 0; padding: 0; list-style: none; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.stat-label { margin: 0 0 0.35rem; font-size: 0.82rem; color: var(--muted); }
.stat-value { margin: 0; font-size: 2rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.stat-note { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--text-2); }

/* Component list (CLARA) */
.components { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.components li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 0.9rem; font-size: 0.95rem; }

.link-list { list-style: none; padding: 0; margin: 2.5rem 0 0; border-top: 1px solid var(--border); }
.link-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }
.link-list .link-note { color: var(--muted); font-size: 0.85rem; }

.next-project {
  display: block; margin: 3rem 0 0; padding: 1.25rem 1.4rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text);
}
.next-project:hover { color: var(--text); border-color: var(--border-strong); }
.next-project span { display: block; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.next-project strong { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; }

/* ---------- Interactive forest plot ---------- */
.viz {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem; margin: 2.25rem 0; box-shadow: var(--shadow); position: relative;
}
.viz-title { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 650; letter-spacing: 0; margin: 0 0 0.25rem; }
.viz-sub { font-size: 0.88rem; color: var(--text-2); margin: 0 0 1rem; }
.viz-controls { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin: 0 0 1rem; }
.no-js .viz-controls, .no-js .viz-chart, .no-js .viz-legend, .no-js .viz-table-wrap { display: none; }
.seg { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg legend { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.3rem; padding: 0; }
.seg-options { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  font-size: 0.84rem; padding: 0.3rem 0.7rem; border-radius: 8px; cursor: pointer; color: var(--text-2);
  user-select: none;
}
.seg input:checked + label { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 1px; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 0.15rem 1.25rem; line-height: 1.4; list-style: none; margin: 0 0 0.5rem; padding: 0; font-size: 0.82rem; color: var(--text-2); }
.viz-legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.key { position: relative; width: 22px; height: 10px; flex: none; }
.key::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 2px; border-radius: 2px; background: currentColor; }
.key::after { content: ""; position: absolute; left: 7px; top: 1px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.key.change { color: var(--series-change); }
.key.level { color: var(--series-level); }
.viz-chart { position: relative; }
.viz-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-chart .grid line { stroke: var(--grid); stroke-width: 1; }
.viz-chart .zero { stroke: var(--axis); stroke-width: 1.5; }
.viz-chart .tick text, .viz-chart .axis-label { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.viz-chart .row-label { fill: var(--text-2); font-size: 13px; }
.viz-chart .zero-label { fill: var(--muted); font-size: 11px; }
.viz-chart .ci { stroke-width: 2.5; stroke-linecap: round; }
.viz-chart .dot { stroke: var(--surface); stroke-width: 2; }
.viz-chart .change .ci { stroke: var(--series-change); }
.viz-chart .change .dot { fill: var(--series-change); }
.viz-chart .level .ci { stroke: var(--series-level); }
.viz-chart .level .dot { fill: var(--series-level); }
.viz-chart .hit { fill: transparent; cursor: default; }
.viz-chart .hit:focus { outline: none; }
.viz-chart .row.is-hover .hitbg { fill: var(--accent-wash); }
.viz-chart .hitbg { fill: transparent; }
.viz-tooltip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 11rem; max-width: 16rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 0.55rem 0.7rem; font-size: 0.8rem; line-height: 1.4; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(4px); transition: opacity 0.12s ease, transform 0.12s ease;
}
.viz-tooltip.is-visible { opacity: 1; transform: none; }
.viz-tooltip .tt-value { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.viz-tooltip .tt-ci { color: var(--text-2); font-variant-numeric: tabular-nums; }
.viz-tooltip .tt-name { margin-top: 0.25rem; display: flex; gap: 0.4rem; align-items: center; color: var(--text-2); }
.viz-tooltip .tt-key { width: 14px; height: 2px; border-radius: 2px; flex: none; }
.viz-note { font-size: 0.82rem; color: var(--muted); margin: 0.75rem 0 0; }
.viz-table-wrap summary { cursor: pointer; font-size: 0.85rem; color: var(--accent); margin-top: 0.75rem; }
.viz-table-wrap .table-scroll { overflow-x: auto; }
.viz-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.6rem; font-variant-numeric: tabular-nums; }
.viz-table th, .viz-table td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); }
.viz-table td.num, .viz-table th.num { text-align: right; }
.viz-fallback { margin: 0; }
.js .viz-fallback { display: none; }

/* ---------- Placeholders: unfinished content, impossible to miss ---------- */
mark.placeholder {
  background: var(--mark-bg); color: var(--mark-text); font-weight: 600;
  padding: 0.05em 0.3em; border-radius: 3px; outline: 2px solid #b39b00;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 4rem; padding: 2rem 0 3rem; font-size: 0.92rem; color: var(--text-2); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.footer-name { margin: 0; font-weight: 600; color: var(--text); }

/* ---------- Reveal on scroll (JS adds .reveal; motion only if allowed) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .reveal { opacity: 1 !important; transform: none !important; }
  .site-header, .theme-toggle, .filters, .toc, .viz-controls { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Home: portrait in the hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.portrait {
  order: -1; width: 112px; height: 112px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
@media (min-width: 52rem) {
  .hero { grid-template-columns: minmax(0, 1fr) 300px; gap: 3.5rem; }
  .portrait { order: 0; width: 300px; height: 300px; border-radius: 28px; }
}

/* ---------- Four stat tiles: 2 x 2 from small tablets up ---------- */
.stats.four { grid-template-columns: 1fr; }
@media (min-width: 30rem) { .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Architecture diagram (CLARA): real text, works at any width ---------- */
.arch ol, .arch ul { padding-left: 0; }
.arch li { margin: 0; }
.arch-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.2rem; }
.arch-node {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.9rem 1.1rem; box-shadow: var(--shadow);
}
.arch-node:not(:last-child)::after {
  content: "\2193"; position: absolute; left: 50%; bottom: -2.05rem; transform: translateX(-50%);
  color: var(--muted); font-size: 1.25rem; line-height: 1;
}
.arch-io { background: var(--surface-2); box-shadow: none; }
.arch-gate { border-color: var(--border-strong); }
.arch-kicker { margin: 0; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.arch-title { margin: 0.1rem 0 0.3rem; font-weight: 650; }
.arch-desc { margin: 0; font-size: 0.9rem; color: var(--text-2); }
.arch-tools {
  list-style: none; margin: 0.6rem 0 0; display: grid; gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.arch-tools li { border: 1px solid var(--border); border-radius: 9px; padding: 0.55rem 0.75rem; font-size: 0.88rem; background: var(--bg); }
.arch-tools strong { display: block; }
.arch-tools span { color: var(--text-2); }
.arch-routes { list-style: none; margin: 0.65rem 0 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.arch-routes li { font-size: 0.82rem; padding: 0.25rem 0.7rem; border-radius: 999px; border: 1.5px solid var(--border-strong); color: var(--text); }
.arch-routes li.ok { border-color: var(--series-level); }
.arch-routes li.ok::before { content: "\2192\00a0"; }
.arch-routes li.back { border-style: dashed; border-color: var(--series-change); }
.arch-routes li.back::before { content: "\21a9\00a0"; }
.arch-routes li.limit { color: var(--text-2); }

/* Lists that are layout, not bullets, take no prose indent */
.prose ul.stats, .prose ul.link-list, .prose ul.components, .prose ul.viz-legend { padding-left: 0; }

/* ---------- CV page ---------- */
.cv-section { padding: 2.25rem 0 1rem; border-bottom: 1px solid var(--border); }
.cv-section:last-child { border-bottom: 0; }
.cv-section h2 { margin: 0 0 1.25rem; }
.cv-entry { max-width: var(--measure); margin: 0 0 1.75rem; }
.cv-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; align-items: baseline; }
.cv-head h3 { margin: 0; font-size: 1.15rem; grid-column: 1; grid-row: 1; }
.cv-dates { margin: 0; grid-column: 2; grid-row: 1; font-size: 0.88rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-org { margin: 0.1rem 0 0.5rem; grid-column: 1 / -1; color: var(--text-2); }
.cv-note { margin: 0; color: var(--text-2); font-size: 0.95rem; }
.cv-entry ul, .cv-list { margin: 0; padding-left: 1.2rem; max-width: var(--measure); }
.cv-entry li, .cv-list li { margin: 0.3rem 0; }
@media print {
  .site-footer, .project-hero .meta-row { display: none; }
  .cv-section { break-inside: avoid-page; }
}

/* ---------- CV page: sticky "jump to section" menu ---------- */
html:has(.section-nav) { scroll-padding-top: 7.5rem; }
@media (max-width: 34rem) { html:has(.section-nav) { scroll-padding-top: 10.75rem; } }
.section-nav {
  position: sticky; top: 3.6rem; z-index: 40;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.section-nav ul { list-style: none; margin: 0; padding: 0.55rem 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.section-nav a {
  display: block; white-space: nowrap; font-size: 0.85rem; text-decoration: none; color: var(--text-2);
  padding: 0.3rem 0.8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
}
.section-nav a:hover { color: var(--text); border-color: var(--border-strong); }
.section-nav a.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
@media print { .section-nav { display: none; } }
