:root {
  --paper: #f4f0e6;
  --card: #fffdf8;
  --ink: #1c1b19;
  --muted: #6b665c;
  --rule: #d9d2c3;
  --data: #1f5aa6;
  --software: #e2552d;
  --quantum: #eaa911;
  --line-career: #1f5aa6;
  --line-projects: #e2552d;
  --line-science: #eaa911;
  --line-certs: #2e8b57;
  --line-hobbies: #c2489a;
  --shadow: rgba(28, 27, 25, 0.12);
  --font: 'Jost', 'Futura', 'Century Gothic', 'Avenir Next', 'Trebuchet MS', sans-serif;
  --panel-w: 410px;
  --fast: 140ms;
  color-scheme: light;
}

/* Dark mode follows the device setting. Print always uses the light palette. */
@media screen and (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #161513;
    --card: #211f1c;
    --ink: #ede7da;
    --muted: #a39c8e;
    --rule: #3b3732;
    --data: #6f9fe6;
    --software: #f0724d;
    --quantum: #f2bb3a;
    --line-career: #4d86d8;
    --shadow: rgba(0, 0, 0, 0.45);
  }

  /* Drawings with black linework need a light backdrop to stay readable. */
  .shot.art img,
  .fl-thumb {
    background: #efe8da;
  }

  .shot.art img {
    border-radius: 8px;
  }
}

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

html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--data);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -50px;
  z-index: 50;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ── Masthead ──────────────────────────────────────────────────────── */
.masthead {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  padding: 22px 16px 14px;
  border-bottom: 2px solid var(--ink);
  margin: 0 24px;
}

.title-block {
  max-width: 620px;
}

.masthead h1 {
  margin: 0;
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
}

.lede {
  margin: 10px 0 0;
  font-size: 17px;
  line-height: 1.45;
}

.how {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex: none;
}

.side-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 22px;
}

.views {
  display: flex;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.views button {
  border: 0;
  background: none;
  padding: 3px 14px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}

.views button:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.views button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}

.top-links {
  display: flex;
  gap: 18px;
  font-size: 15px;
  font-weight: 500;
}

.top-links a {
  text-decoration: none;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 1px;
}

.top-links a:hover {
  border-bottom-color: var(--software);
}

.legend {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 0 6px;
}

.legend li:last-child:nth-child(odd) {
  grid-column: 1;
}

.legend-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 3px 12px 3px 3px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast);
}

.legend-line:hover {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.legend-line[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--card);
}

.legend-line span:last-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.2;
  white-space: nowrap;
}

.legend-line b {
  font-weight: 600;
  font-size: 15px;
}

.legend-line small {
  font-size: 13px;
  color: var(--muted);
}

.bullet {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c);
  color: var(--i);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}

.bullet.sm {
  width: 22px;
  height: 22px;
  font-size: 12px;
}

/* ── Map ───────────────────────────────────────────────────────────── */
.map-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 8px 0 12px;
  position: relative;
}

.map-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 24px;
  scrollbar-width: thin;
  cursor: grab;
}

.dragging,
.dragging .map-wrap,
.dragging .stn {
  cursor: grabbing;
}

.panel-open .map-wrap {
  padding-right: calc(var(--panel-w) + 40px);
}

.map {
  display: block;
  margin: 0 auto;
  user-select: none;
}

.seg {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity var(--fast);
}

.seg.off {
  opacity: 0.13;
}

.seg.next {
  opacity: 0.45;
}

.train rect {
  fill: var(--card);
  stroke-width: 2.5;
}

.trains {
  transition: opacity var(--fast);
}

.conn {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0.1 9;
}

.conn.down {
  opacity: 0.45;
}

.zone {
  fill-opacity: 0.1;
  stroke-opacity: 0.6;
  stroke-width: 1.5;
  stroke-dasharray: 7 6;
  transition: opacity var(--fast);
}

