@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-standard-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-standard-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}

:root {
  --film: #ecefea;
  --ink: #1f2a33;
  --ink-soft: #4a5761;
  --node: #ffffff;
  --edge: #0b7a83;
  --link: #086a73;
  --signal: #e3a21a;
  --rule: #c9d0cb;
  --gutter: clamp(1rem, 5vw, 4rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --film: #1a2228;
    --ink: #e4e8e3;
    --ink-soft: #a6b1ad;
    --node: #222c33;
    --edge: #3fb5be;
    --link: #6cc8cf;
    --signal: #e3a21a;
    --rule: #34414a;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--film);
  color: var(--ink);
  font: 400 1.0625rem/1.55 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
}

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: var(--gutter); top: -3rem;
  background: var(--ink); color: var(--film); padding: 0.5rem 0.75rem;
}
.skip:focus { top: 0.75rem; }

/* Navigation: the five pages as a tiny linear workflow */
.masthead { padding: 1.5rem var(--gutter) 0; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2rem; justify-content: space-between; }
.nav ol { display: flex; flex-wrap: wrap; gap: 0.5rem 0; margin: 0; padding: 0; list-style: none; }
.nav li { display: flex; align-items: center; }
.nav li:not(:last-child)::after {
  content: ""; width: 1.75rem; height: 2px; margin: 0 0.5rem; background: var(--edge);
}
.nav a {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--ink); text-decoration: none;
  font-stretch: 85%; font-weight: 550; font-size: 0.9375rem;
}
.nav a::before {
  content: ""; width: 0.7rem; height: 0.7rem; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--node);
}
.nav a:hover::before { border-color: var(--edge); }
.nav a[aria-current="page"]::before { background: var(--signal); border-color: var(--signal); }
.nav-thesis { font-stretch: 85%; font-size: 0.9375rem; font-weight: 550; }

/* Hero */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) var(--gutter) clamp(2.5rem, 6vw, 4.5rem); overflow: hidden; }
.hero h1 {
  margin: 0;
  font-weight: 860;
  font-stretch: 125%;
  font-size: clamp(2.6rem, 10.5vw, 8.25rem);
  line-height: 0.88;
  letter-spacing: -0.02em;
}
.hero h1 span { display: block; }
.tagline {
  margin: 1.25rem 0 0; max-width: 44ch;
  font-stretch: 80%; font-size: clamp(1.125rem, 2vw, 1.375rem); line-height: 1.35; color: var(--ink-soft);
}

