/* Spencer Tye: the pathway chart */

:root {
  --font: "Archivo", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gap: 28px;
  --radius: 3px;
}

:root,
[data-theme="light"] {
  --paper: #f5f6f2;
  --paper-2: #eceee8;
  --node: #ffffff;
  --ink: #171a17;
  --ink-2: #3f453f;
  --ink-3: #596059;
  --rule: #c5cbc2;
  --rule-2: #dde1da;
  --focus: #1c5aa0;
  --shadow: 23 26 23;

  --c-research: #237a4b;
  --c-comp: #1c5aa0;
  --c-ai: #6341a8;
  --c-biz: #8f5400;
  --c-serve: #b3302a;
  --c-make: #0b6d70;
  --c-create: #a12e6e;
  --c-life: #525d65;
  --c-hub: #171a17;
  --tint: 7%;
  --tint-in: 13%;
  --tint-key: 26%;  /* field picked: key evidence */
  --tint-rel: 14%;  /* field picked: related work */
}

[data-theme="dark"] {
  --paper: #0e1215;
  --paper-2: #151a1e;
  --node: #13191d;
  --ink: #e6eae4;
  --ink-2: #bcc3bb;
  --ink-3: #97a097;
  --rule: #2f383e;
  --rule-2: #222a2f;
  --focus: #7fb0f0;
  --shadow: 0 0 0;

  --c-research: #62c790;
  --c-comp: #79aaec;
  --c-ai: #ad95ee;
  --c-biz: #e3a846;
  --c-serve: #f0837a;
  --c-make: #55c6c4;
  --c-create: #e685bd;
  --c-life: #a2aeb6;
  --c-hub: #e6eae4;
  --tint: 9%;
  --tint-in: 20%;
  --tint-key: 20%;
  --tint-rel: 8%;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--rule) var(--paper);
  accent-color: var(--focus);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  font-variation-settings: normal;
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: color-mix(in oklab, var(--focus) 28%, transparent); color: inherit; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule); border: 3px solid var(--paper); border-radius: 8px; }

img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: color-mix(in oklab, currentColor 45%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.ic { width: 1em; height: 1em; flex: none; vertical-align: -0.125em; }
.sep { color: var(--rule); margin: 0 0.35em; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font: inherit; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 100; }
.skip:focus { top: 12px; }

.wrap, .titleblock, .lensbar-in, .lenswrap, .chart, .letter, .papers, .resumes, .contact {
  max-width: 1480px;
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 40px);
}

