/* Design tokens. The thermal ramp (--heat-*) is the one bold element and is
   reserved for the hero scan and its focus states; everything else is ink on
   paper. Decisions: docs/DECISIONS.md, design system ADR. */
:root {
  --paper: #F5F6F8;
  --surface: #FFFFFF;
  --ink: #141B2D;
  --ink-2: #4A536A;
  --line: #DCE0E8;
  --accent: #A3195B;
  --accent-ink: #FFFFFF;
  --heat-0: #1B1446;
  --heat-1: #5A1A8C;
  --heat-2: #B3206E;
  --heat-3: #E8642C;
  --heat-4: #F7C548;

  --sans: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  /* Classic scale: 14 16 19 24 30 40 56, display fluid. */
  --t-xs: 0.875rem;
  --t-sm: 1rem;
  --t-md: 1.1875rem;
  --t-lg: 1.5rem;
  --t-xl: 1.875rem;
  --t-2xl: 2.5rem;
  --t-display: clamp(4.25rem, 10vw, 8.25rem);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 76rem;
  --measure: 38rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0D1220;
    --surface: #141A2B;
    --ink: #E6E9F2;
    --ink-2: #9AA3BB;
    --line: #253049;
    --accent: #F07AAE;
    --accent-ink: #0D1220;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 2rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-md)/1.6 var(--serif);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--sans); font-weight: 650; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 0.75rem; z-index: 10; }

/* ---------------------------------------------------------------- chrome */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.5rem; font-family: var(--sans); font-size: var(--t-sm);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.site-head nav { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.site-head nav a { text-decoration: none; color: var(--ink-2); }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--ink); }
.site-head nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }

.site-foot {
  display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 2rem; align-items: end;
  margin-top: 6rem; padding-block: 3rem 2.5rem; border-top: 1px solid var(--line);
  font-family: var(--sans); font-size: var(--t-sm);
}
.foot-title { font-size: var(--t-lg); font-weight: 650; margin-bottom: 0.25rem; }
.mail { font-size: var(--t-md); }