/* The career as a workflow: 4 x 2 serpentine on wide screens, a single spine on narrow ones */
.flow {
  --gap-x: clamp(3.75rem, 4.75vw, 5rem);
  --gap-y: 5.5rem;
  list-style: none; margin: clamp(2.5rem, 6vw, 4rem) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 13rem));
  column-gap: var(--gap-x); row-gap: var(--gap-y);
}
.flow > li { position: relative; }
.flow a {
  display: flex; flex-direction: column; gap: 0.1rem; height: 100%;
  padding: 0.8rem 0.95rem 0.85rem;
  background: var(--node); color: var(--ink); text-decoration: none;
  border: 2px solid var(--ink); border-radius: 0.6rem;
  font-stretch: 75%; font-size: 0.9375rem; line-height: 1.3;
}
.flow a:hover { border-color: var(--edge); }
.flow b { font-weight: 750; font-stretch: 90%; font-size: 1.1875rem; }
.flow span { color: var(--ink-soft); }
.flow .yrs { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.flow .now a { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }

/* Edges: a line plus an arrowhead, drawn from the source node toward the next one */
.flow > li:not(:last-child)::after,
.flow > li:not(:last-child)::before { content: ""; position: absolute; background: var(--edge); }

/* row 1, left to right */
.flow > li:nth-child(-n+3)::after { top: 50%; left: 100%; width: var(--gap-x); height: 2px; transform-origin: left; }
.flow > li:nth-child(-n+3)::before {
  top: calc(50% - 6px); left: calc(100% + var(--gap-x) - 9px); width: 9px; height: 14px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
/* row 1 to row 2, downward */
.flow > li:nth-child(4)::after { left: 50%; top: 100%; width: 2px; height: var(--gap-y); transform-origin: top; }
.flow > li:nth-child(4)::before {
  left: calc(50% - 6px); top: calc(100% + var(--gap-y) - 9px); width: 14px; height: 9px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
/* row 2, right to left */
.flow > li:nth-child(5) { grid-area: 2 / 4; }
.flow > li:nth-child(6) { grid-area: 2 / 3; }
.flow > li:nth-child(7) { grid-area: 2 / 2; }
.flow > li:nth-child(8) { grid-area: 2 / 1; }
.flow > li:nth-child(n+5):nth-child(-n+7)::after { top: 50%; right: 100%; width: var(--gap-x); height: 2px; transform-origin: right; }
.flow > li:nth-child(n+5):nth-child(-n+7)::before {
  top: calc(50% - 6px); right: calc(100% + var(--gap-x) - 9px); width: 9px; height: 14px;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

/* The one orchestrated moment: nodes enable in sequence and each edge draws toward the next */
@media (prefers-reduced-motion: no-preference) {
  .flow > li { animation: enable 0.35s ease-out both; animation-delay: calc(var(--i) * 0.22s); }
  .flow > li:not(:last-child)::after { animation: draw 0.22s ease-in both; animation-delay: calc(var(--i) * 0.22s + 0.2s); }
  .flow > li:not(:last-child)::before { animation: enable 0.1s linear both; animation-delay: calc(var(--i) * 0.22s + 0.4s); }
  .flow > li:nth-child(1) { --i: 0; } .flow > li:nth-child(2) { --i: 1; }
  .flow > li:nth-child(3) { --i: 2; } .flow > li:nth-child(4) { --i: 3; }
  .flow > li:nth-child(5) { --i: 4; } .flow > li:nth-child(6) { --i: 5; }
  .flow > li:nth-child(7) { --i: 6; } .flow > li:nth-child(8) { --i: 7; }
  .flow > li:nth-child(4)::after { animation-name: draw-down; }
}
@keyframes enable { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw-down { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Body */
.body {
  display: grid; grid-template-columns: minmax(0, 40rem) minmax(0, 19rem);
  gap: clamp(2rem, 6vw, 6rem); align-items: start;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
  border-top: 2px solid var(--ink);
}
.bio p { margin: 0 0 1.1em; max-width: 66ch; }
.bio .lede { font-size: 1.3125rem; line-height: 1.45; font-stretch: 92%; font-weight: 450; }
.contact { position: sticky; top: 1.5rem; padding-left: 1.25rem; border-left: 2px solid var(--edge); }
.contact h2 { margin: 0 0 0.5rem; font-size: 1.0625rem; font-weight: 750; font-stretch: 110%; }
.contact p { margin: 0 0 1rem; font-size: 0.9375rem; color: var(--ink-soft); }
.resume {
  display: inline-block; padding: 0.55rem 0.9rem; border-radius: 0.6rem;
  background: var(--ink); color: var(--film); text-decoration: none; font-weight: 650; font-stretch: 90%;
}

.foot { padding: 1.5rem var(--gutter) 2.5rem; color: var(--ink-soft); font-stretch: 85%; }

@media (max-width: 62rem) {
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .body { grid-template-columns: minmax(0, 1fr); }
  .contact { position: static; }
}

/* Narrow screens: a vertical spine, every edge points down */
@media (max-width: 46rem) {
  .flow { grid-template-columns: minmax(0, 17rem); --gap-y: 2rem; }
  .flow > li:nth-child(n) { grid-area: auto; }
  .flow > li:nth-child(n):not(:last-child)::after {
    top: 100%; left: 1.5rem; right: auto; width: 2px; height: var(--gap-y); transform-origin: top;
  }
  .flow > li:nth-child(n):not(:last-child)::before {
    top: calc(100% + var(--gap-y) - 9px); left: calc(1.5rem - 6px); right: auto; width: 14px; height: 9px;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
  }
  .flow > li:nth-child(n):not(:last-child)::after { animation-name: draw-down; }
  .nav li:not(:last-child)::after { width: 0.9rem; margin: 0 0.35rem; }
}

@media print {
  .nav, .skip { display: none; }
  body { background: #fff; color: #000; }
}

/* Location maps: tinted OpenStreetMap streets behind each node, faded under the text.
   background-position matches the frame the maps were rendered for (place at 84% / 68%). */
.flow .map a {
  position: relative;
  background:
    linear-gradient(90deg, var(--node) 30%, rgb(255 255 255 / 0) 64%),
    var(--map) 84% 68% / cover no-repeat,
    var(--node);
}
.flow .map a::after {
  content: ""; position: absolute; left: 84%; top: 68%;
  width: 1.15rem; height: 1.15rem;
  border-radius: 50% 50% 50% 0;
  background: radial-gradient(circle at 50% 50%, var(--node) 0 26%, var(--edge) 28%);
  transform: translate(-50%, -115%) rotate(-45deg);
  box-shadow: 0 0 0 2px var(--node);
}
.flow .now a::after { background: radial-gradient(circle at 50% 50%, var(--node) 0 26%, var(--signal) 28%); }
.map-urbana   { --map: url("maps/urbana-light.svg"); }
.map-grenoble { --map: url("maps/grenoble-light.svg"); }
.map-leuven   { --map: url("maps/leuven-light.svg"); }
.map-bagneux  { --map: url("maps/bagneux-light.svg"); }
.map-redmond  { --map: url("maps/redmond-light.svg"); }
.map-chicago { --map: url("maps/chicago-light.svg"); }
.map-seattle { --map: url("maps/seattle-light.svg"); }
.map-cupertino { --map: url("maps/cupertino-light.svg"); }
@media (prefers-color-scheme: dark) {
  .flow .map a { background:
    linear-gradient(90deg, var(--node) 30%, rgb(34 44 51 / 0) 64%),
    var(--map) 84% 68% / cover no-repeat,
    var(--node); }
  .map-urbana   { --map: url("maps/urbana-dark.svg"); }
  .map-grenoble { --map: url("maps/grenoble-dark.svg"); }
  .map-leuven   { --map: url("maps/leuven-dark.svg"); }
  .map-bagneux  { --map: url("maps/bagneux-dark.svg"); }
  .map-redmond  { --map: url("maps/redmond-dark.svg"); }
  .map-chicago { --map: url("maps/chicago-dark.svg"); }
  .map-seattle { --map: url("maps/seattle-dark.svg"); }
  .map-cupertino { --map: url("maps/cupertino-dark.svg"); }
}

.foot .credit { display: block; margin-top: 0.25rem; }

/* Waypoints: shorter roles drawn as small stops on the edge between two nodes */
.via {
  position: absolute; margin: 0; padding: 0; list-style: none; z-index: 1;
  display: flex; justify-content: space-evenly;
  font-stretch: 75%; font-size: 0.8125rem; line-height: 1.2; color: var(--ink-soft);
}
.via li { position: relative; }
.via li::before {
  content: ""; position: absolute; width: 0.6rem; height: 0.6rem; border-radius: 50%;
  background: var(--film); border: 2px solid var(--edge); box-sizing: border-box;
}
.via .yrs { display: block; font-variant-numeric: tabular-nums; }
/* on a vertical edge: dots on the line, labels to the right */
.flow > li:nth-child(4) .via {
  top: 100%; left: 50%; height: var(--gap-y); flex-direction: column;
}
.flow > li:nth-child(4) .via li { padding-left: 0.85rem; }
.flow > li:nth-child(4) .via li::before { left: -0.3rem; top: 0.35rem; }
/* on a horizontal edge: dot on the line, label underneath */
.flow > li:nth-child(7) .via {
  top: 50%; right: 100%; width: var(--gap-x); justify-content: center; text-align: center;
}
.flow > li:nth-child(7) .via li { padding-top: 0.7rem; }
.flow > li:nth-child(7) .via li::before { left: calc(50% - 0.3rem); top: -0.3rem; }
@media (prefers-reduced-motion: no-preference) {
  .via { animation: enable 0.2s linear both; animation-delay: calc(var(--i) * 0.22s + 0.3s); }
}
@media (max-width: 46rem) {
  .flow > li:nth-child(n) .via {
    top: 100%; left: 1.5rem; right: auto; width: auto; height: var(--gap-y);
    flex-direction: column; justify-content: space-evenly; text-align: left;
  }
  .flow > li:nth-child(n) .via li { padding: 0 0 0 0.85rem; }
  .flow > li:nth-child(n) .via li::before { left: -0.3rem; top: 0.35rem; }
  .flow > li:has(.via) { margin-bottom: 3rem; }
  .flow > li:has(.via):not(:last-child)::after { height: calc(var(--gap-y) + 3rem); }
  .flow > li:has(.via):not(:last-child)::before { top: calc(100% + var(--gap-y) + 3rem - 9px); }
  .flow > li:has(.via) .via { height: calc(var(--gap-y) + 3rem); }
}

@media (max-width: 62rem) {
  .flow b { font-size: 1rem; }
  .flow a { padding: 0.7rem 0.75rem; }
}
/* Below desktop width: plain nodes. The maps get illegible and crowd the text; leaving them out also skips the download */
@media (max-width: 62rem) {
  .flow .map a, .flow .now a { background: var(--node); }
  .flow .map a::after { display: none; }
  .flow { --gap-y: 6.5rem; }
}
@media (max-width: 46rem) {
  .flow b { font-size: 1.125rem; }
  .flow { --gap-y: 2rem; }  /* undo the taller tablet gap; waypoint edges add their own room */
}

/* Phones: the page nav becomes a plain two-column list; connectors only make sense on one line */
@media (max-width: 46rem) {
  .nav { display: block; }
  .nav ol { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; }
  .nav li:not(:last-child)::after { display: none; }
  .nav-thesis { display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 0.6rem; }
}

/* ---------- Inner pages ---------- */
.page-title { padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(2rem, 4vw, 3rem); border-bottom: 2px solid var(--ink); }
.page-title h1 {
  margin: 0; font-weight: 860; font-stretch: 125%;
  font-size: clamp(2.6rem, 8vw, 5.75rem); line-height: 0.9; letter-spacing: -0.02em;
}
.page-title p { margin: 1rem 0 0; max-width: 52ch; color: var(--ink-soft); font-size: 1.125rem; }

/* Talks: a vertical workflow spine, newest first; the year marks the first talk of that year */
.timeline {
  list-style: none; margin: 0; padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
  max-width: calc(46rem + 2 * var(--gutter));
}
.timeline > li {
  display: grid; grid-template-columns: 4.25rem 2.25rem minmax(0, 1fr);
  position: relative; padding-bottom: 1.9rem;
}
.timeline > li::before {          /* the spine */
  content: ""; position: absolute; left: calc(4.25rem + 1.125rem - 1px); top: 0.55rem; bottom: -0.55rem;
  width: 2px; background: var(--edge);
}
.timeline > li:last-child::before { display: none; }
.timeline > li::after {           /* the activity node */
  content: ""; position: absolute; left: calc(4.25rem + 1.125rem - 0.4rem); top: 0.3rem;
  width: 0.8rem; height: 0.8rem; border-radius: 50%; box-sizing: border-box;
  background: var(--film); border: 2px solid var(--edge);
}
.timeline .yr {
  grid-column: 1; padding-top: 0.05rem;
  font-weight: 750; font-stretch: 75%; font-size: 1.0625rem; font-variant-numeric: tabular-nums;
}
.talk { grid-column: 3; max-width: 40rem; }
.talk-title { margin: 0; font-size: 1.1875rem; line-height: 1.3; font-weight: 650; font-stretch: 95%; }
.talk-title a { color: var(--ink); text-decoration-color: var(--edge); }
.talk-title a:hover { color: var(--link); }
.venue { margin: 0.3rem 0 0; color: var(--ink-soft); font-stretch: 85%; font-size: 0.9375rem; line-height: 1.45; }

.talk details { margin-top: 0.45rem; }
.talk summary {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; list-style: none;
  color: var(--link); font-weight: 600; font-stretch: 85%; font-size: 0.9375rem;
}
.talk summary::-webkit-details-marker { display: none; }
.talk summary::before {
  content: ""; width: 0.45rem; height: 0.45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s;
}
.talk details[open] summary::before { transform: rotate(45deg); }
.talk details p { margin: 0.5rem 0 0; max-width: 66ch; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { .talk summary::before { transition: none; } }

@media (max-width: 46rem) {
  .timeline > li { grid-template-columns: 1.75rem minmax(0, 1fr); }
  .timeline > li::before { left: calc(0.4rem - 1px); }
  .timeline > li::after { left: 0; }
  .timeline .yr { grid-column: 2; grid-row: 1; padding: 0 0 0.15rem; }
  .timeline .yr.same { display: none; }
  .talk { grid-column: 2; }
}
@media print {
  .talk details > p { display: block; }
}

/* Sections on inner pages (Writings, Innovation) */
.section { padding: clamp(2rem, 5vw, 3rem) var(--gutter) 0; }
.section:last-child { padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.section > h2 {
  margin: 0 0 1.5rem; font-weight: 800; font-stretch: 112%;
  font-size: clamp(1.375rem, 2.6vw, 1.75rem); line-height: 1.15;
}
.section > h2 a { color: inherit; text-decoration-color: var(--edge); }
.section .timeline { padding: 0; }
.section + .section { margin-top: 0.5rem; border-top: 1px solid var(--rule); }
.talk-title cite, .venue cite { font-style: italic; }

/* Beyond text: the spine without the year column */
.timeline.plain > li { grid-template-columns: 2.25rem minmax(0, 1fr); }
.timeline.plain > li::before { left: calc(1.125rem - 1px); }
.timeline.plain > li::after { left: calc(1.125rem - 0.4rem); }
.timeline.plain .talk { grid-column: 2; }

/* Innovation: number column in condensed tabular figures, two columns when there is room */
.patents { list-style: none; margin: 0; padding: 0; max-width: 72rem; columns: 2 26rem; column-gap: 3.5rem; }
.patents li {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem;
  break-inside: avoid; padding: 0.55rem 0; border-top: 1px solid var(--rule); line-height: 1.4;
}
.patents .num {
  font-stretch: 75%; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--link);
  padding-top: 0.05rem;
}
.patents .num a { color: inherit; text-decoration-thickness: 1px; }
.patents .num a:hover { text-decoration-thickness: 2px; }
@media (max-width: 46rem) {
  .timeline.plain > li { grid-template-columns: 1.75rem minmax(0, 1fr); }
  .timeline.plain > li::before { left: calc(0.4rem - 1px); }
  .timeline.plain > li::after { left: 0; }
  .patents li { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
}
