/* Site styles: the "Datasheet" look (IBM Plex Sans, blue accent, label column on
   the left), in a dark and a light theme. <html data-style="a"> is fixed. */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

/* Layout and type per style. */
html[data-style="a"] {
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 72rem;
  --body-size: 1.0625rem;
  --lh: 1.6;
  --radius: 4px;
  --head-weight: 600;
  --head-track: -0.015em;
}

/* Colours. Every pair used for text is checked by check-contrast.mjs in both
   themes, so switching theme never drops below WCAG AA. Dark is the default. */
html[data-style="a"][data-theme="dark"] {
  color-scheme: dark;
  --online: #4cc38a;
  --bg: #0a0c10;
  --band: #12161d;
  --ink: #eef1f5;
  --soft: #c5ccd6;
  --muted: #9aa4b2;
  --rule: #2a323e;
  --accent: #8ab4ff;
  --accent-ink: #0a0c10;
  --accent-soft: #152440;
  --field: #12161d;
  --field-border: #6b7686;
  --sky: #06080f;
}
html[data-style="a"][data-theme="light"] {
  color-scheme: light;
  --online: #1a7f4b;
  --bg: #ffffff;
  --band: #f3f6fb;
  --ink: #161b22;
  --soft: #3d4653;
  --muted: #5d6877;
  --rule: #d8dee7;
  --accent: #1c4fd6;
  --accent-ink: #ffffff;
  --accent-soft: #e8eefc;
  --field: #ffffff;
  --field-border: #7d8898;
  --sky: #f3f6fb;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--lh);
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

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

h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-track); margin: 0; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.1rem; min-height: 4rem; flex-wrap: wrap; padding-block: 0.6rem; }
.brand { font-family: var(--font-head); font-weight: 600; font-size: 1.125rem; color: var(--ink); text-decoration: none; letter-spacing: var(--head-track); }
.site-nav { display: flex; align-items: center; gap: clamp(0.7rem, 1.2vw, 1.1rem); flex-wrap: wrap; font-family: var(--font-ui); font-size: 0.9375rem; }
.site-nav a { color: var(--soft); text-decoration: none; padding-block: 0.35rem; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav .cv { color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius); padding: 0.4rem 0.85rem; font-weight: 500; }
.site-nav .cv:hover { background: var(--accent); color: var(--accent-ink); text-decoration: none; }

/* ---------- buttons ---------- */
.btn { display: inline-block; font-family: var(--font-ui); font-size: 1rem; font-weight: 500; line-height: 1.2; padding: 0.8rem 1.25rem; border-radius: var(--radius); text-decoration: none; border: 1px solid var(--accent); cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.btn-quiet { background: transparent; color: var(--accent); }
.btn-quiet:hover { background: var(--accent-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(2.75rem, 7vw, 5rem) clamp(2.5rem, 6vw, 4.25rem); }
.hero .wrap { display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); line-height: 1.08; }
.hero .lead { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); color: var(--soft); max-width: 36em; margin-top: 1.35rem; }
.hero .facts { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--muted); margin-top: 1rem; }
.hero .actions { margin-top: 1.9rem; }

.photo { margin: 0; }
.photo-frame { display: grid; place-items: center; aspect-ratio: 4 / 5; background: var(--band); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--muted); font-family: var(--font-ui); text-align: center; overflow: hidden; }
.photo-frame svg { width: 46%; height: auto; opacity: 0.55; }
.photo-frame span { display: block; font-size: 0.875rem; margin-top: 0.75rem; }
.photo-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.hero .headline { font-family: var(--font-ui); font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--soft); margin: 0.4rem 0 1rem; max-width: 36rem; }

/* "Download CV": choose PDF or Word */
.cv-menu { position: relative; display: inline-block; }
.cv-menu > summary { list-style: none; cursor: pointer; }
.cv-menu > summary::-webkit-details-marker { display: none; }
.cv-menu > summary::after { content: ""; display: inline-block; width: 0.4em; height: 0.4em; margin-left: 0.5em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-0.2em) rotate(45deg); }
.cv-menu[open] > summary::after { transform: translateY(0.05em) rotate(-135deg); }
.cv-pick { position: absolute; z-index: 30; top: calc(100% + 0.4rem); right: 0; min-width: 13rem; display: grid; gap: 0.15rem; padding: 0.4rem; background: var(--bg); border: 1px solid var(--rule); border-radius: max(var(--radius), 10px); box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); font-family: var(--font-ui); text-align: left; }
.cv-pick a { display: grid; padding: 0.5rem 0.7rem; border-radius: 8px; color: var(--ink); font-weight: 600; text-decoration: none; }
.cv-pick a span { font-weight: 400; font-size: 0.8125rem; color: var(--muted); }
.cv-pick a:hover, .cv-pick a:focus-visible { background: var(--band); color: var(--accent); }
.cv-menu.btn { padding: 0; }
.cv-menu.btn > summary { display: block; padding: 0.8rem 1.25rem; }
.hero .cv-menu .cv-pick, .cv-inline .cv-pick { left: 0; right: auto; }
.cv-inline > summary { color: var(--accent); }

/* Hero: a small round photo to the left of the title, the text beside it; on
   phones the photo sits small above the title, so it comes first, not after the text. */
html[data-style="a"] .hero .wrap { grid-template-columns: 10.5rem minmax(0, 1fr); align-items: start; gap: clamp(1.75rem, 3.5vw, 3rem); }
.hero .photo { order: -1; margin-top: 0.35rem; }
.hero .photo-frame { aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 0; box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px color-mix(in srgb, var(--accent) 55%, transparent), 0 18px 40px rgba(0, 0, 0, 0.28); }
.hero .photo-frame img { object-position: 50% 28%; }
html[data-style="a"] .hero h1 { font-weight: 600; letter-spacing: -0.025em; }

.sub-head { font-family: var(--font-head); font-size: 1.0625rem; font-weight: 600; letter-spacing: 0; margin: 2.75rem 0 1.25rem; padding-top: 1.5rem; border-top: 1px dashed var(--rule); }
.more { margin-top: 2rem; }

/* ---------- role views ---------- */
/* One role is shown at a time. The choice lives on <html data-role>, set before
   the page paints; without JavaScript there is no data-role and all three show. */
.role-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.4rem; width: fit-content; max-width: 100%; background: var(--band); border: 1px solid var(--rule); border-radius: 1.6rem; padding: 0.4rem 0.45rem; font-family: var(--font-ui); font-size: 0.9375rem; }
.role-tabs .label { color: var(--muted); margin: 0 0.5rem 0 0.7rem; }
.role-tabs a { color: var(--soft); text-decoration: none; padding: 0.4rem 0.9rem; border-radius: 999px; }
.role-tabs a:hover { background: var(--bg); color: var(--ink); }
html[data-role="swe"] .role-tabs a[data-r="swe"],
html[data-role="ai"] .role-tabs a[data-r="ai"],
html[data-role="fde"] .role-tabs a[data-r="fde"] { background: var(--accent); color: var(--accent-ink); font-weight: 500; }
html[data-role="swe"] .role-panel:not([data-r="swe"]),
html[data-role="ai"] .role-panel:not([data-r="ai"]),
html[data-role="fde"] .role-panel:not([data-r="fde"]) { display: none; }
.role-panel { margin-top: 2rem; scroll-margin-top: 10rem; }
html:not([data-role]) .role-panel + .role-panel { margin-top: 4rem; }
.role-panel > h3 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.1; }
html[data-style="a"] .role-panel > h3 { letter-spacing: -0.025em; }
.role-panel .lead { font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); color: var(--soft); max-width: 38em; margin-top: 1rem; }

.proof { display: grid; gap: 1rem; margin-top: 2.25rem; }
.proof li { border-left: 3px solid var(--accent); padding: 0.15rem 0 0.15rem 1rem; }
.proof strong { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.0625rem; }
.proof span { color: var(--soft); font-size: 0.97em; }
html[data-style="a"] .proof { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }

/* ---------- sections ---------- */
.sec { border-top: 1px solid var(--rule); padding-block: clamp(2.5rem, 6vw, 4.25rem); }
.sec > .wrap { display: grid; gap: 1.5rem; }
.sec h2 { font-size: clamp(1.45rem, 2.6vw, 1.85rem); line-height: 1.2; }
.sec .sec-note { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--muted); margin-top: 0.4rem; }

html[data-style="a"] .sec > .wrap { grid-template-columns: 13.5rem minmax(0, 1fr); gap: 2.5rem; }
html[data-style="a"] .sec-head { position: sticky; top: 5.5rem; align-self: start; }

/* ---------- experience ---------- */
.jobs { display: grid; gap: 2.1rem; }
.job { display: grid; gap: 0.25rem 1.75rem; }
.job .when { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 0.2rem; }
.job-title { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-track); font-size: 1.1875rem; line-height: 1.3; margin: 0; }
.job .where { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--muted); margin-top: 0.1rem; }
.job .what { color: var(--soft); margin-top: 0.55rem; max-width: 38em; }
html[data-style="a"] .job { grid-template-columns: 10.5rem minmax(0, 1fr); }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; font-family: var(--font-ui); font-size: 0.8125rem; }
.tags li { background: var(--band); border: 1px solid var(--rule); color: var(--soft); border-radius: 999px; padding: 0.12rem 0.65rem; }

.edu-projects { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--muted); margin-top: 0.7rem; max-width: 40em; }

/* ---------- skills ---------- */
/* One card per group. The small labels under a skill say where it was used;
   their dot takes the colour that kind of work has on the timeline. */
