/* Layout and gem treatment from the supplied lifelines-v4-gemmes.html. */
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Regular.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Medium.woff2") format("woff2"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-SemiBold.woff2") format("woff2"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/InstrumentSerif-Regular.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/InstrumentSerif-Italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
:root {
  --cv-peek: 24px;
  --bg: #101512; --ink: #ece6d8; --muted: #b9beb3; --dim: #8f9689;
  --glass: rgba(13, 19, 15, .72); --line: rgba(184, 207, 174, .16);
  --sage: #b8cfae; --gold: #e8bd66; --green: #8dcc8a; --violet: #c4a9dc; --blue: #99d5f0; --grey: #e2e4de;
  --career-change: #d69470; --copper: #d69470;
  --f-display: "Instrument Serif", Georgia, serif;
  --f-body: "Instrument Sans", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { position: relative; margin: 0; min-height: var(--scene-height, 100svh); background: var(--bg); color: var(--ink); font: 14px/1.5 var(--f-body); overflow-x: clip; }
#mesh, #mesh-accelerated { position: fixed; left: 0; top: 0; display: block; }
.skip-link { position: fixed; z-index: 70; top: 8px; left: 8px; padding: .5rem 1rem; border-radius: 6px; background: var(--bg); color: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
#timeline-projects:focus { outline: none; }
/* The heading sticks on both axes within the timeline, then leaves with it
   when the reader reaches the full CV. Native stickiness needs no frame work. */
.timeline-heading {
  --heading-x: max(28px, env(safe-area-inset-left, 0px));
  --heading-y: calc(env(safe-area-inset-top, 0px) + 28px);
  --heading-right: max(16px, env(safe-area-inset-right, 0px));
  position: absolute; top: 0; left: 0; width: 100%; height: var(--scene-height, 100svh);
  padding: var(--heading-y) var(--heading-right) 0 var(--heading-x);
  z-index: 4; pointer-events: none;
}
html.timeline-horizontal { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #e8bd6659 transparent; }
html.timeline-horizontal body { width: var(--scene-width, 100%); overflow-x: clip; }
/* The scene is absolutely positioned; the flow (the full CV) starts below it. */
.js body { min-height: 0; padding-top: var(--scene-height, 100svh); }
.timeline-heading header {
  position: sticky; top: var(--heading-y); left: var(--heading-x);
  width: calc(var(--view-width, 100vw) - var(--heading-x) - var(--heading-right));
  display: grid; grid-template-columns: minmax(0, 32rem) minmax(0, 23rem); justify-content: space-between; gap: 2rem;
  pointer-events: none;
}
.timeline-heading header::before {
  content: ""; position: absolute; z-index: -1;
  inset: calc(-1 * var(--heading-y)) calc(-1 * var(--heading-right)) auto calc(-1 * var(--heading-x));
  height: calc(100% + var(--heading-y) + 28px);
  background: linear-gradient(#101512e6, #101512b3 65%, #10151200);
}
/* On small screens keep the title, name and role; the supporting copy leaves
   room for the timeline after the first scroll, without changing its layout. */
.timeline-heading .cv-tagline, .timeline-heading .cv-side { transition: opacity .3s, visibility 0s; }
.timeline-heading-compact .cv-tagline, .timeline-heading-compact .cv-side { opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.timeline-heading-compact .timeline-heading header::before { height: calc(var(--heading-core-height) + var(--heading-y) + 28px); }
h1 { font: 400 clamp(2.4rem, 5vw, 3.6rem)/1 var(--f-display); margin: 0 0 .55rem; text-wrap: balance; }
/* The name and current role read before the tagline; the role takes its vein colour. */
header .cv-identity { margin: 0 0 .7rem; font: 500 18px/1.35 var(--f-body); color: var(--muted); text-wrap: balance; }
.cv-name { color: var(--ink); font-weight: 600; }
.cv-job { color: var(--green); white-space: nowrap; }
h1 em { color: var(--sage); }
header p { margin: 0; color: var(--muted); max-width: 28rem; }
.cv-tagline { font-size: 18px; line-height: 1.45; color: var(--ink); text-wrap: pretty; }
.cv-side { align-self: center; }
.cv-positioning { border-left: 1px solid #e8bd6659; padding-left: 1rem; }
/* Contact under the positioning: the header ignores the pointer, its links do not. */
.cv-contact { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; margin-top: .8rem; padding-left: calc(1rem + 1px); pointer-events: auto; font-size: 14px; }
.cv-contact a, .cv-footer-links a { color: var(--sage); text-decoration: none; padding-block: .35rem; }
.cv-contact a:hover, .cv-contact a:focus-visible, .cv-footer-links a:hover, .cv-footer-links a:focus-visible { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.cv-positioning p { font-size: 16px; line-height: 1.55; text-wrap: pretty; }
/* Arrival: the title and the identity line rise out of a mask, then the
   positioning resolves word by word. A link to a project skips it. */
.rise-mask { overflow: hidden; padding-bottom: .08em; }
.rise { display: block; }
.cv-positioning .word { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.no-arrival) h1 .rise { animation: arrival-rise 1.1s cubic-bezier(.2, .8, .2, 1) backwards; }
  html:not(.no-arrival) .cv-identity .rise { animation: arrival-rise 1.1s cubic-bezier(.2, .8, .2, 1) .15s backwards; }
  html:not(.no-arrival) .cv-tagline { animation: arrival-fade .8s cubic-bezier(.2, .8, .2, 1) .45s backwards; }
  html:not(.no-arrival) .cv-positioning .word { animation: arrival-word .6s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(.7s + var(--i) * 70ms); }
  html:not(.no-arrival) .cv-contact { animation: arrival-fade .8s cubic-bezier(.2, .8, .2, 1) 1.5s backwards; }
}
.lifelines-paused .cv-intro *, .lifelines-paused .cv-positioning *, .lifelines-paused .cv-contact { animation-play-state: paused; }
@keyframes arrival-rise { from { transform: translateY(105%); } }
@keyframes arrival-fade { from { opacity: 0; transform: translateY(8px); } }
@keyframes arrival-word { from { opacity: 0; filter: blur(10px); transform: translateY(12px); } }
/* Page transitions: a dark circle grows from the gem before its project page
   opens, and closes back into the gem on return (lifelines.js). The safety
   fade only matters if the gem cannot be placed. */
.page-transition { position: fixed; inset: 0; z-index: 60; pointer-events: none; background: var(--bg); }
html.returning::after { content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; background: var(--bg); animation: return-safety .4s ease-out 2.4s forwards; }
@keyframes return-safety { to { opacity: 0; visibility: hidden; } }
.card, .career-note {
  position: absolute; left: 0; top: 0; width: 15.3rem; padding: .8rem .9rem;
  background: var(--glass); border: 1px solid var(--line); border-radius: 10px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(6px); transition: opacity .6s, transform .6s, border-color .3s;
}
.card { cursor: pointer; outline: none; }
.card.in, .career-note.in { opacity: 1; transform: none; }
.card:focus-visible, .card.on { border-color: var(--c); }
.card.on { box-shadow: 0 0 24px color-mix(in srgb, var(--c) 18%, transparent); }
.card h2 { margin: 0 0 .15rem; font: 500 16px/1.25 var(--f-body); color: var(--c); }
.card p { margin: 0; color: var(--muted); font-size: 13px; }
.card time { display: block; margin-top: .4rem; font: 12px/1.3 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.career-note { width: 12rem; padding: .65rem .8rem; border-color: color-mix(in srgb, var(--career-change) 45%, transparent); }
/* The earlier public-sector career stays readable but recedes: a compact,
   quieter card beside its vein, at full contrast once hovered or focused. */
.card[data-role="pm"] { width: 12.5rem; padding: .6rem .75rem; background: rgba(13, 19, 15, .55); }
.card[data-role="pm"] h2 { font-size: 14px; }
.card[data-role="pm"] p, .card[data-role="pm"] time { font-size: 12px; }
.card[data-role="pm"]:not(.on):not(:hover):not(:focus-visible) h2 { color: color-mix(in srgb, var(--c) 72%, var(--dim)); }
.card[data-role="pm"]:not(.on):not(:hover):not(:focus-visible) p, .card[data-role="pm"]:not(.on):not(:hover):not(:focus-visible) time { color: var(--dim); }
.career-note h2 { margin: 0 0 .25rem; color: var(--career-change); font: 500 14px/1.25 var(--f-body); }
.career-note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.career-note time { display: block; margin-top: .4rem; color: var(--muted); font: 12px/1.3 var(--f-mono); }
.career-note.on { border-color: var(--career-change); box-shadow: 0 0 24px color-mix(in srgb, var(--career-change) 18%, transparent); }
.project-hotspot {
  --project-enter-duration: 1000ms; --project-fade-duration: var(--project-enter-duration); --project-preview-opacity: .8;
  position: absolute; width: 44px; height: 44px; z-index: 3;
}
.project-hotspot[data-role="se"] {
  --project-color: var(--gold);
  --gem-0: #9d7636; --gem-1: #fff0c2; --gem-2: #e8bd66; --gem-3: #c7903d;
  --gem-4: #a57835; --gem-5: #dab05d; --gem-6: #ffe1a0; --gem-7: #b18743;
  --gem-8: #e7be77; --gem-9: #fff0c9; --gem-10: #c49349; --gem-11: #eac782;
  --gem-12: #f7dfa8; --gem-13: #d9ac60; --gem-14: #fff3cd; --gem-15: #b58a45; --gem-16: #e4bd77;
}
.project-hotspot[data-role="ai"] {
  --project-color: var(--blue);
  --gem-0: #386d91; --gem-1: #d7f5ff; --gem-2: #83caf3; --gem-3: #4f9ac8;
  --gem-4: #32678a; --gem-5: #79b8df; --gem-6: #b6e6ff; --gem-7: #427fba;
  --gem-8: #8dceef; --gem-9: #ecfaff; --gem-10: #438ab9; --gem-11: #a5dcf1;
  --gem-12: #c1eafb; --gem-13: #6db7e3; --gem-14: #e1f7ff; --gem-15: #477fa8; --gem-16: #92cde9;
}
.project-hotspot[data-role="native"] {
  --project-color: var(--green);
  --gem-0: #236743; --gem-1: #b4f4a0; --gem-2: #5fce72; --gem-3: #329455;
  --gem-4: #226a43; --gem-5: #6fc779; --gem-6: #a5e799; --gem-7: #3d9b5a;
  --gem-8: #83d479; --gem-9: #c7f5b4; --gem-10: #43aa5b; --gem-11: #7fda87;
  --gem-12: #a2e88e; --gem-13: #51b66b; --gem-14: #d6f6bb; --gem-15: #318652; --gem-16: #69ca79;
}
.project-hotspot[data-role="self"] {
  --project-color: var(--copper);
  --gem-0: #966342; --gem-1: #ffe5ca; --gem-2: #d69470; --gem-3: #bd7951;
  --gem-4: #995d3f; --gem-5: #d49b74; --gem-6: #ffcfaa; --gem-7: #ae7959;
  --gem-8: #dfaa87; --gem-9: #ffe6cc; --gem-10: #be835e; --gem-11: #e4b18e;
  --gem-12: #f4d1b5; --gem-13: #ce936e; --gem-14: #ffecd9; --gem-15: #ad7654; --gem-16: #dba781;
}
.project-hotspot.open { z-index: 4; }
.project-hotspot.open:not(.preview)::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  clip-path: var(--project-hover-area); pointer-events: auto;
}
.project-hotspot[hidden], .project-popover[hidden] { display: none; }
.project-pin {
  --gem-shadow: drop-shadow(0 2px 2px #020604) drop-shadow(0 5px 7px #020604e6);
  position: relative; isolation: isolate;
  display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px;
  padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--grey);
}
.project-pin svg { position: relative; z-index: 1; display: block; width: 27px; height: 30px; filter: var(--gem-shadow); }
.project-gem-signal {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, #030805e6, #03080580 48%, transparent 72%);
  opacity: 0; transition: opacity var(--project-fade-duration) ease-in-out;
}
.project-hotspot.open:not(.fading) .project-gem-signal { opacity: 1; }
.project-gem-signal::before, .project-gem-signal::after {
  content: ""; position: absolute; inset: 6px; z-index: 0; pointer-events: none;
  border: 1.5px solid var(--project-color, var(--grey)); border-radius: 50%; opacity: 0;
  box-shadow: 0 0 0 2px #03080580, 0 0 8px color-mix(in srgb, var(--project-color, var(--grey)) 45%, transparent);
  animation: project-gem-wave 2.2s ease-out infinite paused;
}
.project-gem-signal::after { animation-delay: 1.1s; }
.project-hotspot.open .project-gem-signal::before, .project-hotspot.open .project-gem-signal::after { animation-play-state: running; }
@keyframes project-gem-wave {
  0% { transform: scale(.65); opacity: 0; }
  18% { opacity: .9; }
  85%, 100% { transform: scale(2.2); opacity: 0; }
}
.lifelines-paused .project-hotspot.open .project-gem-signal::before, .lifelines-paused .project-hotspot.open .project-gem-signal::after { animation-play-state: paused; }
.project-hotspot[data-accent="blue"] {
  --gem-accent-0: #5c92b5; --gem-accent-1: #8bd0ed; --gem-accent-2: #cef0fa; --gem-accent-3: #417fa5;
  --gem-accent-4: #679fc3; --gem-accent-5: #a7d9f0; --gem-accent-6: #def7ff; --gem-accent-7: #528eaf;
}
.project-pin:hover svg, .project-pin:focus-visible svg, .project-pin[aria-expanded="true"] svg { filter: brightness(1.12) var(--gem-shadow); }
.project-pin:hover, .project-pin:focus-visible, .project-pin[aria-expanded="true"] { color: #fff; background: transparent; }
.project-pin:hover { outline: none; }
.project-pin:focus-visible { outline: 1px solid var(--project-color, var(--grey)); outline-offset: -3px; }
.project-popover {
  position: fixed; width: min(20rem, calc(100vw - 32px)); max-height: calc(100svh - 24px);
  overflow-y: auto; padding: 1rem; background: rgba(13, 19, 15, .97);
  color: var(--ink); border: 1px solid rgba(226, 228, 222, .38); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .32);
  opacity: 1; transition: opacity 280ms ease;
}
.project-hotspot.preview .project-popover { opacity: var(--project-preview-opacity); }
.project-hotspot.preview:not(.fading) .project-popover { animation: project-preview-in var(--project-enter-duration) ease-in-out both; }
.project-hotspot.preview.fading .project-popover { animation: project-preview-out var(--project-fade-duration) ease-in-out both; }
@keyframes project-preview-in { from { opacity: 0; } to { opacity: var(--project-preview-opacity); } }
@keyframes project-preview-out { from { opacity: var(--project-preview-opacity); } to { opacity: 0; } }
.project-hotspot.fading .project-popover { opacity: 0; transition: opacity var(--project-fade-duration) ease-in-out; }
/* Under a preview at 80 % opacity, a dark blurred veil keeps the card
   readable over the veins; it appears and fades with the card. */
.project-hotspot.preview::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  left: var(--panel-x, 0); top: var(--panel-y, 0); width: var(--panel-w, 0); height: var(--panel-h, 0);
  border-radius: 12px; background: rgba(13, 19, 15, .45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: project-veil-in var(--project-enter-duration) ease-in-out both;
}
.project-hotspot.preview.fading::after { animation: project-veil-out var(--project-fade-duration) ease-in-out both; }
@keyframes project-veil-in { from { opacity: 0; } }
@keyframes project-veil-out { to { opacity: 0; } }
/* Opening a card: its context and title rise a few pixels, then its tags
   follow one after another. Paused or reduced motion shows them at once. */
@media (prefers-reduced-motion: no-preference) {
  html:not(.lifelines-paused) .project-hotspot.open .project-context { animation: popover-rise .45s cubic-bezier(.2, .8, .2, 1) backwards; }
  html:not(.lifelines-paused) .project-hotspot.open .project-popover h2 { animation: popover-rise .45s cubic-bezier(.2, .8, .2, 1) .08s backwards; }
  html:not(.lifelines-paused) .project-hotspot.open .project-tag { animation: popover-tag .32s ease-out backwards; animation-delay: calc(.18s + var(--t, 0) * 40ms); }
}
@keyframes popover-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes popover-tag { from { opacity: 0; transform: translateY(4px); } }
.project-popover-heading { position: relative; padding-right: 1.65rem; }
.project-context { margin: 0 0 .4rem; color: var(--muted); font-size: 13px; }
.project-popover h2 { margin: 0; color: var(--project-color, var(--grey)); font: 500 18px/1.25 var(--f-body); text-wrap: balance; }
.project-popover { cursor: pointer; }
.project-page-link { color: inherit; text-decoration: none; }
.project-page-link:focus-visible, .project-page-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.project-read-more { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-top: .75rem; border-top: 1px solid var(--line); color: var(--project-color, var(--grey)); font-weight: 500; }
.project-index-link { display: flex; align-items: center; padding-inline: .7rem; color: var(--ink); font-size: 13px; text-decoration: none; }
.project-index-link:hover, .project-index-link:focus-visible { color: var(--gold); text-decoration: underline; }
.project-dates { margin: .4rem 0 0; color: var(--muted); font: 12px/1.4 var(--f-mono); }
.project-tags { display: flex; flex-wrap: wrap; gap: .45rem 1rem; margin-top: .75rem; }
.project-tag { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink); font: 12px/1.4 var(--f-mono); }
.project-tag-square { width: 8px; height: 8px; flex: 0 0 8px; background: var(--tag-color); }
.project-tag[data-color="gold"] { --tag-color: var(--gold); }
.project-tag[data-color="blue"] { --tag-color: var(--blue); }
.project-tag[data-color="sage"] { --tag-color: var(--sage); }
.project-tag[data-color="violet"] { --tag-color: var(--violet); }
.project-tag[data-color="copper"] { --tag-color: var(--copper); }
.project-tag[data-color="green"] { --tag-color: var(--green); }
.project-tag[data-color="grey"] { --tag-color: var(--grey); }
.project-gallery { margin-top: .85rem; }
.project-gallery-stage { display: grid; isolation: isolate; overflow: hidden; border-radius: 7px; background: #202a22; }
.project-slide { grid-area: 1 / 1; margin: 0; opacity: 0; pointer-events: none; transition: opacity .35s ease-in-out; }
.project-slide.is-active { opacity: 1; pointer-events: auto; }
.project-media-gallery .project-video { margin-top: 0; }
.project-media-gallery .project-cover { object-fit: contain; }
.project-cover {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border: 1px solid var(--line); border-radius: 7px; background: #202a22;
}
.project-gallery-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin-top: .55rem; }
.project-gallery-pick { min-height: 44px; padding: 3px; border-radius: 6px; background: #202a22; letter-spacing: 0; }
.project-gallery-pick img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 3px; }
.project-gallery-pick[aria-pressed="true"] { border-color: var(--grey); box-shadow: 0 0 0 1px var(--grey); }
.project-popover ul { margin: .9rem 0 0; padding: 0; list-style: none; }
.project-popover li + li { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.project-popover h3 { margin: 0; color: var(--project-color, var(--grey)); font: 500 15px/1.3 var(--f-body); }
.project-popover li p { margin: .3rem 0 0; color: var(--muted); font-size: 14px; }
.project-contributions { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.project-contributions ul { margin-top: .55rem; }
.project-contributions h4 { margin: 0; color: var(--ink); font: 500 14px/1.4 var(--f-body); }
.project-component-diagram { margin-top: .5rem; }
.project-video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; margin-top: .85rem; border: 1px solid var(--line); border-radius: 7px; background: #202a22; }
.project-video-play { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; height: 100%; padding: 0; overflow: hidden; border: 0; border-radius: 6px; background: #202a22; color: var(--ink); }
.project-video-play[hidden] { display: none; }
.project-video-play::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0, 0, 0, .85)); pointer-events: none; }
.project-video-play img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.project-video-play svg { position: relative; z-index: 1; width: 56px; height: 56px; filter: drop-shadow(0 2px 8px #0008); }
.project-video-play rect { fill: var(--project-color, var(--blue)); }
.project-video-play path { fill: #101512; }
.project-video-play span { position: absolute; z-index: 1; bottom: .6rem; left: .75rem; font: 500 13px/1.4 var(--f-body); letter-spacing: 0; }
.project-video-play:hover rect, .project-video-play:focus-visible rect { fill: #e5f5fc; }
.project-video-play:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.project-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.component-map { min-width: 0; container-type: inline-size; }
.component-thumbnail-stage { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #121a14; }
.component-expand { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px; background: transparent; }
.component-expand svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.component-legend { display: flex; flex-wrap: wrap; gap: .6rem 1.3rem; align-items: start; margin-bottom: .5rem; font-size: 14px; }
.component-preview .component-legend { gap: .4rem .75rem; margin: .5rem 0 0; font-size: 12px; }
.component-legend-item { display: inline-flex; align-items: center; gap: .5rem; }
.component-legend-item svg { width: 25px; height: 25px; flex: none; }
.component-preview .component-legend-item { gap: .3rem; }
.component-preview .component-legend-item svg { width: 20px; height: 20px; }
.component-legend-item small { display: block; color: var(--muted); font-size: 13px; }
.component-preview .component-legend-item small { display: none; }
.component-svg {
  display: block; width: 100%; height: auto; margin-inline: auto; overflow: visible; border-radius: 7px;
  background-color: #121a14;
  background-image: linear-gradient(115deg, #07100d80, #07100d1a 55%, #07100d33), url("images/diagram-mineral-backdrop.webp");
  background-size: cover; background-position: left center;
}
.component-compact { max-width: 420px; }
.component-desktop { display: none; }
@container (min-width: 820px) {
  .component-desktop { display: block; }
  .component-compact { display: none; }
}
.component-domain rect { fill: rgba(8, 17, 13, .30); stroke: #b8c4a55c; stroke-width: 1; }
.component-domain text { fill: var(--sage); font: var(--component-group-font-size) var(--f-mono); }
.component-label { fill: var(--ink); font: var(--component-font-size) var(--f-body); }
.component-domain text, .component-label { paint-order: stroke; stroke: #08110dd9; stroke-width: 1.6; stroke-linejoin: round; }
.component-crystal-base, .component-crystal-face { opacity: 1; fill-opacity: 1; }
.component-flow, .component-signal { fill: none; vector-effect: non-scaling-stroke; pointer-events: none; }
.component-flow { stroke: #b8c7b8; stroke-width: 1.5; }
.component-open .component-flow { stroke-dasharray: 4 4; }
.component-feedback .component-flow { stroke-dasharray: 5 5; }
.component-crystal-shadow { filter: drop-shadow(0 3px 2px #020604b3); }
.component-route-label { fill: var(--muted); }
.component-result .component-label, .component-emphasis .component-label { font-weight: 600; }
.component-signal { stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 7 193; }
.component-thumbnail .component-flow { stroke-width: 1; }
.component-thumbnail .component-signal { stroke-width: 1.6; }
.project-diagram-dialog {
  --dialog-padding: 20px;
  width: min(1100px, calc(100vw - 24px)); max-width: none; max-height: calc(100svh - 24px);
  margin: auto; padding: var(--dialog-padding); overflow: auto; overscroll-behavior: contain;
  color: var(--ink); background: #101712; border: 1px solid #78957780; border-radius: 14px;
  box-shadow: 0 18px 80px #0009;
}
.project-diagram-dialog::backdrop { background: #050a07bc; }
.component-dialog-head { position: sticky; top: calc(-1 * var(--dialog-padding)); z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0 1rem; background: #101712; }
.component-dialog-head h2 { margin: 0; color: var(--ink); font: 500 20px/1.3 var(--f-body); }
.component-dialog-close { flex: none; letter-spacing: 0; }
.component-dialog-actions { display: flex; align-items: center; gap: .5rem; flex: none; }
.component-dialog-pause { letter-spacing: 0; }
body:has(.project-diagram-dialog[open]) { overflow: hidden; }
@media (max-width: 600px) {
  .project-diagram-dialog { --dialog-padding: 14px; }
  .component-dialog-head h2 { font-size: 17px; }
  .component-close-label { display: none; }
  .component-dialog-close { width: 44px; padding-inline: 0; }
}
.project-close {
  position: absolute; top: -.65rem; right: -.65rem; width: 36px; height: 36px; min-height: 36px;
  padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: 24px/1 var(--f-body);
}
.controls {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 36px); display: flex; gap: 8px; z-index: 6;
  transition: opacity .3s, visibility 0s;
}
.fps-counter {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 6px); z-index: 7;
  box-sizing: content-box; min-width: 7ch; padding: 2px 5px; border-radius: 3px; white-space: nowrap; background: #101512b3; color: var(--muted); opacity: .75;
  font: 13px/1.3 var(--f-mono); text-align: right; pointer-events: none; user-select: none;
  contain: layout style paint;
}
/* Portrait: the controls close the timeline, just above the CV sheet. */
.timeline-vertical .controls { position: absolute; top: calc(var(--scene-height, 100svh) - var(--cv-peek) - 60px); bottom: auto; }
/* Horizontal: they stay on screen along time, and step aside while the CV is read. */
html.cv-reading .controls { opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
button {
  min-height: 42px; font: 12px/1 var(--f-mono); letter-spacing: .06em; color: var(--muted);
  background: rgba(13, 19, 15, .92); border: 1px solid var(--line); border-radius: 999px; padding: .6rem 1rem; cursor: pointer;
}
button:hover, button:focus-visible { color: var(--ink); border-color: var(--sage); outline: 1px solid var(--sage); outline-offset: 3px; }
.fallback { position: relative; padding: 180px 24px 24px; }
@media (max-width: 899px) {
  .controls { position: absolute; }
  .timeline-heading { --heading-y: calc(env(safe-area-inset-top, 0px) + 18px); --heading-x: max(16px, env(safe-area-inset-left, 0px)); }
  .timeline-heading header { grid-template-columns: 1fr; gap: 1.4rem; }
  header p { max-width: 24rem; }
  .cv-tagline { font-size: 17px; }
  .cv-positioning { max-width: 24rem; }
  .cv-positioning p { font-size: 15px; }
  h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
  header .cv-identity { font-size: 16px; margin-bottom: .6rem; }
  .cv-sep { display: none; }
  .cv-job { display: block; }
  .card { width: clamp(10.5rem, 50vw, 15.3rem); padding: .7rem .8rem; }
  .card h2 { font-size: 15px; }
  .career-note { width: clamp(10rem, 46vw, 12rem); }
}
@media (prefers-reduced-motion: reduce) {
  .card, .career-note, .project-slide, .project-popover, .project-gem-signal { transition: none; }
  .project-hotspot.preview:not(.fading) .project-popover, .project-hotspot.preview.fading .project-popover,
  .project-hotspot.preview::after { animation: none; }
  .project-gem-signal::before { animation: none; transform: scale(1.25); opacity: .8; }
  .project-gem-signal::after { display: none; }
}

/* Full CV after the timeline: a sheet whose top edge rises over the scene's
   lower edge (--cv-peek), visible from the first screen. A horizontal page
   keeps it in view wherever it is along time. Its blocks rise in once, when
   it enters the screen (lifelines.js); Pause or reduced motion show them directly. */
.cv-details { position: relative; z-index: 5; margin-top: calc(-1 * var(--cv-peek)); }
html.timeline-horizontal .cv-details { position: sticky; left: 0; width: var(--view-width, 100vw); }
.cv-sheet {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .8fr);
  grid-template-areas: "skills certifications education" "skills certifications languages" "contact contact contact";
  grid-template-rows: auto 1fr auto; align-items: start; position: relative; gap: 2.2rem clamp(2rem, 4vw, 4rem);
  padding: 2.4rem max(16px, env(safe-area-inset-right, 0px)) 4.5rem max(28px, env(safe-area-inset-left, 0px));
  background: #141b16; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
  box-shadow: 0 -16px 36px rgba(2, 6, 4, .55);
}
/* A small handle in the visible edge says that the page continues. */
.cv-sheet::before { content: ""; position: absolute; top: 9px; left: 50%; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px; background: rgba(184, 207, 174, .3); }
.cv-block h2 { margin: 0 0 1rem; font: 400 1.75rem/1.1 var(--f-display); color: var(--ink); text-wrap: balance; }
.cv-skills { grid-area: skills; container-type: inline-size; }
/* Skill groups in one, two or four even columns, by the width they get. */
.cv-skill-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem 1.8rem; }
@container (min-width: 30rem) { .cv-skill-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 56rem) { .cv-skill-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cv-certifications { grid-area: certifications; }
.cv-education { grid-area: education; }
.cv-languages { grid-area: languages; }
.cv-footer { grid-area: contact; display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 2rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.cv-footer h2 { margin: 0; }
.cv-footer-links { display: flex; flex-wrap: wrap; gap: .3rem 1.6rem; margin: 0; font-size: 15px; }
.cv-email { overflow-wrap: anywhere; }
.cv-skill-group h3 { margin: 0 0 .5rem; font: 500 11.5px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sage); }
.cv-chips, .cv-list { margin: 0; padding: 0; list-style: none; }
.cv-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.cv-chips li { padding: .28rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(184, 207, 174, .05); font-size: 14px; line-height: 1.35; color: var(--ink); }
.cv-list li + li { margin-top: .9rem; }
.cv-item { margin: 0; font: 500 15px/1.35 var(--f-body); color: var(--ink); }
.cv-meta { margin: .15rem 0 0; font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.cv-meta time { font: 12.5px/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.cv-languages-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.cv-languages-list li + li { margin-top: .55rem; }
.cv-languages-list .cv-meta { margin: 0; }
@media (max-width: 1199px) {
  .cv-sheet { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "skills skills" "certifications education" "certifications languages" "contact contact"; grid-template-rows: auto auto 1fr auto; }
}
@media (max-width: 699px) {
  .cv-sheet { grid-template-columns: minmax(0, 1fr); grid-template-areas: "skills" "certifications" "education" "languages" "contact"; grid-template-rows: none; gap: 2rem; padding: 2rem max(16px, env(safe-area-inset-right, 0px)) 4rem max(16px, env(safe-area-inset-left, 0px)); }
  .cv-block h2 { font-size: 1.55rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .cv-details:not(.in) .cv-block { opacity: 0; }
  .cv-details.in:not(.instant) .cv-block { animation: cv-rise .9s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i) * 110ms); }
}
.lifelines-paused .cv-details .cv-block { animation-play-state: paused; }
@keyframes cv-rise { from { opacity: 0; transform: translateY(28px); } }
