/* Design tokens */
:root {
  --bg: #f7f8f7;
  --surface: #ffffff;
  --surface-muted: #eef3f1;
  --text: #202423;
  --muted: #66706d;
  --line: #d8dfdc;
  --accent: #0f766e;
  --accent-strong: #0b4f4a;
  --accent-soft: #d9ece8;
  --conference: #8a3342;
  --conference-soft: #f2dce2;
  --gold: #a66f21;
  --work-appointment: #d88a00;
  --honor: #c0567a;
  --teaching: #5f7f4f;
  --shadow: 0 16px 34px rgba(27, 38, 35, 0.08);
  --card-grid-min: clamp(138px, 22vw, 270px);
  --card-gap: clamp(7px, 1vw, 14px);
}

/* Base layout */
* {
  box-sizing: border-box;
}

html {
  font-size: clamp(10.5px, calc(0.64vw + 8.45px), 16px);
}

body {
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

main a,
main li,
main p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Site navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 247, 0.94);
  backdrop-filter: blur(16px);
}

.nav {
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  overflow-x: auto;
}

.nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent-strong);
}

.language-switcher {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  padding-left: 10px;
}

.language-switcher a,
.language-switcher span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.language-switcher span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* Typography */
h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 18px;
  font-size: 4.4rem;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 2rem;
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--conference);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

/* Profile hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(240px, 0.55fr);
  gap: 24px;
  max-width: 1180px;
  min-height: 560px;
  margin: 0 auto;
  padding: 72px 24px 52px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hero-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.profile-photo {
  width: clamp(104px, 12vw, 148px);
  aspect-ratio: 1;
  border: 4px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(27, 38, 35, 0.18);
  object-fit: cover;
}

.hero-identity .eyebrow {
  margin-bottom: 10px;
}

.lead {
  max-width: 760px;
  margin-bottom: 28px;
  color: #3d4643;
  font-size: 1.18rem;
}

.current-activity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  max-width: 940px;
  margin-bottom: 18px;
}

.current-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--surface);
}

.current-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.current-card strong {
  display: block;
  margin-bottom: 4px;
  line-height: 1.25;
}

.current-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 900px;
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-bottom: 2px solid var(--accent-soft);
  padding: 3px 2px;
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
}

.cv-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  max-width: 900px;
  margin-top: 14px;
}

.cv-downloads span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.cv-downloads a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.cv-downloads a:hover {
  background: var(--accent);
  color: var(--surface);
}

.hero-panel {
  align-self: center;
  min-width: 0;
  border-left: 5px solid var(--accent);
  padding: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  margin-bottom: 16px;
}

.focus-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.focus-list span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 5px;
  padding: 4px 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 750;
}

/* Shared sections and cards */
.section,
.content-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 24px;
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 250px);
  gap: 32px;
  align-items: start;
}