.skills { display: grid; gap: 1.25rem; }
.skill-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); gap: 1.25rem; }
.skill-card { background: var(--band); border: 1px solid var(--rule); border-radius: max(var(--radius), 8px); padding: 1.35rem 1.4rem 1.25rem; display: flex; flex-direction: column; }
.skill-card h3 { font-size: 1.25rem; line-height: 1.25; }
.skill-label { font-family: var(--font-ui); font-size: 0.875rem; color: var(--accent); margin-top: 0.25rem; }
.skill-list { margin-top: 0.9rem; }
.skill-list li { display: grid; gap: 0.4rem; padding: 0.7rem 0; border-top: 1px solid var(--rule); }
.skill-name { font-weight: 600; line-height: 1.3; }
.srcs, .skill-card .also { display: flex; flex-wrap: wrap; gap: 0.35rem; font-family: var(--font-ui); font-size: 0.8125rem; }
.src { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--bg); border: 1px solid var(--rule); border-radius: 999px; padding: 0.1rem 0.65rem 0.1rem 0.55rem; color: var(--soft); text-decoration: none; line-height: 1.5; }
.src i { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--c, var(--muted)); }
.src:not([data-track]) { padding-inline: 0.65rem; }
a.src { color: var(--ink); }
a.src:hover { border-color: var(--accent); color: var(--accent); }
.skill-card .also { align-items: center; margin-top: auto; padding-top: 0.9rem; border-top: 1px solid var(--rule); color: var(--muted); }
.skill-card .also > span:first-child { margin-right: 0.3rem; }
.skill-card .also .src { border-style: dashed; border-color: var(--field-border); }
/* The filter row uses the timeline's buttons and names. Here a filter fades the rest instead of hiding it. */
.sk-filters { font-family: var(--font-ui); font-size: 0.875rem; }
.skills [data-track].is-dim { opacity: 0.22; pointer-events: auto; }

/* Years per programming language: one row each, a bar for every job or project it was used in. */
.skill-chart { grid-column: 1 / -1; position: relative; }
.yrs { margin-top: 1.1rem; display: grid; gap: 0.15rem; }
.yrs-row { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: 0 1.25rem; align-items: center; padding: 0.5rem 0; border-top: 1px solid var(--rule); }
.yrs-name { display: grid; gap: 0.1rem; }
.yrs-total { font-family: var(--font-ui); font-size: 0.875rem; color: var(--soft); font-variant-numeric: tabular-nums; }
.yrs-track { position: relative; height: calc(var(--lanes) * 16px + 8px); background-image: linear-gradient(to right, var(--rule) 1px, transparent 1px); background-size: var(--year) 100%; }
.yrs-seg { position: absolute; border: 0; padding: 0; cursor: pointer; top: calc(var(--lane) * 16px + 6px); height: 12px; min-width: 8px; border-radius: 4px; background: var(--c); box-shadow: 0 0 0 1px var(--band); margin-left: 1px; }
.yrs-seg:not(.is-point) { box-sizing: border-box; border-right: 2px solid var(--band); border-radius: 4px 6px 6px 4px; }
.yrs-seg.is-point { width: 10px; height: 10px; top: calc(var(--lane) * 16px + 7px); border-radius: 50%; box-shadow: 0 0 0 2px var(--band); margin-left: -1px; }
.yrs-seg::before { content: ""; position: absolute; inset: -7px -3px; } /* a target larger than the mark */
.yrs-seg:hover, .yrs-seg:focus-visible, .yrs-seg.is-on { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 1; }
.yrs-axis { border-top: 0; padding: 0; }
.yrs-years { position: relative; height: 1.5rem; font-family: var(--font-ui); font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.yrs-years span { position: absolute; top: 0.25rem; padding-left: 0.3rem; }
.yrs-readout { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--soft); min-height: 3em; margin-top: 0.6rem; padding: 0.6rem 0.8rem; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius); }
.yrs-readout strong { color: var(--ink); font-weight: 600; margin-right: 0.25rem; }
.yrs-note { font-family: var(--font-ui); font-size: 0.875rem; color: var(--muted); margin-top: 0.7rem; max-width: 52em; }
/* The details card opens here, under the bar that was selected (a sheet at the bottom of the screen on phones). */
.sk-card h4 { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-track); font-size: 1.25rem; line-height: 1.3; margin: 0.3rem 0 0; }
.tl-meta .sk-kind { color: var(--c); font-weight: 600; }
.sk-card .more { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1.25rem; }
.sk-totimeline { font: inherit; font-weight: 500; color: var(--accent); background: none; border: 0; padding: 0.3rem 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
@media (min-width: 40.01rem) { .tl-card.sk-card { top: var(--y, 14px); } }
.yrs-list { margin-top: 0.8rem; font-family: var(--font-ui); font-size: 0.9375rem; }
.yrs-list summary { cursor: pointer; color: var(--accent); font-weight: 500; width: fit-content; padding-block: 0.3rem; }
.yrs-list .skill-list { font-family: var(--font-body); font-size: 1rem; }
@media (max-width: 40rem) {
  .yrs-row { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
  .yrs-name { grid-template-columns: 1fr auto; align-items: baseline; }
  .yrs-years span:nth-child(even) { display: none; }
  .yrs-axis > span { display: none; }
}

/* ---------- courses and certificates ---------- */
.certs { display: grid; }
.certs li { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr); gap: 0.1rem 1.75rem; padding: 0.6rem 0; border-top: 1px solid var(--rule); color: var(--soft); }
.certs li:first-child { border-top: 0; padding-top: 0; }
.certs .when { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.certs b { color: var(--ink); font-weight: 600; }
@media (max-width: 36rem) { .certs li { grid-template-columns: minmax(0, 1fr); } }

/* ---------- projects ---------- */
.projects { display: grid; gap: 2rem; }
.proj { display: grid; gap: 0.9rem; align-content: start; }
.shot { margin: 0; aspect-ratio: 16 / 10; display: grid; place-items: center; background: var(--band); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--muted); font-family: var(--font-ui); font-size: 0.875rem; text-align: center; padding: 1rem; }
.proj h3 { font-size: 1.1875rem; line-height: 1.3; }
.proj h3 a { color: var(--ink); }
.proj h3 a:hover { color: var(--accent); }
.proj p { color: var(--soft); }
.readmore { font-family: var(--font-ui); font-size: 0.9375rem; font-weight: 500; }
.more { font-family: var(--font-ui); font-size: 0.9375rem; font-weight: 500; }

html[data-style="a"] .projects { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; }

.brief { display: grid; gap: 0.9rem; }
.brief li { color: var(--soft); }
.brief b { color: var(--ink); font-weight: 600; }
.brief b a { color: inherit; }
.brief b a:hover { color: var(--accent); }

/* ---------- publications ---------- */
.pubs { display: grid; gap: 1.6rem; }
.pub .title { font-family: var(--font-head); font-weight: 600; font-size: 1.125rem; line-height: 1.35; }
.pub .authors { color: var(--soft); margin-top: 0.3rem; font-size: 0.97em; }
.pub .authors b { color: var(--ink); font-weight: 600; }
.pub .venue { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--muted); margin-top: 0.25rem; }
.pub-head { font-size: 1.0625rem; margin-bottom: 1.25rem; }
.pub-note { color: var(--soft); max-width: 44em; margin: -0.5rem 0 1.5rem; }
.pub { scroll-margin-top: 6rem; }
.pub-links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.5rem; font-family: var(--font-ui); font-size: 0.9375rem; font-weight: 500; margin-top: 0.6rem; }
.pub .authors { max-width: 46em; }

/* ---------- contact ---------- */
.contact-grid { display: grid; gap: 2rem; }
.contact-form { display: grid; gap: 1rem; max-width: 34rem; }
.contact-form label { display: grid; gap: 0.35rem; font-family: var(--font-ui); font-size: 0.9375rem; font-weight: 500; }
.contact-form input,
.contact-form textarea { font: inherit; font-family: var(--font-ui); font-size: 1rem; color: var(--ink); background: var(--field); border: 1px solid var(--field-border); border-radius: var(--radius); padding: 0.7rem 0.8rem; width: 100%; }
.contact-form textarea { min-height: 8.5rem; resize: vertical; }
.contact-form .btn { justify-self: start; }
.elsewhere { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }

.site-footer { border-top: 1px solid var(--rule); padding-block: 1.75rem 2.5rem; font-family: var(--font-ui); font-size: 0.875rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }

/* ---------- project labels and the team filter ---------- */
.proj-filters { font-family: var(--font-ui); font-size: 0.875rem; margin-bottom: 1.5rem; }
.proj-filter { font: 500 0.875rem/1 var(--font-ui); color: var(--ink); background: transparent; border: 1px solid var(--field-border); border-radius: 999px; padding: 0.5rem 0.85rem; cursor: pointer; }
.proj-filter:hover { background: var(--band); border-color: var(--ink); }
.proj-filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
html[data-projects="online"] [data-status]:not([data-status="online"]),
html[data-projects="offline"] [data-status]:not([data-status="offline"]) { display: none; }
.proj-labels { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-family: var(--font-ui); font-size: 0.8125rem; color: var(--muted); }
.proj .proj-labels { color: var(--muted); }
.proj-labels .has-demo { color: var(--accent); font-weight: 500; text-decoration: none; }
.proj-labels a.has-demo:hover { text-decoration: underline; }
/* Online / offline: a filled green dot or an empty ring; the word is in the text colour */
.status { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-ui); font-size: 0.8125rem; font-weight: 500; color: var(--soft); white-space: nowrap; }
.status-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: none; }
.status.is-on .status-dot { background: var(--online); box-shadow: 0 0 0 3px color-mix(in srgb, var(--online) 22%, transparent); }
.status.is-off .status-dot { border: 1.5px solid var(--muted); }
.status-note { color: var(--soft); }
.proj-when { margin-top: 0.15rem; font-family: var(--font-ui); font-size: 0.8125rem; color: var(--muted); }
.brief-how { font-family: var(--font-ui); font-size: 0.875rem; color: var(--muted); }