.zone-label {
  font: 600 13px var(--font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  fill: var(--muted);
  transition: opacity var(--fast);
}

.focusing .zones {
  opacity: 0.35;
}

.span {
  fill: none;
  stroke-width: 30;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.22;
}

.mark-dot {
  fill: var(--ink);
  pointer-events: none;
}

.stn.selected .mark-dot {
  fill: var(--card);
}

.byline,
.cv-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.cv-note {
  margin: -4px 0 10px;
}

.ongoing {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 500;
}

.ongoing span {
  margin-right: 4px;
}

.map.focusing .trains {
  opacity: 0;
}

.stn {
  cursor: pointer;
  outline: none;
  transition: opacity var(--fast);
}

.stn .hit {
  fill: transparent;
}

.stn .mark {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 3;
  transition: fill var(--fast), stroke-width var(--fast);
}

.stn.terminus .mark {
  fill: var(--ink);
}

.stn:hover .mark,
.stn:focus-visible .mark {
  stroke-width: 4.5;
}

.stn.selected .mark {
  fill: var(--ink);
}

.stn.terminus.selected .mark {
  fill: var(--software);
}

.stn:focus-visible .hit {
  fill: color-mix(in srgb, var(--data) 10%, transparent);
  stroke: var(--data);
  stroke-width: 2;
  rx: 6;
}

.stn.off {
  opacity: 0.28;
}

.stn.next {
  opacity: 0.7;
}

.label {
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 5px;
  stroke-linejoin: round;
  fill: var(--ink);
}

.l-name {
  font-size: 18px;
  font-weight: 600;
}

.l-sub {
  font-size: 14.5px;
  font-weight: 400;
  fill: var(--muted);
}

.l-star {
  font-size: 14px;
  fill: var(--software);
}

.terminus .l-name {
  font-size: 30px;
  font-weight: 700;
}

.terminus .l-sub {
  font-size: 16px;
  fill: var(--ink);
}

.stn:hover .l-name,
.stn.selected .l-name {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.map-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 4px 40px 0;
  font-size: 13px;
  color: var(--muted);
}

.map-note .key {
  color: var(--ink);
}

.map-note .swipe {
  display: none;
  color: var(--ink);
}

.map-scrolls .map-note .swipe {
  display: inline;
}

/* ── Station panel ─────────────────────────────────────────────────── */
.panel {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  width: var(--panel-w);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 6px 6px 0 var(--shadow);
  animation: panel-in 160ms ease-out;
}

.panel[hidden] {
  display: none;
}

/* While a station panel is open the page behind it doesn't scroll. --scrollbar-w comes from
   setPanelOpen() in app.js and stands in for the hidden scrollbar so nothing shifts. */
@media screen {
  body.panel-open {
    overflow: hidden;
    padding-right: var(--scrollbar-w, 0px);
  }

  html:has(> body.panel-open) {
    overscroll-behavior: none;
  }
}

@keyframes panel-in {
  from {
    transform: translateX(16px);
    opacity: 0;
  }
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 18px;
  border-bottom: 1.5px solid var(--rule);
}

.panel-lines {
  display: flex;
  gap: 4px;
}

.panel-kind {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.close:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.panel-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 22px 26px;
  scrollbar-width: thin;
}

.panel h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  outline: none;
}

.meta {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.meta b {
  color: var(--ink);
  font-weight: 600;
}

.text {
  margin: 14px 0 0;
}

.panel h3 {
  margin: 22px 0 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.numbers {
  margin: 16px 0 0;
  border-top: 1.5px solid var(--ink);
}

.numbers div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.numbers dt {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.numbers dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.35;
}

.points,
.stars,
.cv ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

.points li,
.stars li {
  margin-bottom: 7px;
  font-size: 15px;
  line-height: 1.45;
}

.stars {
  list-style: none;
  padding-left: 22px;
}

.stars li::before {
  content: '★';
  float: left;
  margin-left: -22px;
  color: var(--software);
}

.tools {
  margin: 16px 0 0;
  font-size: 14.5px;
}

.tools span {
  margin-right: 6px;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.line-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.line-btn {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  padding: 6px;
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  background: none;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.line-btn:hover {
  border-color: var(--ink);
}

.certs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.certs li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14.5px;
  line-height: 1.3;
}

.certs small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.certs .year {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 18px 0 0;
  font-weight: 500;
}

.links a,
.certs small a {
  text-decoration: none;
  border-bottom: 1.5px solid var(--ink);
}

.certs small a {
  border-bottom-width: 1px;
  color: var(--ink);
}

.skills {
  margin: 0;
}

.skills div {
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}

.skills div:first-child dt {
  font-size: 18px;
}

.skills dt {
  font-weight: 600;
  font-size: 15.5px;
}

.skills dd {
  margin: 1px 0 0;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--muted);
}

.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  font-size: 15px;
}

.langs b {
  font-weight: 600;
}

.link-btn {
  padding: 0;
  border: none;
  border-bottom: 1.5px solid var(--ink);
  background: none;
  font-weight: 500;
  cursor: pointer;
}

.lineage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
  padding-top: 4px;
  border-top: 1.5px solid var(--ink);
}