.section-heading {
  max-width: 680px;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.overview-copy {
  min-width: 0;
}

.narrative {
  border-top: 3px solid var(--accent);
  padding-top: 18px;
  color: #37423f;
}

.narrative p {
  margin-bottom: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.metric-card,
.chart-card,
.record-card,
.package-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* Overview and publication chart */
.metric-card {
  min-height: 112px;
  padding: 18px;
}

.metric-card strong {
  display: block;
  color: var(--accent-strong);
  font-size: 2.1rem;
  line-height: 1;
}

.metric-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.chart-card {
  padding: 24px;
}

.publication-chart-card {
  margin: 10px 0 24px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.chart-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 16px;
  align-items: end;
  min-height: 220px;
}

.bar-item {
  border: 0;
  padding: 0;
  background: transparent;
  display: grid;
  gap: 6px;
  justify-items: center;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 750;
  cursor: pointer;
}

.bar-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.bar-track {
  position: relative;
  width: 100%;
  max-width: 54px;
  height: 150px;
  border-radius: 6px;
  background: var(--surface-muted);
  overflow: hidden;
}

.publication-year-button.is-active .bar-track,
.publication-year-button:hover .bar-track {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.publication-year-button.is-active strong,
.publication-year-button.is-active > span {
  color: var(--accent-strong);
}

.bar-stack {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 10px;
}

.bar-segment {
  display: block;
}

.bar-segment.journal {
  background: var(--accent);
}

.bar-segment.conference {
  background: var(--conference);
}

.kind-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.kind-dot.conference {
  background: var(--conference);
}

.carousel-control {
  display: block;
  width: 100%;
  min-width: 0;
  height: clamp(42px, 6vw, 58px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: var(--shadow);
  font: inherit;
  font-size: clamp(1.25rem, 2.5vw, 1.85rem);
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.carousel-control:hover,
.carousel-control:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.carousel-control:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.publication-carousel-shell {
  --publication-slide-gap: clamp(8px, 1vw, 12px);

  display: grid;
  grid-template-columns:
    clamp(28px, 4vw, 38px)
    minmax(0, 1fr)
    clamp(28px, 4vw, 38px);
  gap: clamp(6px, 1vw, 10px);
  align-items: center;
}

.publication-carousel-control {
  height: clamp(44px, 7vw, 64px);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.publication-carousel {
  --publication-slide-width: clamp(270px, 32vw, 390px);

  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(8px, 1.4vw, 16px);
  background: var(--surface);
  box-shadow: var(--shadow);
  container-type: inline-size;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.publication-carousel::-webkit-scrollbar {
  display: none;
}

.publication-year-track {
  display: grid;
  grid-auto-columns: var(--publication-slide-width);
  grid-auto-flow: column;
  grid-template-rows: auto auto;
  column-gap: var(--publication-slide-gap);
  row-gap: 10px;
  align-items: start;
  width: max-content;
  min-width: 100%;
}

.publication-year-group {
  display: contents;
}

.publication-year-heading {
  grid-row: 1;
  grid-column: span var(--publication-year-span);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--surface-muted);
  color: var(--accent-strong);
  font-weight: 900;
}

.publication-year-heading span {
  font-size: 1.15rem;
}

.publication-year-heading small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.publication-year-cards {
  display: contents;
}

.publication-slide {
  grid-row: 2;
  width: var(--publication-slide-width);
  display: flex;
  align-items: flex-start;
  scroll-margin-left: 16px;
  scroll-snap-align: start;
}

@supports (width: 1cqw) {
  .publication-carousel {
    --publication-slide-width: min(
      390px,
      calc((100cqw - var(--publication-slide-gap)) / 2)
    );
  }
}

.publication-slide .record-card {
  width: 100%;
}

.publication-meta-details {
  margin-top: 12px;
}

.publication-meta-details summary {
  display: none;
}

.publication-meta-details .meta-list {
  margin-top: 0;
}

.publication-carousel-shell.is-compact-publications .publication-meta-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.publication-carousel-shell.is-compact-publications .publication-meta-details summary {
  display: list-item;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 850;
  cursor: pointer;
}

.publication-carousel-shell.is-compact-publications .publication-meta-details .meta-list {
  margin-top: 10px;
}

/* Collaborations map */
.collaboration-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.45fr);
  gap: 18px;
  align-items: stretch;
}

.collaboration-map-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.collaboration-map {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: clamp(340px, 31vw, 430px);
  border-radius: 8px;
  background: var(--surface-muted);
  cursor: grab;
  overflow: hidden;
}

.collaboration-map:active {
  cursor: grabbing;
}

.collaboration-map svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.map-loading {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.collaboration-map.loaded .map-loading {
  display: none;
}

.map-sphere {
  fill: var(--surface-muted);
}

.map-graticule {
  fill: none;
  stroke: rgba(102, 112, 109, 0.2);
  stroke-width: 0.6;
  vector-effect: non-scaling-stroke;
}

.map-country {
  fill: #dfe8e4;
  stroke: #c2ceca;
  stroke-width: 0.55;
  vector-effect: non-scaling-stroke;
}

.publication-map-node {
  fill: var(--accent);
  opacity: 0.76;
  stroke: var(--surface);
  stroke-width: 2.2;
}

.stay-route-line {
  fill: none;
  pointer-events: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.stay-route-path {
  opacity: 0.82;
  stroke: var(--conference);
  stroke-dasharray: 6 7;
  stroke-width: 1.7;
}

.stay-stem-halo,
.stay-stem {
  stroke-linecap: round;
}

.stay-stem-halo {
  stroke: var(--surface);
  stroke-width: 6;
}

.stay-stem {
  stroke: var(--conference);
  stroke-width: 3;
}

.stay-map-marker circle {
  fill: var(--conference);
  stroke: var(--surface);
  stroke-width: 2.4;
}

.stay-month-label {
  fill: var(--conference);
  stroke: var(--surface);
  stroke-linejoin: round;
  stroke-width: 3;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  paint-order: stroke fill;
}

.work-marker-pin-halo,
.work-marker-pin {
  stroke-linejoin: round;
}

.work-marker-pin-halo {
  fill: none;
  stroke: var(--surface);
  stroke-width: 3.2;
}

.work-marker-pin {
  fill: var(--work-appointment);
  stroke: var(--surface);
  stroke-width: 1.4;
}

.work-marker-hole {
  fill: var(--surface);
  stroke: rgba(102, 112, 109, 0.28);
  stroke-width: 1;
}

.work-label {
  fill: var(--work-appointment);
  stroke: var(--surface);
  stroke-linejoin: round;
  stroke-width: 2.2;
  font-size: 10.6px;
  font-weight: 850;
  letter-spacing: 0;
  paint-order: stroke fill;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.map-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.map-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
}

.legend-publication {
  border-radius: 999px;
  background: var(--accent);
}

.legend-stay {
  position: relative;
  border-radius: 50% 50% 50% 0;
  background: transparent;
}

.legend-stay::before {
  position: absolute;
  top: 0;
  left: 4px;
  width: 2px;
  height: 8px;
  border-radius: 999px;
  background: var(--conference);
  content: "";
}

.legend-stay::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--conference);
  content: "";
}

.legend-work {
  position: relative;
  width: 12px !important;
  height: 14px !important;
}

.legend-work::before {
  position: absolute;
  inset: 0;
  background: var(--work-appointment);
  clip-path: polygon(50% 100%, 16% 32%, 28% 8%, 50% 0, 72% 8%, 84% 32%);
  content: "";
}

.legend-work::after {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--surface);
  content: "";
}

/* Collaboration metrics */
.collaboration-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.collaboration-metric-block {
  min-width: 0;
}

.collaboration-metric-block + .collaboration-metric-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.collaboration-metric-block h3 {
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-size: 0.95rem;
  text-transform: uppercase;
}

.collaboration-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.collaboration-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-muted);
}

.collaboration-metrics strong {
  display: block;
  color: var(--accent-strong);
  font-size: 1.6rem;
  line-height: 1;
}

.collaboration-metrics span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* Career timeline */
.career-timeline-card {
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.career-timeline-toolbar,
.career-timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.career-timeline-toolbar {
  margin-bottom: 12px;
}

.timeline-zoom-controls {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.timeline-zoom-controls button {
  min-width: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  background: var(--surface);
  color: var(--accent-strong);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.timeline-zoom-controls button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.career-filter,
.career-reset {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--surface-muted);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.career-filter.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.career-reset {
  margin-left: auto;
  background: var(--surface);
  color: var(--accent-strong);
}

.career-timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-radius: 8px;
  background: var(--surface-muted);
}

.career-timeline {
  position: relative;
  min-height: var(--timeline-display-height, 820px);
  touch-action: pan-x pan-y;
  cursor: grab;
}

.career-timeline:active {
  cursor: grabbing;
}

.career-timeline svg {
  display: block;
}

.career-timeline.loaded .map-loading {
  display: none;
}

.career-timeline-legend {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 750;
}

.career-timeline-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.career-timeline-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-education {
  background: #2f7f9f;
}

.legend-experience {
  background: var(--accent);
}

.legend-stay-block {
  background: var(--conference);
}

.legend-certification {
  position: relative;
  border: 2px solid var(--muted);
  border-radius: 999px;
  background: var(--surface-muted);
}

.legend-certification::after {
  position: absolute;
  top: 4px;
  left: 2px;
  width: 6px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
  content: "";
}

.legend-honor {
  background: var(--honor);
  transform: rotate(45deg) scale(0.8);
}

.legend-grant {
  height: 5px;
  border-radius: 999px;
  background: var(--gold);
}

.career-axis-line {
  stroke: var(--text);
  stroke-width: 2;
}

.career-axis line {
  stroke: rgba(102, 112, 109, 0.22);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.career-axis text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-anchor: middle;
}

.career-lane-labels text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.career-block rect {
  stroke: var(--surface);
  stroke-width: 1.5;
}

.career-block.education rect {
  fill: #2f7f9f;
}

.career-block.experience rect {
  fill: var(--accent);
}

.career-block.stay rect {
  fill: var(--conference);
}

.career-block.current rect {
  stroke-dasharray: 5 3;
}

.career-block text {
  fill: #ffffff;
  font-size: 11px;
  font-weight: 850;
  pointer-events: none;
}

.career-grant-edge {
  stroke-linecap: round;
  stroke: var(--gold);
  stroke-width: 4;
}

.career-marker line {
  stroke-dasharray: 4 4;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.career-marker.certification line {
  stroke: var(--muted);
}

.career-marker.honor line {
  stroke: var(--honor);
}

.career-marker path {
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.career-marker.certification path {
  fill: var(--surface-muted);
  stroke: var(--muted);
}

.career-marker.honor path {
  fill: var(--honor);
  stroke: var(--surface);
}

.career-marker text {
  fill: var(--text);
  font-size: 10px;
  font-weight: 800;
  paint-order: stroke fill;
  stroke: var(--surface-muted);
  stroke-linejoin: round;
  stroke-width: 3px;
}

/* Career block/grant/marker labels are generated by career-timeline.js. */
.career-block-label text,
.career-grant-label text,
.career-marker-label text {
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: 0;
  paint-order: stroke fill;
  stroke: var(--surface-muted);
  stroke-linejoin: round;
  stroke-width: 4px;
}

.career-block-label.education text {
  fill: #2f7f9f;
}

.career-block-label.experience text {
  fill: var(--accent-strong);
}

.career-block-label.stay text {
  fill: var(--conference);
}

.career-grant-label text {
  fill: var(--gold);
}

.career-marker.certification .career-marker-label text {
  fill: var(--muted);
  stroke-width: 4px;
}

.career-marker.honor .career-marker-label text {
  fill: var(--honor);
  stroke-width: 4px;
}

.career-detail-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.career-detail-filters button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.career-detail-filters button.active {
  border-color: var(--career-color, var(--accent));
  background: color-mix(in srgb, var(--career-color, var(--accent)) 14%, var(--surface));
  color: var(--career-color, var(--accent-strong));
}

.career-detail-filters button[data-career-detail-filter="all"].active {
  --career-color: var(--accent);
}

.career-detail-filters span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.72rem;
}

.career-detail-filters button.active span {
  background: color-mix(in srgb, var(--career-color, var(--accent)) 16%, var(--surface));
  color: var(--career-color, var(--accent-strong));
}

/* Career detail cards */
.career-detail-list {
  display: grid;
  gap: var(--card-gap);
  max-height: 680px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.career-detail-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  margin-bottom: 12px;
}

.career-detail-heading .eyebrow {
  margin-bottom: 0;
}

.career-detail-heading h3 {
  margin-bottom: 0;
}

.career-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 5px solid var(--career-color);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(27, 38, 35, 0.05);
}

.career-category-education,
.career-card.education {
  --career-color: #2f7f9f;
}

.career-category-experience,
.career-card.experience {
  --career-color: var(--accent);
}

.career-category-stay,
.career-card.stay {
  --career-color: var(--conference);
}

.career-category-certification,
.career-card.certification {
  --career-color: var(--muted);
}

.career-category-honor,
.career-card.honor {
  --career-color: var(--honor);
}

.career-category-grant,
.career-card.grant {
  --career-color: var(--gold);
}

.career-card .record-topline span,
.career-card .record-topline time {
  color: var(--career-color);
}

.career-card h3 {
  margin-bottom: 8px;
}

.career-card p {
  margin-bottom: 8px;
  color: #3e4845;
}

.career-card h3 a,
.career-card h3 {
  color: var(--text);
}

.career-organization-card {
  padding: 0;
  overflow: hidden;
}

.career-organization-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.35fr);
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
  background: color-mix(in srgb, var(--career-color) 7%, var(--surface));
}

.career-organization-heading h3 {
  margin-bottom: 4px;
}

.career-progression-summary {
  align-self: center;
  margin: 0;
  color: var(--career-color);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.35;
}

.career-progression {
  display: grid;
  gap: 0;
  padding: 16px;
}

.career-progress-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
}