/* ---------------- Title block ---------------- */
.titleblock {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "id thesis actions" "edu edu edu";
  gap: 18px 40px;
  align-items: end;
  padding-top: clamp(20px, 3.2vw, 40px);
  padding-bottom: 18px;
}
.tb-id { grid-area: id; display: flex; align-items: center; gap: 20px; min-width: 0; }
.tb-portrait {
  width: clamp(72px, 7vw, 104px); height: auto; aspect-ratio: 1;
  border-radius: 50%; object-fit: cover;
  border: 1px solid var(--rule);
}
.tb-name h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5.2vw, 4.6rem);
  line-height: 0.95;
  font-weight: 760;
  font-stretch: 94%;
  letter-spacing: -0.028em;
  white-space: nowrap;
}
.tb-degree { margin: 10px 0 0; color: var(--ink-2); font-size: 0.98rem; font-stretch: 92%; line-height: 1.4; }
.tb-degree span { display: block; }
.tb-def { font-weight: 620; color: var(--ink); }
.tb-thesis { grid-area: thesis; margin: 0; padding: 0 0 4px; max-width: 520px; justify-self: center; }
.tb-thesis p {
  margin: 0;
  font-size: clamp(1.02rem, 1.3vw, 1.2rem);
  line-height: 1.38;
  font-weight: 500;
  text-wrap: pretty;
}
.tb-thesis a { display: inline-block; margin-top: 8px; font-size: 0.84rem; color: var(--ink-3); }
.tb-actions { grid-area: actions; display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; padding-bottom: 4px; font-size: 0.94rem; font-weight: 560; }
.tb-actions a { text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.tb-actions a:hover { border-bottom-color: currentColor; }
.theme-btn {
  display: grid; place-items: center; width: 36px; height: 36px;
  background: none; border: 1px solid var(--rule); border-radius: 50%; cursor: pointer; color: var(--ink-2);
  transition: border-color 0.2s, color 0.2s;
}
.theme-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.theme-btn .ic { width: 16px; height: 16px; }
[data-theme="light"] .ic-sun, [data-theme="dark"] .ic-moon { display: none; }
.tb-edu {
  grid-area: edu; margin: 0; padding-top: 14px; border-top: 1px solid var(--ink);
  font-size: 0.86rem; font-stretch: 90%; color: var(--ink-2);
}

/* ---------------- Lens bar ---------------- */
.lensbar {
  position: relative; z-index: 2;
  background: var(--paper);
  border-bottom: 1px solid var(--rule-2);
}
.lensbar-in { display: flex; align-items: center; gap: 16px; padding-block: 10px; }
.lens-q { margin: 0; font-size: 0.86rem; font-weight: 600; color: var(--ink-3); white-space: nowrap; font-stretch: 90%; }
.lens-set { display: flex; gap: 6px; flex-wrap: wrap; }
.cv-wrap { margin-left: auto; position: relative; }
.cv-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 230px; display: grid; padding: 6px; background: var(--node); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 14px 30px -14px rgb(var(--shadow) / 0.55); }
.cv-menu[hidden] { display: none; }
.cv-menu a { display: flex; justify-content: space-between; gap: 16px; padding: 9px 10px; border-radius: 2px; font-size: 0.92rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.cv-menu a span { font-weight: 500; font-size: 0.8rem; color: var(--ink-3); }
.cv-menu a:hover, .cv-menu a:focus-visible { background: var(--paper-2); }
.lens {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px 7px 9px;
  background: var(--node);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.92rem; font-weight: 580; font-stretch: 92%;
  cursor: pointer; white-space: nowrap;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.lens:hover { border-color: var(--ink-3); }
.lens[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------------- Lens panel + legend ---------------- */
.lenswrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 40px;
  padding-top: 22px; padding-bottom: 22px; align-items: start;
}
.lp-head {
  margin: 0; max-width: 30ch;
  font-size: clamp(1.45rem, 2.4vw, 2.15rem); line-height: 1.12;
  font-weight: 720; font-stretch: 92%; letter-spacing: -0.018em; text-wrap: balance;
}
.lp-lede { margin: 12px 0 0; max-width: 68ch; color: var(--ink-2); font-size: 1rem; }
.lp-proof { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.lp-proof li { border-top: 1px solid var(--rule); }
.lp-proof button {
  display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 9px 22px 10px 0; font-size: 0.95rem; line-height: 1.35; color: var(--ink);
  position: relative;
}
.lp-proof button::after {
  content: ""; position: absolute; right: 2px; top: 50%; width: 7px; height: 7px;
  border-top: 1.5px solid var(--ink-3); border-right: 1.5px solid var(--ink-3);
  transform: translateY(-50%) rotate(45deg); transition: transform 0.25s var(--ease);
}
.lp-proof button:hover { color: var(--lens-c, var(--ink)); }
.lp-proof button:hover::after { transform: translate(3px, -50%) rotate(45deg); }
.lp-cv, .btn {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 18px;
  padding: 10px 16px; border-radius: var(--radius);
  background: var(--ink); color: var(--paper); text-decoration: none;
  font-size: 0.95rem; font-weight: 620; border: 1px solid var(--ink); cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.lp-cv span, .btn span { font-weight: 500; opacity: 0.72; font-size: 0.82rem; }
.lp-cv:hover, .btn:hover { box-shadow: 0 6px 16px -8px rgb(var(--shadow) / 0.45); transform: translateY(-1px); }
body[data-lens="science"] { --lens-c: var(--c-research); }
body[data-lens="ai"] { --lens-c: var(--c-ai); }
body[data-lens="business"] { --lens-c: var(--c-biz); }
.lp-cv { background: var(--lens-c, var(--ink)); border-color: var(--lens-c, var(--ink)); }
[data-theme="dark"] .lp-cv { color: var(--paper); }
.lp:not([hidden]) { animation: lp-in 0.45s var(--ease); }
@keyframes lp-in { from { opacity: 0.001; transform: translateY(6px); } }

.lg-box { width: 30px; height: 16px; border: 1px solid var(--ink-3); background: var(--node); border-radius: 2px; }
.lg-chain { width: 1px; height: 18px; background: var(--ink-3); position: relative; }
.lg-chain::after { content: ""; position: absolute; left: -2px; bottom: 0; box-sizing: border-box; width: 5px; height: 5px; border-right: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3); transform: rotate(45deg); }
.lg-rx { width: 30px; height: 12px; border: 1.5px solid var(--ink-3); border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }

/* ---------------- Chart ---------------- */
.chart {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "research comp ai biz"
    "serve make create life";
  gap: 34px;
  padding-bottom: 64px;
  outline: none;
}
.region {
  --h: var(--ink);
  position: relative;
  padding: 10px 12px 12px;
  border-radius: 6px;
  background: color-mix(in oklab, var(--h) var(--tint), transparent);
  border: 1px solid color-mix(in oklab, var(--h) 26%, transparent);
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease);
}
.region[data-region="research"] { --h: var(--c-research); }
.region[data-region="comp"] { --h: var(--c-comp); }
.region[data-region="ai"] { --h: var(--c-ai); }
.region[data-region="biz"] { --h: var(--c-biz); }
.region[data-region="serve"] { --h: var(--c-serve); }
.region[data-region="make"] { --h: var(--c-make); }
.region[data-region="create"] { --h: var(--c-create); }
.region[data-region="life"] { --h: var(--c-life); }

.rg-name {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 0 0 8px;
  font-size: 1.02rem; font-weight: 760; font-stretch: 86%; letter-spacing: -0.005em;
  color: var(--h);
}
.rg-count { font-size: 0.78rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--h); opacity: 0.9; }

.chain, .grid { list-style: none; margin: 0; padding: 0; }
.chain { display: grid; gap: 12px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 8px; }

.cpd { position: relative; z-index: 2; }
.cpd-btn {
  position: relative;
  display: grid; gap: 2px;
  width: 100%; min-height: 0;
  padding: 6px 34px 7px 10px;
  text-align: left; cursor: pointer;
  background: var(--node);
  border: 1px solid color-mix(in oklab, var(--h) 48%, var(--rule));
  border-radius: 3px;
  color: var(--ink);
  transition: background 0.45s var(--ease), border-color 0.45s var(--ease), color 0.45s var(--ease), box-shadow 0.25s var(--ease), opacity 0.45s var(--ease);
}
.cpd-t { font-size: 0.92rem; line-height: 1.18; font-weight: 660; font-stretch: 84%; letter-spacing: -0.004em; text-wrap: balance; }
.cpd-m { display: flex; flex-wrap: wrap; column-gap: 0.7em; font-size: 0.76rem; line-height: 1.3; color: var(--ink-3); font-stretch: 90%; }
.yr { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.cpd-f {
  position: absolute; top: 7px; right: 8px;
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.72rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--h);
}
.cpd-f .ic { width: 13px; height: 13px; }
.cpd-btn:hover { border-color: var(--h); box-shadow: 0 1px 1px rgb(var(--shadow) / 0.06), 0 8px 18px -12px rgb(var(--shadow) / 0.5); }
.cpd.is-open .cpd-btn { border-color: var(--h); box-shadow: 0 0 0 1px var(--h), 0 8px 18px -12px rgb(var(--shadow) / 0.5); }
.cpd.is-linked .cpd-btn { border-color: var(--h); }

/* lens weighting: in-lens compounds come forward, others fold to outlines */
body:not([data-lens="all"]) .cpd.in .cpd-btn {
  background: color-mix(in oklab, var(--h) var(--tint-key), var(--node));
  border-color: var(--h);
}
body:not([data-lens="all"]) .cpd.in .cpd-t { font-weight: 720; }
body:not([data-lens="all"]) .cpd:not(.in) .cpd-btn {
  background: var(--paper);
  border-style: dashed;
  border-color: var(--rule);
  box-shadow: none;
}
body:not([data-lens="all"]) .cpd:not(.in) .cpd-t { font-weight: 520; color: var(--ink-2); }
body:not([data-lens="all"]) .cpd:not(.in) .cpd-f { color: var(--ink-3); }
body:not([data-lens="all"]) .cpd:not(.in) .cpd-btn:hover { border-style: solid; border-color: var(--ink-3); }
body:not([data-lens="all"]) .region.none-in { background: color-mix(in oklab, var(--h) 3%, transparent); border-color: var(--rule-2); }

/* reaction (transfer) layer */
.rx-layer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.rx-layer path.rx { fill: none; stroke: var(--ink-3); stroke-width: 1; opacity: 0; stroke-dasharray: 2 4; transition: opacity 0.3s var(--ease), stroke 0.3s var(--ease); }
.rx-layer path.rx.on { stroke: var(--rx-c, var(--ink)); stroke-width: 1.6; opacity: 1; stroke-dasharray: none; }
.rx-layer path.rx.on.draw { animation: rx-draw 0.7s var(--ease) both; }
@keyframes rx-draw { from { stroke-dashoffset: var(--len); stroke-dasharray: var(--len); } to { stroke-dashoffset: 0; stroke-dasharray: var(--len); } }
.rx-layer .rx-head { fill: var(--rx-c, var(--ink)); opacity: 0; transition: opacity 0.3s; }
.rx-layer .rx-head.on { opacity: 1; }
.rx-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.rx-label {
  position: absolute; transform: translate(-50%, -50%);
  padding: 3px 8px 4px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--rx-c, var(--ink));
  color: var(--ink); font-size: 0.76rem; font-weight: 600; font-stretch: 88%; white-space: nowrap;
  opacity: 0; transition: opacity 0.25s var(--ease);
  box-shadow: 0 4px 10px -6px rgb(var(--shadow) / 0.4);
}
.rx-label.on { opacity: 1; }
.rx-label.vert { transform: translate(-50%, -50%) rotate(-90deg); }

