/* Edward Deleu · edeleu.com
   Shared styles. No build step, no external fonts; JS: a small optional script in projects.html and the ride map on personal.html.
   Color = topic: sage (materials & quantum), clay (characterization), lilac (machine learning);
   slate is a fourth, non-topic hue used only for section bars on Home. */

:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --ink: #292f2c;
  --heading: #2f4a3c;
  --muted: #585f58;
  --accent: #365e4c;
  --accent-dark: #1a392b;
  --line: #dcded5;
  --warm: #8a5a3e;

  --sage: #e9eee4;  --sage-2: #dce7d4;  --sage-ink: #46613c;
  --clay: #f3e6dc;  --clay-2: #efd9c8;  --clay-ink: #7a4d33;
  --lilac: #ebe7f0; --lilac-2: #e0d9ec; --lilac-ink: #614c76;
  --slate: #e6ecf1; --slate-2: #d7e0e8; --slate-ink: #3e5a70;   /* fourth hue: non-topic accents on Home */

  --spectrum: linear-gradient(90deg, #8fae80, #c99a78 55%, #a08cbc);
  --shadow: 0 6px 22px #243d2b14;
  --bar-sage: linear-gradient(90deg, #56744c, #9fbb8f);
  --bar-clay: linear-gradient(90deg, #9e6644, #d9a985);
  --bar-lilac: linear-gradient(90deg, #735e98, #b6a5d3);
  --bar-slate: linear-gradient(90deg, #4f6b82, #9db2c4);
  color-scheme: light only;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
::selection { background: var(--clay-2); color: var(--ink); }
a { color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
p { margin: 0 0 14px; }
h1 { font: normal clamp(2.125rem, 1.6rem + 2vw, 2.875rem)/1.1 Georgia, serif; letter-spacing: -.03em; margin: 0 0 20px; color: var(--heading); }
h2 { font: normal 27px/1.3 Georgia, serif; letter-spacing: -.02em; margin: 0; color: var(--heading); }
h3 { font-size: 19px; font-weight: 600; letter-spacing: -.015em; line-height: 1.4; margin: 0 0 8px; overflow-wrap: break-word; }
img { max-width: 100%; height: auto; }

.wrap { width: min(1000px, calc(100% - 64px)); margin: auto; }
.skip { position: absolute; top: -80px; left: 20px; background: var(--bg); padding: 10px; z-index: 3; }
.skip:focus { top: 10px; }

/* Header: four destinations only. A thin spectrum line replaces the gray rule. */
.header { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0; }
.header::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--spectrum); opacity: .55; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); text-decoration: none; font-size: 15px; }
.brand img { width: 22px; height: 22px; flex: none; }
.site-nav { display: flex; gap: 26px; flex-wrap: wrap; }
.site-nav a { font-size: 14px; text-decoration: none; color: var(--muted); padding: 8px 0; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

.nw { white-space: nowrap; }
.meta { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.pdf { font-size: 11px; letter-spacing: .05em; color: var(--muted); margin-left: 3px; text-decoration: none; display: inline-block; }
.links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.links a { font-size: 13.5px; padding: 3px 0; }

/* Hero, with a faint hBN-style lattice (alternating two-color sites) */
.hero { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 60px; align-items: center; padding: 54px 0 46px; }
.hero::before {
  content: ''; position: absolute; z-index: -1; top: -20px; bottom: -20px; right: -60px; width: 400px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='24.249'%3E%3Cpath d='M0 12.124L7 0H21L28 12.124L21 24.249H7ZM28 12.124H42' fill='none' stroke='%237d9a70' stroke-width='.8'/%3E%3Cg fill='%237d9a70'%3E%3Ccircle cx='0' cy='12.124' r='1.9'/%3E%3Ccircle cx='42' cy='12.124' r='1.9'/%3E%3Ccircle cx='21' cy='0' r='1.9'/%3E%3Ccircle cx='21' cy='24.249' r='1.9'/%3E%3C/g%3E%3Cg fill='%23c39272'%3E%3Ccircle cx='7' cy='0' r='1.5'/%3E%3Ccircle cx='7' cy='24.249' r='1.5'/%3E%3Ccircle cx='28' cy='12.124' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 40%, transparent 100%);
  opacity: .6;
}
.eyebrow { color: var(--warm); font-size: 13px; font-weight: 600; letter-spacing: .03em; margin: 0 0 10px; }
.portrait-frame { position: relative; width: 210px; }
.portrait-frame::before { content: ''; position: absolute; inset: 10px -10px -10px 10px; border-radius: 10px; background: linear-gradient(140deg, var(--sage-2), var(--clay-2) 55%, var(--lilac-2)); z-index: -1; }
.portrait { display: block; width: 210px; height: 274px; object-fit: cover; object-position: center 39%; border-radius: 9px; background: var(--sage); }
.hobbies { color: var(--muted); font-size: 14px; }
.profile-links { margin-top: 20px; align-items: center; column-gap: 14px; }
.profile-links .primary { font-weight: 600; }
.profile-links .divider { width: 1px; height: 14px; background: var(--line); margin: 0 2px; }

/* Collapsible sections. Each has its own color bar (--bar). */
.fold { --bar: var(--bar-sage); border-top: 1px solid var(--line); }
.fold.bar-clay { --bar: var(--bar-clay); }
.fold.bar-lilac { --bar: var(--bar-lilac); }
.fold.bar-slate { --bar: var(--bar-slate); }
.fold > summary { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 28px 0 22px; cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2::before { content: ''; display: block; width: 38px; height: 3px; border-radius: 3px; background: var(--bar); margin-bottom: 12px; transition: width .2s ease; }
@media (hover: hover) { .fold > summary:hover h2::before { width: 56px; } }
.fold-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; padding-bottom: 4px; }
.fold-toggle::before { content: 'Hide'; }
.fold:not([open]) .fold-toggle::before { content: 'Show'; }
.fold-toggle::after { content: ''; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 14l4-4 4 4' fill='none' stroke='%23365e4c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; transition: transform .2s ease; }
.fold:not([open]) .fold-toggle::after { transform: rotate(180deg); }
.fold > summary:hover .fold-toggle { color: var(--accent); }
.fold > summary:hover .fold-toggle::after { border-color: var(--accent); }
.fold-body { padding-bottom: 38px; }
.section-note { font-size: 13px; color: var(--muted); margin: -6px 0 22px; }
.section-note.pub-note { margin: 20px 0 0; }
.section-intro { font-size: 15px; color: var(--muted); max-width: 760px; margin: -4px 0 26px; }

/* News */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 14px; font-size: 14.5px; padding: 7px 0; }
.news time { font-size: 12px; color: var(--warm); font-variant-numeric: tabular-nums; padding-top: 2px; white-space: nowrap; }

/* Project rows: colour comes from the topic */
.project { --tint: var(--sage); --tint-2: var(--sage-2); --tint-ink: var(--sage-ink);
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 26px; align-items: start;
  padding: 0 0 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.project:last-of-type { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.clay  { --tint: var(--clay);  --tint-2: var(--clay-2);  --tint-ink: var(--clay-ink); }
.lilac { --tint: var(--lilac); --tint-2: var(--lilac-2); --tint-ink: var(--lilac-ink); }
.project h3 a { color: inherit; text-decoration: none; }
.project h3 a:hover { text-decoration: underline; text-decoration-color: var(--tint-ink); }
.project-copy > p:not(.meta) { font-size: 14.5px; line-height: 1.7; }
.project-copy > p:not(.meta), .more-body p, .section-intro, .bio > p { max-width: 68ch; }
.kind { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; padding: 1px 9px; border-radius: 99px; background: var(--tint); border: 1px solid var(--tint-2); border-color: color-mix(in srgb, var(--tint-ink) 28%, transparent); color: var(--tint-ink); margin-right: 8px; vertical-align: 1px; }
.current-project .kind { background: var(--surface); }
figure { margin: 0; min-width: 0; }
.thumb { display: block; aspect-ratio: 8 / 5; padding: 6px; border-radius: 10px; background: linear-gradient(140deg, var(--tint-2), var(--tint) 60%); transition: box-shadow .18s ease, transform .18s ease; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--surface); border-radius: 4px; }
@media (hover: hover) { .thumb:hover { box-shadow: var(--shadow); transform: translateY(-1px); } }
.thumb-wrap { min-width: 0; }
figcaption { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 8px; }
.more-body .related { font-size: 13px; color: var(--muted); }

/* Expandable detail (native, keyboard accessible) */
.more { margin-top: 10px; border-top: 1px dashed var(--line); }
.more summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--accent); padding: 9px 0 4px; display: inline-flex; gap: 6px; align-items: center; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: '+'; content: '+' / ''; font-size: 16px; line-height: 1; width: 12px; }
.more[open] summary::before { content: '−'; content: '−' / ''; }
.more[open] summary .closed, .more:not([open]) summary .opened { display: none; }
.more-body { padding: 6px 0 2px; }
.more-body p { font-size: 14.5px; line-height: 1.75; }
.more-body .label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tint-ink, var(--sage-ink)); margin-right: 6px; }
.more-body .focus { font-size: 13px; color: var(--muted); padding-left: 12px; border-left: 2px solid var(--tint-2, var(--line)); }