.career-progress-item:not(:last-child) {
  padding-bottom: 18px;
}

.career-progress-item:not(:last-child)::before {
  position: absolute;
  top: 18px;
  bottom: 0;
  left: 6px;
  width: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--career-color) 34%, var(--line));
  content: "";
}

.career-progress-dot {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--career-color);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--career-color) 52%, var(--line));
}

.career-progress-content h4 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
}

.career-progress-content > p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.task-details {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.task-details summary {
  color: var(--career-color);
  font-size: 0.84rem;
  font-weight: 850;
  cursor: pointer;
}

.task-details .meta-list {
  margin-top: 10px;
}

.subsection-title {
  margin: 28px 0 14px;
  color: var(--accent-strong);
  font-size: 1.18rem;
}

.record-card {
  padding: 18px;
}

.record-card h3 a,
.record-card h3 {
  color: var(--text);
}

.record-card p {
  margin-bottom: 8px;
  color: #3e4845;
}

.record-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.record-topline time {
  color: var(--gold);
}

.meta-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.meta-list li + li {
  margin-top: 4px;
}

/* Projects */
.project-role-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.project-role-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  white-space: nowrap;
}

.project-role-legend i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

/* Dynamic role-* classes come from project participation classes. */
.project-role-legend .role-working {
  background: var(--muted);
}