/* ---------------------------------------------------------------- link pills + email */
.links { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.link-pill {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.42rem 0.85rem 0.42rem 0.45rem;
  border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  font-family: var(--sans); font-size: var(--t-xs); font-weight: 600; text-decoration: none; color: var(--ink);
  transition: box-shadow 150ms ease, transform 150ms ease;
}
.link-pill svg { width: 1.45rem; height: 1.45rem; flex: none; }
.link-pill:hover { color: var(--ink); box-shadow: 0 0 0 1.5px var(--accent); transform: translateY(-1px); }
.foot-links { margin: 0; justify-content: flex-end; }
.email { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; font-family: var(--sans); font-size: var(--t-md); }
.email svg { width: 1.3rem; height: 1.3rem; color: var(--accent); flex: none; }
.email a { text-decoration-color: var(--accent); }
.copy-email {
  font: 600 var(--t-xs) var(--sans); cursor: pointer; color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.7rem;
}
.copy-email:hover { border-color: var(--accent); color: var(--accent); }
.foot-note { grid-column: 1 / -1; color: var(--ink-2); font-size: var(--t-xs); margin: 0; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-block; font-family: var(--sans); font-size: var(--t-sm); font-weight: 600;
  padding: 0.6em 1.05em; border-radius: 999px; text-decoration: none; cursor: pointer;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { background: transparent; color: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem);
  align-items: center; padding-block: clamp(2rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem);
}
.name {
  font-size: var(--t-display); font-weight: 750; line-height: 0.88; letter-spacing: -0.045em;
  font-variation-settings: "opsz" 96;
}
.headline { font-family: var(--sans); font-size: var(--t-lg); font-weight: 500; margin: 1.5rem 0 1rem; color: var(--ink); }
.intro { max-width: 34rem; color: var(--ink-2); font-size: var(--t-md); }
.hero-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.scan { margin: 0; }
.scan-frame {
  position: relative; aspect-ratio: 1; border-radius: 1.25rem; overflow: hidden; background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.scan-frame img, .scan-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame canvas { opacity: 0; transition: opacity 700ms ease; }
.scan-frame canvas.on { opacity: 1; }
.scan[data-mode] .scan-frame::after {
  /* faint scan line, only once a non-colour view is showing */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(0deg, rgb(255 255 255 / 0.05) 0 1px, transparent 1px 4px);
  transition: opacity 700ms ease;
}
.scan[data-mode="thermal"] .scan-frame::after, .scan[data-mode="depth"] .scan-frame::after { opacity: 1; }
.scan figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 0.9rem; font-family: var(--sans); font-size: var(--t-xs); color: var(--ink-2); }
.scan-modes { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.scan-modes button {
  font: inherit; font-weight: 600; color: var(--ink-2); background: none; border: 0; cursor: pointer;
  padding: 0.35rem 0.8rem; border-radius: 999px;
}
.scan-modes button[aria-pressed="true"] { color: #fff; background: var(--ink); }
.scan-modes button[data-mode="thermal"][aria-pressed="true"] { background: linear-gradient(90deg, var(--heat-1), var(--heat-2) 55%, var(--heat-3)); }
.scan-modes button[data-mode="depth"][aria-pressed="true"] { background: #3C4A63; }
.scan-note { flex: 1 1 14rem; }
html:not(.js) .scan-modes, html:not(.js) .filters { display: none; }

/* ---------------------------------------------------------------- bands */
.band { border-top: 1px solid var(--line); }
.band-grid { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 2rem; padding-block: clamp(2.5rem, 5vw, 4rem); }
.band-label { font-size: var(--t-sm); font-weight: 650; color: var(--ink-2); padding-top: 0.3rem; }
.band-body { min-width: 0; }

.now, .themes { list-style: none; margin: 0; padding: 0; }
.now li, .themes li { padding-block: 0 1.4rem; }
.now a, .themes a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; text-decoration: none; }
.now a { align-items: center; }
.now-logo, .venture-logo {
  display: inline-grid; place-items: center; flex: none; background: #fff; border-radius: 12px;
  box-shadow: 0 0 0 1px var(--line); overflow: hidden;
}
.now-logo { width: 2.6rem; height: 2.6rem; padding: 0.3rem; }
.venture-logo { width: 4.5rem; height: 4.5rem; padding: 0.5rem; border-radius: 16px; }
.now-logo img, .venture-logo img { width: 100%; height: 100%; object-fit: contain; }
.logo-initial { font-family: var(--sans); font-weight: 750; font-size: 1.25rem; color: #fff; background: linear-gradient(135deg, var(--heat-1), var(--heat-2)); box-shadow: none; }
.now-name, .theme-name { font-family: var(--sans); font-size: var(--t-xl); font-weight: 650; letter-spacing: -0.02em; }
.now a:hover .now-name, .themes a:hover .theme-name { color: var(--accent); }
.now-role, .theme-count { font-family: var(--sans); font-size: var(--t-sm); color: var(--ink-2); }
.now-what, .theme-blurb { display: block; color: var(--ink-2); max-width: var(--measure); }
.metrics { margin-top: 1rem; padding-top: 1.25rem; border-top: 1px dashed var(--line); color: var(--ink-2); max-width: var(--measure); }

/* ---------------------------------------------------------------- publications */
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { padding-block: 1.4rem; border-bottom: 1px solid var(--line); }
.pub:first-child { padding-top: 0; }
.pubs-full .pub { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1.5rem; }
.pubs-full .pub:first-child { padding-top: 1.4rem; }
.pub[hidden] { display: none; }
.pub-year { font-family: var(--sans); font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 0.2rem; }
.pub-title { font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.015em; margin-bottom: 0.45rem; max-width: 46rem; }
.pub-title a { text-decoration: none; }
.pub-meta, .pub-venue { font-family: var(--sans); font-size: var(--t-xs); color: var(--ink-2); margin: 0 0 0.2rem; }
.me { color: var(--ink); font-weight: 650; }
.oa { display: inline-block; margin-left: 0.4rem; padding: 0 0.45em; border-radius: 4px; font-size: 0.78rem; font-weight: 600; color: var(--accent); box-shadow: inset 0 0 0 1px currentColor; }
.pub-summary { margin: 0.6rem 0 0.5rem; max-width: var(--measure); }
.kw { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; font-family: var(--sans); font-size: 0.8rem; }
.kw a { display: inline-block; padding: 0.12rem 0.55rem; border-radius: 6px; background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--ink-2); text-decoration: none; }
.kw a:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tag-filter { font-family: var(--sans); font-size: var(--t-sm); color: var(--ink-2); margin: 0 0 0.5rem; }
.pub-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin: 0; font-family: var(--sans); font-size: var(--t-xs); font-weight: 600; }
.more { font-family: var(--sans); font-weight: 600; display: inline-block; margin-top: 1.5rem; }

.page-head { padding-block: clamp(2rem, 5vw, 4rem) 2rem; }
.page-head h1 { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 750; letter-spacing: -0.04em; line-height: 0.95; }
.lede { font-size: var(--t-lg); line-height: 1.45; max-width: 44rem; color: var(--ink-2); margin-top: 1.25rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
.filters button {
  font-family: var(--sans); font-size: var(--t-xs); font-weight: 600; cursor: pointer;
  padding: 0.45rem 0.9rem; border-radius: 999px; color: var(--ink); background: transparent; border: 1px solid var(--line);
}
.filters button span { color: var(--ink-2); margin-left: 0.2rem; font-variant-numeric: tabular-nums; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filters button[aria-pressed="true"] span { color: inherit; opacity: 0.7; }

/* ---------------------------------------------------------------- paper page */
.paper { padding-block: 2rem 0; }
.crumbs { font-family: var(--sans); font-size: var(--t-sm); margin-bottom: 2rem; }
.crumbs a::before { content: "\2190\00a0"; }
.paper-kind { font-family: var(--sans); font-size: var(--t-sm); color: var(--ink-2); margin-bottom: 0.75rem; }
.paper-title { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.04; max-width: 56rem; }
.paper-authors { font-family: var(--sans); margin: 1.5rem 0 0.25rem; }
.paper-venue { color: var(--ink-2); font-style: italic; }
.paper-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: clamp(2rem, 6vw, 5rem); margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.paper h2 { font-size: var(--t-sm); font-weight: 650; color: var(--ink-2); margin: 0 0 0.75rem; }
.paper-main h2 + * { margin-top: 0; }
.paper-main h2:not(:first-child) { margin-top: 2.5rem; }
.paper-summary { font-size: 1.375rem; line-height: 1.55; max-width: var(--measure); }
.findings { margin: 0; padding: 0; list-style: none; max-width: var(--measure); }
.findings li { position: relative; padding: 0 0 0.9rem 1.5rem; }
.findings li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.6rem; height: 2px; background: var(--accent); }
.paper-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; }
.paper-side { font-size: var(--t-sm); }
.paper-side h2:not(:first-child) { margin-top: 2rem; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; font-family: var(--sans); font-size: var(--t-xs); }
.tags a { display: inline-block; padding: 0.25rem 0.7rem; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; }
.cite { font-size: var(--t-sm); line-height: 1.5; overflow-wrap: anywhere; }
.bib summary { font-family: var(--sans); font-size: var(--t-xs); font-weight: 600; cursor: pointer; margin-bottom: 0.5rem; }
.bib pre { font-size: 0.75rem; line-height: 1.5; overflow-x: auto; background: var(--surface); padding: 0.9rem; border-radius: 0.6rem; box-shadow: 0 0 0 1px var(--line); }
.related { margin-top: 4rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- work + about */
.ventures { display: grid; gap: 2.75rem; }
.venture-head { display: flex; align-items: center; gap: 1.25rem; }
.venture h3 { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -0.03em; }
.venture h3 a { text-decoration: none; }
.venture-role { font-family: var(--sans); font-size: var(--t-sm); color: var(--ink-2); margin: 0.4rem 0 0.75rem; }
.venture-what { font-size: var(--t-lg); line-height: 1.4; max-width: var(--measure); }
.ticks { margin: 0; padding: 0; list-style: none; max-width: var(--measure); }
.ticks li { position: relative; padding: 0 0 0.6rem 1.25rem; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 0.45rem; height: 1px; background: var(--ink-2); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.5rem; padding-bottom: 2rem; }
.tl-when { font-family: var(--sans); font-size: var(--t-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 0.15rem; }
.timeline h3, .edu h3 { font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.015em; }
.tl-org { font-family: var(--sans); font-size: var(--t-sm); color: var(--ink-2); margin: 0.25rem 0 0.6rem; }
.skills { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 0.75rem 1.5rem; margin: 0; }
.skills dt { font-family: var(--sans); font-weight: 600; font-size: var(--t-sm); padding-top: 0.15rem; }
.skills dd { margin: 0; color: var(--ink-2); }

.about-head { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 3rem; align-items: end; }
.about-portrait { border-radius: 1rem; aspect-ratio: 1; object-fit: cover; }
/* story: a real sequence, so the left column carries the year */
.story { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.25rem; }
.story > li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.5rem; }
.story-when { margin: 0; padding-top: 0.25rem; font-family: var(--sans); font-size: var(--t-sm); font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; }
.story h3 { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.story p { max-width: var(--measure); margin: 0; }
.story > li:first-child p:last-child { font-size: var(--t-lg); line-height: 1.45; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; }
.facts li { padding: 0.9rem 1rem; border-radius: 0.8rem; background: var(--surface); box-shadow: 0 0 0 1px var(--line); font-size: var(--t-sm); line-height: 1.45; }
.edu { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; }
.edu p { margin: 0 0 0.25rem; max-width: var(--measure); }
.awards { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.awards th { text-align: left; font-family: var(--sans); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); padding: 0 0 0.6rem; border-bottom: 1px solid var(--line); }
.awards td { padding: 0.65rem 1rem 0.65rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.awards td:nth-child(2) { color: var(--ink-2); white-space: nowrap; }
.awards .num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plain { margin: 0; padding: 0; list-style: none; }
.plain li { padding-bottom: 0.6rem; }

/* ---------------------------------------------------------------- 404 */
.lost { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; padding-block: clamp(2rem, 6vw, 5rem); }
.lost h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 750; letter-spacing: -0.04em; line-height: 0.98; }
.lost-signal {
  aspect-ratio: 1; border-radius: 1.25rem; display: grid; place-items: center; overflow: hidden; position: relative;
  background: radial-gradient(circle at 50% 55%, var(--heat-3), var(--heat-2) 30%, var(--heat-1) 55%, var(--heat-0) 80%);
}
.lost-signal::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgb(255 255 255 / 0.06) 0 1px, transparent 1px 4px); }
.lost-signal span { font-family: var(--sans); font-weight: 800; font-size: clamp(4rem, 12vw, 8rem); letter-spacing: -0.05em; color: #FFF6D5; mix-blend-mode: overlay; }
.lost-picks { margin: 2rem 0 0; padding: 0; list-style: none; font-family: var(--sans); font-size: var(--t-sm); }
.lost-picks li { padding: 0.5rem 0; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .scan { max-width: 30rem; }
  .band-grid { grid-template-columns: 1fr; gap: 1rem; }
  .paper-grid { grid-template-columns: 1fr; }
  .about-head { grid-template-columns: 1fr; }
  .about-portrait { width: 10rem; order: -1; }
  .lost { grid-template-columns: 1fr; }
  .lost-signal { max-width: 14rem; }
  .foot-links { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .site-head nav { gap: 1.1rem; }
  .story > li { grid-template-columns: 1fr; gap: 0.25rem; }
  .venture-head { align-items: flex-start; }
  .venture-logo { width: 3.5rem; height: 3.5rem; }
  .now-logo { width: 2.2rem; height: 2.2rem; }
  .pubs-full .pub { grid-template-columns: 1fr; gap: 0.25rem; }
  .timeline > li { grid-template-columns: 1fr; gap: 0.25rem; }
  .skills { grid-template-columns: 1fr; gap: 0.25rem; }
  .skills dd { margin-bottom: 1rem; }
  .site-foot { grid-template-columns: 1fr; }
  .awards td:nth-child(2) { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .site-head nav, .scan figcaption, .filters, .btn, .skip { display: none !important; }
  body { background: #fff; color: #000; }
}