.lineage h3 {
  margin-top: 12px;
}

.stop {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 6px;
  padding: 6px 10px;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  background: none;
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.stop:hover {
  border-color: var(--ink);
}

.stop-dots {
  display: flex;
  gap: 2px;
}

.stop-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
}

.none {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

blockquote {
  margin: 12px 0;
  padding-left: 14px;
  border-left: 3px solid var(--software);
  font-size: 16px;
}

blockquote cite {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  font-style: normal;
  color: var(--muted);
}

.shot {
  margin: 16px 0 0;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
}

.shot img,
.shot video {
  display: block;
  width: 100%;
  height: auto;
}

.shot figcaption {
  padding: 6px 12px 7px;
  border-top: 1.5px solid var(--ink);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
}

/* Illustrations with a transparent background sit straight on the page. */
.shot.art {
  border: 0;
  border-radius: 0;
}

.shot.art img {
  width: 92%;
  margin: 0 auto;
}

.shot.art figcaption {
  padding: 4px 0 0;
  border-top: 0;
  background: none;
}

.shot-missing {
  display: none;
  padding: 40px 12px;
  text-align: center;
  color: var(--muted);
  background: color-mix(in srgb, var(--rule) 60%, var(--paper));
}

.shot.missing img,
.shot.missing video {
  display: none;
}

.shot.missing .shot-missing {
  display: block;
}

/* ── Plain CV ──────────────────────────────────────────────────────── */
.cv {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  background: var(--paper);
}

.cv[hidden] {
  display: none;
}

.cv-open {
  overflow: hidden;
}

.cv-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 14px 24px;
  background: var(--paper);
  border-bottom: 1.5px solid var(--rule);
}

.cv-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 16px;
  font-size: 14.5px;
  font-weight: 500;
}

.cv-nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.cv-nav a:hover,
.cv-nav a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

.cv-sec {
  scroll-margin-top: 84px;
}

details.cv-sec > summary {
  display: block;
  list-style: none;
  cursor: pointer;
}

details.cv-sec > summary::-webkit-details-marker {
  display: none;
}

details.cv-sec > summary h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

details.cv-sec > summary h2::after {
  content: '+';
  margin-left: auto;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
}

details.cv-sec[open] > summary h2::after {
  content: '−';
}

details.cv-sec > summary:hover h2 {
  border-bottom-color: var(--software);
}

.cv-count {
  color: var(--muted);
  font-weight: 500;
}

.cv-doc {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.cv-header h1 {
  margin: 0;
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
  outline: none;
}

.cv-role {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: 500;
}

.cv-contact {
  margin: 4px 0 0;
  color: var(--muted);
}

.cv-doc h2 {
  margin: 36px 0 12px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.cv-lines {
  list-style: none;
  padding: 0 !important;
}

.cv-lines li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 6px;
}

.cv-item {
  padding: 0 0 16px 16px;
  border-left: 4px solid var(--c);
}

.cv-item + .cv-item {
  margin-top: 8px;
}

.cv-item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
}

.cv-item h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.cv-when {
  color: var(--muted);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

.cv-org {
  margin: 2px 0 0;
  font-weight: 500;
}

.cv-item p {
  margin: 6px 0 0;
}

.cv li {
  margin-bottom: 4px;
}

.cv .shot {
  max-width: 460px;
}

.noscript {
  padding: 24px;
}

/* ── Timeline ──────────────────────────────────────────────────────── */
.map-area[hidden],
.timeline-area[hidden] {
  display: none;
}

/* In timeline view the header shrinks and the timeline scrolls inside the window. */
body.timeline-view {
  height: 100vh;
  height: 100dvh;
}

.timeline-view .lede,
.timeline-view .how,
.timeline-view .legend {
  display: none;
}

.timeline-view .masthead {
  align-items: center;
  padding-bottom: 12px;
}

.timeline-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px 24px 16px;
}