.project-role-legend .role-research {
  background: var(--accent);
}

.project-role-legend .role-lead {
  background: var(--gold);
}

.project-carousel-shell {
  --project-carousel-gap: var(--card-gap);
  --project-card-width: clamp(260px, 34vw, 430px);

  display: grid;
  grid-template-columns:
    clamp(28px, 4vw, 38px)
    minmax(0, 1fr)
    clamp(28px, 4vw, 38px);
  gap: clamp(6px, 1vw, 10px);
  align-items: center;
}

.project-carousel-control {
  height: clamp(42px, 6vw, 58px);
}

.project-grid {
  display: grid;
  grid-auto-columns: var(--project-card-width);
  grid-auto-flow: column;
  gap: var(--project-carousel-gap);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.project-grid::-webkit-scrollbar {
  display: none;
}

@supports (width: 1cqw) {
  .project-grid {
    container-type: inline-size;
    grid-auto-columns: min(430px, calc((100cqw - var(--project-carousel-gap)) / 2));
  }
}

.project-card {
  --project-color: var(--accent);
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 6px solid var(--project-color);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
}

.project-card.role-working {
  --project-color: var(--muted);
}

.project-card.role-research {
  --project-color: var(--accent);
}

.project-card.role-lead {
  --project-color: var(--gold);
}

.project-topline {
  justify-content: flex-start;
}

.project-topline time {
  margin-left: auto;
}

.project-type-label {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 7px;
  line-height: 1;
}

.project-card .record-topline span,
.project-card .record-topline time {
  color: var(--project-color);
}

.project-card h3 {
  color: var(--text);
}

.project-card p {
  margin-bottom: 8px;
  color: #3e4845;
}

.project-meta-details {
  margin-top: 12px;
}

.project-meta-details summary {
  display: none;
}

.project-meta-details .meta-list {
  margin-top: 0;
}

.project-carousel-shell.is-compact-projects .project-meta-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.project-carousel-shell.is-compact-projects .project-meta-details summary {
  display: list-item;
  color: var(--project-color);
  font-size: 0.84rem;
  font-weight: 850;
  cursor: pointer;
}

.project-carousel-shell.is-compact-projects .project-meta-details .meta-list {
  margin-top: 10px;
}

/* Teaching workload charts */
.teaching-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
  margin-bottom: 16px;
}

.teaching-hours-card {
  display: flex;
  min-width: 0;
  min-height: 320px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.teaching-hours-card .chart-heading {
  margin-bottom: 10px;
}

.teaching-hours-card .chart-heading span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.teaching-hours-card .chart-heading h3 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 1.35rem;
}

.teaching-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.teaching-chart-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.teaching-chart-legend i {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--org-color);
}

.teaching-year-bars {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 0;
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-muted);
}

.teaching-year-bar {
  display: grid;
  height: 230px;
  min-width: 0;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  align-items: end;
  text-align: center;
}

.teaching-year-bar span,
.teaching-year-bar strong,
.teaching-degree-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.teaching-year-stack {
  display: flex;
  width: 100%;
  min-height: 8px;
  height: var(--bar-size);
  flex-direction: column-reverse;
  align-self: end;
  overflow: hidden;
  border-radius: 8px 8px 3px 3px;
  background: var(--surface);
}

.teaching-year-stack i {
  display: block;
  width: 100%;
  min-height: 2px;
  height: var(--segment-size);
  background: var(--org-color);
}

.teaching-year-bar strong {
  overflow-wrap: anywhere;
}

.teaching-degree-bars {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 0;
}

.teaching-degree-row {
  display: grid;
  gap: 7px;
}

.teaching-degree-row div {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}

.teaching-degree-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.18;
}

.teaching-degree-row span {
  flex: 0 0 auto;
}

