/* ==========================================================
   Andrew Blayama Stephen — portfolio
   Palette: slide-glass paper, field ink, jade (stain), ochre (signal)
   Type: Bricolage Grotesque (display) · IBM Plex Sans (body) · IBM Plex Mono (data)
   ========================================================== */

@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }

:root {
  --paper: #f2f4f1;
  --surface: #fbfcfa;
  --sunk: #e7ebe6;
  --ink: #14201c;
  --ink-2: #3b4a44;
  --muted: #62716b;
  --line: #d3dbd6;
  --jade: #0d6a55;
  --jade-soft: #d6ebe3;
  --ochre: #b8741f;
  --ochre-soft: #f4e5cf;
  --focus: #0d6a55;

  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --r: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1512;
    --surface: #141d19;
    --sunk: #1a2520;
    --ink: #e4ece8;
    --ink-2: #bccac3;
    --muted: #8a9c94;
    --line: #26332d;
    --jade: #5cc7a6;
    --jade-soft: #173a30;
    --ochre: #e4a758;
    --ochre-soft: #3a2b17;
    --focus: #5cc7a6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1512;
  --surface: #141d19;
  --sunk: #1a2520;
  --ink: #e4ece8;
  --ink-2: #bccac3;
  --muted: #8a9c94;
  --line: #26332d;
  --jade: #5cc7a6;
  --jade-soft: #173a30;
  --ochre: #e4a758;
  --ochre-soft: #3a2b17;
  --focus: #5cc7a6;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.22rem; letter-spacing: -0.01em; line-height: 1.25; }
p { margin: 0; }
.lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--ink-2); max-width: 60ch; }
.mono, .eyebrow, .tag, .meta { font-family: var(--f-mono); }
.eyebrow {
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); display: flex; align-items: center; gap: 0.6em;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--jade); display: inline-block; }
.muted { color: var(--muted); }
em.hl { font-style: normal; color: var(--jade); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: 0.5rem; margin-right: auto; }
.brand b { font-family: var(--f-display); font-size: 1.12rem; letter-spacing: -0.02em; }
.brand span { font-family: var(--f-mono); font-size: 0.74rem; color: var(--muted); }
.nav { display: flex; gap: 0.25rem; align-items: center; flex-wrap: wrap; }
.nav a {
  text-decoration: none; font-size: 0.92rem; padding: 0.4rem 0.75rem; border-radius: 999px; color: var(--ink-2);
}
.nav a:hover { background: var(--sunk); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.theme-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  width: 36px; height: 36px; border-radius: 999px; cursor: pointer; display: grid; place-items: center;
}
.theme-btn:hover { border-color: var(--muted); }
.theme-btn svg { width: 17px; height: 17px; }

/* ---------- buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; cursor: pointer;
  font: 500 0.95rem/1 var(--f-body); padding: 0.8rem 1.1rem; border-radius: var(--r);
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn svg { width: 16px; height: 16px; }

/* ---------- sections ---------- */
section { padding-block: clamp(56px, 8vw, 104px); }
section + section { border-top: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 1.5rem 3rem; margin-bottom: 2.75rem; align-items: end; }
.sec-head .eyebrow { margin-bottom: 0.9rem; }
.sec-head p { color: var(--ink-2); max-width: 58ch; }
@media (max-width: 820px) { .sec-head { grid-template-columns: 1fr; } }