/* hub: the pattern, drawn as a cycle */
.hub {
  position: relative;
  display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 6px 22px; align-items: center;
}
.cycle { position: relative; aspect-ratio: 1; width: 100%; color: var(--c-hub); grid-row: span 2; }
.cycle-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cy-track { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 1 5; }
.cy-arc { fill: none; stroke: currentColor; stroke-width: 1.4; }
.cy-node { fill: var(--paper); stroke: currentColor; stroke-width: 1.4; }
.cy-name {
  position: absolute; inset: 0; display: grid; place-items: center; margin: 0;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem); font-weight: 760; font-stretch: 86%; letter-spacing: -0.01em;
}
.cy-steps { list-style: none; margin: 0; padding: 0; }
.cy-s {
  position: absolute; max-width: 44%;
  font-size: 0.74rem; line-height: 1.3; font-weight: 600; font-stretch: 86%; text-align: center;
  background: var(--paper); padding: 2px 6px; text-wrap: balance;
}
.cy-n { left: 50%; top: 16%; transform: translate(-50%, -50%); }
.cy-e { left: 84%; top: 50%; transform: translate(-50%, -50%); max-width: 30%; }
.cy-s2 { left: 50%; top: 84%; transform: translate(-50%, -50%); }
.cy-w { left: 16%; top: 50%; transform: translate(-50%, -50%); max-width: 30%; }
.hub-note p { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--ink-2); max-width: 44ch; }
.hub-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 620; font-size: 0.92rem; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.hub-link .ic { transition: transform 0.25s var(--ease); }
.hub-link:hover .ic { transform: translateX(3px); }
.hub-origin { grid-column: 2; margin: 8px 0 0; display: grid; grid-template-columns: 80px 1fr; gap: 12px; align-items: center; }
.origin-btn { padding: 0; border: 1px solid var(--rule); border-radius: 2px; background: var(--node); cursor: zoom-in; overflow: hidden; }
.origin-btn img { width: 100%; height: auto; object-fit: contain; }
.origin-btn:hover { border-color: var(--ink-3); }
.hub-origin figcaption { font-size: 0.84rem; line-height: 1.4; color: var(--ink-3); }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: color-mix(in oklab, currentColor 45%, transparent); color: var(--ink-2); }