.teaching-degree-stack {
  display: flex;
  width: var(--bar-size);
  min-width: 8px;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.teaching-degree-stack i {
  display: block;
  width: var(--segment-size);
  min-width: 2px;
  height: 100%;
  background: var(--org-color);
}

/* Teaching timeline */
.teaching-timeline-card,
.teaching-timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.teaching-timeline-card {
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 16px;
}

.teaching-timeline-legends {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.teaching-organization-legend,
.teaching-type-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.teaching-organization-legend span,
.teaching-type-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.teaching-organization-legend i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--org-color);
}

.teaching-type-legend i {
  width: 18px;
  height: 12px;
  border: 2px solid var(--muted);
  border-radius: 4px;
  background: var(--surface);
}

.teaching-type-legend .type-supervision {
  border-style: dashed;
  border-radius: 999px;
  background: repeating-linear-gradient(
    135deg,
    rgba(102, 112, 109, 0.14) 0 3px,
    transparent 3px 6px
  );
}

.teaching-timeline-scroll {
  max-height: 760px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  background: var(--surface-muted);
}

.teaching-timeline-scroll.is-zoomed {
  overflow-x: auto;
}

.teaching-timeline-frame {
  width: max-content;
  min-width: 100%;
  margin: 0 auto;
}

.teaching-timeline-stage {
  position: relative;
  width: var(--stage-width);
  max-width: none;
  min-height: var(--timeline-height);
  margin: 0 auto;
  transform-origin: top left;
}

.teaching-axis {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: var(--axis-left);
  width: 2px;
  border-radius: 999px;
  background: var(--text);
  z-index: 1;
}

.teaching-year-tick {
  position: absolute;
  top: var(--tick-top);
  left: calc(var(--axis-left) - 24px);
  z-index: 3;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  transform: translateX(-100%);
}

.teaching-year-tick::after {
  position: absolute;
  top: 0.72em;
  left: calc(100% + 8px);
  width: 16px;
  height: 1px;
  background: rgba(102, 112, 109, 0.34);
  content: "";
}

.teaching-timeline-connector {
  position: absolute;
  top: var(--connector-top);
  left: var(--connector-left);
  z-index: 1;
  width: var(--connector-width);
  height: 2px;
  background: var(--org-color);
}

.teaching-timeline-connector::after {
  position: absolute;
  top: -5px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--org-color);
  border-radius: 999px;
  background: var(--surface-muted);
  content: "";
}

/* Dynamic side-* and type-* classes come from the teaching timeline layout. */
.teaching-timeline-connector.side-right::after {
  left: -6px;
}

.teaching-timeline-connector.side-left::after {
  right: -6px;
}

.teaching-timeline-item {
  position: absolute;
  top: var(--item-top);
  left: var(--item-left);
  z-index: 2;
  width: var(--item-width);
  min-height: var(--item-height);
  border-color: var(--org-color);
  border-left: 5px solid var(--org-color);
  padding: 13px 14px;
}

.teaching-timeline-item.type-supervision {
  border-style: dashed;
  border-left-style: solid;
  border-radius: 18px 8px 18px 8px;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(102, 112, 109, 0.06) 0 6px,
      transparent 6px 12px
    ),
    var(--surface);
}