/* ---------- hero (intro) ---------- */
.hero { padding-block: clamp(40px, 6vw, 80px) clamp(48px, 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero h1 { margin-block: 1.1rem 1.4rem; }
.hero .lede { margin-bottom: 2rem; }
.contact-row { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 1.75rem; font-family: var(--f-mono); font-size: 0.82rem; color: var(--muted); }
.contact-row a { text-decoration: none; border-bottom: 1px solid var(--line); }
.contact-row a:hover { color: var(--jade); border-color: var(--jade); }

.portrait { position: relative; max-width: 420px; justify-self: end; width: 100%; }
.portrait figure { margin: 0; position: relative; border-radius: var(--r); overflow: hidden; background: var(--sunk); aspect-ratio: 4 / 5; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
/* detection-box frame: a nod to the object-detection work */
.bbox { position: absolute; inset: 9% 17% 44% 22%; border: 2px solid var(--jade); border-radius: 2px; pointer-events: none; }
.bbox::before {
  content: attr(data-label); position: absolute; left: -2px; bottom: 100%;
  background: var(--jade); color: var(--paper); font: 500 0.7rem/1 var(--f-mono);
  padding: 4px 6px; white-space: nowrap; border-radius: 2px 2px 0 0;
}
.coords {
  display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.7rem;
  font: 0.72rem/1.4 var(--f-mono); color: var(--muted); letter-spacing: 0.02em;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { justify-self: start; max-width: 340px; order: -1; }
}

/* ---------- df.info panel ---------- */
@media (max-width: 560px) { .brand span { display: none; } }
.info {
  align-self: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  font: 0.84rem/1.65 var(--f-mono); overflow-x: auto;
}
.info-bar { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.74rem; }
.info pre { margin: 0; padding: 1rem 1.1rem 1.15rem; white-space: pre; color: var(--ink-2); }
.info .k { color: var(--jade); }
.info .c { color: var(--muted); }
.info .s { color: var(--ochre); }

/* ---------- stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.stat { padding: 1.4rem 1.25rem; display: grid; gap: 0.3rem; align-content: start; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { font-family: var(--f-display); font-size: clamp(1.9rem, 3.2vw, 2.6rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.88rem; color: var(--muted); }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- capabilities ---------- */
.caps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cap { background: var(--surface); padding: 1.6rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 0.9rem; }
.cap .glyph { width: 44px; height: 44px; color: var(--jade); }
.cap p { color: var(--ink-2); font-size: 0.97rem; }
.cap ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; }
.cap .evidence { font: 0.78rem/1.5 var(--f-mono); color: var(--muted); border-top: 1px dashed var(--line); padding-top: 0.8rem; }
.cap .evidence a { color: var(--jade); }
@media (max-width: 900px) { .caps { grid-template-columns: 1fr; } }

.tag {
  display: inline-block; font-size: 0.72rem; line-height: 1; padding: 0.38rem 0.5rem; border-radius: 4px;
  background: var(--sunk); color: var(--ink-2); white-space: nowrap;
}
.tag.jade { background: var(--jade-soft); color: var(--jade); }
.tag.ochre { background: var(--ochre-soft); color: var(--ochre); }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.role { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.5rem 2rem; padding-block: 1.6rem; border-top: 1px solid var(--line); }
.role:last-child { border-bottom: 1px solid var(--line); }
.role .when { font: 0.8rem/1.5 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 0.2rem; }
.role .when .now { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--jade); }
.role .when .now::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 0 3px var(--jade-soft); }
.role h3 { margin-bottom: 0.2rem; }
.role .org { color: var(--ink-2); font-size: 0.95rem; margin-bottom: 0.7rem; }
.role .org span { color: var(--muted); }
.role ul { margin: 0; padding-left: 1.1rem; color: var(--ink-2); display: grid; gap: 0.3rem; max-width: 72ch; }
.role ul li::marker { color: var(--jade); }
.role .tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.9rem; }
@media (max-width: 700px) { .role { grid-template-columns: 1fr; } }

