@font-face {
  font-family: "Roboto";
  src: url("assets/roboto-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-alt: #f7f9fb;
  --text: #1c1c1c;
  --muted: #5d6670;
  --accent: #0091be;
  --accent-hover: #006e91;
  --stripe: #fad027;
  --banner: #86a7ff;
  --banner-text: #0d1b3d;
  --line: #e6e9ec;
  --footer: #3c3838;
  --footer-text: #fefefe;
  --header-h: 72px;
  --map-sea: #dbe7ff;
  --map-land: #f4f1e8;
  --map-border: #c9c3b3;
  --map-route: #c0392b;
  --card-bg: rgba(255,255,255,.95);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --bg-alt: #1b1f24;
    --text: #e8eaed;
    --muted: #a3acb6;
    --accent: #4fc3f7;
    --accent-hover: #8fdcff;
    --line: #2b3138;
    --footer: #0e1013;
    --map-sea: #1d2a44;
    --map-land: #2c3440;
    --map-border: #46505e;
    --map-route: #ff6b5b;
    --card-bg: rgba(27,31,36,.95);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }

body {
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; transition: color .3s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 5px solid var(--stripe);
}
.header .container {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { font-size: 26px; font-weight: 400; color: var(--text); white-space: nowrap; }
.logo a { color: inherit; }
.logo a:hover { text-decoration: none; }
.menu { display: flex; gap: 22px; list-style: none; }
.menu a { color: var(--text); }
.menu a:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 720px) {
  :root { --header-h: 96px; }
  .header .container { flex-direction: column; justify-content: center; gap: 4px; }
  .logo { font-size: 22px; }
  .menu { gap: 16px; font-size: 15px; flex-wrap: wrap; justify-content: center; }
}

/* Banner */
.banner {
  margin-top: var(--header-h);
  /* Maple-leaf tile from the original site, over its blue. */
  background: url("assets/leaves.png") top / 700px auto repeat fixed var(--banner);
  color: var(--banner-text);
  text-shadow: 0 0 6px #fff, 0 0 14px #fff, 0 0 22px rgba(255,255,255,.8);
  padding: 56px 0;
}
.banner .container { display: flex; align-items: center; gap: 40px; }
.banner img {
  width: 220px; border-radius: 50%; aspect-ratio: 1; object-fit: cover;
  border: 4px solid #fff; flex-shrink: 0;
}
.banner h2 { font-size: 40px; font-style: italic; font-weight: bold; line-height: 1.2; }
.banner p { margin-top: 12px; font-size: 19px; opacity: .9; }
@media (max-width: 720px) {
  .banner { padding: 36px 0; }
  .banner .container { flex-direction: column; text-align: center; gap: 20px; }
  .banner img { width: 160px; }
  .banner h2 { font-size: 30px; }
}

/* Sections */
section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 -8px 20px var(--line) inset;
}
section:nth-of-type(even) { background: var(--bg-alt); }
.section-title {
  font-size: 32px; font-weight: 400;
  padding-bottom: 12px; margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
h3 { font-size: 21px; font-weight: 400; margin: 28px 0 12px; }
h3:first-child { margin-top: 0; }
p + p { margin-top: 14px; }

/* About */
.about-text { max-width: 820px; }

/* Journey map */
.journey-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 40px; }
.journey-head h3 { margin: 0; }
.journey-play {
  font: inherit; font-size: 14px; cursor: pointer;
  padding: 6px 14px; border-radius: 4px;
  color: var(--accent); background: transparent; border: 1px solid var(--accent);
}
.journey-play:hover { background: var(--accent); color: #fff; }
.journey-hint { font-size: 14px; color: var(--muted); margin: 4px 0 16px; }

.journey { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .journey { grid-template-columns: 1fr; } }

.journey-map { position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
#career-map { display: block; width: 100%; height: auto; }
.map-sea { fill: var(--map-sea); }
.map-land { fill: var(--map-land); }
.map-borders { fill: none; stroke: var(--map-border); stroke-width: .6; }
.map-arc {
  fill: none; stroke: var(--map-route); stroke-width: 3; stroke-linecap: round;
  transition: stroke-dashoffset .9s ease-in-out;
}
.map-pin { cursor: pointer; outline: none; }
.map-pin .pin-halo { fill: var(--accent); opacity: 0; transition: opacity .3s; }
.map-pin .pin-dot { fill: var(--bg); stroke: var(--map-route); stroke-width: 3; transition: fill .3s; }
.map-pin text {
  font-size: 17px; fill: var(--text); font-style: italic;
  paint-order: stroke; stroke: var(--map-land); stroke-width: 4px; stroke-linejoin: round;
}
.map-pin.is-past .pin-dot { fill: var(--map-route); }
.map-pin.is-active .pin-dot { fill: var(--stripe); }
.map-pin.is-active .pin-halo { opacity: .3; animation: pulse 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.map-pin.is-active text { font-weight: bold; }
.map-pin:focus-visible .pin-dot { stroke: var(--accent); stroke-width: 4; }
@keyframes pulse { from { transform: scale(.6); opacity: .45; } to { transform: scale(1.5); opacity: 0; } }

.journey-map { container-type: inline-size; }
.map-card {
  padding: 12px 16px;
  background: var(--card-bg);
  border-top: 1px solid var(--line);
  border-left: 4px solid var(--stripe);
  font-size: 14px; line-height: 1.5;
}
/* On wide maps, float the card over the empty Atlantic. */
@container (min-width: 620px) {
  .map-card {
    position: absolute; left: 36%; width: 32%; bottom: 14px;
    border-top: none; border-radius: 6px;
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
  }
}
.map-card span, .map-card strong { display: block; }
.card-when { color: var(--muted); font-size: 13px; }
.card-title { font-size: 16px; }
.card-role { color: var(--accent); }
.card-detail { margin-top: 6px; }

.journey-steps { list-style: none; border-left: 3px solid var(--line); }
.journey-steps li { margin: 0; }
.journey-steps button {
  all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%;
  padding: 10px 12px 10px 18px; position: relative; line-height: 1.4;
  border-radius: 0 4px 4px 0;
}
.journey-steps button::before {
  content: ""; position: absolute; left: -9px; top: 16px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--map-route);
}
.journey-steps button.is-past::before { background: var(--map-route); }
.journey-steps button.is-active { background: var(--bg-alt); box-shadow: inset 3px 0 0 var(--stripe); }
.journey-steps button.is-active::before { background: var(--stripe); }
.journey-steps button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.journey-steps .when { display: block; font-size: 13px; color: var(--muted); }
.journey-steps .where { display: block; font-weight: bold; }
.journey-steps .what { display: block; font-size: 15px; }

/* Publications */
.pub-note { color: var(--muted); margin-bottom: 24px; }
.pubs { padding-left: 36px; }
.pubs li {
  padding: 12px 0 12px 8px;
  border-bottom: 1px solid var(--line);
  line-height: 1.6;
}
.pubs li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.pubs .title { display: block; font-weight: bold; }
.pubs .authors { display: block; font-size: 15px; color: var(--muted); }
.pubs .authors b { color: var(--text); }
.pubs .venue { font-size: 15px; }
.tag {
  display: inline-block; font-size: 12px; line-height: 1;
  padding: 3px 7px; margin-left: 6px; border-radius: 3px;
  background: var(--stripe); color: #222; vertical-align: 2px;
}

/* Links / contact */
.links { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin-top: 20px; }
.links a {
  display: inline-block; padding: 8px 16px;
  border: 1px solid var(--accent); border-radius: 4px;
}
.links a:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* Footer */
footer { background: var(--footer); color: var(--footer-text); padding: 24px 0; font-size: 15px; }
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
footer a { color: #fff; }

/* Keep city labels legible when the map is phone-sized. */
@container (max-width: 520px) {
  .map-pin text { font-size: 30px; stroke-width: 6px; }
  .map-pin .pin-dot { stroke-width: 5; }
}