.teaching-event-kind {
  display: inline-flex;
  border-radius: 999px;
  margin-bottom: 7px;
  padding: 3px 7px;
  background: var(--surface-muted);
  color: var(--org-color);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.teaching-timeline-item.type-supervision .teaching-event-kind {
  border: 1px dashed var(--org-color);
  background: var(--surface);
}

.teaching-timeline-item h3 {
  margin-bottom: 6px;
  font-size: 1rem;
  line-height: 1.2;
}

.teaching-timeline-item p {
  margin-bottom: 5px;
  color: #3e4845;
  font-size: 0.86rem;
  line-height: 1.25;
}

.teaching-timeline-item time {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

/* Dissemination and media */
.dissemination-summary {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dissemination-total,
.channel-mix,
.publication-impact,
.media-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dissemination-total {
  padding: 18px;
}

.dissemination-total strong {
  display: block;
  color: var(--accent-strong);
  font-size: 2.4rem;
  line-height: 1;
}

.dissemination-total span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.channel-mix {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.channel-row {
  --channel-color: var(--accent);
  display: grid;
  grid-template-columns: minmax(130px, 0.34fr) minmax(120px, 1fr) 34px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

/* Dynamic category-* classes come from dissemination category ids. */
.category-articles {
  --channel-color: var(--conference);
  --channel-soft: rgba(138, 51, 66, 0.09);
}

.category-presentations {
  --channel-color: var(--gold);
  --channel-soft: rgba(166, 111, 33, 0.1);
}

.category-press {
  --channel-color: #2f7f9f;
  --channel-soft: rgba(47, 127, 159, 0.08);
}

.category-social {
  --channel-color: var(--accent);
  --channel-soft: rgba(15, 118, 110, 0.08);
}

.category-tv {
  --channel-color: #6d5fa3;
  --channel-soft: rgba(109, 95, 163, 0.09);
}

.channel-track {
  height: 11px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}

.channel-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--channel-color);
}

.channel-row strong {
  color: var(--accent-strong);
  text-align: right;
}

.dissemination-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.dissemination-filters button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.dissemination-filters button.active {
  border-color: var(--channel-color, var(--accent));
  background: var(--channel-soft, var(--accent-soft));
  color: var(--channel-color, var(--accent-strong));
}

.dissemination-layout {
  --dissemination-panel-height: clamp(420px, 44vw, 520px);
  --dissemination-impact-height: var(--dissemination-panel-height);

  display: grid;
  grid-template-columns: minmax(270px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.publication-impact {
  position: sticky;
  top: 74px;
  height: var(--dissemination-impact-height);
  max-height: var(--dissemination-impact-height);
  overflow-y: auto;
  padding: 16px;
}

.publication-impact h3 {
  margin-bottom: 12px;
  color: var(--accent-strong);
  font-size: 1rem;
}

.publication-impact-list {
  display: grid;
  gap: 10px;
}

.publication-impact article {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.publication-impact strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  line-height: 1.25;
}

.impact-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.impact-badges span {
  border: 1px solid var(--channel-color);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--channel-color);
  font-size: 0.72rem;
  font-weight: 850;
}

.media-carousel-shell {
  --media-carousel-gap: var(--card-gap);
  --media-carousel-columns: 2;

  display: grid;
  grid-template-columns:
    clamp(28px, 4vw, 38px)
    minmax(0, 1fr)
    clamp(28px, 4vw, 38px);
  gap: clamp(6px, 1vw, 10px);
  align-items: center;
  min-width: 0;
  min-height: var(--dissemination-panel-height);
}

.media-carousel-control {
  height: clamp(42px, 6vw, 58px);
}

.media-grid {
  display: grid;
  align-content: start;
  align-items: stretch;
  grid-auto-columns: calc(
    (100% - (var(--media-carousel-columns) - 1) * var(--media-carousel-gap))
    / var(--media-carousel-columns)
  );
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  gap: var(--media-carousel-gap);
  min-width: 0;
  min-height: var(--dissemination-panel-height);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.media-grid::-webkit-scrollbar {
  display: none;
}

.media-card {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  border-left: 6px solid var(--channel-color);
  padding: 18px;
  overflow-wrap: anywhere;
  scroll-snap-align: start;
}

.media-card[hidden] {
  display: none;
}

.media-card .record-topline span,
.media-card .record-topline time {
  color: var(--channel-color);
}

.media-card .record-topline span {
  border: 1px solid var(--channel-color);
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--channel-soft);
  line-height: 1;
}

.media-card h3 {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 10px;
  font-size: 1.04rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.media-card p {
  margin-bottom: 8px;
  color: #3e4845;
}

.media-source {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-weight: 800;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.media-details {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.media-details summary {
  display: list-item;
  color: var(--channel-color);
  font-size: 0.84rem;
  font-weight: 850;
  cursor: pointer;
}

.media-details-content {
  display: grid;
  gap: 0;
  margin-top: 9px;
}

.tags {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

/* Software projects and packages */
.software-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(220px, 0.45fr);
  gap: 18px;
  margin: 0 0 22px;
}

.software-timeline-card,
.language-card {
  min-width: 0;
}

.software-timeline-scroll {
  margin-top: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.software-timeline-scroll .timeline-years,
.software-timeline-scroll .timeline-rows {
  min-width: 760px;
}

.timeline-years {
  display: grid;
  gap: 6px;
  margin: 4px 0 10px;
  padding-left: 150px;
  padding-right: 150px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.timeline-years span {
  min-width: 0;
}

.timeline-rows {
  display: grid;
  gap: 8px;
  max-height: 240px;
  padding-right: 6px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.timeline-row {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr) 138px;
  grid-template-areas: "label-start track label-end";
  gap: 12px;
  align-items: center;
}

.timeline-label {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
}

.timeline-label-start {
  grid-area: label-start;
}

.timeline-label-end {
  grid-area: label-end;
  justify-self: end;
  text-align: right;
}

.timeline-track {
  grid-area: track;
  position: relative;
  height: 34px;
  border-radius: 6px;
  background: var(--surface-muted);
  overflow: visible;
}

.activity-pulse {
  position: absolute;
  left: var(--left);
  bottom: 50%;
  width: var(--width);
  min-width: 3px;
  height: var(--height);
  border-radius: 999px;
  background: var(--language-color);
  opacity: 0.86;
  transform: translateY(50%);
}

.timeline-marker {
  position: absolute;
  top: 3px;
  left: var(--left);
  width: 2px;
  height: 28px;
  background: var(--surface);
  transform: translateX(-4px);
}

.timeline-marker.created {
  border-left: 2px dotted var(--muted);
}

.timeline-marker.pushed {
  border-left: 2px solid var(--text);
}

.language-stack {
  display: flex;
  width: 100%;
  height: 18px;
  border-radius: 6px;
  background: var(--surface-muted);
  overflow: hidden;
}

.language-stack span {
  display: block;
  min-width: 2px;
}

.language-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.language-list div {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.language-list span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.language-list i {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.software-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.25fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.software-carousel {
  --software-carousel-gap: var(--card-gap);

  min-width: 0;
}

.software-carousel-control {
  display: none;
  height: clamp(42px, 6vw, 58px);
}

.software-snapshot {
  position: sticky;
  top: 68px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.software-snapshot h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.snapshot-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-muted);
}

.snapshot-grid strong {
  display: block;
  color: var(--accent-strong);
  font-size: 1.65rem;
  line-height: 1;
}

.snapshot-grid span,
.snapshot-detail span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.snapshot-detail {
  border-top: 1px solid var(--line);
  padding: 11px 0;
}

.snapshot-detail strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 0.96rem;
}

.snapshot-language-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.snapshot-language-key span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.snapshot-language-key i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.repo-list {
  display: grid;
  gap: 8px;
}

.software-layout.is-side-by-side .repo-carousel-shell {
  max-height: var(--software-snapshot-height);
}

.software-layout.is-side-by-side .repo-list {
  max-height: var(--software-snapshot-height);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.repo-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.22fr) minmax(260px, 1fr) minmax(280px, 0.42fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface);
}

.repo-row h3 {
  margin: 5px 0 2px;
  font-size: 1rem;
}

.repo-row h3 a {
  color: var(--accent-strong);
}

.repo-identity p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
}

.software-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.repo-summary p {
  display: -webkit-box;
  margin-bottom: 8px;
  color: #3e4845;
  font-size: 0.92rem;
  line-height: 1.42;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.repo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.repo-tags span {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.repo-stats {
  display: grid;
  gap: 7px;
}

.repo-statline,
.repo-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.repo-statline span {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  background: var(--surface-muted);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.repo-dates span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--card-gap);
}

.package-carousel-shell {
  display: grid;
  grid-template-columns:
    clamp(28px, 4vw, 38px)
    minmax(0, 1fr)
    clamp(28px, 4vw, 38px);
  gap: clamp(6px, 1vw, 10px);
  align-items: center;
}

.package-carousel-shell .software-carousel-control {
  display: block;
}

.package-carousel-shell .package-grid {
  display: grid;
  align-items: start;
  grid-auto-columns: 100%;
  grid-auto-flow: column;
  grid-template-columns: none;
  gap: var(--software-carousel-gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.package-carousel-shell .package-grid::-webkit-scrollbar {
  display: none;
}

.package-card {
  width: 100%;
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  scroll-snap-align: start;
}

.package-card h3 a,
.package-card h3 {
  color: var(--text);
}

.package-card p {
  margin-bottom: 8px;
  color: #3e4845;
}

.package-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.package-stat-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-muted);
}

.package-stat-grid strong {
  display: block;
  color: var(--accent-strong);
  font-size: 1.24rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.package-stat-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.package-download-chart {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-muted);
  overflow: hidden;
}

.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 118px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
}

.chart-plot {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.chart-grid-line {
  position: absolute;
  right: 0;
  left: 0;
  border-top: 1px solid rgba(102, 112, 109, 0.2);
  pointer-events: none;
}

.chart-grid-line.top {
  top: 0;
}

.chart-grid-line.middle {
  top: 59px;
}

.package-bars {
  display: flex;
  gap: 5px;
  align-items: end;
  height: 118px;
}

.package-bar {
  display: flex;
  flex: 1 1 0;
  flex-direction: column-reverse;
  min-width: 4px;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.package-bar span {
  display: block;
  min-height: 1px;
  opacity: 0.9;
}

.chart-x-axis {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  overflow: hidden;
}

.chart-x-axis span {
  flex: 1 1 0;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  writing-mode: vertical-rl;
}

.package-splits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 8px;
}

.package-splits h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.package-scroll-list {
  max-height: 176px;
  overflow-y: auto;
  padding-right: 4px;
}

.package-splits p {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-bottom: 0;
  padding-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.package-splits p + p {
  margin-top: 6px;
}

.package-splits strong {
  color: var(--accent-strong);
}

.package-splits span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.package-splits i {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.artifact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.artifact-list a {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 7px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}

.artifact-list strong {
  color: var(--accent-strong);
}

/* Organizations */
.organization-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.organization-summary article,
.organization-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.organization-summary article {
  padding: 16px;
}

.organization-summary strong {
  display: block;
  color: var(--accent-strong);
  font-size: 2rem;
  line-height: 1;
}

.organization-summary span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-weight: 850;
}

.organization-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.organization-card-metrics span {
  --relationship-color: var(--muted);
  border: 1px solid var(--relationship-color);
  border-radius: 999px;
  padding: 3px 7px;
  background: color-mix(in srgb, var(--relationship-color) 10%, var(--surface));
  color: var(--relationship-color);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}

/* Dynamic metric rel-* classes color organization chips. */
.organization-card-metrics .rel-education {
  --relationship-color: #2f7f9f;
}

.organization-card-metrics .rel-experience {
  --relationship-color: var(--accent);
}

.organization-card-metrics .rel-stays {
  --relationship-color: var(--conference);
}

.organization-card-metrics .rel-publications {
  --relationship-color: #5b63b7;
}

.organization-card-metrics .rel-teaching {
  --relationship-color: var(--teaching);
}

.organization-directory {
  display: grid;
  grid-template-columns: minmax(150px, 0.22fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.organization-country-tabs {
  position: sticky;
  top: 74px;
  display: grid;
  gap: 8px;
}

.organization-country-tabs button {
  border: 1px solid var(--line);
  border-left: 5px solid transparent;
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.organization-country-tabs button.active {
  border-color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.organization-country-tabs span,
.organization-country-tabs small {
  display: block;
}

.organization-country-tabs span {
  font-weight: 900;
}

.organization-country-tabs small {
  margin-top: 3px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.organization-country-panels {
  min-width: 0;
  max-height: clamp(520px, 72vh, 760px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.organization-country-panel.active {
  display: block;
}

.organization-country-heading {
  margin-bottom: 12px;
}

.organization-country-heading h3 {
  color: var(--accent-strong);
  font-size: 1.12rem;
}

.organization-city-group + .organization-city-group {
  margin-top: 18px;
}

.organization-city-group h4 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.organization-hierarchy-list {
  display: grid;
  gap: 10px;
}

.organization-card {
  position: relative;
  border-left: 6px solid color-mix(in srgb, var(--accent) 70%, var(--line));
  padding: 18px;
}

.organization-card.depth-1 {
  border-left-color: color-mix(in srgb, var(--accent) 48%, var(--line));
}

.organization-card.depth-2 {
  border-left-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.organization-card h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.organization-card p {
  margin-bottom: 8px;
  color: #3e4845;
}

.organization-path {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.organization-children {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-muted);
}

.organization-children-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.organization-children .organization-card {
  box-shadow: none;
}

/* Responsive layout */
@media (max-width: 760px) {
  .career-timeline-scroll {
    overflow-x: hidden;
  }

  .career-timeline-scroll.is-zoomed {
    overflow-x: auto;
  }

  .career-timeline {
    cursor: default;
    touch-action: pan-y;
  }
}

@media (max-width: 620px) {
  .nav {
    justify-content: flex-start;
  }

  .hero,
  .overview,
  .collaboration-layout,
  .software-visual-grid,
  .software-layout,
  .teaching-chart-grid,
  .dissemination-summary,
  .dissemination-layout,
  .organization-directory {
    grid-template-columns: 1fr;
  }

  .overview .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collaboration-map {
    min-height: clamp(300px, 76vw, 440px);
  }

  .dissemination-layout {
    --dissemination-impact-height: clamp(210px, 50vw, 260px);
  }

  .publication-impact {
    position: static;
    height: var(--dissemination-impact-height);
    max-height: var(--dissemination-impact-height);
    overflow-y: auto;
  }

  .software-snapshot {
    position: static;
  }

  .organization-country-tabs {
    position: static;
    grid-auto-columns: minmax(130px, 1fr);
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .organization-country-tabs button {
    min-width: 0;
  }

  .organization-country-panels {
    max-height: 560px;
  }

  .timeline-years {
    min-width: 760px;
    padding-left: 0;
    padding-right: 0;
  }

  .timeline-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "label-start label-end"
      "track track";
    gap: 4px;
  }

  .timeline-label-end {
    display: block;
  }

  .repo-carousel-shell {
    display: grid;
    grid-template-columns:
      clamp(28px, 4vw, 38px)
      minmax(0, 1fr)
      clamp(28px, 4vw, 38px);
    gap: clamp(6px, 1vw, 10px);
    align-items: center;
  }

  .repo-carousel-shell .software-carousel-control {
    display: block;
  }

  .repo-carousel-shell .repo-list {
    container-type: inline-size;
    display: grid;
    grid-auto-columns: min(390px, calc((100cqw - var(--software-carousel-gap)) / 2));
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: var(--software-carousel-gap);
    overflow-x: auto;
    overflow-y: hidden;
    padding-right: 0;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .repo-carousel-shell .repo-list::-webkit-scrollbar {
    display: none;
  }

  .repo-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    min-width: 0;
    scroll-snap-align: start;
  }

  .repo-summary p {
    -webkit-line-clamp: 3;
  }

  .career-organization-heading {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .project-role-legend {
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
    padding-top: 46px;
  }

  .hero-panel {
    padding: 20px;
  }

  .hero-identity {
    grid-template-columns: 1fr;
    gap: 14px;
    justify-items: center;
    text-align: center;
  }

  .profile-photo {
    width: 112px;
  }

  h1 {
    font-size: 3rem;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 560px) {
  .nav {
    padding: 12px 16px;
  }

  .hero,
  .section,
  .content-section {
    padding-right: 16px;
    padding-left: 16px;
  }

  h1 {
    font-size: 2.35rem;
  }

  .hero {
    padding-top: 34px;
  }

  .lead {
    font-size: 1rem;
  }

  .career-timeline-card,
  .teaching-timeline-card {
    margin-right: -8px;
    margin-left: -8px;
    padding: 10px;
  }

  .chart-card,
  .teaching-hours-card,
  .record-card,
  .project-card,
  .career-card,
  .media-card,
  .package-card,
  .organization-card {
    padding: 12px;
  }

  .record-topline,
  .software-meta {
    gap: 5px;
  }

  .teaching-hours-card {
    min-height: 280px;
  }

  .teaching-year-bars {
    gap: 8px;
    padding: 10px;
  }

  .teaching-year-bar {
    height: 190px;
  }

  .career-timeline-toolbar,
  .career-timeline-legend,
  .teaching-timeline-legends {
    padding-right: 2px;
    padding-left: 2px;
  }

  .career-reset {
    margin-left: 0;
  }

  .teaching-timeline-scroll {
    overflow-x: hidden;
    overscroll-behavior: contain;
  }

  .teaching-timeline-scroll.is-zoomed {
    overflow-x: auto;
  }

  .teaching-timeline-scroll.is-fit-width {
    max-height: none;
  }

  .teaching-timeline-frame {
    min-width: 0;
    margin-right: 0;
    margin-left: 0;
    overflow: visible;
  }

  .teaching-timeline-stage {
    max-width: none;
    margin-right: 0;
    margin-left: 0;
  }

  .package-download-chart {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
  }

  .chart-y-axis {
    font-size: 0.62rem;
  }

  .package-bars,
  .chart-y-axis {
    height: 104px;
  }

  .chart-grid-line.middle {
    top: 52px;
  }

  .chart-x-axis {
    gap: 3px;
    height: 34px;
    margin-top: 4px;
  }

  .chart-x-axis span {
    font-size: 0.52rem;
    line-height: 1;
  }

  .chart-x-axis span:nth-child(3n + 2),
  .chart-x-axis span:nth-child(3n + 3) {
    color: transparent;
  }

  h2 {
    font-size: 1.55rem;
  }
}
