/* Light: warm paper and burgundy, in the spirit of msingh-info.vercel.app.
   Dark: warm charcoal with rose and gold, the same palette at night. */
:root {
  --bg: #f5f2ec;
  --surface: #fffdf8;
  --line: rgba(17, 23, 35, 0.12);
  --line-soft: rgba(17, 23, 35, 0.08);
  --ink: #111723;
  --muted: #586071;
  --faint: #8a909b;
  --accent: #6b1735;
  --accent-ink: #fffdf8;
  --accent-soft: rgba(107, 23, 53, 0.08);
  --byte: #7a2140;
  --space: #9aa0aa;
  --amber: #8a6a1f;
  --gold: #b99658;
  --gold-soft: rgba(185, 150, 88, 0.16);
  --green: #1a7f37;
  --red: #b42318;
  --shadow: 0 18px 60px rgba(12, 16, 24, 0.1);
  --shadow-sm: 0 6px 24px rgba(12, 16, 24, 0.06);
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f;
    --surface: #1e1a16;
    --line: rgba(245, 235, 220, 0.16);
    --line-soft: rgba(245, 235, 220, 0.09);
    --ink: #f2ece3;
    --muted: #b0a699;
    --faint: #7d746a;
    --accent: #e2899f;
    --accent-ink: #15120f;
    --accent-soft: rgba(226, 137, 159, 0.14);
    --byte: #e8a3b5;
    --space: #7d746a;
    --amber: #d8b77e;
    --gold: #d8b77e;
    --gold-soft: rgba(216, 183, 126, 0.15);
    --green: #8cc9a1;
    --red: #f08b7c;
    --shadow: none;
    --shadow-sm: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #15120f;
  --surface: #1e1a16;
  --line: rgba(245, 235, 220, 0.16);
  --line-soft: rgba(245, 235, 220, 0.09);
  --ink: #f2ece3;
  --muted: #b0a699;
  --faint: #7d746a;
  --accent: #e2899f;
  --accent-ink: #15120f;
  --accent-soft: rgba(226, 137, 159, 0.14);
  --byte: #e8a3b5;
  --space: #7d746a;
  --amber: #d8b77e;
  --gold: #d8b77e;
  --gold-soft: rgba(216, 183, 126, 0.15);
  --green: #8cc9a1;
  --red: #f08b7c;
  --shadow: none;
  --shadow-sm: none;
  color-scheme: dark;
}

/* Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  cursor: default;  /* the arrow, not the text I-beam; text can still be selected */
}
a, button, summary, label { cursor: pointer; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.mono { font-family: var(--mono); }
.i { width: 16px; height: 16px; flex: none; }
.i.sm { width: 12px; height: 12px; }
.scholar { color: #4285f4; }
.linkedin { color: #0a66c2; }
.orcid { color: #a6ce39; }

/* Page width: the side margin grows with the screen, and the content stops at --max. */
:root { --gutter: 20px; --max: 1480px; }
@media (min-width: 640px) { :root { --gutter: 32px; } }
@media (min-width: 1024px) { :root { --gutter: 6vw; } }
@media (min-width: 1600px) { :root { --gutter: 8vw; } }
@media (min-width: 2200px) { :root { --max: 1680px; } }
.wrap { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.skip {
  position: absolute; left: 16px; top: -48px; z-index: 30;
  background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px;
}
.skip:focus { top: 12px; }

.content-error {
  margin-top: 24px; padding: 14px 18px; border-radius: 12px; font-size: 15px;
  background: rgba(209, 36, 47, 0.1); color: var(--red); border: 1px solid rgba(209, 36, 47, 0.35);
}

/* Top bar --------------------------------------------------------------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.bar-inner {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); height: 60px;
  display: flex; align-items: center; gap: 24px;
}
.brand { font: 500 15px var(--mono); display: flex; align-items: center; gap: 8px; }
.brand-cursor {
  width: 8px; height: 16px; background: var(--byte); border-radius: 1px;
  animation: blink 1.1s steps(1) infinite;
}
.bar nav { display: flex; gap: 22px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.bar nav a { color: var(--muted); font-size: 14px; white-space: nowrap; padding: 4px 0; border-bottom: 2px solid transparent; }
.bar nav a:hover { color: var(--ink); }
.bar nav a.on { color: var(--ink); border-bottom-color: var(--accent); }
.theme {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer;
}
.theme:hover { color: var(--ink); }
.theme .moon { display: none; }
.menu {
  display: none; place-items: center; width: 34px; height: 34px; flex: none; margin-left: auto;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer;
}
.menu .close-i, .bar.open .menu .open-i { display: none; }
.bar.open .menu .close-i { display: block; }
.hint-touch { display: none; }
@media (hover: none) { .hint-hover { display: none; } .hint-touch { display: inline; } }
[data-dark="1"] .theme .sun { display: none; }
[data-dark="1"] .theme .moon { display: block; }

/* Hero ------------------------------------------------------------------- */
.hero {
  padding-top: 72px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(40px, 6vw, 96px); align-items: center;
}
.byline {
  display: flex; align-items: center; gap: 14px;
  font: 600 22px/1.2 var(--sans); letter-spacing: -0.01em; color: var(--ink);
}
.byline::before { content: ""; width: 28px; height: 2px; border-radius: 1px; background: var(--accent); }
.byline + .eyebrow { margin-top: 10px; }
.eyebrow {
  display: flex; align-items: center; gap: 12px; color: var(--accent);
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
h1 {
  margin-top: 22px; font: 600 clamp(44px, 6.4vw, 76px)/1.02 var(--serif); letter-spacing: -0.03em;
}
h1 em, h2 em { font-style: italic; color: var(--accent); }
.intro { margin-top: 26px; max-width: 58ch; font-size: 18px; line-height: 1.65; color: var(--muted); }
.roles { margin-top: 24px; display: grid; gap: 6px; }
.roles li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.roles strong { font-weight: 600; font-size: 15px; }
.roles span { color: var(--muted); font-size: 14px; }
.links { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  font-size: 15px; font-weight: 600; box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--muted); }
.socials { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.socials a { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; font-weight: 500; }
.socials a:hover { color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 10px 28px var(--accent-soft); }

.portrait { position: relative; width: 100%; max-width: 500px; justify-self: end; }
.photo { position: relative; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 5; }
.photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.photo figcaption {
  position: absolute; inset: auto 0 0 0; padding: 60px 24px 22px;
  background: linear-gradient(to top, rgba(10, 12, 18, 0.72), transparent);
  color: #fff; font-size: 17px; font-weight: 600;
}
.photo figcaption span {
  display: block; margin-bottom: 4px; font-size: 11px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; opacity: 0.8;
}
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.chips p {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.chips p::before { content: ""; grid-row: span 2; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.chips strong { font-size: 14px; font-weight: 600; }
.chips span { font-size: 12px; color: var(--muted); }

/* Hexdump viewer: a small window sized to its content, with the cat on top. */
.band-wrap { padding-top: 88px; }
.viewer {
  position: relative; width: max-content; max-width: 100%;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.viewer-head {
  display: flex; justify-content: space-between; gap: 32px; padding: 10px 20px;
  border-bottom: 1px solid var(--line-soft); font: 400 12px var(--mono); color: var(--faint);
}
.viewer-head span:first-child { color: var(--muted); }
.viewer .hexdump { padding: 16px 20px 18px; }
.viewer .cat { position: absolute; right: 36px; bottom: calc(100% - 1px); }
.hexdump { font: 400 15px/26px var(--mono); overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; min-width: 0; }
.hx-row { display: flex; white-space: pre; width: max-content; }
.hx-off { color: var(--space); margin-right: 2ch; }
.hx-bytes { display: flex; gap: 1ch; margin-right: 2ch; }
.hx-bytes .gap { width: 1ch; }
.hx-ascii { color: var(--space); }
.hexdump span[data-i] { border-radius: 3px; transition: background-color .12s; }
.hx-b { color: var(--byte); }
.hx-sp { color: var(--space); }
.hx-nl { color: var(--gold); }
.hexdump .hl, .hexdump .cur { background: var(--accent-soft); }
.hexdump .hl { box-shadow: 0 0 0 1px var(--accent); }
.hexdump.decoding span[data-i] { opacity: .2; }
.hexdump.decoding .hx-ascii span[data-i] { opacity: 0; }
.hexdump span.shown { opacity: 1 !important; transition: opacity .35s ease-out; }
.hx-end { color: var(--space); }
.hx-end::after {
  content: ""; display: inline-block; width: 9px; height: 16px; margin-left: 1ch; vertical-align: -2px;
  background: var(--byte); border-radius: 1px; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.cat { margin: 0; font: 400 14px/16px var(--mono); color: var(--ink); position: relative; flex: none; }
.cat .meow {
  position: absolute; right: 100%; top: -2px; margin-right: 6px; font-size: 12px; color: var(--accent);
  opacity: 0; animation: meow 9s 3s infinite;
}
@keyframes meow { 0% { opacity: 0; transform: translateY(4px); } 4%, 16% { opacity: 1; transform: none; } 22%, 100% { opacity: 0; transform: translateY(-4px); } }
.cat .swap { display: inline-grid; }
.cat .swap > span { grid-area: 1 / 1; }
.cat .eyes-open { animation: open 5s infinite; }
.cat .eyes-shut { opacity: 0; animation: shut 5s infinite; }
@keyframes open { 0%, 90% { opacity: 1; } 90.5%, 95% { opacity: 0; } 95.5%, 100% { opacity: 1; } }
@keyframes shut { 0%, 90% { opacity: 0; } 90.5%, 95% { opacity: 1; } 95.5%, 100% { opacity: 0; } }
.cat .tail-a { animation: frame-a 1.2s steps(1) infinite; }
.cat .tail-b { opacity: 0; animation: frame-b 1.2s steps(1) infinite; }
@keyframes frame-a { 50% { opacity: 0; } }
@keyframes frame-b { 50% { opacity: 1; } }

/* Sections --------------------------------------------------------------- */
.section { padding-top: 112px; }
h2 { font: 600 clamp(30px, 3.6vw, 40px)/1.15 var(--serif); letter-spacing: -0.02em; }
.lede { margin-top: 10px; color: var(--muted); font-size: 18px; max-width: 62ch; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.more, .actions a { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 14px; font-weight: 600; }
.more:hover, .actions a:hover { text-decoration: underline; }
.subhead { margin: 40px 0 14px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* Cards (research and engineering) */
.cards { margin-top: 36px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (min-width: 1200px) { .cards.three { grid-template-columns: repeat(3, 1fr); } }
.card {
  display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 22px;
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm);
}
.card.linked { transition: border-color .15s, transform .15s; }
.card.linked:hover { border-color: var(--accent); transform: translateY(-2px); }
.stage { width: 100%; aspect-ratio: 400 / 184; background: var(--bg); border-bottom: 1px solid var(--line-soft); }
.card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 19px; line-height: 1.35; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.card-body > p:not(.meta):not(.actions) { color: var(--muted); font-size: 15px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font: 400 13px var(--mono); color: var(--muted); margin-top: auto; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font: 400 12px/1 var(--mono); padding: 6px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.actions { display: flex; gap: 16px; }

.audit { display: flex; align-items: center; padding: 0 24px; overflow: hidden; min-height: 0; }
.audit pre { margin: 0; font: 400 13px/22px var(--mono); color: var(--ink); }
.audit .ln { display: inline-block; animation: line 10s infinite backwards; }
.audit .ln:nth-child(2) { animation-delay: .8s; }
.audit .ln:nth-child(3) { animation-delay: 1.6s; }
.audit .ln:nth-child(4) { animation-delay: 2.8s; }
.audit .ln:nth-child(5) { animation-delay: 3.8s; }
.audit .ln:nth-child(6) { animation-delay: 4.6s; }
@keyframes line { 0% { opacity: 0; transform: translateX(-4px); } 3%, 80% { opacity: 1; transform: none; } 88%, 100% { opacity: 0; } }
.c-muted { color: var(--faint); }
.c-bad { color: var(--red); }
.c-good { color: var(--green); }

.also { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px; border-top: 1px solid var(--line-soft); }
.also li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 15px; }
.also strong { color: var(--ink); font-weight: 600; }

/* Impact */
.impact { margin-top: 36px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.impact article {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 20px; padding: 22px;
  box-shadow: var(--shadow-sm);
}
.big { font: 600 30px/1.1 var(--serif); letter-spacing: -0.02em; color: var(--accent); }
.impact h3 { margin-top: 12px; font-size: 15px; font-weight: 600; }
.impact article p:last-child { margin-top: 6px; color: var(--muted); font-size: 14px; }
.partners { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.partners li { border-top: 2px solid var(--accent); padding-top: 12px; display: grid; gap: 2px; }
.partners strong { font-weight: 600; }
.partners span { color: var(--muted); font-size: 14px; }

/* Publications */
.pubs li { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line-soft); }
.pubs li:last-child { border-bottom: 1px solid var(--line-soft); }
.year { font: 400 13px/1.9 var(--mono); color: var(--faint); }
.pubs .title { font-weight: 600; line-height: 1.45; }
.pubs .title a:hover { color: var(--accent); text-decoration: underline; }
.pubs .authors { margin-top: 4px; color: var(--muted); font-size: 15px; }
.pubs .authors b { color: var(--ink); font-weight: 600; }
.pubs .venue { margin-top: 2px; color: var(--muted); font-size: 14px; font-style: italic; }
.pubs .venue.mono { font-size: 13px; font-style: normal; }
.pubs .venue a { color: var(--accent); }
.badge {
  display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px; font-style: normal;
  background: var(--gold-soft); color: var(--amber); font-size: 12px; font-weight: 600; vertical-align: 1px;
}
.review { margin-top: 24px; }
.review summary {
  cursor: pointer; width: max-content; color: var(--accent); font-size: 14px; font-weight: 600;
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.review summary::-webkit-details-marker { display: none; }
.review summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 18px; line-height: 1; }
.review[open] summary::before { transform: rotate(90deg); }
.review ul { margin-top: 12px; padding-left: 16px; border-left: 2px solid var(--line-soft); }
.review li { color: var(--muted); font-size: 15px; padding: 5px 0; }

/* Moments: masonry that keeps each photo's shape, filter chips, and a lightbox */
.filters { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  height: 34px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); font: 500 14px var(--sans); cursor: pointer; transition: color .15s, border-color .15s, background-color .15s;
}
.filter:hover { color: var(--ink); border-color: var(--muted); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
/* Masonry on a grid: rows are 4px and main.js sets each photo's row span from its height, so photos
   fill from the left and a filtered set packs together instead of leaving empty columns. */
.moments {
  --gap: 24px; margin-top: 24px; display: grid; grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 4px; grid-auto-flow: row dense; column-gap: 20px;
}
@media (min-width: 1200px) { .moments { grid-template-columns: repeat(4, 1fr); } }
.moment { align-self: start; margin: 0; }
.moment[hidden] { display: none; }
.moment-open {
  display: block; width: 100%; padding: 0; border: 0; border-radius: 16px; overflow: hidden; cursor: zoom-in;
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.moment-open img { display: block; width: 100%; height: auto; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.moment-open:hover img { transform: scale(1.03); }
.moment figcaption { margin-top: 10px; font-size: 14px; font-weight: 500; line-height: 1.45; }
.moment-date { display: block; margin-bottom: 2px; font: 400 12px var(--mono); color: var(--faint); }

html:has(.lightbox[open]) { overflow: hidden; }
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: #f2ece3;
}
.lightbox::backdrop { background: rgba(12, 10, 8, 0.97); }
.lightbox figure {
  position: absolute; inset: 0; margin: 0; padding: 64px 84px 56px; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.lightbox img {
  max-width: 100%; max-height: calc(100vh - 180px); border-radius: 12px; pointer-events: auto; touch-action: pan-y;
  user-select: none; -webkit-user-drag: none;
}
.lightbox figcaption { max-width: 60ch; text-align: center; font-size: 15px; font-weight: 500; }
.lightbox .moment-date { color: rgba(242, 236, 227, 0.6); }
.lb-btn {
  position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.08); color: #fff;
  font: 400 26px/1 var(--sans); cursor: pointer; transition: background-color .15s;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.18); }
.lb-close { top: 18px; right: 18px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.talks {
  margin-top: 16px; display: grid; grid-template-columns: 220px 1fr 1fr; gap: 28px; align-items: start;
  border-radius: 20px; padding: 24px 26px; background: var(--surface); border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}
.talks h3 { font: 600 20px/1.2 var(--serif); }
.talks p { font-size: 15px; color: var(--muted); }
.talks .year { display: block; line-height: 1.6; }

/* Journey */
.journey { margin-top: 36px; }
.journey > li { display: grid; grid-template-columns: 120px 1fr; gap: 24px; padding: 26px 0; border-top: 1px solid var(--line-soft); }
.journey > li:last-child { border-bottom: 1px solid var(--line-soft); }
.yr { font: 600 30px/1 var(--serif); color: var(--accent); letter-spacing: -0.02em; }
.journey ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 32px; }
.journey ul li { position: relative; padding-left: 18px; font-size: 15px; color: var(--muted); }
.journey ul li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

/* Credentials */
.cred { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.timeline { border-left: 1px solid var(--line); margin-left: 5px; }
.timeline li { position: relative; display: grid; gap: 2px; padding: 0 0 24px 24px; }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.when { font: 400 13px/1.9 var(--mono); color: var(--muted); }
.timeline h3 { font-size: 16px; font-weight: 600; line-height: 1.5; }
.at { color: var(--muted); font-weight: 400; margin-left: 4px; }
.at::before { content: "at "; }
.timeline p { margin-top: 4px; color: var(--muted); font-size: 15px; max-width: 62ch; }
.plain li { padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 15px; }
.plain li:last-child { border-bottom: 1px solid var(--line-soft); }

.strip { padding-top: 88px; }
.strip-frame { overflow: hidden; }
.strip-frame img { margin: 0 auto; }

/* Skills */
.tools { margin-top: 28px; display: grid; gap: 4px; }
.tool-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; }
.tool-row h3 { font-size: 14px; font-weight: 500; color: var(--muted); }
.tool-icons { display: flex; flex-wrap: wrap; }
.tool { position: relative; }
.tool img { width: 43px; height: 45px; }
.tool::after {
  content: attr(data-name); position: absolute; left: 50%; bottom: calc(100% + 2px);
  transform: translate(-50%, 4px); white-space: nowrap; pointer-events: none;
  background: var(--ink); color: var(--bg); font: 500 12px/1 var(--sans); padding: 6px 8px; border-radius: 6px;
  opacity: 0; transition: opacity .12s, transform .12s; z-index: 2;
}
.tool:hover::after, .tool:focus::after { opacity: 1; transform: translate(-50%, 0); }
.methods { margin-top: 24px; color: var(--muted); font-size: 15px; max-width: 72ch; }
.methods strong { color: var(--ink); font-weight: 600; }

/* Activity */
.activity { margin-top: 28px; position: relative; }
.act-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.act-stats dd { font: 600 30px/1.1 var(--serif); letter-spacing: -0.01em; }
.act-stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; }
.act-stats dt { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.act-scroll { margin-top: 24px; overflow-x: auto; scrollbar-width: thin; }
.act-chart { width: 100%; height: auto; overflow: visible; display: block; }
.act-chart .bar-rect { pointer-events: none; fill: var(--accent); transform-box: fill-box; transform-origin: 50% 100%; animation: grow .7s cubic-bezier(.2,.7,.2,1) backwards; }
.act-chart .bar-rect.nil { fill: var(--line); }
.act-chart .hit { fill: transparent; cursor: default; }
.act-chart .hit:hover + .bar-rect, .act-chart .bar-rect.on { fill: var(--gold); }
.act-chart text { font: 400 12px var(--sans); fill: var(--muted); }
@keyframes grow { from { transform: scaleY(0); } }
.act-tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--bg);
  font: 500 12px/1.3 var(--sans); padding: 6px 8px; border-radius: 6px; white-space: nowrap;
  transform: translate(-50%, -100%); opacity: 0; transition: opacity .1s;
}
.act-tip.on { opacity: 1; }

/* Footer */
.footer { padding-top: 128px; padding-bottom: 40px; }
.email { display: inline-block; margin-top: 16px; font: 600 clamp(20px, 3vw, 28px) var(--serif); color: var(--accent); }
.email:hover { text-decoration: underline; }
.nap { margin-top: 48px; overflow: hidden; }
.nap img { margin: 0 auto; }
.fine { margin-top: 24px; color: var(--faint); font-size: 13px; text-align: center; }

/* Smaller screens -------------------------------------------------------- */
@media (max-width: 1080px) {
  .impact { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .portrait { max-width: 460px; justify-self: start; }
  .also, .cred, .partners { grid-template-columns: 1fr; }
  .cred { gap: 0; }
  .moments { grid-template-columns: repeat(2, 1fr); column-gap: 14px; }
  .journey > li { grid-template-columns: 1fr; gap: 12px; }
  .talks { grid-template-columns: 1fr; gap: 12px; }
  .journey ul { grid-template-columns: 1fr; }
  .tool-row { grid-template-columns: 1fr; gap: 4px; margin-bottom: 8px; }
}
@media (max-width: 760px) {
  .menu { display: grid; }
  .theme { margin-left: 0; }
  .bar nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 0; padding: 6px var(--gutter) 14px;
    background: var(--bg); border-bottom: 1px solid var(--line-soft); box-shadow: var(--shadow-sm);
  }
  .bar.open nav { display: flex; }
  .bar nav a { padding: 12px 0; font-size: 16px; border-bottom: 1px solid var(--line-soft); }
  .bar nav a:last-child { border-bottom: 0; }
  .bar nav a.on { border-bottom-color: var(--line-soft); color: var(--accent); }
}
@media (max-width: 680px) {
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  /* Phone rhythm: tighter sections, smaller gaps, larger animals. */
  .hero { padding-top: 36px; gap: 32px; }
  .section { padding-top: 72px; }
  .band-wrap { padding-top: 48px; }
  .strip { padding-top: 56px; }
  .footer { padding-top: 80px; }
  .subhead { margin: 32px 0 12px; }
  .lede { font-size: 16px; }
  .intro { font-size: 17px; margin-top: 20px; }
  h1 { margin-top: 16px; }
  .byline { font-size: 19px; gap: 10px; }
  .byline::before { width: 18px; }
  .eyebrow { font-size: 11px; letter-spacing: 0.1em; }
  .eyebrow::before { width: 18px; }
  .links { margin-top: 24px; }
  .btn { height: 44px; padding: 0 16px; font-size: 14px; }
  .socials { gap: 8px 18px; }
  .cards { margin-top: 24px; gap: 16px; }
  .card { border-radius: 18px; }
  .card-body { padding: 18px 18px 20px; gap: 8px; }
  .card h3 { font-size: 17px; }
  .impact { gap: 12px; margin-top: 24px; }
  .impact article { padding: 18px; }
  .big { font-size: 26px; }
  .filters { margin-top: 20px; gap: 6px; }
  .filter { height: 32px; padding: 0 12px; font-size: 13px; }
  .moments { margin-top: 18px; --gap: 18px; }
  .moment figcaption { font-size: 13px; margin-top: 8px; }
  .lightbox figure { padding: 64px 12px 84px; }
  .lb-prev, .lb-next { top: auto; bottom: 20px; transform: none; }
  .lb-prev { left: calc(50% - 56px); }
  .lb-next { right: calc(50% - 56px); }
  .talks { padding: 20px; }
  .journey { margin-top: 24px; }
  .journey > li { padding: 20px 0; }
  .yr { font-size: 26px; }
  .viewer .hexdump { padding: 14px 16px 16px; }
  .viewer-head { padding: 10px 16px; }
  .at { display: block; margin-left: 0; }
  .act-stats { gap: 12px; }
  .act-stats dt { font-size: 13px; }
  .strip-frame img { width: 620px; max-width: none; margin-left: calc((100% - 620px) / 2); }
  .nap { margin-top: 32px; }
  .nap img { width: 560px; max-width: none; margin: 0; }
  .act-chart { min-width: 620px; }
  .cat { display: none; }
  .hexdump { font-size: 12px; line-height: 21px; }
  .impact { grid-template-columns: 1fr; }
  .pubs li { grid-template-columns: 1fr; gap: 2px; }
  .chips { gap: 10px; }
  .chips p { padding: 12px; }
  .chips strong { font-size: 13px; }
  .act-stats dd { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