/* ---------------- Detail panel ---------------- */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: min(500px, 100vw);
  background: var(--node);
  border-left: 1px solid var(--rule);
  box-shadow: -18px 0 40px -24px rgb(var(--shadow) / 0.45);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(0);
  transition: transform 0.45s var(--ease), visibility 0s;
}
.panel[hidden] { display: block; visibility: hidden; transform: translateX(104%); transition: transform 0.35s var(--ease), visibility 0s 0.35s; }
.panel-in { padding: 18px 26px 40px; }
.panel-top { display: flex; align-items: center; justify-content: flex-end; gap: 12px; position: sticky; top: -18px; background: var(--node); padding: 18px 0 10px; margin-top: -18px; z-index: 1; }
.panel-region { margin: 0 0 14px; display: inline-flex; align-items: center; gap: 8px; font-size: 0.84rem; font-weight: 700; font-stretch: 88%; color: var(--h, var(--ink-2)); }
.panel-region::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--h, var(--ink-3)); }
.panel::before { content: ""; position: sticky; top: 0; display: block; height: 4px; background: var(--h, var(--ink)); z-index: 2; }
.panel-close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule); background: var(--node); cursor: pointer; color: var(--ink-2); }
.panel-close:hover { color: var(--ink); border-color: var(--ink-3); }
.panel-title { margin: 0 0 6px; font-size: 1.6rem; line-height: 1.1; font-weight: 740; font-stretch: 90%; letter-spacing: -0.016em; outline: none; text-wrap: balance; }
.panel-body { font-size: 0.97rem; line-height: 1.55; }
.panel-body .d-org { margin: 0 0 12px; color: var(--ink-3); font-size: 0.9rem; line-height: 1.45; }
.panel-body ul { margin: 0 0 14px; padding-left: 1.1em; }
.panel-body li { margin: 0 0 7px; }
.panel-body li::marker { color: var(--h, var(--ink-3)); }
.panel-body .d-quote { margin: 16px 0; padding: 2px 0 2px 14px; border-left: 1px solid var(--h, var(--rule)); color: var(--ink-2); font-size: 0.95rem; }
.panel-body .d-sub { margin: 16px 0 6px; font-weight: 700; font-size: 0.88rem; }
.panel-body .d-linklist { list-style: none; padding: 0; }
.panel-body .d-linklist li { margin: 0; border-top: 1px solid var(--rule-2); }
.panel-body .d-linklist a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; text-decoration: none; }
.panel-body .d-linklist a:hover { color: var(--h); }
.panel-body .d-links a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.figs figure { margin: 0; }
.figs figure.wide { grid-column: 1 / -1; }
.figs img, .figs .fig-link img {
  width: 100%; height: auto; background: var(--paper-2);
  border: 1px solid var(--rule-2); border-radius: 2px; cursor: zoom-in;
}
.figs .fig-link img { cursor: pointer; }
.figs figcaption { margin-top: 6px; font-size: 0.8rem; line-height: 1.38; color: var(--ink-3); }
.panel-rx:empty { display: none; }
.panel-rx { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--rule); }
.panel-rx h4 { margin: 0 0 8px; font-size: 0.88rem; font-weight: 700; }
.panel-rx ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.panel-rx button {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center;
  width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--rule-2); border-radius: 3px;
  padding: 8px 10px; cursor: pointer;
}
.panel-rx button:hover { border-color: var(--rxc, var(--ink-3)); }
.panel-rx .rx-dot { width: 10px; height: 10px; border-radius: 2px; background: var(--rxc); grid-row: span 2; }
.panel-rx .rx-to { font-weight: 650; font-size: 0.92rem; font-stretch: 88%; }
.panel-rx .rx-how { font-size: 0.8rem; color: var(--ink-3); }

/* ---------------- Reading sections ---------------- */
.letter, .papers, .resumes, .contact {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 24px 56px;
  padding-top: 64px; padding-bottom: 64px;
  border-top: 1px solid var(--ink);
}
.sec-rail h2 { margin: 0; font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1.05; font-weight: 740; font-stretch: 92%; letter-spacing: -0.02em; }
.sec-rail p { margin: 10px 0 0; color: var(--ink-3); max-width: 34ch; font-size: 0.95rem; }
.sec-rail { align-self: start; position: sticky; top: 76px; }
.letter-body { max-width: 68ch; font-size: 1.07rem; line-height: 1.66; }
.letter-body p { margin: 0 0 1.05em; text-wrap: pretty; }
.letter-body .letter-key {
  margin: 1.4em 0; font-size: clamp(1.2rem, 1.8vw, 1.45rem); line-height: 1.35; font-weight: 640; font-stretch: 94%; letter-spacing: -0.01em;
}

.pubs { list-style: none; margin: 0; padding: 0; max-width: 78ch; }
.pub { padding: 14px 0 16px; border-top: 1px solid var(--rule); }
.pub-t { margin: 0; font-size: 1.12rem; line-height: 1.3; font-weight: 650; font-stretch: 94%; }
.pub-t a { text-decoration-color: color-mix(in oklab, currentColor 30%, transparent); }
.pub-a { margin: 5px 0 0; font-size: 0.92rem; color: var(--ink-2); }
.pub-a b { font-weight: 700; color: var(--ink); }
.pub-v { margin: 4px 0 0; font-size: 0.86rem; color: var(--ink-3); }
.pub-abs { margin-top: 10px; }
.pub-abs summary { cursor: pointer; font-size: 0.88rem; font-weight: 650; width: max-content; }
.pub-abs summary::marker { color: var(--ink-3); }
.pub-abs p { margin: 8px 0 0; font-size: 0.95rem; line-height: 1.6; color: var(--ink-2); max-width: 70ch; }
.posters { list-style: none; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px 18px; }
.posters button { display: grid; gap: 8px; width: 100%; padding: 0; background: none; border: 0; text-align: left; cursor: zoom-in; }
.posters img {
  width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--paper-2);
  border: 1px solid var(--rule-2); border-radius: 2px; padding: 8px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.posters button:hover img { border-color: var(--ink-3); box-shadow: 0 10px 22px -16px rgb(var(--shadow) / 0.6); }
.posters span { font-size: 0.88rem; line-height: 1.3; font-weight: 620; font-stretch: 90%; }
.posters em { display: block; font-style: normal; font-weight: 450; color: var(--ink-3); font-size: 0.8rem; margin-top: 2px; }

.cv-table { width: 100%; max-width: 860px; border-collapse: collapse; font-size: 0.98rem; }
.cv-table th, .cv-table td { text-align: left; padding: 12px 12px 12px 0; border-top: 1px solid var(--rule); vertical-align: baseline; }
.cv-table thead th { font-size: 0.8rem; font-weight: 600; color: var(--ink-3); border-top: 0; padding-top: 0; }
.cv-table tbody th { font-weight: 680; font-stretch: 92%; }
.cv-table td { color: var(--ink-2); }
.cv-table td:last-child { text-align: right; padding-right: 0; }
.cv-table a { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; text-decoration: none; padding: 5px 10px; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); }
.cv-table a:hover { border-color: var(--ink); }
.cv-table tr.is-lens th, .cv-table tr.is-lens td { background: color-mix(in oklab, var(--lens-c) 10%, transparent); }
.cv-table tr.is-lens th { box-shadow: inset 3px 0 0 -2px var(--lens-c); padding-left: 10px; }