.panel-open .timeline-area {
  padding-right: calc(var(--panel-w) + 40px);
}

.tl-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tl-btn {
  flex: none;
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tl-play {
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
}

.tl-scrub {
  flex: 1;
  min-width: 80px;
  accent-color: var(--ink);
  cursor: pointer;
}

.tl-date {
  flex: none;
  min-width: 128px;
  font-weight: 600;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.fl-now {
  flex: none;
  display: flex;
  gap: 10px;
  height: 64px;
  overflow: hidden;
}

.fl-card {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  height: 64px;
  padding: 6px 16px 6px 6px;
  border: 0;
  border-left: 6px solid var(--c);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 1px 0 var(--rule), 0 0 0 1px var(--rule);
  text-align: left;
  cursor: pointer;
  animation: fl-card-in 320ms ease;
}

.fl-card:hover .fl-title,
.fl-card:focus-visible .fl-title {
  text-decoration: underline;
}

.fl-summary {
  padding-left: 14px;
  cursor: default;
}

.fl-thumb {
  flex: none;
  width: 68px;
  height: 46px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--paper);
}

.fl-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.fl-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.fl-title {
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fl-title .fl-star {
  color: var(--software);
}

.fl-sub {
  overflow: hidden;
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

@keyframes fl-card-in {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
}

.fl-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.fl-svg {
  display: block;
}

.fl-place {
  fill: var(--ink);
  opacity: 0.05;
}

.fl-place-label {
  font: 600 11px var(--font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  fill: var(--muted);
}

.fl-lane {
  opacity: 0.07;
  pointer-events: none;
}

.fl-year {
  stroke: var(--rule);
  stroke-width: 1;
}

.fl-year-label {
  font: 500 12px var(--font);
  fill: var(--muted);
}

.fl-rail {
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.45;
}

.fl-edge {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 0.1 6;
  opacity: 0.4;
  transition: opacity 200ms ease;
}

.fl-edge.hl {
  stroke-width: 2.5;
  opacity: 1;
}

.fl-edge.off {
  opacity: 0.08;
}

.fl-flow {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  visibility: hidden;
}

.fl-particle {
  stroke: var(--card);
  stroke-width: 2;
  visibility: hidden;
}

.fl-item {
  opacity: 0;
  cursor: pointer;
  transition: opacity 280ms ease;
}

.fl-item.shown {
  opacity: 1;
}

.fl-item.shown.next {
  opacity: 0.5;
}

.fl-item.shown.off {
  opacity: 0.15;
}

.fl-item:focus {
  outline: none;
}

.fl-hit {
  stroke: transparent;
  stroke-width: 28;
  pointer-events: stroke;
}

.fl-bar {
  stroke-width: 9;
  stroke-linecap: round;
}

.fl-cap {
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.fl-dot {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 2.5;
  transform-box: fill-box;
  transform-origin: center;
}

.fl-item.pop .fl-dot {
  animation: fl-pop 560ms cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes fl-pop {
  from {
    transform: scale(0);
  }
}

.fl-dot-in {
  fill: var(--ink);
  pointer-events: none;
}

.fl-item.selected .fl-dot {
  fill: var(--ink);
}

.fl-item.selected .fl-dot-in {
  fill: var(--card);
}

.fl-item:hover .fl-dot,
.fl-item:focus-visible .fl-dot {
  stroke-width: 4;
}

.fl-item:focus-visible .fl-dot {
  stroke: var(--data);
}

.fl-label {
  font: 500 13.5px var(--font);
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.fl-label .fl-star {
  fill: var(--software);
}

.fl-item.selected .fl-label {
  font-weight: 600;
}

.fl-item:hover .fl-label,
.fl-item:focus-visible .fl-label {
  text-decoration: underline;
}

.fl-head {
  pointer-events: none;
}

.fl-head line {
  stroke: var(--ink);
  stroke-width: 2;
}


.fl-lanes {
  pointer-events: none;
}

.fl-lanes-bg {
  fill: var(--paper);
}

.fl-badge {
  font: 700 11px var(--font);
}

.fl-lane-name {
  font: 600 14px var(--font);
  fill: var(--ink);
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .masthead {
    padding: 22px 16px 16px;
    margin: 0 12px;
    gap: 24px;
  }

  .masthead h1 {
    font-size: 42px;
  }

  .legend-line small {
    display: none;
  }
}

@media (max-width: 760px) {
  .cv-bar {
    flex-wrap: wrap;
    padding: 10px 14px;
  }

  .cv-nav {
    order: 3;
    flex: 1 0 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .cv-sec {
    scroll-margin-top: 110px;
  }

  .masthead {
    flex-direction: column;
    gap: 14px;
    padding: 18px 4px 14px;
  }

  .masthead h1 {
    font-size: 36px;
  }

  .lede {
    font-size: 16px;
  }

  .how {
    font-size: 14px;
  }

  .side {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .side-top {
    justify-content: flex-start;
  }

  .legend {
    display: flex;
    flex-wrap: wrap;
  }

  .legend-line {
    padding-right: 12px;
  }

  .legend-line b {
    font-size: 14px;
  }

  .map-wrap {
    padding: 0 12px;
  }

  .panel-open .map-wrap {
    padding-right: 12px;
  }

  .map-note {
    margin: 4px 16px 0;
  }

  .panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: 86vh;
  }

  @keyframes panel-in {
    from {
      transform: translateY(24px);
      opacity: 0;
    }
  }

  .lineage {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cv-header h1 {
    font-size: 36px;
  }
  .timeline-area {
    padding: 10px 12px 12px;
  }

  .panel-open .timeline-area {
    padding-right: 12px;
  }

  .tl-date {
    min-width: 0;
    font-size: 15px;
  }

  .fl-thumb {
    width: 52px;
    height: 40px;
  }

  .fl-card:not(:first-child) {
    display: none;
  }

  .fl-title {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Print: the plain CV only ──────────────────────────────────────── */
@media print {
  .cv details::details-content {
    content-visibility: visible;
    display: contents;
  }

  details.cv-sec > summary h2::after,
  .cv-count {
    display: none;
  }

  body {
    background: #fff;
    font-size: 10pt;
  }

  body > *:not(.cv) {
    display: none !important;
  }

  .cv,
  .cv[hidden] {
    display: block !important;
    position: static;
    overflow: visible;
    background: #fff;
  }

  .cv-bar {
    display: none;
  }

  .cv-doc {
    max-width: none;
    padding: 0;
  }

  .cv-header h1 {
    font-size: 28pt;
  }

  .cv-doc h2 {
    margin: 16px 0 8px;
  }

  .cv-item {
    break-inside: avoid;
    padding-bottom: 8px;
  }

  .cv-item h3 {
    font-size: 11.5pt;
  }

  .cv-doc,
  .cv-item p,
  .cv ul,
  .skills dd,
  .certs li,
  .langs,
  blockquote {
    font-size: 9pt;
    line-height: 1.3;
  }

  .cv-doc h2 {
    margin: 10px 0 5px;
    font-size: 9.5pt;
  }

  .cv-item {
    padding-bottom: 4px;
  }

  .cv-item + .cv-item {
    margin-top: 4px;
  }

  .cv-item p,
  .cv ul {
    margin-top: 3px;
  }

  .cv .shot,
  .cv .links,
  .cv-lines {
    display: none;
  }

  .skills,
  .cv-doc .certs {
    columns: 2;
    column-gap: 24px;
  }

  .skills div,
  .cv .certs {
    columns: 2;
    column-gap: 22px;
  }

  .certs li {
    break-inside: avoid;
    padding: 3px 0;
  }

  .skills dt,
  .skills div:first-child dt {
    font-size: 9.5pt;
  }

  blockquote {
    margin: 6px 0;
  }

  .cv li {
    margin-bottom: 1px;
  }
}