/* ---------- skills matrix ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 2rem 2.5rem; }
.skill-group h3 { font-size: 0.78rem; font-family: var(--f-mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.9rem; }
.skill-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.skill-group li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-bottom: 0.5rem; border-bottom: 1px dotted var(--line); font-size: 0.97rem; }
.skill-group li small { font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); white-space: nowrap; }

/* ---------- news log ---------- */
.log { list-style: none; margin: 0; padding: 0; display: grid; }
.log li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: 1.25rem; padding-block: 1rem; border-top: 1px solid var(--line); align-items: baseline; }
.log li:last-child { border-bottom: 1px solid var(--line); }
.log time { font: 0.8rem var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.log p { color: var(--ink-2); }
.log p b { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) { .log li { grid-template-columns: 1fr; gap: 0.35rem; } }

/* ---------- two col ---------- */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 64px); }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.edu { display: grid; gap: 1.1rem; }
.edu-item { display: grid; gap: 0.2rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.edu-item .meta { font-size: 0.78rem; color: var(--muted); }
.edu-item p { color: var(--ink-2); }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.plain-list li { display: flex; gap: 0.75rem; align-items: baseline; color: var(--ink-2); }
.plain-list li::before { content: "→"; color: var(--jade); font-family: var(--f-mono); }

/* ---------- CTA / footer ---------- */
.cta { background: var(--ink); color: var(--paper); border-radius: var(--r); padding: clamp(28px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2rem; align-items: end; }
.cta h2 { color: var(--paper); }
.cta p { color: color-mix(in srgb, var(--paper) 72%, var(--ink)); margin-top: 0.9rem; max-width: 52ch; }
.cta .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.cta .btn.ghost { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 35%, var(--ink)); }
.cta .btns { justify-content: flex-end; }
.copy-mail { font-family: var(--f-mono); font-size: 0.85rem; }
@media (max-width: 820px) { .cta { grid-template-columns: 1fr; } .cta .btns { justify-content: flex-start; } }

.site-footer { padding-block: 2.5rem 3rem; font: 0.8rem/1.6 var(--f-mono); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--jade); }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ---------- page hero (research / projects) ---------- */
.page-hero { padding-block: clamp(40px, 6vw, 80px) clamp(40px, 6vw, 72px); }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.page-hero h1 { margin-block: 1rem 1.25rem; }
@media (max-width: 860px) { .page-hero-grid { grid-template-columns: 1fr; } }