/* ---------- demos on project pages ---------- */
.demo-head { font-size: clamp(1.35rem, 2.4vw, 1.65rem); line-height: 1.25; margin-bottom: 1rem; }
.demo { background: var(--band); border: 1px solid var(--rule); border-radius: max(var(--radius), 8px); padding: clamp(1rem, 2.5vw, 1.5rem); display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.demo > * { min-width: 0; }
.demo-status { font-family: var(--font-ui); font-size: 0.875rem; color: var(--muted); grid-column: 1 / -1; }
.demo select, .demo input[type="text"] { font: inherit; font-family: var(--font-ui); font-size: 1rem; color: var(--ink); background: var(--field); border: 1px solid var(--field-border); border-radius: var(--radius); padding: 0.55rem 0.7rem; }
.demo select { max-width: 100%; width: 100%; }
.demo label { min-width: 0; max-width: 100%; display: grid; gap: 0.3rem; font-family: var(--font-ui); font-size: 0.875rem; font-weight: 500; color: var(--soft); }
.demo :disabled { opacity: 0.55; cursor: default; }
.demo h3 { font-family: var(--font-ui); font-size: 0.9375rem; font-weight: 600; letter-spacing: 0; margin-bottom: 0.5rem; }

/* ColPali: questions and the indexing facts on the left, the RAG steps on the right */
#cp-demo { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr); align-items: start; }
.cp-intro { grid-column: 1 / -1; display: grid; gap: 0.5rem; font-family: var(--font-ui); font-size: 0.9rem; color: var(--soft); padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.cp-intro b { color: var(--ink); }
.cp-pick { display: grid; gap: 1.25rem; align-content: start; }
.cp-group { display: grid; gap: 0.35rem; }
.cp-group + .cp-group { margin-top: 0.75rem; }
.cp-group-name { font-family: var(--font-ui); font-size: 0.8rem; color: var(--muted); }
.cp-q { text-align: left; padding: 0.5rem 0.7rem; font-family: var(--font-ui); font-size: 0.875rem; line-height: 1.35; color: var(--soft); background: var(--bg); border: 1px solid var(--rule); border-radius: max(var(--radius), 6px); cursor: pointer; }
.cp-q:hover { border-color: var(--field-border); }
.cp-q[aria-pressed="true"] { color: var(--ink); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.cp-q:focus-visible, .cp-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cp-index { font-family: var(--font-ui); font-size: 0.85rem; color: var(--soft); display: grid; gap: 0.5rem; }
.cp-docs { padding-left: 1.1rem; display: grid; gap: 0.4rem; list-style: disc; }
.cp-ask { font-family: var(--font-head); font-size: 1.2rem; font-weight: 600; margin-bottom: 0.75rem; }
.cp-steps { padding-left: 1.4rem; display: grid; gap: 1.1rem; font-family: var(--font-ui); font-size: 0.9rem; color: var(--soft); }
.cp-steps b { color: var(--ink); }
.cp-steps li::marker { font-weight: 600; color: var(--accent); }
.cp-chart { display: flex; align-items: flex-end; gap: 2px; height: 7rem; margin-top: 0.6rem; padding-top: 1.2rem; border-bottom: 1px solid var(--rule); }
.cp-bar { position: relative; flex: 1 1 0; min-width: 3px; background: var(--field-border); opacity: 0.55; border-radius: 2px 2px 0 0; }
.cp-bar.is-top { background: var(--accent); opacity: 1; }
.cp-bar em { position: absolute; bottom: 100%; left: 50%; translate: -50% 0; margin-bottom: 2px; font-style: normal; font-weight: 600; font-size: 0.75rem; color: var(--ink); }
.cp-table { margin-top: 0.4rem; font-size: 0.8rem; }
.cp-table summary { cursor: pointer; color: var(--accent); }
.cp-table table { margin-top: 0.4rem; border-collapse: collapse; }
.cp-table td, .cp-table th { padding: 0.1rem 0.8rem 0.1rem 0; text-align: left; font-variant-numeric: tabular-nums; }
.cp-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0.6rem 0; }
.cp-tab { display: grid; gap: 0.3rem; padding: 0.35rem; text-align: left; font-family: var(--font-ui); font-size: 0.8rem; color: var(--soft); background: var(--bg); border: 1px solid var(--rule); border-radius: max(var(--radius), 6px); cursor: pointer; }
.cp-tab img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 3px; background: #fff; }
.cp-tab b { color: var(--ink); }
.cp-tab[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cp-view { display: grid; gap: 0.5rem; }
.cp-view img { width: 100%; height: auto; background: #fff; border: 1px solid var(--rule); border-radius: max(var(--radius), 6px); }
.cp-toggle { display: flex !important; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.cp-answer { margin-top: 0.6rem; padding: 0.85rem 1rem; background: var(--bg); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: max(var(--radius), 6px); color: var(--ink); }
.cp-answer-head { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; }
.cp-answer-body { display: grid; gap: 0.45rem; font-size: 0.92rem; line-height: 1.5; }
.cp-answer-body ul, .cp-answer-body ol { padding-left: 1.2rem; display: grid; gap: 0.25rem; }
@media (max-width: 52rem) { #cp-demo { grid-template-columns: minmax(0, 1fr); } }

.cp-gold { margin-top: 0.5rem; font-size: 0.85rem; color: var(--soft); }
.cp-rating { margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); font-size: 0.85rem; color: var(--soft); }
.cp-rating b { font-weight: 600; margin-right: 0.25rem; }
.cp-rating.is-correct b, .cp-mark.is-correct { color: var(--accent); }
.cp-rating.is-partial b, .cp-mark.is-partial { color: var(--ink); }
.cp-rating.is-abstain b, .cp-mark.is-abstain { color: var(--muted); }
.cp-rating.is-wrong b, .cp-mark.is-wrong { color: var(--t-intern); }
.cp-mark { font-style: normal; font-weight: 700; margin-left: 0.25rem; }
.cp-rating-note { margin-top: 0.4rem; font-size: 0.8rem; color: var(--muted); }

/* "How well did it do?" on a project page */
.evaluation { margin-top: clamp(2rem, 5vw, 3rem); }
.eval-intro, .eval-improve { max-width: 46rem; color: var(--soft); }
.eval-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; margin: 1.25rem 0; }
.eval-stats div { padding: 0.9rem 1rem; background: var(--band); border: 1px solid var(--rule); border-radius: max(var(--radius), 8px); }
.eval-stats dt { font-family: var(--font-head); font-size: 1.6rem; font-weight: 600; color: var(--ink); }
.eval-stats dd { margin: 0.2rem 0 0; font-family: var(--font-ui); font-size: 0.875rem; color: var(--soft); }
.eval-examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.eval-example { margin: 0; padding: 0.9rem 1rem; border: 1px solid var(--rule); border-top: 3px solid var(--muted); border-radius: max(var(--radius), 8px); display: grid; gap: 0.45rem; align-content: start; }
.eval-example.is-good { border-top-color: var(--accent); }
.eval-example.is-miss { border-top-color: var(--ink); }
.eval-example.is-wrong { border-top-color: var(--t-intern); }
.eval-example figcaption { font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.eval-q { font-family: var(--font-ui); font-weight: 600; color: var(--ink); }
.eval-example blockquote { margin: 0; padding-left: 0.75rem; border-left: 2px solid var(--rule); font-style: italic; color: var(--soft); }
.eval-verdict { font-family: var(--font-ui); font-size: 0.875rem; color: var(--soft); }

/* Medical notes: samples and a note box on the left, the steps and results on the right */
#mn-demo { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); align-items: start; }
.mn-pick { display: grid; gap: 0.6rem; align-content: start; }
.mn-samples { display: grid; gap: 0.5rem; }
.mn-sample-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; }
.mn-sample { display: grid; gap: 0.1rem; text-align: left; padding: 0.6rem 0.75rem; font-family: var(--font-ui); font-size: 0.875rem; color: var(--soft); background: var(--bg); border: 1px solid var(--rule); border-radius: max(var(--radius), 6px); cursor: pointer; }
.mn-sample b { color: var(--ink); font-size: 0.95rem; }
.mn-sample:hover:not(:disabled) { border-color: var(--field-border); }
.mn-sample[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.mn-sample:focus-visible, .mn-pdf:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mn-pdf { font-family: var(--font-ui); font-size: 0.8rem; white-space: nowrap; }
.mn-or { margin-top: 0.6rem; }
#mn-text { font: inherit; font-family: var(--font-ui); font-size: 0.95rem; color: var(--ink); background: var(--field); border: 1px solid var(--field-border); border-radius: var(--radius); padding: 0.6rem 0.7rem; resize: vertical; width: 100%; }
.mn-run-text { justify-self: start; }
.mn-steps { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.45rem; counter-reset: mn; font-family: var(--font-ui); font-size: 0.9rem; }
.mn-steps li { counter-increment: mn; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); column-gap: 0.6rem; color: var(--muted); }
.mn-steps li::before { content: counter(mn); grid-row: span 2; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--rule); font-size: 0.8rem; }
.mn-steps b { font-weight: 600; }
.mn-detail { font-size: 0.85rem; }
.mn-steps li[data-state="active"], .mn-steps li[data-state="done"] { color: var(--ink); }
.mn-steps li[data-state="active"]::before { border-color: var(--accent); color: var(--accent); }
.mn-steps li[data-state="done"]::before { content: "\2713"; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mn-steps li[data-state="skipped"] { opacity: 0.6; }
.mn-steps li[data-state="failed"] { color: var(--t-intern); }
.mn-notes { display: grid; gap: 0.75rem; }
.mn-note { background: var(--bg); border: 1px solid var(--rule); border-radius: max(var(--radius), 6px); padding: 0.85rem 1rem; display: grid; gap: 0.5rem; }
.mn-note-head { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.mn-note-n { font-family: var(--font-ui); font-size: 0.8rem; color: var(--muted); }
.mn-verdict { font-family: var(--font-head); font-size: 1.25rem; font-weight: 600; }
.mn-truth { font-family: var(--font-ui); font-size: 0.875rem; color: var(--soft); }
.mn-truth.is-wrong { color: var(--t-intern); }
.mn-meta { font-family: var(--font-ui); font-size: 0.8rem; color: var(--muted); }
.mn-note details { font-family: var(--font-ui); font-size: 0.85rem; color: var(--soft); }
.mn-note details summary { cursor: pointer; color: var(--accent); }
.mn-note details p { white-space: pre-line; margin-top: 0.4rem; max-height: 14rem; overflow: auto; }
.mn-json { margin: 0.75rem 0 0; padding: 0.75rem 1rem; background: var(--bg); border: 1px solid var(--rule); border-radius: max(var(--radius), 6px); font-family: var(--mono, ui-monospace, monospace); font-size: 0.85rem; overflow-x: auto; }
@media (max-width: 52rem) { #mn-demo { grid-template-columns: minmax(0, 1fr); } }

/* Fashion-MNIST: test pictures on the left, the model's answer on the right */
#fashion-demo { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.fm-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.fm-grid button { padding: 0; border: 2px solid transparent; border-radius: 3px; background: #000; cursor: pointer; line-height: 0; }
.fm-grid canvas { width: 100%; height: auto; image-rendering: pixelated; }
.fm-grid button:hover { border-color: var(--field-border); }
.fm-grid button[aria-pressed="true"] { border-color: var(--accent); }
.fm-result { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem 1.25rem; align-items: center; }
.fm-big { width: 7rem; height: 7rem; image-rendering: pixelated; background: #000; border: 1px solid var(--rule); border-radius: var(--radius); }
.fm-verdict { font-family: var(--font-head); font-size: 1.375rem; font-weight: 600; line-height: 1.25; }
.fm-truth { font-family: var(--font-ui); font-size: 0.9375rem; margin-top: 0.2rem; color: var(--soft); }
.fm-truth.is-wrong { color: var(--t-intern); }
.fm-bars { grid-column: 1 / -1; display: grid; gap: 0.3rem; font-family: var(--font-ui); font-size: 0.875rem; }
.fm-bar { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 3rem; gap: 0.75rem; align-items: center; color: var(--soft); }
.fm-track { display: block; height: 10px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.fm-track i { display: block; height: 100%; background: var(--field-border); border-radius: 0 4px 4px 0; }
.fm-bar.is-top { color: var(--ink); font-weight: 600; }
.fm-bar.is-top .fm-track i { background: var(--accent); }
.fm-bar.is-real span:first-child::after { content: " (real)"; font-weight: 400; color: var(--muted); }
.fm-bar b { font-weight: inherit; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 52rem) { #fashion-demo { grid-template-columns: minmax(0, 1fr); } .fm-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); } }

/* calculator: a terminal on the left, tokens and examples on the right */
#calc-demo { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.term { --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; background: var(--sky); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.term-screen { height: 17rem; overflow-y: auto; padding: 0.9rem 1rem; font-family: var(--mono); font-size: 0.875rem; line-height: 1.55; }
.term-screen p { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-note { color: var(--muted); }
.term-in { color: var(--ink); margin-top: 0.35rem; }
.term-out { color: var(--accent); font-weight: 600; }
.term-err { color: var(--t-intern); }
.term-line { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.75rem; border-top: 1px solid var(--rule); background: var(--bg); }
.demo .term-line label { font-family: var(--mono); font-size: 1rem; color: var(--accent); }
.demo .term-line input { flex: 1; min-width: 0; font-family: var(--mono); }
.term-line .btn { padding: 0.6rem 0.9rem; font-size: 0.9375rem; }
.calc-tokens { display: flex; flex-wrap: wrap; gap: 0.4rem; min-height: 3.4rem; margin-bottom: 1.25rem; }
.tok { display: inline-grid; justify-items: center; gap: 0.1rem; background: var(--bg); border: 1px solid var(--field-border); border-radius: var(--radius); padding: 0.3rem 0.6rem 0.25rem; }
.tok b { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 1rem; font-weight: 600; }
.tok i { font-family: var(--font-ui); font-size: 0.75rem; font-style: normal; color: var(--muted); }
.tok.is-bad { border-color: var(--t-intern); }
.tok.is-bad i { color: var(--t-intern); }
.tok-hint { font-family: var(--font-ui); font-size: 0.875rem; color: var(--muted); }
.calc-try { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.calc-try .src { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.8125rem; cursor: pointer; color: var(--ink); padding: 0.25rem 0.7rem; }
.calc-try .src:hover { border-color: var(--accent); color: var(--accent); }

/* image library: controls, two views of the scan, numbers */
.img-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 0.9rem 1.25rem; }
.img-slice-label { flex: 1; min-width: 12rem; }
.img-slice { width: 100%; accent-color: var(--accent); }
.img-views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.img-views figure { margin: 0; display: grid; gap: 0.5rem; }
.img-views canvas { width: 100%; height: auto; background: #000; border: 1px solid var(--rule); border-radius: var(--radius); image-rendering: pixelated; }
.img-views figcaption { font-family: var(--font-ui); font-size: 0.875rem; color: var(--soft); }
#imglib-demo:not(.has-result) .img-after { opacity: 0.25; }
#imglib-demo:not(.has-result) .img-after-name, #imglib-demo.has-result .img-empty { display: none; }
.img-stats { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.2rem 1.5rem; font-family: var(--font-ui); font-size: 0.875rem; grid-auto-flow: column; grid-template-rows: auto auto; }
.img-stats dt { color: var(--muted); }
.img-stats dd { margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 52rem) { #calc-demo { grid-template-columns: minmax(0, 1fr); } .img-stats { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: auto 1fr; } }

/* ---------- pictures: card covers and report figures ---------- */
.shot.has-img { padding: 0; overflow: hidden; background: #fff; }
.shot.has-img img, .shot.has-img video { width: 100%; height: 100%; object-fit: cover; display: block; }
.after-demo { margin-top: clamp(1.5rem, 4vw, 2.5rem); }

/* Project video (recorded walkthrough) */
.video-fig { margin: 0; }
.video-wrap { position: relative; }
/* Catches taps on the picture; the bottom strip stays free for the native controls. */
.video-tap {
  position: absolute;
  inset: 0 0 64px 0;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.seek-hint {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 33%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: #fff;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.seek-hint b { font-size: 2rem; line-height: 1; }
.seek-hint.back { left: 0; border-radius: 12px 50% 50% 12px / 12px 50% 50% 12px; background: radial-gradient(circle at 30% 50%, rgba(0, 0, 0, 0.35), transparent 70%); }
.seek-hint.fwd { right: 0; border-radius: 50% 12px 12px 50% / 50% 12px 12px 50%; background: radial-gradient(circle at 70% 50%, rgba(0, 0, 0, 0.35), transparent 70%); }
.seek-hint.show { animation: seek-flash 0.65s ease-out; }
@keyframes seek-flash { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .seek-hint.show { animation: none; opacity: 1; } }
.video-help { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--muted); }
.video-fig video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 1px solid var(--rule);
  background: #000;
}
.video-fig figcaption { margin-top: 0.6rem; font-size: 0.9rem; color: var(--muted); }
.video-fig .credit { display: block; margin-top: 0.25rem; font-size: 0.8rem; opacity: 0.8; }
.video-fig .credit a { color: inherit; }

/* ---------- project page ---------- */
.project-top { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1.75rem, 4vw, 2.75rem); }
.crumbs { font-family: var(--font-ui); font-size: 0.9375rem; font-weight: 500; margin-bottom: 1.5rem; }
.project-top h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.1; max-width: 22em; }
html[data-style="a"] .project-top h1 { letter-spacing: -0.025em; }
.project-top .lead { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); color: var(--soft); max-width: 38em; margin-top: 1.25rem; }
.facts-list { margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.25rem 2rem; border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.facts-list dt { font-family: var(--font-ui); font-size: 0.875rem; color: var(--muted); }
.facts-list dd { margin: 0.15rem 0 0; }
.project-body { padding-block: clamp(2rem, 5vw, 3.25rem); }
.project-body > * { max-width: 42rem; }
.project-body h2 { font-size: clamp(1.35rem, 2.4vw, 1.65rem); line-height: 1.25; margin: 2.5rem 0 0.9rem; }
.project-body h2:first-child { margin-top: 0; }
.project-body p { color: var(--soft); margin-top: 0.9rem; }
.pager { border-top: 1px solid var(--rule); font-family: var(--font-ui); }
.pager .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding-block: 1.5rem; }
.pager a { text-decoration: none; font-weight: 500; }
.pager a:hover { text-decoration: underline; }
.pager a span { display: block; font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.pager .next { text-align: right; }

/* ---------- small screens ---------- */
@media (max-width: 52rem) {
  html[data-style="a"] .hero .wrap { grid-template-columns: 8rem minmax(0, 1fr); gap: 1.5rem; }
  html[data-style="a"] .sec > .wrap,
  html[data-style="a"] .projects,
  html[data-style="a"] .proof { grid-template-columns: minmax(0, 1fr); }
  html[data-style="a"] .sec > .wrap { gap: 1.5rem; }
  html[data-style="a"] .sec-head { position: static; }
  html[data-style="a"] .hero .photo { max-width: none; }
  .role-tabs { border-radius: var(--radius); }
  .role-tabs .label { width: 100%; margin: 0.2rem 0.5rem; }
}
@media (max-width: 36rem) {
  html[data-style="a"] .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  html[data-style="a"] .hero .photo { width: 6.5rem; margin-top: 0; }
  html[data-style="a"] .job { grid-template-columns: minmax(0, 1fr); }
  .pager .wrap { grid-template-columns: minmax(0, 1fr); }
  .pager .next { text-align: left; }
  .site-nav { gap: 0.25rem 1rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- theme setting ---------- */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.theme { display: flex; border: 1px solid var(--rule); border-radius: 999px; padding: 2px; }
.theme button { display: grid; place-items: center; width: 2rem; height: 2rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.theme button:hover { color: var(--ink); }
.theme button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.theme svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.site-header .site-nav { margin-left: auto; }

/* ---------- timeline ---------- */
/* Trail colours belong to the theme, not the style: one set for a dark sky, one for a pale band. */
html[data-theme="dark"] {
  --t-me: #f4c95d;
  --t-work: #74aaff;
  --t-academia: #e9c2ff; /* lighter than the first violet, so it stays apart from the Work blue for colour-blind readers */
  --t-intern: #ff9478;
  --t-personal: #5fd6b3;
  --t-star: #ffffff;
}
html[data-theme="light"] {
  --t-me: #855600;
  --t-work: #1c4fd6;
  --t-academia: #b0209f; /* more magenta than the first violet, for the same reason */
  --t-intern: #b93822;
  --t-personal: #0a6e55;
  --t-star: #b0209f;
}
[data-track="work"] { --c: var(--t-work); }
[data-track="academia"] { --c: var(--t-academia); }
[data-track="intern"] { --c: var(--t-intern); }
[data-track="personal"] { --c: var(--t-personal); }

html[data-style] .tl-sec > .wrap { display: block; }
html[data-style] .tl-sec > .tl-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.25rem 2.5rem; margin-bottom: 1.5rem; }
.tl-head .sec-note { max-width: 36rem; }
.tl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; font-family: var(--font-ui); font-size: 0.875rem; }
.tl-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.tl-tools-label { color: var(--muted); margin-right: 0.25rem; }
.tl-filter, .sk-filter, .tl-reset, .sk-reset, .tl-chip { font: 500 0.875rem/1 var(--font-ui); color: var(--ink); background: transparent; border: 1px solid var(--field-border); border-radius: 999px; padding: 0.5rem 0.85rem; cursor: pointer; }
.tl-filter, .sk-filter { display: inline-flex; align-items: center; gap: 0.5rem; }
.tl-filter i, .sk-filter i, .tl-chip::before { content: ""; display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--c); }
.tl-filter:hover, .sk-filter:hover, .tl-chip:hover { background: var(--band); border-color: var(--ink); }
.tl-filter[aria-pressed="true"], .sk-filter[aria-pressed="true"], .tl-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tl-reset, .sk-reset { border-color: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; padding-inline: 0.4rem; }

.tl-scroller { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; border-block: 1px solid var(--rule); background: var(--sky); scrollbar-width: thin; scrollbar-color: var(--field-border) transparent; }
.tl-scroller.is-dragging { cursor: grabbing; user-select: none; }
.tl-canvas { min-width: 1180px; width: 100%; max-width: 1720px; margin-inline: auto; }
.tl-svg { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: pan-x pan-y; }

.tl-svg text { font-family: var(--font-ui); }
.tl-decor { fill: #ffffff; }
.tl-eratint { fill: var(--ink); opacity: 0.035; }
.tl-axis, .tl-tick { stroke: var(--field-border); stroke-width: 1.5; }
.tl-year { font-size: 17px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.tl-yearline { stroke: var(--ink); stroke-width: 1; opacity: 0.07; }
.tl-era-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 6; }
.tl-era-label { font-size: 15px; font-weight: 600; fill: var(--ink); }
.tl-place-bar { fill: var(--ink); opacity: 0.09; }
.tl-place-label { font-size: 14px; font-weight: 600; fill: var(--ink); }
.tl-flag-edge { fill: none; stroke: var(--ink); stroke-opacity: 0.45; stroke-width: 0.75; }
.tl-places { pointer-events: none; }
.tl-constellation { fill: none; stroke: var(--t-star); stroke-width: 1; opacity: 0.3; }

.tl-path, .tl-glow, .tl-hit { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tl-path { stroke-width: 3.5; transition: stroke-width 0.15s; }
.tl-glow { stroke-width: 11; opacity: 0.5; }
.tl-hit { stroke: transparent; stroke-width: 24; pointer-events: stroke; }
.tl-hitdot { fill: transparent; }
/* A gradient only carries the fade; the colour comes from the trail's track. */
.tl-s-c { stop-color: var(--c); }
.tl-s-time { stop-color: var(--t-me); }
.tl-item { color: var(--c); cursor: pointer; outline: none; transition: opacity 0.25s; }
.tl-time, .tl-playhead, .tl-timelabel { color: var(--t-me); }
.tl-time .tl-path { stroke-width: 5; }
.tl-time .tl-glow { stroke-width: 14; opacity: 0.6; }
.tl-label { font-size: 14px; font-weight: 600; fill: currentColor; paint-order: stroke; stroke: var(--sky); stroke-width: 5px; stroke-linejoin: round; }
.tl-headdot { fill: currentColor; }
.tl-headglow, .tl-beadglow, .tl-starglow { fill: currentColor; opacity: 0.55; }
.tl-beadcore { fill: var(--sky); stroke: currentColor; stroke-width: 2.5; transition: r 0.15s; }
/* A role is a solid dot; a small project is a ring. */
.tl-role .tl-beadcore, .tl-roledot { fill: currentColor; stroke: var(--sky); stroke-width: 2; }
.tl-star { color: var(--t-star); }
.tl-starshape { fill: currentColor; }
.tl-link { fill: none; stroke: var(--c); stroke-width: 1.3; stroke-dasharray: 2 6; stroke-linecap: round; opacity: 0.7; }

/* Light theme: no night sky, so no stars in the background and no glow. */
html[data-theme="light"] .tl-playhead .tl-headglow, html[data-theme="light"] .tl-decor, html[data-theme="light"] .tl-glow, html[data-theme="light"] .tl-headglow, html[data-theme="light"] .tl-beadglow, html[data-theme="light"] .tl-starglow { display: none; }

/* Pointing at one thing quietens the rest. */
.tl-svg:has(.tl-item:hover) .tl-item:not(:hover):not(.is-on):not(.is-linked):not(.is-kin), .tl-svg:has(.tl-item:focus-visible) .tl-item:not(:focus-visible):not(.is-on):not(.is-linked):not(.is-kin) { opacity: 0.4; }
.tl-item:hover .tl-path, .tl-item:focus-visible .tl-path, .tl-item.is-on .tl-path, .tl-item.is-linked .tl-path, .tl-item.is-kin .tl-path { stroke-width: 6; }
/* A paper and its internship are one pair: the arc between them brightens with either. */
.tl-star:hover .tl-link, .tl-star.is-on .tl-link, .tl-star.is-linked .tl-link, .tl-star.is-kin .tl-link, .tl-star:focus-visible .tl-link { opacity: 1; stroke-width: 2.2; stroke-dasharray: none; }
.tl-item:hover .tl-beadcore, .tl-item:focus-visible .tl-beadcore, .tl-item.is-on .tl-beadcore { fill: currentColor; r: 7px; }
.tl-item:focus-visible .tl-label, .tl-item.is-on .tl-label, .tl-item.is-linked .tl-label { text-decoration: underline; }
.tl-star:hover .tl-starshape, .tl-star:focus-visible .tl-starshape, .tl-star.is-on .tl-starshape, .tl-star.is-linked .tl-starshape, .tl-star.is-kin .tl-starshape { transform-box: fill-box; transform-origin: center; transform: scale(1.35); }
.tl-item:focus-visible .tl-hit { stroke: var(--ink); stroke-opacity: 0.14; }
.tl-item:focus-visible .tl-hitdot { stroke: var(--ink); stroke-width: 2; }
[data-track].is-dim { opacity: 0.07; pointer-events: none; }
.tl-item.is-dim .tl-label { visibility: hidden; }

/* Name tags for the small projects: shown when pointed at, selected, or under the time cursor. */
.tl-tip { opacity: 0; pointer-events: none; transition: opacity 0.15s; }
.tl-tip rect { fill: var(--ink); }
.tl-tip text { font-size: 13px; font-weight: 500; fill: var(--sky); }
.tl-tip.is-shown { opacity: 1; }

.tl-cursor line { stroke: var(--ink); stroke-width: 1; opacity: 0.55; }
.tl-cursor rect { fill: var(--ink); }
.tl-cursor text { font-size: 14px; font-weight: 600; fill: var(--sky); }

.tl-when { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; min-height: 3.25rem; margin-top: 1.25rem; font-family: var(--font-ui); }
.tl-when-head { display: grid; min-width: 12rem; }
.tl-when-date { font-size: 0.9375rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.tl-when-place { font-size: 0.875rem; color: var(--muted); }
.tl-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tl-chip { display: inline-flex; align-items: center; gap: 0.5rem; }
.tl-none { font-size: 0.9375rem; color: var(--muted); }

/* Playback controls, in the top left corner of the sky */
.tl-controls { position: absolute; z-index: 4; top: 12px; left: max(12px, calc((100% - var(--wrap)) / 2 + clamp(1.25rem, 4vw, 2.5rem))); display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.35rem; background: color-mix(in srgb, var(--bg) 88%, transparent); border: 1px solid var(--rule); border-radius: 999px; backdrop-filter: blur(6px); font-family: var(--font-ui); }
.tl-play, .tl-showall, .tl-mute { font: 500 0.875rem/1 var(--font-ui); cursor: pointer; }
.tl-play { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 999px; padding: 0.55rem 0.95rem; min-width: 6.4rem; }
.tl-play:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.tl-play svg { width: 0.85rem; height: 0.85rem; fill: currentColor; }
.tl-play .tl-ico-pause, .tl-play.is-playing .tl-ico-play { display: none; }
.tl-play.is-playing .tl-ico-pause { display: inline; }
.tl-mute { display: inline-flex; align-items: center; gap: 0.4rem; height: 2.2rem; padding: 0 0.75rem 0 0.6rem; background: transparent; color: var(--ink); border: 1px solid var(--field-border); border-radius: 999px; white-space: nowrap; }
.tl-mute:hover { background: var(--band); }
.tl-mute svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tl-mute .tl-ico-muted, .tl-mute[aria-pressed="true"] .tl-ico-sound { display: none; }
.tl-mute[aria-pressed="true"] .tl-ico-muted { display: inline; }
.tl-mute[aria-pressed="true"] { color: var(--soft); }
.tl-showall { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; background: transparent; color: var(--ink); border: 1px solid var(--field-border); border-radius: 50%; }
.tl-showall:hover:not(:disabled) { background: var(--band); }
.tl-showall:disabled { color: var(--muted); border-color: var(--rule); cursor: default; }
.tl-showall svg { width: 1.05rem; height: 1.05rem; fill: currentColor; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tl-showall[hidden], .tl-reset[hidden], .sk-reset[hidden] { display: none; }

/* Step-by-step appearance during playback */
.tl-pop { transition: opacity 0.5s ease; }
.tl-pop.is-pending { opacity: 0 !important; pointer-events: none; }
.tl-bead.tl-pop, .tl-roledot.tl-pop, .tl-pop-star .tl-starshape { transform-box: fill-box; transform-origin: center; transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
.tl-bead.tl-pop.is-pending, .tl-roledot.tl-pop.is-pending, .tl-pop-star.is-pending .tl-starshape { transform: scale(0.2); }
.tl-item.is-unborn { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .tl-pop, .tl-bead.tl-pop, .tl-roledot.tl-pop, .tl-pop-star .tl-starshape { transition: none; } }

/* The card that opens when something on the timeline is selected. */
.tl-stage { position: relative; }
.tl-card { position: absolute; z-index: 6; top: 14px; left: var(--x, 12px); width: min(25rem, calc(100% - 24px)); background: var(--bg); color: var(--ink); border: 1px solid var(--field-border); border-top: 4px solid var(--c); border-radius: max(var(--radius), 8px); padding: 1.1rem 1.25rem 1.3rem; box-shadow: 0 18px 50px rgb(0 0 0 / 0.45); font-size: 0.9375rem; line-height: 1.55; max-height: min(34rem, 82vh); overflow: auto; }
.tl-card[hidden] { display: none; }
.tl-card:focus { outline: none; }
.tl-card-close { position: absolute; top: 0.45rem; right: 0.45rem; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 0; border-radius: 50%; background: transparent; color: var(--soft); cursor: pointer; }
.tl-card-close:hover { background: var(--band); color: var(--ink); }
.tl-card-close svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tl-meta { font-family: var(--font-ui); font-size: 0.875rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; padding-right: 2.25rem; }
.tl-meta #tl-kind { color: var(--c); font-weight: 600; }
.tl-card h3 { font-size: 1.25rem; line-height: 1.3; margin-top: 0.3rem; }
.tl-card .where { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--muted); margin-top: 0.15rem; }
.tl-text { color: var(--soft); margin-top: 0.7rem; }
.tl-points { list-style: disc; padding-left: 1.15rem; margin-top: 0.6rem; color: var(--soft); display: grid; gap: 0.3rem; }
.tl-points li::marker { color: var(--c); }
.tl-card .tags { margin-top: 0.9rem; }
.tl-card .more { margin-top: 0.9rem; }
.tl-related { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.9rem; font-family: var(--font-ui); font-size: 0.875rem; color: var(--muted); }
.tl-related[hidden] { display: none; }
@media (max-width: 40rem) {
  .tl-card { position: fixed; top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; max-height: 70vh; overflow: auto; }
}

/* Small screens: name and theme setting share the first row, links go below. */
@media (max-width: 68rem) {
  .site-header .brand-row { order: 1; }
  .site-header .theme { order: 2; margin-left: auto; }
  .site-header .site-nav { order: 3; width: 100%; margin-left: 0; }
}
@media (max-width: 52rem) {
  .site-header .site-nav .cv { display: none; }
}
/* The menu and its two scroll arrows: the wrapper only takes part in the layout on phones. */
.nav-rail { display: contents; }
.nav-arrow { display: none; }
/* Phones: the links stay on one row that scrolls sideways, so the sticky header stays short.
   An arrow at either end shows there is more that way (site.js), and moves the row. */
@media (max-width: 36rem) {
  .site-header .nav-rail { display: flex; align-items: center; position: relative; order: 3; width: 100%; min-width: 0; }
  .site-header .nav-rail .site-nav { flex: 1; min-width: 0; }
  .nav-arrow { display: grid; place-items: center; position: absolute; top: 50%; z-index: 2; width: 2rem; height: 2rem; margin-top: -1rem; padding: 0; border: 1px solid var(--rule); border-radius: 50%; background: var(--bg); color: var(--ink); cursor: pointer; box-shadow: 0 0 0 0.6rem color-mix(in srgb, var(--bg) 80%, transparent); }
  .nav-arrow[hidden] { display: none; }
  .nav-arrow.prev { left: 0; }
  .nav-arrow.next { right: 0; }
  .nav-arrow svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  html[data-style] .site-header .site-nav { flex-wrap: nowrap; overflow-x: auto; gap: 0 1.15rem; font-size: 0.9375rem; padding-inline: 0 2.25rem; scrollbar-width: none; scroll-behavior: smooth; }
  html[data-style] .site-header .site-nav::-webkit-scrollbar { display: none; }
  .site-header .site-nav a { flex: none; white-space: nowrap; padding-block: 0.55rem; }
  .site-header .wrap { padding-block: 0.5rem 0.15rem; gap: 0.25rem 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { .tl-item, .tl-path, .tl-tip, .tl-beadcore { transition: none; } }
.tl-cursor, .tl-time, .tl-decor, .tl-playhead, .tl-timelabel { pointer-events: none; }

/* Narrow screens: the playback controls sit above the sky instead of over it, so they never cover a star or a label. */
@media (max-width: 52rem) {
  .tl-controls { position: static; width: fit-content; margin: 0 clamp(1.25rem, 4vw, 2.5rem) 0.75rem; }
}

/* Project pictures as a carousel: the current picture in front, the previous and
   next ones smaller and shaded behind it (gallery.js). Without the script the
   pictures are listed one under another. */
.gallery { --cf-h: clamp(13rem, 38vw, 25rem); --cf-side: 20%; --cf-w: 64%; }
.cf-stage { display: grid; gap: 1.5rem; }
.cf-item { margin: 0; display: grid; gap: 0.5rem; }
.cf-item img, .cf-item video { display: block; max-width: 100%; height: auto; background: #fff; border: 1px solid var(--rule); border-radius: calc(var(--radius) + 4px); }
.cf-item figcaption { font-family: var(--font-ui); font-size: 0.875rem; color: var(--soft); }
.g-placeholder { aspect-ratio: 16 / 10; display: grid; place-items: center; padding: 1rem; text-align: center; background: var(--band); border: 1px dashed var(--rule); border-radius: calc(var(--radius) + 4px); color: var(--muted); font-family: var(--font-ui); font-size: 0.875rem; }

.is-cf .cf-stage { display: block; position: relative; height: var(--cf-h); overflow-x: clip; touch-action: pan-y pinch-zoom; }
.is-cf .cf-item {
  position: absolute; top: 0; left: 50%; height: 100%; max-width: var(--cf-w);
  display: flex; align-items: center; justify-content: center;
  translate: -50% 0; scale: 0.6; opacity: 0; z-index: 0; pointer-events: none;
  transition: left 0.45s ease, scale 0.45s ease, opacity 0.45s ease, filter 0.45s ease;
}
.is-cf .cf-item figcaption { display: none; }
.is-cf .cf-item picture { display: contents; }
.is-cf .cf-item img, .is-cf .cf-item video, .is-cf .g-placeholder { height: 100%; width: auto; max-width: 100%; object-fit: contain; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28); }
.is-cf .g-placeholder { aspect-ratio: 16 / 10; }
/* an animation keeps its own proportions (no bands above and below) */
.is-cf .cf-item video { height: auto; max-height: 100%; }
.cf-play[hidden] { display: none; }
.cf-play .cf-play-off, .cf-play.is-playing .cf-play-on { display: none; }
.cf-play.is-playing .cf-play-off { display: inline-flex; align-items: center; gap: 0.4rem; }
.cf-play-on { display: inline-flex; align-items: center; gap: 0.35rem; }
.cf-play.is-playing .cf-play-off { gap: 0.35rem; }
.cf-play { cursor: pointer; }
.is-cf .cf-item[data-pos="0"] { scale: 1; opacity: 1; z-index: 3; }
.is-cf .cf-item[data-pos="-1"], .is-cf .cf-item[data-pos="1"] { scale: 0.78; opacity: 1; z-index: 2; filter: brightness(0.42) saturate(0.6); }
.is-cf .cf-item[data-pos="-1"] { left: var(--cf-side); }
.is-cf .cf-item[data-pos="1"] { left: calc(100% - var(--cf-side)); }
.is-cf .cf-item[data-pos="-far"] { left: 0; }
.is-cf .cf-item[data-pos="far"] { left: 100%; }
@media (prefers-reduced-motion: reduce) { .is-cf .cf-item { transition: none; } }

/* each half of the stage is a button: left half back, right half forward */
.cf-hit {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 4; padding: 0 0.5rem;
  display: flex; align-items: center; border: 0; background: none; color: var(--ink); cursor: pointer; touch-action: pan-y pinch-zoom;
}
.cf-hit.prev { left: 0; justify-content: flex-start; cursor: w-resize; }
.cf-hit.next { right: 0; justify-content: flex-end; cursor: e-resize; }
.cf-hit svg {
  width: 2.75rem; height: 2.75rem; padding: 0.7rem; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--rule); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0.8; transition: opacity 0.2s, scale 0.2s;
}
.cf-hit:hover svg { opacity: 1; scale: 1.08; color: var(--accent); border-color: var(--accent); }
.cf-hit:focus-visible { outline: none; }
.cf-hit:focus-visible svg { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
.cf-hit:disabled { cursor: default; }
.cf-hit:disabled svg { display: none; }

.cf-caption { max-width: 46rem; min-height: 2.9em; margin: 1rem auto 0; text-align: center; font-family: var(--font-ui); font-size: 0.95rem; line-height: 1.45; color: var(--soft); }
.cf-nav { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 0.4rem; }
.cf-count { font-family: var(--font-ui); font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cf-dots { display: flex; gap: 0.15rem; }
.cf-dot { width: 1.5rem; height: 1.5rem; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.cf-dot::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 999px; background: var(--muted); opacity: 0.55; transition: width 0.2s; }
.cf-dot[aria-current="true"]::before { width: 1.25rem; opacity: 1; background: var(--ink); }
.cf-dot:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.cf-expand, .cf-play { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.6rem; border: 1px solid var(--rule); border-radius: 999px; background: none; color: var(--soft); font-family: var(--font-ui); font-size: 0.8rem; cursor: zoom-in; }
.cf-expand svg, .cf-play svg { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cf-expand:hover, .cf-play:hover { color: var(--accent); border-color: var(--accent); }
.cf-expand:focus-visible, .cf-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.g-btn {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0;
  border: 1px solid var(--rule); border-radius: 50%; background: var(--bg); color: var(--ink); cursor: pointer;
}
.g-btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.g-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.g-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 40rem) { .gallery { --cf-h: clamp(11rem, 52vw, 16rem); --cf-side: 12%; --cf-w: 80%; } .cf-hit svg { width: 2.4rem; height: 2.4rem; padding: 0.6rem; } }

/* Enlarged picture */
.lightbox { max-width: min(94vw, 80rem); max-height: 94vh; padding: 0; border: 1px solid var(--rule); border-radius: calc(var(--radius) + 6px); background: var(--bg); color: var(--ink); }
.lightbox:modal { overscroll-behavior: contain; }
.lightbox::backdrop { background: rgba(5, 7, 10, 0.82); overflow: hidden; overscroll-behavior: contain; }
.lightbox figure { margin: 0; }
.lightbox img, .lightbox video { display: block; max-width: 100%; max-height: calc(94vh - 9rem); width: auto; height: auto; margin: 0 auto; background: #fff; }
/* Zoom: pinch, double-tap or the +/- buttons; when zoomed the picture scrolls inside its frame (gallery.js) */
.lb-zoom { overflow: hidden; max-height: calc(94vh - 9rem); touch-action: pan-x pan-y; cursor: zoom-in; overscroll-behavior: contain; }
.lb-zoom.is-zoomed { overflow: auto; cursor: grab; }
.lb-zoom.is-zoomed.is-dragging { cursor: grabbing; }
.lb-zoom:has(> img[hidden]) { cursor: auto; }
.lightbox [hidden] { display: none; }
.lb-zoom.is-zoomed img { max-width: none; max-height: none; }
.lb-zoom-btns { display: inline-flex; gap: 0.5rem; }
.lb-zoom-btns[hidden] { display: none; }
.lightbox figcaption { padding: 0.9rem 1.25rem 0; font-family: var(--font-ui); font-size: 0.95rem; color: var(--soft); max-width: 60rem; }
.lb-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem 1rem; }
.lb-bar form { margin-left: auto; }
.lb-count { font-family: var(--font-ui); font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lightbox .g-btn:disabled { opacity: 0.35; }

/* Demo video at the top of a project page. Before it starts, a silent preview
   loops in the frame under a "Watch the demo" button that starts it in place. */
.project-media { margin-top: clamp(1.5rem, 4vw, 2.5rem); }
.video-start { position: absolute; inset: 0; z-index: 2; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #000; cursor: pointer; }
.video-start .video-preview { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-start::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.05) 30%, rgba(0, 0, 0, 0.35)); pointer-events: none; }
.play-badge {
  position: absolute; z-index: 1; left: 50%; top: 50%; translate: -50% -50%;
  display: inline-flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1.35rem 0.6rem 0.6rem; border-radius: 999px;
  background: rgba(14, 16, 20, 0.84); color: #fff; font-family: var(--font-ui); font-size: clamp(0.95rem, 1.6vw, 1.15rem); font-weight: 600; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); transition: scale 0.2s ease;
}
.play-dot { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.play-dot svg { width: 1.2rem; height: 1.2rem; fill: currentColor; margin-left: 2px; }
.play-badge .watch-len { font-weight: 400; opacity: 0.8; padding-left: 0.75rem; border-left: 1px solid rgba(255, 255, 255, 0.4); }
.video-start:hover .play-badge, .video-start:focus-visible .play-badge { scale: 1.05; }
.video-start:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .play-badge { transition: none; } }
.video-wrap.started .video-start { display: none; }

/* "Now": the agentic hub, one wide card with its milestones */
.now-card { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); padding: clamp(1.1rem, 2.5vw, 1.75rem); background: var(--band); border: 1px solid var(--rule); border-radius: max(var(--radius), 10px); }
.now-text { display: grid; gap: 0.7rem; align-content: start; }
.now-text h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.25; }
.now-status { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-ui); font-size: 0.85rem; color: var(--soft); }
.now-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); }
@media (prefers-reduced-motion: no-preference) { .now-dot { animation: now-pulse 2.4s ease-out infinite; } }
@keyframes now-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 0.55rem transparent; } }
.now-points { display: grid; gap: 0.35rem; padding-left: 1.1rem; list-style: disc; color: var(--soft); }
.now-steps { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--rule); display: grid; gap: 0.9rem; align-content: start; font-family: var(--font-ui); }
.now-steps li { position: relative; display: grid; gap: 0.1rem; }
.now-steps li::before { content: ""; position: absolute; left: calc(-1.1rem - 6px); top: 0.35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.now-steps li:last-child::before { background: var(--accent); }
.now-when { font-size: 0.8rem; font-weight: 600; color: var(--accent); }
.now-steps li > span:last-child { font-size: 0.92rem; color: var(--ink); }
@media (max-width: 52rem) { .now-card { grid-template-columns: minmax(0, 1fr); } }

/* Headed lists in a project's text */
.about-h { font-size: 1.1rem; margin-top: 0.6rem; }
.about-list { display: grid; gap: 0.45rem; padding-left: 1.2rem; list-style: disc; }
/* a list inside the running text (no heading of its own) reads like the paragraphs */
.project-body p + .about-list { color: var(--soft); margin-top: 0.6rem; }
.project-body strong { color: var(--ink); font-weight: 600; }
.wip { display: inline-block; padding: 0.05rem 0.45rem; border: 1px solid var(--rule); border-radius: 999px; font-family: var(--font-ui); font-size: 0.75rem; color: var(--soft); vertical-align: 0.1em; }

.now-art { display: block; width: 100%; max-width: 20rem; height: auto; margin-top: 1.25rem; border-radius: 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); }

/* Architecture diagrams ("How it is built"), version 2: blocks in zones, numbered flows (diagram.js) */
.arch { margin-top: clamp(2rem, 5vw, 3rem); }
.dg-fig { margin: 0 0 1.5rem; }
.dg-scroll { overflow-x: auto; padding: 0.9rem; background: var(--band); border: 1px solid var(--rule); border-radius: max(var(--radius), 14px); }
.dg-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dg { display: block; width: 100%; min-width: 46rem; height: auto; font-family: var(--font-ui); }
.dg-zone rect { stroke-width: 1; }
.dg-zone.is-mine rect { fill: color-mix(in srgb, var(--accent) 6%, transparent); stroke: color-mix(in srgb, var(--accent) 30%, var(--rule)); }
.dg-zone.is-platform rect { fill: color-mix(in srgb, var(--ink) 4%, transparent); stroke: var(--rule); }
.dg-zone.is-external rect { fill: none; stroke: var(--muted); stroke-dasharray: 4 5; stroke-opacity: 0.7; }
.dg-zone text { font-size: 12px; font-weight: 600; fill: var(--muted); }
.dg-box { fill: var(--bg); stroke: var(--rule); stroke-width: 1.2; }
.dg-ibg { fill: var(--accent-soft); }
.dg-icon { fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.is-ext .dg-ibg { fill: color-mix(in srgb, var(--ink) 8%, transparent); }
.is-ext .dg-icon { stroke: var(--soft); }
.dg-name { font-size: 14px; font-weight: 600; fill: var(--ink); }
.dg-role { font-size: 12px; fill: var(--soft); }
.dg-edge { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.dg-edge.is-dashed { stroke-dasharray: 5 5; }
.dg-edge.is-quiet { stroke-opacity: 0.3; }
.dg-badge circle { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.dg-badge text { font-size: 11px; font-weight: 700; fill: var(--accent); }
.dg-badge.is-off { display: none; }
.dg-active { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-dasharray: 7 6; animation: dg-flow 0.8s linear infinite; }
.dg-active.is-rev { animation-direction: reverse; }
.dg-active.is-still { animation: none; stroke-dasharray: none; }
.dg-head { fill: var(--accent); }
@keyframes dg-flow { from { stroke-dashoffset: 13; } to { stroke-dashoffset: 0; } }
.dg-node, .dg-edge, .dg-badge { transition: opacity 0.25s ease; }
.dg-fig.is-focus .dg-node:not(.is-on) { opacity: 0.32; }
.dg-fig.is-focus .dg-edge { opacity: 0.18; }
.dg-fig.is-focus .dg-badge:not(.is-on) { opacity: 0.3; }
.dg-node.is-on .dg-box { stroke: var(--accent); stroke-width: 2; }
.dg-badge.is-on circle { fill: var(--accent); }
.dg-badge.is-on text { fill: var(--accent-ink); }
@media (prefers-reduced-motion: reduce) { .dg-node, .dg-edge, .dg-badge { transition: none; } .dg-active { animation: none; stroke-dasharray: none; } }

.dg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 1rem 0 0.6rem; font-family: var(--font-ui); }
.dg-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.dg-tab, .dg-play { font: inherit; font-size: 0.9rem; padding: 0.35rem 0.85rem; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--soft); cursor: pointer; }
.dg-tab[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.dg-flow-name { margin: 0; font-weight: 600; color: var(--ink); }
.dg-play { display: inline-flex; align-items: center; gap: 0.45rem; margin-left: auto; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); }
.dg-play[hidden] { display: none; }
.dg-play-icon { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.dg-play[aria-pressed="true"] .dg-play-icon { width: 9px; height: 9px; border: 0; background: currentColor; border-radius: 1px; }
.dg-tab:focus-visible, .dg-play:focus-visible, .dg-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dg-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 0.35rem 1rem; font-family: var(--font-ui); }
.dg-step { display: flex; gap: 0.65rem; align-items: flex-start; width: 100%; text-align: left; font: inherit; font-size: 0.92rem; line-height: 1.45; color: var(--soft); background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 0.45rem 0.6rem; cursor: pointer; }
.dg-step:hover, .dg-step.is-current { background: var(--band); border-color: var(--rule); color: var(--ink); }
.dg-num { flex: none; display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; margin-top: 0.05rem; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); font-size: 0.75rem; font-weight: 700; }
.dg-step.is-current .dg-num { background: var(--accent); color: var(--accent-ink); }
.arch-text { max-width: 46rem; color: var(--soft); }
.arch-text + .arch-text { margin-top: 0.75rem; }

/* "Get in touch": the contact card at the end of the home page and project pages */
.talk { position: relative; display: grid; gap: 1rem; padding: clamp(1.5rem, 5vw, 2.75rem); background: radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 42%), var(--band); border: 1px solid var(--rule); border-radius: max(var(--radius), 18px); }
.talk h2 { margin: 0; font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.1; }
.talk-text { margin: 0; max-width: 38rem; font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--soft); }
.talk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.4rem; }
/* the contact card spans the full width, not the section's heading column */
.talk-sec > .wrap { display: block; }

/* the contact form inside the card (home page): beside the intro on wide screens */
.talk-intro { display: grid; gap: 1rem; align-content: start; }
.talk.has-form { gap: 2rem; }
@media (min-width: 56rem) { .talk.has-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 3rem; } }
.talk-form { max-width: none; }
.talk-form input, .talk-form textarea { background: var(--bg); }
.talk-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; min-height: 1.4em; font-family: var(--font-ui); font-size: 0.95rem; color: var(--soft); }
.form-status.is-ok { color: var(--accent); }

/* A collection of projects on the home page: one wide card that opens into a list */
.col { grid-column: 1 / -1; border: 1px solid var(--rule); border-radius: max(var(--radius), 14px); background: var(--band); }
.col > summary { list-style: none; cursor: pointer; display: grid; gap: 1.25rem; padding: clamp(1rem, 3vw, 1.5rem); border-radius: inherit; }
.col > summary::-webkit-details-marker { display: none; }
.col > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 48rem) { .col > summary { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); align-items: center; gap: 2rem; } }
.col-mosaic { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
.col-mosaic img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); display: block; }
.col-text { display: grid; gap: 0.5rem; }
.col-context { font-family: var(--font-ui); font-size: 0.875rem; color: var(--muted); }
.col-title { font-size: clamp(1.25rem, 2.6vw, 1.5rem); font-weight: 700; line-height: 1.25; color: var(--ink); }
.col-intro { color: var(--soft); }
.col-toggle { justify-self: start; margin-top: 0.4rem; font-family: var(--font-ui); font-weight: 600; color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius); padding: 0.55rem 1rem; }
.col-toggle::after { content: ""; display: inline-block; width: 0.4em; height: 0.4em; margin-left: 0.55em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-0.2em) rotate(45deg); }
.col[open] .col-toggle::after { transform: translateY(0.05em) rotate(-135deg); }
.col .col-close, .col[open] .col-open { display: none; }
.col[open] .col-close { display: inline; }
.col > summary:hover .col-toggle { background: var(--accent); color: var(--accent-ink); }
.col-list { list-style: none; margin: 0; padding: 0 clamp(0.75rem, 3vw, 1.5rem) clamp(1rem, 3vw, 1.5rem); display: grid; gap: 0.5rem; }
.col-item { border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); }
.col-item > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; align-items: center; gap: 0.9rem; padding: 0.6rem 0.9rem 0.6rem 0.6rem; border-radius: inherit; }
.col-item > summary::-webkit-details-marker { display: none; }
.col-item > summary::after { content: ""; width: 0.45em; height: 0.45em; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); margin: 0 0.3rem; }
.col-item[open] > summary::after { transform: rotate(-135deg); }
.col-item > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.col-item > summary:hover .col-item-title { color: var(--accent); }
.col-item > summary img, .col-thumb-blank { width: 4.5rem; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; display: block; }
.col-thumb-blank { display: grid !important; place-items: center; background: linear-gradient(135deg, var(--band), color-mix(in srgb, var(--accent) 12%, var(--band))); border: 1px solid var(--rule); }
.col-thumb-blank svg { width: 42%; height: auto; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; opacity: 0.8; }
.col-item-title { font-weight: 600; color: var(--ink); line-height: 1.3; }
.col-item-meta { grid-column: 2; font-family: var(--font-ui); font-size: 0.85rem; color: var(--muted); margin-top: -0.6rem; }
.col-item > summary { grid-template-rows: auto auto; }
.col-item > summary img, .col-item > summary .col-thumb-blank { grid-row: 1 / span 2; }
.col-item > summary::after { grid-column: 3; grid-row: 1 / span 2; }
.col-item-body { display: grid; gap: 0.6rem; padding: 0 1rem 1rem calc(4.5rem + 1.5rem); color: var(--soft); }
@media (max-width: 40rem) { .col-item-body { padding-left: 1rem; } }
.col-item-body p { margin: 0; }