.all-projects { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 22px; background: linear-gradient(110deg, var(--sage), var(--clay) 55%, var(--lilac)); border-radius: 10px; margin-top: 30px; }
.all-projects p { margin: 0; font-size: 14px; }
.all-projects a { font-size: 14px; font-weight: 600; white-space: nowrap; }

/* Methods & tools: one row of four on desktop */
.toolkit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tool-group { display: grid; grid-template-rows: subgrid; grid-row: span 2; row-gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 12px; }
.tool-group h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--warm); margin: 0 0 8px; }
.tool-group ul { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.tool-group li { padding: 4px 0; }
.tool-group li + li { border-top: 1px dashed var(--line); }
.tool-group b { display: block; font-weight: 600; color: var(--ink); font-size: 13.5px; }

/* Talks & posters */
.talks { list-style: none; margin: 0; padding: 0; }
.talks li { --tint: var(--sage); --tint-2: var(--sage-2); --tint-ink: var(--sage-ink); display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.talks li:last-child { border-bottom: 0; }
.talks li.clay { --tint: var(--clay); --tint-2: var(--clay-2); --tint-ink: var(--clay-ink); }
.talks li.lilac { --tint: var(--lilac); --tint-2: var(--lilac-2); --tint-ink: var(--lilac-ink); }
.talks time { font-size: 12px; color: var(--warm); font-variant-numeric: tabular-nums; padding-top: 3px; }
.talk-title { font-size: 14.5px; margin: 0 0 2px; }
.talk-title a { color: var(--ink); text-decoration-color: #9fb4a8; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.talk-title a:hover { color: var(--accent); text-decoration-color: currentColor; }
.talks .meta { margin: 0; }
.talks .kind { min-width: 52px; text-align: center; }

/* Projects intro figure */
.intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 44px; align-items: center; }
.intro-figure img { display: block; width: 100%; height: auto; }
.intro-figure { align-self: end; margin-bottom: 30px; }
.intro-figure figcaption { margin-top: 2px; }

/* Research arc (generated by tools/make_research_arc.py) */
.research-arc { margin: 4px 0 30px; padding: 10px 14px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.arc-svg { display: block; width: 100%; height: auto; overflow: visible; }
.arc-svg text { font-family: inherit; }
.arc-year { font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.arc-title { font-size: 14px; fill: var(--ink); }
.arc-era-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.arc-node { cursor: pointer; }
.arc-node .arc-dot { transition: stroke-width .15s ease; }
.arc-node:hover .arc-title, .arc-node:focus-visible .arc-title { fill: var(--accent); text-decoration: underline; }
.arc-node:hover .arc-dot { stroke-width: 3.5; }
.arc-node:focus-visible { outline: none; }
.arc-node:focus-visible .arc-dot { stroke: var(--accent); stroke-width: 4; }
.arc-pulse { transform-box: fill-box; transform-origin: center; animation: arc-pulse 2.8s ease-out infinite; }
@keyframes arc-pulse { 0% { opacity: .7; transform: scale(.85); } 70%, 100% { opacity: 0; transform: scale(1.35); } }
.arc-list { display: none; list-style: none; margin: 0; padding: 4px 0 0; }
.arc-list li { position: relative; padding: 5px 0; font-size: 14px; }
.arc-list li:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 50%; height: 100%; width: 2px; background: var(--line); }
.arc-list a { position: relative; display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.arc-list a:hover { color: var(--accent); text-decoration: underline; }
.arc-list .arc-era-li { padding: 8px 0 2px 38px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.arc-list .arc-era-li::before { display: none; }
.arc-li-icon { flex: none; width: 28px; height: 28px; background: var(--surface); border-radius: 50%; }
.arc-li-year { display: inline-block; min-width: 56px; font-size: 12px; color: var(--warm); font-variant-numeric: tabular-nums; }
.research-arc figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; margin-top: 4px; }
.arc-key { white-space: nowrap; }
.arc-key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 4px 0 10px; }
.arc-key i:first-child { margin-left: 0; }
.k-ml { background: #9883b4; } .k-char { background: #c39272; } .k-mat { background: #7d9a70; }

/* Arriving at a project from another page: brief highlight */
.project:target { animation: arrive 1.8s ease-out; border-radius: 10px; }
.current-project:target { animation: ring 1.8s ease-out; }
@keyframes arrive { from { background-color: var(--tint); box-shadow: 0 0 0 12px var(--tint); } to { background-color: transparent; box-shadow: 0 0 0 12px transparent; } }
@keyframes ring { from { box-shadow: 0 0 0 3px var(--tint-ink); } to { box-shadow: 0 0 0 3px transparent; } }

/* Publications */
.publication { min-width: 0; padding: 0 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.publication:last-of-type { margin: 0; padding: 0; border: 0; }
.publication h3 { font-size: 15px; letter-spacing: 0; margin-bottom: 3px; font-weight: 600; }
.publication p { font-size: 13px; color: var(--muted); margin: 0; }
.pub-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; margin-top: 4px; font-size: 13px; }
.bibtex summary { padding: 4px 0; cursor: pointer; list-style: none; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.bibtex summary::-webkit-details-marker { display: none; }
.bibtex summary::after { content: ' +'; content: ' +' / ''; text-decoration: none; display: inline-block; margin-left: 3px; }
.bibtex[open] summary::after { content: ' −'; content: ' −' / ''; }
.bibtex { min-width: 0; max-width: 100%; }
.bibtex[open] { flex-basis: 100%; }
.bibtex pre { max-width: 100%; margin: 8px 0 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); }

/* Education + awards */
.support { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 0 55px; align-items: start; }
.entry { margin-bottom: 22px; }
.entry h3 { font-size: 16px; margin: 0 0 6px; letter-spacing: 0; }
.entry p { margin: 0 0 6px; }
.entry p:not(.meta) { font-size: 14px; }
.education-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.education-head > span { font-size: 12px; color: var(--warm); font-variant-numeric: tabular-nums; }
.award { border-bottom: 1px solid var(--line); }
.award summary { display: grid; grid-template-columns: 60px minmax(0, 1fr) 13px; gap: 10px; align-items: baseline; list-style: none; font-size: 13.5px; font-weight: 500; padding: 13px 0; cursor: pointer; }
.award summary::-webkit-details-marker { display: none; }
.award summary::after { content: '+'; content: '+' / ''; font-size: 18px; line-height: 1; color: var(--accent); }
.award[open] summary::after { content: '−'; content: '−' / ''; }
.award summary:hover > span:last-of-type { color: var(--accent); }
.year { font-size: 12px; font-weight: 400; color: var(--warm); font-variant-numeric: tabular-nums; }
.award-detail { padding: 0 23px 16px 70px; font-size: 13px; }
.award-detail p { margin-bottom: 8px; }
.award-detail a { font-size: 12px; }
.award-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.societies { margin-top: 22px; }
.societies h3 { font-size: 13px; letter-spacing: 0; margin-bottom: 4px; }
.societies p { font-size: 13px; color: var(--muted); }

/* Projects page */
.page-intro { padding: 46px 0 22px; max-width: 720px; }

.page-intro p:not(.eyebrow) { color: var(--muted); }
.page-intro p.lede { color: var(--ink); font-size: 16px; }
.page-intro .section-note { margin: 0; }
.topic-nav { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 28px; }
.topic-nav a { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; text-decoration: none; padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: linear-gradient(135deg, var(--surface), var(--tint, var(--sage))); color: var(--ink); }
.topic-nav a::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--tint-ink, var(--sage-ink)); }
.topic-nav a:hover { border-color: var(--tint-ink, var(--accent)); }
.topic-nav .sage { --tint: var(--sage); --tint-ink: var(--sage-ink); }
.topic-nav .count { color: var(--muted); font-size: 12px; }
.current-project { --tint: var(--sage); --tint-2: var(--sage-2); --tint-ink: var(--sage-ink); padding: 22px 24px; background: linear-gradient(115deg, var(--sage-2), var(--sage) 55%, #f1f4ee); border-radius: 10px; margin-bottom: 36px; }
.current-project .lead { font-size: 14.5px; margin: 0 0 12px; }
.current-project .question { font-size: 14.5px; margin: 0; }
.current-project .label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sage-ink); margin-right: 6px; }
.research-top { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; margin-bottom: 6px; }
.research-structures { background: var(--surface); border-radius: 8px; padding: 8px 8px 6px; }
.research-structures img { display: block; width: 100%; height: auto; }
.research-structures figcaption { margin-top: 4px; }
.current-project .more { border-top-color: #bccab4; border-top-color: color-mix(in srgb, var(--sage-ink) 25%, transparent); }
.research-body { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 30px; align-items: start; }
.research-density { margin: 4px 0 16px; background: var(--surface); border-radius: 8px; padding: 8px 8px 6px; }
.research-density img { display: block; width: 100%; height: auto; }
.research-density figcaption { margin-top: 4px; }
.research-figure { background: var(--surface); border-radius: 8px; padding: 10px 10px 8px; margin-top: 4px; }
.research-figure img { display: block; width: 100%; height: auto; }
.research-figure figcaption { margin-top: 4px; }
.current-project h3 { font-size: 20px; }

/* Personal page */
.topic-nav .clay { --tint: var(--clay); --tint-ink: var(--clay-ink); }
.topic-nav .lilac { --tint: var(--lilac); --tint-ink: var(--lilac-ink); }
.topic-nav .slate { --tint: var(--slate); --tint-ink: var(--slate-ink); }
.personal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 18px; padding: 0 0 48px; }
.personal-feature { margin: 6px 0 18px; }
.feature-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 16px; row-gap: 2px; align-items: center; }
.feature-head .card-icon { grid-row: 1 / span 2; margin-bottom: 0; }
.personal-card .feature-head h2 { grid-column: 2; margin: 0; align-self: end; }
.feature-desc { grid-column: 2; font-size: 14px; color: var(--muted); align-self: start; }
.hobbies a, .pub-note a { white-space: nowrap; }
/* Collapsible feature cards (same Hide/Show control as the sections on Home) */
.pfold > summary { cursor: pointer; list-style: none; }
.pfold > summary::-webkit-details-marker { display: none; }
.pfold > summary .fold-toggle { grid-column: 3; grid-row: 1 / span 2; padding-bottom: 0; }
.pfold:not([open]) .fold-toggle::before { content: 'Show'; }
.pfold:not([open]) .fold-toggle::after { transform: rotate(180deg); }
.pfold > summary:hover .fold-toggle { color: var(--tint-ink); }
.pfold > summary:hover .fold-toggle::after { border-color: var(--tint-ink); }
.pfold > summary:focus-visible { outline: 2px solid var(--tint-ink); outline-offset: 4px; border-radius: 6px; }
.personal-card { --tint: var(--sage); --tint-2: var(--sage-2); --tint-ink: var(--sage-ink); position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px 22px 20px; }
.personal-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--tint-2), var(--tint-ink)); }
.personal-card.clay { --tint: var(--clay); --tint-2: var(--clay-2); --tint-ink: var(--clay-ink); }
.personal-card.lilac { --tint: var(--lilac); --tint-2: var(--lilac-2); --tint-ink: var(--lilac-ink); }
.personal-card.slate { --tint: var(--slate); --tint-2: var(--slate-2); --tint-ink: var(--slate-ink); }
.card-icon { display: block; width: 44px; height: 44px; padding: 8px; margin-bottom: 12px; border-radius: 50%; color: var(--tint-ink); background: linear-gradient(135deg, var(--tint), var(--tint-2)); }
.personal-card h2 { font-size: 21px; margin-bottom: 6px; }
.personal-card > p { font-size: 14px; color: var(--muted); margin: 0; }
/* Blocks for future content */
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.photo-grid figure { margin: 0; }
.photo-grid a { display: block; border-radius: 8px; overflow: hidden; }
.photo-grid figcaption { margin-top: 6px; font-size: 12.5px; color: var(--ink); }
.photo-grid img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; transition: transform .25s ease; }
@media (hover: hover) { .photo-grid a:hover img { transform: scale(1.03); } }
.photo-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.more-photos { margin-top: 14px; }
.more-photos summary { color: var(--tint-ink); }
.more-photos .photo-grid { margin-top: 8px; }
.route-map { margin: 16px 0 0; }
.route-map .map-fallback { display: block; }
.ride-map.is-live { height: 340px; border-radius: 8px; border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.ride-map .maplibregl-ctrl-attrib { font-size: 10px; }
.ride-map:focus-visible { outline-offset: 2px; }
.ride-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; margin-top: 16px; }
.ride-photo { margin: 0; }
.ride-photo a { display: block; border-radius: 8px; overflow: hidden; }
.ride-photo img { display: block; width: 100%; height: auto; }
.ride-photo figcaption { margin-top: 6px; }
.route-map figcaption { margin-top: 8px; font-size: 12.5px; }
.route-map figcaption b { color: var(--ink); font-weight: 600; }
.ride-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.ride-stats div { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.ride-stats dt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--warm); }
.ride-stats dd { margin: 2px 0 0; font-size: 16px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ride-stats dd span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.route-map img { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
/* Live ride map (MapLibre): controls, pins, popups, elevation profile */
.ride-map .ride-style { display: flex; background: #fff; border-radius: 4px; box-shadow: 0 0 0 2px #0000001a; overflow: hidden; }
.ride-style button { border: 0; margin: 0; background: none; padding: 6px 10px; font: 600 12px/1.2 system-ui, -apple-system, "Segoe UI", Arial, sans-serif; color: var(--muted); cursor: pointer; }
.ride-style button + button { border-left: 1px solid #e2e4dc; }
.ride-style button[aria-pressed="true"] { background: var(--tint, var(--sage)); color: var(--tint-ink, var(--sage-ink)); }
.ride-style button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ride-fit svg { display: block; margin: auto; color: #333; }
.ride-pin { cursor: pointer; border-radius: 50%; box-shadow: 0 1px 4px #0000004d; }
.ride-pin.start { width: 17px; height: 17px; background: #fff; border: 3.5px solid var(--tint-ink, var(--sage-ink)); }
.ride-pin.finish, .ride-pin.turn { width: 14px; height: 14px; background: #c39272; border: 2.5px solid #fff; }
.ride-pin.photo { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: #fff; border: 2px solid var(--tint-ink, var(--sage-ink)); color: var(--tint-ink, var(--sage-ink)); }
.ride-pin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ride-popup .maplibregl-popup-content { padding: 8px 10px; border-radius: 8px; font: 12.5px/1.4 system-ui, -apple-system, "Segoe UI", Arial, sans-serif; color: var(--ink); box-shadow: var(--shadow); }
.route-map .ride-popup img { width: 200px; height: auto; margin-bottom: 6px; border: 0; border-radius: 5px; }
.ride-tip { pointer-events: none; }
.ride-tip .maplibregl-popup-content { padding: 4px 8px; border-radius: 6px; font: 600 12px/1.3 system-ui, -apple-system, "Segoe UI", Arial, sans-serif; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ride-profile { margin-top: 10px; }
.ride-profile-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.ride-readout { color: var(--ink); font-variant-numeric: tabular-nums; }
.ride-profile-plot { height: 76px; margin-top: 2px; cursor: crosshair; touch-action: pan-y; border-radius: 4px; -webkit-user-select: none; user-select: none; }
.ride-profile-plot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ride-profile-plot svg { display: block; overflow: visible; }
.ride-profile-plot text { font: 10.5px/1 system-ui, -apple-system, "Segoe UI", Arial, sans-serif; fill: var(--muted); }
.ride-profile-plot .rp-label { fill: var(--warm); }
.rp-line { fill: none; stroke: var(--tint-ink, var(--sage-ink)); stroke-width: 1.6; stroke-linejoin: round; }
.rp-stop { stop-color: var(--tint-ink, var(--sage-ink)); }
.rp-grid { stroke: var(--line); stroke-dasharray: 2 3; }
.rp-axis { stroke: #c9ccc2; }
.rp-mark { stroke: #c39272; stroke-dasharray: 3 3; }
.rp-cursor { stroke: var(--ink); stroke-opacity: .5; }
.rp-dot { fill: #c39272; stroke: #fff; stroke-width: 2; }
.route-map:fullscreen { display: flex; flex-direction: column; margin: 0; padding: 16px; background: var(--bg); }
.route-map:fullscreen .ride-map.is-live { flex: 1 1 auto; height: auto; min-height: 0; }
.route-map:-webkit-full-screen { display: flex; flex-direction: column; margin: 0; padding: 16px; background: var(--bg); }
.route-map:-webkit-full-screen .ride-map.is-live { flex: 1 1 auto; height: auto; min-height: 0; }
.route-map.maplibregl-pseudo-fullscreen { display: flex; flex-direction: column; margin: 0; padding: 12px; background: var(--bg); }
.route-map.maplibregl-pseudo-fullscreen .ride-map.is-live { flex: 1 1 auto; height: auto; min-height: 0; }
.reading-list { list-style: none; margin: 12px 0 0; padding: 0; font-size: 14px; }
.reading-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.reading-list li:last-child { border-bottom: 0; }
.reading-list span { color: var(--muted); font-size: 13px; }

footer { position: relative; display: flex; justify-content: space-between; gap: 6px 15px; flex-wrap: wrap; padding: 22px 0 30px; font-size: 12px; color: var(--muted); }
footer::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--spectrum); opacity: .55; }

/* The intro figure is decorative; drop it once the text column would get cramped. */
@media (max-width: 960px) {
  .intro-grid { display: block; }
  .intro-figure { display: none; }
}
@media (max-width: 900px) {
  .research-top { grid-template-columns: 1fr; }
  .research-structures { max-width: 520px; }
}
@media (max-width: 760px) {
  .arc-svg { display: none; }
  .arc-list { display: block; }
  .arc-key { white-space: normal; }
  .research-body { grid-template-columns: 1fr; }
  .research-figure { max-width: 320px; }
}
@media (max-width: 820px) {
  .toolkit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { gap: 32px; grid-template-columns: minmax(0, 1fr) 170px; }
  .portrait-frame, .portrait { width: 170px; }
  .portrait { height: 230px; }
  .project { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
  .support { grid-template-columns: 1fr; }
  .hero::before { width: 290px; right: -50px; opacity: .5; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 32px); }
  .header { padding: 16px 0 12px; flex-wrap: wrap; gap: 6px 20px; }
  .site-nav { gap: 4px 20px; }
  .hero { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 22px; padding: 28px 0 32px; }
  .hero::before { display: none; }
  .portrait-frame, .portrait { width: 132px; }
  .portrait { height: 165px; }
  .portrait-frame::before { inset: 6px -6px -6px 6px; }
  .fold > summary { padding: 24px 0 18px; }
  .fold-body { padding-bottom: 28px; }
  .fold-toggle::before { display: none; }
  .project { grid-template-columns: 1fr; gap: 14px; }
  .thumb { max-width: 300px; }
  .news li, .talks li { grid-template-columns: 1fr; gap: 2px; }
  .toolkit { gap: 10px; }
  .photo-grid, .photo-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .photo-grid > figure:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .photo-grid > figure:last-child:nth-child(odd) img { aspect-ratio: 2 / 1; }
  .ride-row { grid-template-columns: 1fr; }
  .ride-map.is-live { height: 280px; }
  .ride-profile-head { flex-direction: column; }
  .feature-head { grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 12px; }
  .feature-head .card-icon { width: 40px; height: 40px; padding: 7px; align-self: start; }
  .personal-card .feature-head h2 { align-self: center; }
  .feature-desc { grid-column: 2 / 4; }
  .pfold > summary .fold-toggle { grid-row: 1; }
  .personal-card { padding: 18px 16px 16px; }
  .current-project { padding: 16px; }
  .tool-group { padding: 12px 14px 10px; }
  .award summary { grid-template-columns: 52px minmax(0, 1fr) 13px; gap: 8px; }
  .award-detail { padding-left: 60px; padding-right: 0; }
  .all-projects { flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; }
  .links a { padding: 6px 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .photo-grid img { transition: none; } .photo-grid a:hover img { transform: none; } .arc-pulse { animation: none; opacity: .4; } .project:target, .current-project:target { animation: none; } .thumb, .fold-toggle::after, .fold > summary h2::before { transition: none; } .thumb:hover { transform: none; } }
@media print {
  .header, .skip, .topic-nav, .hero::before, .portrait-frame::before, .fold-toggle { display: none; }
  body { background: #fff; }
  .thumb:hover { transform: none; box-shadow: none; }
  .wrap { width: 100%; }
  .project, .publication, .award, .current-project, .personal-card, .talks li, .tool-group { break-inside: avoid; }
  .ride-profile { display: none; }
  h2, h3 { break-after: avoid; }
}