/* microscope field */
.scope { margin: 0; justify-self: center; width: 100%; max-width: 420px; }
.scope-lens { position: relative; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #efe6ee; box-shadow: 0 0 0 10px var(--sunk), 0 0 0 11px var(--line); }
.scope canvas { width: 100%; height: 100%; display: block; }
.scope figcaption { margin-top: 1.4rem; text-align: center; font: 0.72rem/1.5 var(--f-mono); color: var(--muted); }

/* themes */
.themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.theme { border-top: 2px solid var(--ink); padding-top: 1rem; display: grid; gap: 0.5rem; align-content: start; }
.theme .meta { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.theme p { color: var(--ink-2); font-size: 0.95rem; }
@media (max-width: 900px) { .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .themes { grid-template-columns: 1fr; } }

/* publications */
.pubs { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.pub { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem 2rem; padding-block: 2rem; border-top: 1px solid var(--line); }
.pub:last-child { border-bottom: 1px solid var(--line); }
.pub .year { font-family: var(--f-display); font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.pub .badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.8rem; }
.pub h3 { font-size: clamp(1.15rem, 1.8vw, 1.38rem); max-width: 48ch; }
.pub .authors { margin-top: 0.6rem; color: var(--ink-2); font-size: 0.95rem; }
.pub .authors b { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--jade); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.pub .venue { margin-top: 0.35rem; font-size: 0.92rem; color: var(--muted); }
.pub .gist { margin-top: 0.9rem; color: var(--ink-2); max-width: 70ch; }
.pub .links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.chip-link {
  display: inline-flex; align-items: center; gap: 0.4rem; font: 500 0.8rem/1 var(--f-mono);
  padding: 0.55rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink);
  background: var(--surface); cursor: pointer;
}
.chip-link:hover { border-color: var(--jade); color: var(--jade); }
.chip-link svg { width: 13px; height: 13px; }
@media (max-width: 640px) { .pub { grid-template-columns: 1fr; } .pub .year { font-size: 1.3rem; } }

/* talks */
.talks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.talk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem 1.3rem; display: grid; gap: 0.4rem; align-content: start; }
.talk .meta { font-size: 0.76rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.talk p { color: var(--ink-2); font-size: 0.95rem; }
@media (max-width: 720px) { .talks { grid-template-columns: 1fr; } }

/* ongoing research block */
.ongoing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
.ongoing article { border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem; background: var(--surface); display: grid; gap: 0.7rem; align-content: start; }
.ongoing ul { margin: 0; padding-left: 1.1rem; color: var(--ink-2); display: grid; gap: 0.3rem; }
@media (max-width: 820px) { .ongoing { grid-template-columns: 1fr; } }

/* ---------- projects ---------- */
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); counter-reset: step; }
.pipeline li { counter-increment: step; position: relative; padding: 1.1rem 1rem 1.2rem 0; border-top: 2px solid var(--line); display: grid; gap: 0.35rem; align-content: start; }
.pipeline li::before { content: counter(step, decimal-leading-zero); font: 500 0.74rem var(--f-mono); color: var(--jade); }
.pipeline li::after { content: ""; position: absolute; top: -6px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--jade); }
.pipeline b { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.pipeline span { font-size: 0.86rem; color: var(--muted); }
@media (max-width: 900px) { .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 1rem; } }
@media (max-width: 520px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.75rem; align-items: center; }
.filters .label { font: 0.76rem var(--f-mono); color: var(--muted); margin-right: 0.4rem; text-transform: uppercase; letter-spacing: 0.1em; }
.filter {
  font: 500 0.86rem/1 var(--f-body); padding: 0.55rem 0.85rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filter .n { font-family: var(--f-mono); font-size: 0.74rem; opacity: 0.7; margin-left: 0.3rem; }

.featured { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); margin-bottom: 1.25rem; }
.featured .body { padding: clamp(22px, 3.5vw, 40px); display: grid; gap: 1rem; align-content: start; }
.featured .visual { background: var(--sunk); border-left: 1px solid var(--line); display: grid; place-items: center; padding: 1.5rem; min-height: 280px; }
.featured .visual .scope { max-width: 300px; }
.featured h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
@media (max-width: 860px) { .featured { grid-template-columns: 1fr; } .featured .visual { border-left: 0; border-top: 1px solid var(--line); } }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem 1.4rem 1.3rem; display: flex; flex-direction: column; gap: 0.8rem; transition: border-color .15s ease, transform .15s ease; }
.card:hover { border-color: color-mix(in srgb, var(--jade) 55%, var(--line)); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.card-top .meta { font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .where { font-size: 0.88rem; color: var(--muted); margin-top: -0.35rem; }
.card p { color: var(--ink-2); font-size: 0.95rem; }
.card details { font-size: 0.92rem; color: var(--ink-2); }
.card summary { cursor: pointer; font: 500 0.8rem var(--f-mono); color: var(--jade); list-style: none; }
.card summary::-webkit-details-marker { display: none; }
.card summary::before { content: "+ "; }
.card details[open] summary::before { content: "− "; }
.card details ul { margin: 0.6rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; }
.card .stack { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: auto; padding-top: 0.9rem; border-top: 1px dashed var(--line); }
.card .links { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cat { font: 500 0.7rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 0.35rem 0.5rem; border-radius: 4px; }
.cat.ml { background: var(--jade-soft); color: var(--jade); }
.cat.bi { background: var(--ochre-soft); color: var(--ochre); }
.cat.survey { background: var(--sunk); color: var(--ink-2); }
.cat.gov { background: var(--ink); color: var(--paper); }
.empty-note { color: var(--muted); font-family: var(--f-mono); font-size: 0.85rem; }

/* ---------- entrance motion (content visible at rest) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .rise.d1 { animation-delay: .06s; } .rise.d2 { animation-delay: .12s; } .rise.d3 { animation-delay: .18s; } .rise.d4 { animation-delay: .24s; }
  @keyframes rise { from { transform: translateY(10px); opacity: .001; } to { transform: none; opacity: 1; } }
}
.portrait picture { display: contents; }
