:root {
  color-scheme: light;
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-muted: #f4f4f2;
  --text: #171717;
  --muted: #5f5f5a;
  --border: #d8d8d2;
  --accent: #111111;
  --max-width: 1100px;
  --narrow-width: 820px;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  --header-bg: rgba(250, 250, 249, 0.86);
  --landscape-blue: #2f64a6;
  --landscape-teal: #28746b;
  --landscape-gold: #8d6418;
  --landscape-line: #b9b9b0;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101111;
  --surface: #161818;
  --surface-muted: #131515;
  --text: #f5f5f3;
  --muted: #b7b7b0;
  --border: #2d3131;
  --accent: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --header-bg: rgba(16, 17, 17, 0.86);
  --landscape-blue: #85b5ef;
  --landscape-teal: #81c8b4;
  --landscape-gold: #e9c075;
  --landscape-line: #606761;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #101111;
    --surface: #161818;
    --surface-muted: #131515;
    --text: #f5f5f3;
    --muted: #b7b7b0;
    --border: #2d3131;
    --accent: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --header-bg: rgba(16, 17, 17, 0.86);
    --landscape-blue: #85b5ef;
    --landscape-teal: #81c8b4;
    --landscape-gold: #e9c075;
    --landscape-line: #606761;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

img {
  max-width: 100%;
  display: block;
}

strong {
  font-weight: 700;
}

/* Links */
a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

.container.narrow,
.narrow {
  width: min(calc(100% - 2rem), var(--narrow-width));
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
}

.header-inner {
  position: relative;
  display: grid;
  gap: 1.25rem;
  padding: 1.4rem 0;
}

.header-inner.has-theme-toggle .eyebrow {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline-end: 3.75rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  font-size: 3.1rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.15rem;
}

h4 {
  font-size: 1.1rem;
}

.positioning {
  margin: 1rem 0 0;
  max-width: 55rem;
  font-size: 1.08rem;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem 1.2rem;
}

.header-nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
}

.header-quick-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-left: auto;
}

.header-quick-links .button {
  min-height: 2.25rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.92rem;
}

.theme-toggle {
  position: absolute;
  top: 1.4rem;
  inset-inline-end: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--surface-muted);
  border-color: var(--muted);
}

.theme-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

.theme-toggle:focus-visible,
.landscape-node:focus-visible,
.landscape-preview-link:focus-visible,
.landscape-preview-close:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  color: var(--text);
}

.hero {
  padding: 3.25rem 0 2.25rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.hero-side {
  display: grid;
  gap: 1rem;
}

.profile-photo {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-intro {
  margin: 0;
  font-size: 1.08rem;
  max-width: 46rem;
  text-align: justify;
  text-justify: inter-word;
}

.section {
  padding: 1.5rem 0 3.5rem;
}

.section-muted {
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-heading {
  margin-bottom: 1.35rem;
}

.section-heading-note {
  display: inline-block;
  color: var(--muted);
  font-size: 0.55em;
  font-weight: 400;
}

.section-heading p {
  margin: 0.8rem 0 0;
  color: var(--muted);
  max-width: 46rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.single-card-grid {
  grid-template-columns: 1fr;
}

.landscape-section {
  padding-top: 0.5rem;
}

.research-landscape {
  --node-color: var(--landscape-blue);
}

.landscape-map {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1100 / 540;
}

.landscape-art,
.landscape-nodes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.landscape-art {
  z-index: -1;
  pointer-events: none;
  overflow: visible;
}

.landscape-foundational,
[data-group="foundational"] {
  --node-color: var(--landscape-blue);
}

.landscape-science,
[data-group="science"] {
  --node-color: var(--landscape-teal);
}

.landscape-llms,
[data-group="llms"] {
  --node-color: var(--landscape-gold);
}

.landscape-region {
  fill: var(--node-color);
  fill-opacity: 0.065;
  stroke: var(--node-color);
  stroke-opacity: 0.42;
  stroke-width: 1;
  stroke-dasharray: 4 7;
}

.landscape-edge {
  stroke: var(--landscape-line);
  stroke-width: 1;
  stroke-opacity: 0.55;
  stroke-dasharray: 2 6;
  transition: stroke-opacity 160ms ease;
}

.landscape-edge.is-connected {
  stroke: var(--text);
  stroke-opacity: 0.8;
  stroke-width: 1.4;
}

.landscape-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3rem;
  max-width: 15rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--node-color);
  border-radius: 999px;
  background: var(--bg);
  color: var(--node-color);
  font-size: clamp(0.7rem, 1.15vw, 0.86rem);
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow 160ms ease, background-color 160ms ease;
}

.landscape-topic {
  font-size: clamp(0.8rem, 1.25vw, 0.96rem);
  font-weight: 500;
}

.landscape-paper {
  background: var(--node-color);
  color: var(--surface);
  font-size: clamp(0.68rem, 1.05vw, 0.8rem);
  font-weight: 650;
}

.landscape-node:hover,
.landscape-node.is-active {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--node-color) 16%, transparent);
}