.contact { padding-bottom: 40px; }
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.contact-list .btn { margin-top: 0; }
.contact-list a { display: inline-flex; align-items: center; gap: 6px; font-weight: 620; }
.email-out { margin-left: 12px; font-weight: 650; font-size: 1.02rem; }
.email-out:empty { display: none; }
.colophon { grid-column: 1 / -1; margin: 30px 0 0; padding-top: 14px; border-top: 1px solid var(--rule-2); font-size: 0.82rem; color: var(--ink-3); }

/* ---------------- Image viewer ---------------- */
.viewer {
  width: min(96vw, 1400px); max-width: none; height: 94vh; max-height: none; padding: 0;
  border: 1px solid var(--rule); border-radius: 4px; background: var(--node); color: var(--ink);
}
.viewer::backdrop { background: rgb(8 10 12 / 0.72); }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.viewer-bar { display: flex; align-items: center; gap: 16px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--rule-2); }
.viewer-cap { margin: 0; flex: 1; font-size: 0.9rem; color: var(--ink-2); }
.viewer-open { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; font-weight: 620; white-space: nowrap; }
.viewer-close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule); background: var(--node); cursor: pointer; }
.viewer-stage { overflow: auto; display: grid; place-items: center; padding: 14px; background: var(--paper-2); }
.viewer-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1240px) {
  .chart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "research comp" "ai biz" "serve make" "create life";
  }
  .titleblock { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "id actions" "thesis thesis" "edu edu"; }
  .tb-thesis p { max-width: 70ch; }
}
@media (max-width: 900px) {
  .lenswrap { grid-template-columns: 1fr; gap: 20px; padding-top: 20px; }
  .lp-proof { grid-template-columns: 1fr; }
  .lensbar-in { padding-inline: 0; }
  .lens-q { display: none; }
  .lens-set { flex-wrap: nowrap; overflow-x: auto; padding: 0 clamp(16px, 3vw, 40px); scrollbar-width: none; }
  .lens-set::-webkit-scrollbar { display: none; }
  .lens { padding: 7px 13px; }
  .chart { grid-template-columns: 1fr; grid-template-areas: "research" "comp" "ai" "biz" "serve" "make" "create" "life"; gap: 18px; }
  .rx-layer, .rx-labels { display: none; }
  .hub { grid-template-columns: 1fr; justify-items: center; padding: 10px 0; }
  .cycle { max-width: 340px; }
  .cycle { grid-row: auto; }
  .hub-note, .hub-origin { grid-column: 1; max-width: 520px; }
  .letter, .papers, .resumes, .contact { grid-template-columns: 1fr; padding-top: 44px; padding-bottom: 44px; }
  .sec-rail { position: static; }
  .titleblock { grid-template-columns: 1fr; grid-template-areas: "id" "thesis" "actions" "edu"; gap: 16px; }
  .tb-actions { justify-content: flex-start; gap: 4px 16px; font-size: 0.9rem; }
  .titleblock { position: relative; padding-top: 18px; gap: 12px; }
  .theme-btn { position: absolute; top: 16px; right: clamp(16px, 3vw, 40px); }
  .tb-edu { display: none; }
  .tb-portrait { width: 64px; }
  .tb-thesis p { font-size: 0.98rem; }
  .tb-id { padding-right: 44px; }
  .lens-set { flex: 1; min-width: 0; padding-right: 8px; }
  .cv-wrap { margin-right: clamp(16px, 3vw, 40px); }
    .lp-lede { font-size: 0.95rem; }
  .tb-thesis { justify-self: start; }
  .tb-name h1 { white-space: normal; }
}
@media (max-width: 520px) {
  .tb-id { gap: 14px; }
  .figs { grid-template-columns: 1fr 1fr; gap: 10px; }
  .panel-in { padding-inline: 18px; }
  .cv-table td:nth-child(2) { display: none; }
  .cv-table thead th:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media print {
  .lensbar, .panel, .viewer, .rx-layer, .rx-labels, .theme-btn, .skip { display: none !important; }
  .sec-rail { position: static; }
}

#cyArrow path { stroke: var(--c-hub); }

@media (max-width: 900px) {
  .lens-set { padding-right: clamp(16px, 3vw, 40px); }
  /* phones: field buttons wrap onto a second row instead of running off screen */
  .lens-set { flex-wrap: wrap; overflow-x: visible; }
}
@media (max-width: 560px) {
  /* narrow phones: the four field buttons as an even 2 x 2 grid */
  .lens-set { display: grid; grid-template-columns: 1fr 1fr; }
  .lens { justify-content: center; }
}

/* one-line chart key */
.keywrap { max-width: 1480px; margin-inline: auto; padding: 0 clamp(16px, 3vw, 40px) 12px; }
.keyline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; font-size: 0.8rem; color: var(--ink-3); }
.keyline .lg-h { margin: 0; font-weight: 650; color: var(--ink-2); font-size: 0.8rem; }
.keyline dl { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; }
.keyline dl > div { display: flex; align-items: center; gap: 8px; }
.keyline dt { display: grid; place-items: center; color: var(--ink-3); width: 26px; }
.keyline dd { margin: 0; line-height: 1.3; }
.keyline .lg-box { width: 22px; height: 12px; }
.keyline .lg-chain { height: 14px; }
.keyline .lg-rx { width: 22px; height: 10px; transform: translateY(3px); }
@media (max-width: 1240px) {
  .chart { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "research comp" "ai biz" "serve make" "create life"; }
}
@media (max-width: 1100px) {
  .lenswrap { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 900px) {
  .keywrap { display: none; }
  .chart { grid-template-columns: 1fr; grid-template-areas: "research" "comp" "ai" "biz" "serve" "make" "create" "life"; }
  .hub { grid-template-columns: 1fr; justify-items: center; }
  .cycle { max-width: 300px; }
  .cy-s { font-size: 0.82rem; }
}

/* compact-map refinements */
.hub { grid-template-columns: 260px minmax(0, 1fr); }
.cy-name { font-size: 0.95rem; z-index: 1; }
.cy-e, .cy-w { max-width: 24%; }
.cy-n, .cy-s2 { max-width: 40%; }
.chart { row-gap: 22px; scroll-margin-top: 64px; }
.region, .cpd { scroll-margin-top: 72px; }
@media (max-width: 900px) { .hub { grid-template-columns: 1fr; } }

/* phones: the pattern moves below the chart so the map comes first */
.hub-mobile { display: none; }
@media (max-width: 900px) {
  .lenswrap > .hub { display: none; }
  .hub-mobile { display: grid; max-width: 1480px; margin: 0 auto; padding: 8px clamp(16px, 3vw, 40px) 40px; }
}
/* keep the lens bar on one row at laptop widths */
@media (max-width: 1400px) { .lens-q { display: none; } }
@media (max-width: 1300px) and (min-width: 901px) { .lens { padding: 7px 12px; } .lens-set { flex-wrap: nowrap; } }

/* denser map (owner: fit the whole chart on one screen at 100%) */
.titleblock { padding-top: clamp(14px, 2vw, 26px); padding-bottom: 10px; gap: 10px 36px; }
.tb-name h1 { font-size: clamp(2.2rem, 3.6vw, 3.4rem); }
.tb-portrait { width: clamp(64px, 5.5vw, 84px); }
.tb-degree { margin-top: 6px; font-size: 0.92rem; }
.tb-thesis p { font-size: clamp(0.95rem, 1.1vw, 1.08rem); }
.tb-edu { padding-top: 10px; font-size: 0.82rem; }
.lensbar-in { padding-block: 7px; }
.lens { padding-top: 5px; padding-bottom: 5px; font-size: 0.88rem; }
.lenswrap { padding-top: 16px; padding-bottom: 14px; }
.lp-head { font-size: clamp(1.3rem, 1.9vw, 1.75rem); }
.lp-lede { margin-top: 8px; font-size: 0.95rem; }
.lp-proof button { padding: 6px 22px 7px 0; font-size: 0.9rem; }
.lp-cv { margin-top: 12px; padding: 8px 14px; }
.hub { grid-template-columns: 200px minmax(0, 1fr); }
.cy-s { font-size: 0.7rem; }
.cy-name { font-size: 0.88rem; }
.hub-note p { font-size: 0.86rem; }
.keywrap { padding-bottom: 8px; }
.chart { row-gap: 30px; column-gap: 40px; padding-bottom: 40px; }
.region { padding: 8px 10px 10px; }
.rg-name { margin-bottom: 6px; font-size: 0.95rem; }
.chain { gap: 8px; }
.grid { gap: 6px; }
.cpd-btn { padding: 4px 30px 5px 9px; gap: 0; }
.cpd-t { font-size: 0.86rem; line-height: 1.15; }
.cpd-m { font-size: 0.72rem; line-height: 1.25; }
.cpd-f { top: 5px; right: 7px; font-size: 0.68rem; }
.cpd-f .ic { width: 12px; height: 12px; }
@media (max-width: 900px) {
  .hub { grid-template-columns: 1fr; }
  .cpd-t { font-size: 0.92rem; }
  .cpd-m { font-size: 0.76rem; }
  .cpd-btn { padding: 6px 30px 7px 10px; }
}

/* ---------------- Pinned nav (the one bar that follows the page) ---------------- */
.topnav { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--rule-2); }
.topnav-in { max-width: 1480px; margin-inline: auto; padding-inline: clamp(16px, 3vw, 40px); min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tn-name { font-weight: 760; font-stretch: 88%; letter-spacing: -0.01em; font-size: 1.02rem; color: var(--ink); text-decoration: none; opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s 0.25s; }
.topnav.scrolled .tn-name { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.topnav .tb-actions { margin-left: auto; padding: 0; gap: 4px 20px; flex-wrap: nowrap; }
.topnav .tb-actions a { white-space: nowrap; }
@media (max-width: 720px) { .topnav .tb-actions { flex-wrap: wrap; row-gap: 6px; padding-block: 6px; } }
.topnav .theme-btn { position: static; width: 34px; height: 34px; }
.cv-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 11px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font: inherit; font-size: 0.9rem; font-weight: 640; font-stretch: 92%; cursor: pointer; white-space: nowrap; }
.cv-btn:hover { box-shadow: 0 6px 14px -8px rgb(var(--shadow) / 0.5); }
.cv-btn .ic { width: 14px; height: 14px; }
.cv-btn .ic-caret { transition: transform 0.2s var(--ease); }
.cv-btn[aria-expanded="true"] .ic-caret { transform: rotate(180deg); }
.cv-head { margin: 4px 10px 6px; font-size: 0.78rem; font-weight: 600; color: var(--ink-3); }
.lensbar, .letter, .papers, .contact { scroll-margin-top: 60px; }
.chart { scroll-margin-top: 60px; }
.region, .cpd { scroll-margin-top: 68px; }

/* the page header now holds only the name block and the education line */
.titleblock { grid-template-columns: minmax(0, 1fr); grid-template-areas: "id" "edu"; }

/* the pattern: one centred figure with the letter link under it */
.lenswrap > .hub { align-self: center; }
.hub { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 0; }
.cycle { width: min(260px, 100%); grid-row: auto; }
.hub-note .hub-link { margin-top: 0; }
.cy-s { font-size: 0.78rem; }
.cy-name { font-size: 1.02rem; }
.hub-note { text-align: center; }

@media (max-width: 560px) {
  .tn-name { display: none; }
  .topnav-in { padding-inline: 12px; }
  .topnav .tb-actions { gap: 4px 10px; font-size: 0.84rem; width: 100%; justify-content: space-between; flex-wrap: wrap; padding-block: 6px; }
  .topnav .tb-actions a { white-space: nowrap; }
@media (max-width: 720px) { .topnav .tb-actions { flex-wrap: wrap; row-gap: 6px; padding-block: 6px; } }
  .cv-btn { padding: 5px 9px; font-size: 0.84rem; gap: 4px; }
  .topnav .theme-btn { width: 30px; height: 30px; }
  .cv-btn > .ic:first-child { display: none; }
}
.topnav .cv-menu a, .topnav .cv-menu a:hover { border-bottom: 0; padding: 9px 10px; font-weight: 600; }
@media (max-width: 400px) { .tn-long { display: none; } }

/* the pattern diagram is parked (see parked/pattern-diagram.md); the lens panel takes the full width */
.lenswrap { grid-template-columns: minmax(0, 1fr); }

/* under a field, both ends of every drawn link are highlighted like that field's own boxes */
body:not([data-lens="all"]) .cpd.is-linked .cpd-btn {
  background: color-mix(in oklab, var(--h) var(--tint-key), var(--node));
  border-style: solid;
  border-color: var(--h);
}
body:not([data-lens="all"]) .cpd.is-linked .cpd-t { font-weight: 720; color: var(--ink); }
body:not([data-lens="all"]) .cpd.is-linked .cpd-f { color: var(--h); }

/* the letter opens collapsed: two paragraphs and the start of a third */
.letter-body[data-collapsed="true"] > p:nth-of-type(n+4) { display: none; }
.letter-body[data-collapsed="true"] > p:nth-of-type(3) { -webkit-mask-image: linear-gradient(#000 15%, transparent); mask-image: linear-gradient(#000 15%, transparent); }
.letter-more { font-family: inherit; margin-top: 8px; background: none; color: var(--ink); border-color: var(--ink); }

/* work and volunteer tags on the boxes */
.tag { display: inline-block; align-self: center; padding: 1px 5px 2px; border-radius: 2px; font-size: 0.64rem; line-height: 1.2; font-weight: 620; font-stretch: 90%; letter-spacing: 0.01em; white-space: nowrap; }
.tag-work { border: 1px solid var(--ink-3); color: var(--ink-2); }
.tag-vol { border: 1px solid var(--ink-3); background: var(--ink-3); color: var(--node); }
.keyline dt.lg-tags { display: flex; gap: 4px; width: auto; }

/* talks, listed under the papers */
.papers-sub { margin: 30px 0 4px; font-size: 1.05rem; font-weight: 720; font-stretch: 92%; letter-spacing: -0.005em; }
.talks { list-style: none; margin: 0 0 8px; padding: 0; max-width: 78ch; }
.talks li { padding: 12px 0 14px; border-top: 1px solid var(--rule); }

/* email shows under its button, so the links on that row stay put */
.contact-list { align-items: flex-start; }
.contact-list li:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.contact-list a { min-height: 44px; }
.email-out { margin-left: 0; width: 0; white-space: nowrap; }
.email-out a { min-height: 0; }

/* Papers & posters: paper types as chart tags; posters on a research-field panel */
.pub-v .tag { font-size: 0.7rem; margin-right: 2px; vertical-align: 1px; }
.poster-field {
  --h: var(--c-research);
  margin-top: 34px; padding: 10px 12px 14px;
  border-radius: 6px;
  background: color-mix(in oklab, var(--h) var(--tint), transparent);
  border: 1px solid color-mix(in oklab, var(--h) 26%, transparent);
}
.poster-field .posters { margin-top: 4px; }
.poster-field .posters em { color: var(--ink-2); }

/* Beyond my resume: the letter as a sheet, like the detail panel */
.letter-body {
  background: var(--node);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 40px) clamp(18px, 3.4vw, 48px);
  box-sizing: border-box;
  max-width: calc(68ch + 2 * clamp(18px, 3.4vw, 48px));
}

/* Papers & posters: how the work moved from poster to paper, as two short research-field chains
   in the empty column (desktop only). Each step jumps to its entry. */
.rail-lineage { --h: var(--c-research); margin-top: 30px; width: min(270px, 100%); }
.rl-name { margin: 0 0 8px; font-size: 0.86rem; font-weight: 760; font-stretch: 86%; color: var(--h); }
.rl-name + .rl-chain { margin-bottom: 26px; }
.rl-chain { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rl-chain li { position: relative; }
.rl-chain a, .rl-chain button {
  width: 100%; font: inherit; text-align: left; cursor: pointer;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 6px 10px 7px; border-radius: 3px; text-decoration: none; color: var(--ink);
  background: var(--node); border: 1px solid color-mix(in oklab, var(--h) 48%, var(--rule));
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.rl-chain li:last-child a { background: color-mix(in oklab, var(--h) var(--tint-in), var(--node)); border-color: var(--h); }
.rl-chain a:hover, .rl-chain a:focus-visible, .rl-chain button:hover, .rl-chain button:focus-visible { border-color: var(--h); box-shadow: 0 8px 18px -12px rgb(var(--shadow) / 0.5); }
.rl-t { font-size: 0.86rem; line-height: 1.2; font-weight: 660; font-stretch: 84%; }
.rl-chain .yr { font-size: 0.76rem; color: var(--ink-3); }
#pub-preprint, #pub-meeting, #pub-dot, #talk-mac, #poster-age { scroll-margin-top: 76px; }

/* Posters: grouped by school, oldest first. Every poster sits on one shared column grid, so
   thumbnails line up across rows: 5 columns when the panel is wide, 3 when medium, 2 on phones.
   Each school spans as many columns as it has posters (--n); on phones each school takes a full row. */
.poster-field { container-type: inline-size; }
.poster-route {
  --cols: 2;
  list-style: none; margin: 4px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 0 18px;
}
.pr-step { grid-column: 1 / -1; grid-row: span 2; display: grid; grid-template-columns: subgrid; grid-template-rows: subgrid; row-gap: 0; }
.pr-school { grid-column: 1 / -1; align-self: end; display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 0.86rem; font-weight: 680; font-stretch: 86%; color: var(--ink-2); }
.poster-route .posters { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: 18px; margin: 0 0 26px; }
.pr-step:last-child .posters { margin-bottom: 0; }
.poster-route .posters > li { width: auto; }
@container (min-width: 440px) { .poster-route { --cols: 3; } .pr-step { grid-column: span min(var(--n), 3); } }
@container (min-width: 720px) { .poster-route { --cols: 5; } .pr-step { grid-column: span var(--n); } }
.pr-step + .pr-step .pr-school::before {
  content: ""; flex: none; width: 22px; height: 7px;
  background: linear-gradient(color-mix(in oklab, var(--h) 70%, transparent), color-mix(in oklab, var(--h) 70%, transparent)) left center / 20px 1px no-repeat;
}
.pr-step + .pr-step .pr-school::after {
  content: ""; position: absolute; left: 14px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; box-sizing: border-box;
  border-right: 1px solid var(--h); border-top: 1px solid var(--h); transform: rotate(45deg);
}
.pr-step + .pr-step .pr-school { position: relative; }

/* Beyond my resume: the letter's route drawn as a small pathway (desktop only).
   Main chain = the fields in the order the letter takes them; side branches = what the letter
   says came out of each. Branch lines and heads are drawn by site.js. */
.rail-route { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 26px; position: relative; }
.rail-route > li { position: relative; display: grid; grid-template-columns: 162px 1fr; column-gap: 34px; align-items: center; }
.rr-node {
  display: block; padding: 7px 11px 8px;
  background: color-mix(in oklab, var(--h) var(--tint-in), var(--node));
  border: 1px solid var(--h); border-radius: 3px;
  font-size: 0.92rem; line-height: 1.18; font-weight: 700; font-stretch: 84%; letter-spacing: -0.004em; color: var(--ink);
}
.rr-out { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.rr-out li { font-size: 0.78rem; line-height: 1.25; font-weight: 560; font-stretch: 88%; color: var(--ink-2); }
.rr-branch { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.rr-branch path { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.rr-branch .rr-head { fill: var(--ink-3); stroke: none; }
.rr-branch .rr-chev { fill: none; stroke: var(--ink-3); stroke-width: 1; }
@media (max-width: 1240px) { .rail-route > li { grid-template-columns: 1fr; row-gap: 8px; } .rr-out { padding-left: 56px; } }

@media (max-width: 900px) { .rail-lineage, .rail-route { display: none; } }

/* One geometry for every vertical step arrow (chart columns, letter route, poster-to-paper chains):
   the line starts --ai below the box above and its arrowhead tip stops --ai above the box below,
   so every arrow sits the same distance from both boxes. The 5px chevron's tip lies 6px below its top. */
.chain, .rl-chain { row-gap: var(--ag); }
.chain { --ag: 8px; --ai: 1px; --ax: 18px; --al: color-mix(in oklab, var(--h) 70%, transparent); --ah: var(--h); }
.rl-chain { --ag: 14px; --ai: 3px; --ax: 18px; --al: color-mix(in oklab, var(--h) 70%, transparent); --ah: var(--h); }
.chain > .cpd + .cpd::before, .rl-chain > li + li::before {
  content: ""; position: absolute; left: var(--ax); width: 1px;
  top: calc(var(--ai) - var(--ag)); height: calc(var(--ag) - 2 * var(--ai));
  background: var(--al);
}
.chain > .cpd + .cpd::after, .rl-chain > li + li::after {
  content: ""; position: absolute; left: calc(var(--ax) - 2px); top: calc(-1 * var(--ai) - 6px);
  width: 5px; height: 5px; box-sizing: border-box;
  border-right: 1px solid var(--ah); border-bottom: 1px solid var(--ah); transform: rotate(45deg);
}

/* two levels of emphasis under a field: key evidence (.in) and related work (.rel) look the same,
   except related work has a dashed border */
body:not([data-lens="all"]) .cpd.rel .cpd-btn {
  background: color-mix(in oklab, var(--h) var(--tint-rel), var(--node));
  border-style: dashed;
  border-color: var(--h);
}
body:not([data-lens="all"]) .cpd.rel .cpd-t { font-weight: 720; color: var(--ink); }
body:not([data-lens="all"]) .cpd.rel .cpd-f { color: var(--h); }
/* links that reach related work are thinner and fainter and carry no label */
.rx-layer path.rx.on.minor { stroke-width: 1; opacity: 0.55; }
.rx-layer .rx-head.on.minor { opacity: 0.55; }
/* link labels a step smaller than the box titles */
.rx-label { padding: 2px 6px 3px; font-size: 0.68rem; font-weight: 580; }

/* Streamlined map: six fields in two rows of three. The wider gutters carry the links,
   and their labels sit level (not rotated) inside the gutters. */
.chart {
  --cgap: clamp(104px, 9vw, 134px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: "research comp ai" "biz make serve";
  column-gap: var(--cgap); row-gap: 44px;
}
.rx-label {
  white-space: normal; text-align: center; line-height: 1.1; text-wrap: balance;
  padding: 1px 6px 2px; border-radius: 8px;
}
@media (max-width: 1100px) {
  .chart { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "research comp" "ai biz" "make serve"; }
}
@media (max-width: 900px) {
  .chart { grid-template-columns: 1fr; grid-template-areas: "research" "comp" "ai" "biz" "make" "serve"; row-gap: 18px; }
}
/* the resting map: every link drawn as a faint hairline in the destination's hue */
.rx-layer path.rx.on.rest { stroke-width: 1; opacity: 0.32; }
.rx-layer .rx-head.on.rest { opacity: 0.32; }
.rx-label.minor { border-style: dashed; color: var(--ink-2); box-shadow: none; }

/* the contact heading is a question: balanced lines, the key word in Archivo's own italic */
.contact .sec-rail h2 { text-wrap: balance; }
.contact .sec-rail h2 em { font-style: italic; font-weight: 700; letter-spacing: -0.01em; }