/* On a member's page: the rest of the collection */
.col-more { margin-top: clamp(2rem, 5vw, 3rem); }
.col-more-head { font-size: 1.125rem; margin-bottom: 0.9rem; }
.col-more-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.col-more-list a { display: grid; gap: 0.45rem; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.col-more-list a:hover span { color: var(--accent); }
.col-more-list img, .col-more-list .col-thumb-blank { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); }
@media (max-width: 47.99rem) { .col-mosaic { grid-template-columns: repeat(4, 1fr); } }
.col-more-list .col-thumb-blank svg { width: 22%; }
.fm-how { margin: 0.35rem 0 0.9rem; max-width: 34rem; font-size: 0.9rem; color: var(--soft); }

/* ---------- chess.com badge, left of the name ---------- */
.brand-row { display: flex; align-items: center; gap: 0.6rem; }
.chess { position: relative; }
.chess-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.55rem 0.25rem 0.4rem; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--soft); font: 600 0.8125rem/1 var(--font-ui); font-variant-numeric: tabular-nums; cursor: pointer; }
.chess-badge[hidden] { display: none; }
.chess-badge svg { width: 1rem; height: 1rem; fill: currentColor; }
.chess-badge:hover, .chess-badge[aria-expanded="true"] { color: var(--ink); border-color: var(--accent); }
.chess-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The card is drawn in chess.com's own look (its dark panels, green button), the same in both site themes. */
.chess-card { --cc-bg: #262421; --cc-panel: #312e2b; --cc-line: #3c3a37; --cc-text: #ffffff; --cc-soft: #bab9b8; --cc-muted: #989795; --cc-green: #81b64c; --cc-green-dark: #45753c;
  position: absolute; top: calc(100% + 0.6rem); left: 0; z-index: 30; width: 17.5rem; padding: 0.9rem 0.9rem 0.85rem; border-radius: 8px; background: var(--cc-bg); color: var(--cc-text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.chess-card[hidden] { display: none; }
.chess-head { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.7rem; font-size: 1rem; font-weight: 700; }
.chess-head a { color: var(--cc-text); text-decoration: none; }
.chess-head a:hover { text-decoration: underline; }
.chess-pawn { width: 1.35rem; height: 1.35rem; fill: var(--cc-green); }
.chess-site { margin-left: auto; font-size: 0.75rem; font-weight: 600; color: var(--cc-muted); }
.chess-rows { display: grid; gap: 0.3rem; }
.chess-rows li { display: grid; grid-template-columns: 1.4rem 1fr auto 4.6rem; align-items: center; gap: 0.5rem; padding: 0.55rem 0.65rem; border-radius: 5px; background: var(--cc-panel); }
.chess-rows li[hidden] { display: none; }
.chess-ico { width: 1.25rem; height: 1.25rem; }
.chess-ico.bullet { fill: #e3aa24; }
.chess-ico.blitz { fill: #f7c631; }
.chess-ico.rapid { fill: var(--cc-green); }
.chess-fmt { font-size: 0.9375rem; font-weight: 600; color: var(--cc-soft); }
.chess-rows .now { font-size: 1.0625rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.chess-rows .best { font-size: 0.75rem; font-weight: 600; color: var(--cc-muted); text-align: right; font-variant-numeric: tabular-nums; }
.chess-actions { display: flex; gap: 0.5rem; margin-top: 0.85rem; }
.chess-btn { flex: 1; text-align: center; padding: 0.6rem 0.5rem 0.55rem; border-radius: 5px; background: var(--cc-line); box-shadow: 0 4px 0 #1f1e1c; color: var(--cc-text); font-size: 0.9375rem; font-weight: 800; text-decoration: none; transition: filter 0.15s; }
.chess-btn.go { background: var(--cc-green); box-shadow: 0 4px 0 var(--cc-green-dark); }
.chess-btn:hover { filter: brightness(1.1); }
.chess-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #1f1e1c; }
.chess-btn.go:active { box-shadow: 0 2px 0 var(--cc-green-dark); }
.chess-btn:focus-visible, .chess-head a:focus-visible { outline: 2px solid var(--cc-green); outline-offset: 2px; }
.chess-note { margin: 0.85rem 0 0; font-size: 0.75rem; color: var(--cc-muted); }
/* Phones: full width under the badge (the header's blur makes it the frame for
   fixed elements, so the card cannot be pinned to the bottom of the screen) */
@media (max-width: 40rem) {
  .chess-card { width: calc(100vw - 2rem); }
}

/* ---------- Experience: why I fit a role, then the work history ---------- */
.part-head { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-track); font-size: clamp(1.4rem, 2.4vw, 1.75rem); line-height: 1.2; }
.part-note { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--muted); margin: 0.35rem 0 1.25rem; }
.part.experience { margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--rule); }
.part.experience .sub-head { margin-top: 2.75rem; }
.sec-jump { display: grid; gap: 0.15rem; margin-top: 1.25rem; font-family: var(--font-ui); font-size: 0.9375rem; }
.sec-jump a { display: block; padding: 0.4rem 0 0.4rem 0.75rem; border-left: 2px solid var(--rule); color: var(--soft); text-decoration: none; }
.sec-jump a:hover { color: var(--ink); border-left-color: var(--soft); }
.sec-jump a[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }
@media (max-width: 52rem) {
  .sec-jump { grid-auto-flow: column; justify-content: start; gap: 0 1.25rem; }
  .sec-jump a { border-left: 0; padding: 0.3rem 0; text-decoration: underline; text-underline-offset: 3px; }
}

/* medical notes demo: what is happening right now, next to "What happens" */
.mn-flow-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; }
.mn-busy { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 500; font-size: 0.8125rem; color: var(--accent); }
.mn-busy[hidden] { display: none; }
.mn-busy i { width: 0.95rem; height: 0.95rem; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-top-color: var(--accent); animation: mn-spin 0.8s linear infinite; }
@keyframes mn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mn-busy i { animation-duration: 2.4s; } }

/* a project page that starts with "About the project": space before the demo below it */
.project-body.about-first { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }

/* "On this page" on the main project pages: jump to each part */
.page-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1.75rem; font-family: var(--font-ui); font-size: 0.875rem; }
.page-jump span { color: var(--muted); margin-right: 0.25rem; }
.page-jump a { padding: 0.4rem 0.8rem; border: 1px solid var(--field-border); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; }
.page-jump a:hover { border-color: var(--accent); color: var(--accent); }
.page-jump a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.site-footer .site-dates { margin: 0; }