.landscape-node.is-related {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--node-color) 22%, transparent);
}

.landscape-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 10rem;
  margin-top: 0.75rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--node-color);
  border-radius: var(--radius);
  background: var(--surface);
}

.landscape-preview-meta {
  margin: 0 0 0.4rem;
  padding-inline-end: 2.75rem;
  color: var(--node-color);
  font-size: 0.78rem;
  font-weight: 650;
}

.landscape-preview-title {
  padding-inline-end: 2.75rem;
  font-size: 1.02rem;
  line-height: 1.4;
}

.landscape-preview-summary {
  max-width: 49rem;
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.landscape-preview-link {
  flex-shrink: 0;
  min-height: 2.25rem;
}

.landscape-preview-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.landscape-preview-close {
  position: absolute;
  top: 0.6rem;
  inset-inline-end: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.landscape-preview-close:hover {
  background: var(--surface-muted);
  border-color: var(--muted);
}

.landscape-preview-close svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.landscape-help-touch {
  display: none;
}

.publication-entry[id] {
  scroll-margin-top: 1.5rem;
}

.publication-list {
  display: grid;
  gap: 1.55rem;
}

.publication-groups {
  display: grid;
  gap: 2rem;
}

.publication-group + .publication-group {
  padding-top: 1.65rem;
  border-top: 1px solid var(--border);
}

.publication-group-title {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
}

.publication-group-note {
  font-weight: 600;
  text-transform: none;
}

.publication-entry {
  display: grid;
  grid-template-columns: 8.7rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.publication-badge {
  display: grid;
  gap: 0.02rem;
  justify-self: start;
  min-width: 7.8rem;
  margin-top: 0.1rem;
  padding: 0.2rem 0.7rem 0.24rem;
  border-radius: 4px;
  background: #a66f16;
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.publication-badge-note {
  font-size: 0.68rem;
  font-weight: 650;
}

.publication-main h3 {
  margin-bottom: 0.3rem;
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.35;
}

.publication-authors,
.publication-venue {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.45;
}

.publication-authors {
  color: var(--text);
}

.publication-venue {
  color: var(--text);
}

.self-author {
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.publication-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.publication-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 1.65rem;
  padding: 0.24rem 0.7rem;
  border: 1px solid var(--text);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.publication-action:hover,
.publication-action:focus-visible {
  background: var(--text);
  color: var(--bg);
}

.applied-badge {
  min-width: 8.4rem;
}

.experience-education-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1.25rem;
  align-items: start;
}

.card .experience-education-title {
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
}

.experience-education-grid .publication-main h4 {
  margin-bottom: 0.3rem;
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.35;
}

.employment-card .publication-entry {
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.employment-card .education-detail-panel {
  text-align: left;
}

.education-card .publication-entry,
.education-card .education-extra-item {
  grid-template-columns: 5.2rem minmax(0, 1fr);
}

.education-thesis-list {
  gap: 1.35rem;
}

.education-badge {
  min-width: 5.2rem;
}

.card .education-meta {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.card .education-overlap-note {
  font-size: 0.86rem;
}

.education-detail-row {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.education-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.education-toggle {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.education-toggle[aria-expanded="true"] {
  background: var(--text);
  color: var(--bg);
}

.education-detail-panels {
  display: grid;
  max-width: 50rem;
}

.education-detail-panels .education-detail-panel {
  margin-top: 0;
}

.education-title-body {
  max-width: 42rem;
  text-align: left;
}

.education-extra {
  margin-top: 1.55rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.card .education-extra h4 {
  margin-bottom: 0.55rem;
  font-size: 1rem;
}

.education-extra-list {
  display: grid;
  gap: 0.85rem;
}

.education-extra-item {
  display: grid;
  grid-template-columns: 8.7rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.education-extra-badge {
  min-width: 5.2rem;
  opacity: 0.86;
}

.education-extra-item h5 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.35;
}

.card .education-extra-item p {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.applied-details {
  margin-top: 0.55rem;
}

.applied-details summary {
  width: max-content;
  cursor: pointer;
  list-style: none;
}

.applied-details summary::-webkit-details-marker {
  display: none;
}

.applied-details summary::marker {
  content: "";
}

.applied-details-body {
  margin-top: 0.55rem;
  max-width: 50rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--text);
  background: var(--surface);
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: justify;
  text-justify: inter-word;
}

.applied-details-body p {
  margin: 0;
}

.stack {
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.full-width-card {
  grid-column: 1 / -1;
}

.card h3,
.card h4 {
  margin-bottom: 0.7rem;
}

.card p,
.card ul {
  margin: 0;
}

.card p + p {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.paper-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.katex {
  font-size: 1em;
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.15rem 0;
}

.post-main {
  padding: 3rem 0 4rem;
}

.post-shell {
  width: min(calc(100% - 2rem), var(--narrow-width));
  margin: 0 auto;
}

.post-heading {
  margin-bottom: 1.25rem;
}

.post-heading h1 {
  margin-top: 0.45rem;
  font-size: 2.8rem;
}

.post-summary {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.author-list {
  display: grid;
  gap: 0.35rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.author-name {
  color: var(--text);
  font-weight: 650;
}

.author-links {
  white-space: nowrap;
}

.post-note {
  margin: 1rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-left: 4px solid #a66f16;
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.post-note p {
  margin: 0;
}

.post-note strong,
.post-note code {
  color: var(--text);
}

.post-note code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.writing-note {
  margin-bottom: 1rem;
}

.post-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 4vw, 2rem);
}

.post-content h2 {
  margin: 2rem 0 0.6rem;
  font-size: 1.35rem;
}

.post-content h2:first-child {
  margin-top: 0;
}

.post-content p,
.post-content ul {
  margin: 0 0 1rem;
}

.post-figure {
  margin: 1.35rem 0;
}

.post-figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 0.75rem;
}

.post-figure.narrow img {
  width: min(100%, 24rem);
  margin: 0 auto;
}

.post-figure.compact img {
  width: min(100%, 16rem);
  margin: 0 auto;
}

.post-figure.adversarial-figure img {
  width: min(100%, 26rem);
  margin: 0 auto;
}

.post-figure.turing-setup-figure img {
  width: min(100%, 50%);
  margin: 0 auto;
}

.post-figure.cantor-construction-figure img {
  width: 70%;
  margin: 0 auto;
}

.post-figure figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.post-content p:last-child,
.post-content ul:last-child {
  margin-bottom: 0;
}

.bibtex {
  margin-top: 1.8rem;
}

.bibtex pre {
  margin: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) / 2);
  background: var(--surface-muted);
  padding: 1rem;
  line-height: 1.45;
  font-size: 0.86rem;
}

.bibtex code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

.more-work-card {
  margin-top: 1rem;
}

.list-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.link-row.compact {
  margin-top: auto;
}

.button,
.text-link {
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
}

.button:hover,
.button:focus-visible {
  border-color: var(--text);
}

.text-link {
  color: var(--muted);
  font-weight: 600;
}

ul {
  padding-left: 1.15rem;
}

.clean-list li + li,
.compact-list li + li,
li + li {
  margin-top: 0.35rem;
}

.site-footer {
  padding: 1.4rem 0 2.5rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .hero-grid,
  .card-grid,
  .experience-education-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .hero-side .profile-photo {
    width: min(100%, 12rem);
    justify-self: center;
  }

  .publication-action {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    line-height: 1.2;
    white-space: normal;
    text-align: center;
  }

  .landscape-map {
    aspect-ratio: auto;
  }

  .landscape-art {
    display: none;
  }

  .landscape-nodes {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    padding: 0 0 0.75rem;
  }

  .landscape-node {
    position: static;
    transform: none;
    width: 100%;
    max-width: none;
    min-height: 2.75rem;
    font-size: 0.8rem;
    white-space: normal;
  }

  .landscape-topic {
    grid-column: 1 / -1;
    justify-self: start;
    width: auto;
    margin-top: 0.8rem;
    font-size: 1rem;
  }

  .landscape-preview {
    align-items: start;
    flex-direction: column;
    gap: 0.8rem;
  }
}

@media (max-width: 760px), (hover: none) {
  .landscape-help-hover {
    display: none;
  }

  .landscape-help-touch {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .landscape-node,
  .landscape-edge {
    transition: none;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 1rem 0;
  }

  .theme-toggle {
    top: 1rem;
  }

  .hero {
    padding-top: 2rem;
  }

  .hero-intro {
    text-align: left;
  }

  .section {
    padding-bottom: 2.5rem;
  }

  .publication-list {
    gap: 1.45rem;
  }

  .publication-entry,
  .education-extra-item,
  .experience-education-grid .publication-entry,
  .experience-education-grid .education-extra-item {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .publication-badge {
    min-width: 7.8rem;
  }

  .post-figure.turing-setup-figure img {
    width: 100%;
  }

  .card {
    padding: 1rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  .post-heading h1 {
    font-size: 2.2rem;
  }
}
/* Two lanes share the central axis, as in the CV. */
.career-timeline {
  margin: 2rem 0 0;
}

.career-timeline-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.career-timeline-heading h3 {
  margin: 0;
  font-size: 1.1rem;
}

.career-timeline-scroll {
  overflow-x: auto;
  padding: 0.5rem 0 0.4rem;
}

.career-timeline-scroll:focus-visible {
  outline: 2px solid var(--landscape-blue);
  outline-offset: 3px;
}

.career-timeline-chart {
  position: relative;
  min-width: 950px;
  height: 225px;
}

.career-timeline-lane {
  position: absolute;
  left: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.career-timeline-lane-education {
  top: 85px;
  color: var(--landscape-blue);
}

.career-timeline-lane-employment {
  top: 175px;
  color: var(--muted);
}

.career-timeline-plot {
  position: absolute;
  inset: 0 1.5rem 0 7rem;
}

.career-timeline-axis {
  position: absolute;
  top: 132px;
  right: 0;
  left: 0;
  border-top: 2px solid var(--muted);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
}

.career-timeline-axis span {
  position: absolute;
  top: 0;
  left: var(--position);
  padding-top: 9px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.career-timeline-axis span::before {
  position: absolute;
  top: -3px;
  left: 50%;
  height: 6px;
  border-left: 1px solid var(--muted);
  content: "";
}

.career-timeline-axis span.career-timeline-minor {
  padding: 0;
}

.career-timeline-axis span.career-timeline-minor::before {
  top: -2px;
  height: 4px;
}

.career-timeline-axis span.career-timeline-now {
  transform: translateX(-100%);
}

.career-timeline-axis span.career-timeline-now::before {
  left: 100%;
}

/* The dotted boundaries mark the funded Bocconi period across both lanes. */
.career-timeline-funded {
  position: absolute;
  top: 101px;
  left: var(--start);
  width: var(--length);
  height: 72px;
  border-right: 1px dotted var(--muted);
  border-left: 1px dotted var(--muted);
  pointer-events: none;
}

.career-timeline-funded::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  border-bottom: 1px dashed var(--muted);
  content: "";
}

.career-timeline-period {
  position: absolute;
  top: 72px;
  left: var(--start);
  width: var(--length);
  height: 38px;
  color: var(--landscape-blue);
  text-decoration: none;
}

/* The dashed interval and its end caps remain separate from the axis. */
.career-timeline-period::before {
  position: absolute;
  top: 26px;
  right: 0;
  left: 0;
  height: 7px;
  border-right: 1px solid currentColor;
  border-left: 1px solid currentColor;
  background: repeating-linear-gradient(to right, currentColor 0 5px, transparent 5px 8px) center / 100% 1px no-repeat;
  content: "";
}

.career-timeline-period span {
  position: absolute;
  top: 0;
  left: 50%;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  transform: translateX(-50%);
}

.timeline-flag {
  display: inline-block;
  width: 1.2em;
  height: 0.8em;
  vertical-align: -0.03em;
  border: 1px solid rgba(128, 128, 128, 0.5);
}

.timeline-flag-pl {
  background: linear-gradient(to bottom, #fff 50%, #dc143c 50%);
}

.timeline-flag-fr {
  background: linear-gradient(to right, #002395 33.33%, #fff 33.33%, #fff 66.67%, #ed2939 66.67%);
}

.timeline-flag-it {
  background: linear-gradient(to right, #009246 33.33%, #fff 33.33%, #fff 66.67%, #ce2b37 66.67%);
}

.timeline-flag-at {
  background: linear-gradient(to bottom, #ed2939 33.33%, #fff 33.33%, #fff 66.67%, #ed2939 66.67%);
}

.career-timeline-bocconi span {
  left: calc(100% + 10px);
  transform: none;
}

.career-timeline-bocconi span::before {
  position: absolute;
  top: 26px;
  left: -10px;
  width: 17px;
  border-top: 1px solid currentColor;
  content: "";
  transform: rotate(-55deg);
  transform-origin: left center;
}

.career-timeline-exchange {
  top: 24px;
  color: var(--landscape-blue);
}

.career-timeline-work {
  top: 169px;
  color: var(--muted);
}

.career-timeline-work::before {
  top: 0;
}

.career-timeline-work span {
  top: 13px;
}

.career-timeline-period:hover span,
.career-timeline-period:focus-visible span {
  background: var(--surface-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.career-timeline-period:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  z-index: 1;
}

[id^="timeline-"]:target:not(#timeline-heading) {
  outline: 2px solid var(--landscape-blue);
  outline-offset: 5px;
  scroll-margin-top: 6rem;
}

.employment-card .career-internship {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.career-internship .education-detail-actions {
  margin-top: 0.55rem;
}
