/* TACTICAL TELEMETRY DARK — single substrate. No gradients, no radius, no shadows. */
:root {
  --brut-bg: #0A0A0A;
  --brut-panel: #121212;
  --brut-fg: #EAEAEA;
  --brut-dim: #a8a8a8;
  --brut-line: #2a2a2a;
  --brut-red: #FF2A2A;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Courier, monospace;
}

*, *::before, *::after { border-radius: 0 !important; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  background: var(--brut-bg);
  color: var(--brut-fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  margin: 0;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.25rem 4rem;
}

/* CRT scanlines + mechanical grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.12) 2px, rgba(0,0,0,0.12) 4px);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brut-red);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10001;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--brut-red); outline-offset: 2px; }

/* Keep the CRT texture off long-form reading surfaces */
body.reading::before, body.reading::after { display: none; }

/* Nav + footer: compartmentalized strips */
.site-nav, .site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid var(--brut-fg);
  padding: 1rem 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-footer { border-bottom: none; border-top: 2px solid var(--brut-fg); margin-top: 4rem; }
.site-nav nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.site-nav nav a { white-space: nowrap; }

/* Header actions: search + menu toggle */
.nav-actions { display: flex; align-items: center; gap: 0.6rem; }
.site-nav > .brand, .nav-actions { position: relative; z-index: 2; }
#nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; padding: 0; cursor: pointer;
  background: none; border: 1px solid var(--brut-line); color: var(--brut-fg);
}
#nav-toggle:hover { border-color: var(--brut-red); color: var(--brut-red); }
#nav-toggle .ico-close { display: none; }
.nav-open #nav-toggle .ico-open { display: none; }
.nav-open #nav-toggle .ico-close { display: block; }

@media (max-width: 760px) {
  .site-nav {
    position: sticky; top: 0; z-index: 10002; background: var(--brut-bg);
    display: grid; grid-template-columns: 1fr auto; align-items: center;
    gap: 0; padding: 0.55rem 0; border-bottom: 1px solid var(--brut-line);
  }
  .nav-actions { justify-self: end; gap: 0.45rem; }
  .nav-js #nav-toggle { display: inline-flex; }
  /* icon-only search, no label, so the bar stays one row */
  #search-trigger span { display: none; }
  #search-trigger { padding: 0.45rem; }

  .nav-js #nav-drawer { display: none; }
  .nav-js.nav-open #nav-drawer {
    display: flex; flex-direction: column; gap: 0;
    position: fixed; inset: 0; z-index: 1;
    background: var(--brut-bg);
    padding: 4.2rem 1.25rem 2rem; overflow-y: auto;
    border-top: 2px solid var(--brut-fg);
  }
  .nav-js.nav-open #nav-drawer a {
    display: block; padding: 1.05rem 0; font-size: 0.95rem;
    letter-spacing: 0.08em; text-decoration: none;
    border-bottom: 1px solid var(--brut-line);
  }
  .nav-js.nav-open #nav-drawer a:hover,
  .nav-js.nav-open #nav-drawer a[aria-current="page"] { color: var(--brut-red); }
  html.nav-open { overflow: hidden; }
  .nav-open body::before, .nav-open body::after { display: none; }
}
.brand { font-weight: 700; }

main { padding-top: 2rem; }

/* Mono reserved for chrome: nav, labels, meta, code */
.site-nav, .site-footer, .telemetry, .meta, time, .file-no,
.read-more, .ico, .tech-tags, figcaption {
  font-family: var(--font-mono);
}

/* Narrow measure for long-form reading */
article.page { max-width: 40rem; }

/* Homepage rhythm: air between sections */
.home > div { margin-bottom: 1rem; }
.home h2 { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--brut-line); }
.home h3 { margin-top: 2rem; }
.home .tech-tags { margin-bottom: 1.5rem; }
.home .blog-grid { margin-top: 2rem; }

/* Skills: bordered telemetry cells, no JS, no animation */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1px; background: var(--brut-line); border: 1px solid var(--brut-line); margin: 1.5rem 0; }
.skills-grid p { background: var(--brut-bg); margin: 0; padding: 0.8rem 1rem; font-size: 0.9rem; line-height: 1.6; }
.skills-grid strong { display: block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brut-red); margin-bottom: 0.35rem; }

/* Experience: bordered panel, header strip, accented list */
.exp { border: 1px solid var(--brut-line); padding: 1.25rem 1.5rem; }
.exp h3 { margin-top: 0; }
.exp h3 + p em { font-style: normal; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brut-red); }
.exp ul { border-left: 2px solid var(--brut-red); margin-left: 0.25rem; padding-left: 1.25rem; }
.exp li { margin: 0.35rem 0; }

/* Hero: bordered panel, buttons untouched */
.hero { border: 1px solid var(--brut-line); background: var(--brut-panel); padding: 1.5rem 1.5rem 0.25rem; margin-bottom: 2rem; }
.hero .cta-row { margin-bottom: 1.5rem; }

/* Projects: one bordered panel per project */
.proj { border: 1px solid var(--brut-line); padding: 1.25rem 1.5rem; margin: 1.25rem 0; }
.proj h3 { margin-top: 0; }
.proj .tech-tags { margin-bottom: 0; }

/* Hero: status strip + action row */
.home > .telemetry:first-child { margin-bottom: 0.25rem; }
.home h1 { margin-top: 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 2.5rem; }
.cta-row a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--brut-fg);
  padding: 0.6rem 1rem;
}
.cta-row a:hover { border-color: var(--brut-red); color: var(--brut-red); }
@media (max-width: 640px) {
  .cta-row { flex-direction: column; }
  .cta-row a { display: block; text-align: center; }
}
@media (max-width: 480px) {
  .cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .cta-row a { font-size: 0.72rem; padding: 0.55rem 0.4rem; text-align: center; }
  .cta-row a:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Post layout: sticky side rail fills desktop void */
@media (min-width: 1024px) {
  .post-layout {
    display: grid;
    grid-template-columns: minmax(0, 40rem) 15rem;
    gap: 2.5rem;
    align-items: start;
  }
  .side-rail { position: sticky; top: 1.5rem; border: 1px solid var(--brut-line); }
  .side-rail section { padding: 0.9rem 1rem; border-bottom: 1px solid var(--brut-line); }
  .side-rail section:last-child { border-bottom: none; }
  .side-rail h2 { font-size: 0.7rem; letter-spacing: 0.1em; margin: 0 0 0.5rem; }
  .side-rail h2::before { content: "/// "; color: var(--brut-red); }
  .side-rail nav ul { list-style: none; margin: 0; padding: 0; font-size: 0.8rem; }
  .side-rail nav li { margin: 0.3rem 0; }
  .side-rail nav ul ul { padding-left: 0.8rem; }
  .side-rail p { font-size: 0.8rem; margin: 0.25rem 0; }
}

/* Headings: heavy, sentence case, compact */
h1, h2, h3 {
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
h1 { font-size: clamp(1.4rem, 3vw, 2rem); }
h2 { font-size: clamp(1.15rem, 2.4vw, 1.6rem); }
h2::before { content: "/// "; color: var(--brut-red); }

.telemetry, .meta, time {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brut-dim);
}
.telemetry { color: var(--brut-red); }
.lede { border-left: 4px solid var(--brut-red); padding-left: 1rem; }

hr { border: none; border-top: 2px solid var(--brut-fg); }

a { color: var(--brut-fg); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--brut-red); }
::selection { background: var(--brut-red); color: #fff; }

/* Content blocks */
article.page header { border-bottom: 2px solid var(--brut-fg); margin-bottom: 2rem; padding-bottom: 1rem; }
/* Content images sit above the decorative CRT scanline/grain overlays */
img { border: 1px solid var(--brut-line); max-width: 100%; position: relative; z-index: 10001; }
figure { margin: 1.5rem auto; border: 1px solid var(--brut-line); max-width: 44rem; }
figure img { display: block; width: 100%; border: none; }
figcaption {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brut-dim);
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--brut-line);
}
figcaption::before { content: "/// "; color: var(--brut-red); }
pre {
  border: 2px solid var(--brut-fg);
  background: var(--brut-panel);
  padding: 1rem;
  overflow-x: auto;
  text-transform: none;
}
code, kbd, samp {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--brut-panel);
  border: 1px solid var(--brut-line);
  padding: 0.1rem 0.4rem;
  text-transform: none;
  letter-spacing: 0;
}
pre code { border: none; background: none; padding: 0; }
blockquote { border-left: 4px solid var(--brut-red); margin-left: 0; padding-left: 1rem; color: var(--brut-dim); }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td { border: 1px solid var(--brut-line); padding: 0.5rem; text-align: left; }
th { text-transform: uppercase; letter-spacing: 0.08em; }

/* Blog cards + index lists: grid determinism */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px; background: var(--brut-line); border: 1px solid var(--brut-line); margin: 1.5rem 0; }
.blog-card { background: var(--brut-bg); padding: 1.25rem; text-decoration: none; display: block; }
.blog-card:hover { background: var(--brut-panel); }
.blog-card--featured { box-shadow: inset 3px 0 0 var(--brut-red); }
.featured-posts { margin: 1.5rem 0 2rem; }
.featured-posts .telemetry { margin-bottom: 0.5rem; }
.blog-card h3 { margin: 0.5rem 0; font-size: 1rem; }
.file-no { font-size: 0.7rem; letter-spacing: 0.1em; color: var(--brut-red); margin: 0; text-transform: uppercase; }
.read-more { color: var(--brut-red); font-size: 0.75rem; letter-spacing: 0.08em; }

/* Prev / next post nav: two telemetry cells */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--brut-line);
  border: 1px solid var(--brut-line);
  margin-top: 3rem;
}
.post-nav-cell { background: var(--brut-bg); padding: 1rem 1.25rem; display: block; text-decoration: none; }
.post-nav-cell.next { text-align: right; }
a.post-nav-cell:hover { background: var(--brut-panel); }
a.post-nav-cell:hover .post-nav-title { color: var(--brut-red); }
.post-nav-title { display: block; margin-top: 0.4rem; font-weight: 700; }

.index-list { list-style: none; padding: 0; border: 1px solid var(--brut-line); }
.index-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--brut-line);
}
.index-list li:last-child { border-bottom: none; }

/* Category filter */
.filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0; }
.index-list li[hidden] { display: none; }
@media (max-width: 640px) {
  .filter-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.5rem; }
  .filter-row button, .filter-row .filter-all { flex: 0 0 auto; }
}
.filter-row .filter-all {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em;
  text-decoration: none; color: var(--brut-dim); padding: 0.35rem 0.6rem;
  border: 1px solid transparent;
}
.filter-row .filter-all:hover { color: var(--brut-red); border-color: var(--brut-line); }
.filter-row button {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  background: var(--brut-bg);
  color: var(--brut-fg);
  border: 1px solid var(--brut-line);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.filter-row button:hover { border-color: var(--brut-fg); }
.filter-row button[aria-pressed="true"] { border-color: var(--brut-red); color: var(--brut-red); }

/* Pager: same chrome as the filter buttons */
.pager { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.pager[hidden] { display: none; }
.pager button {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  background: var(--brut-bg);
  color: var(--brut-fg);
  border: 1px solid var(--brut-line);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.pager button:hover { border-color: var(--brut-fg); }
.pager button:disabled { opacity: 0.35; cursor: default; }

.tech-tags { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brut-dim); display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; }
.tech-tags span { border: 1px solid var(--brut-line); padding: 0.1rem 0.45rem; }
.work-card li strong { color: var(--brut-fg); }
.ico { color: var(--brut-red); font-size: 0.75rem; letter-spacing: 0.08em; }

/* Suggested-listening audio box: bordered panel, native controls */
.audio-box { border: 1px solid var(--brut-line); background: var(--brut-panel); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.audio-box .meta { margin: 0 0 0.5rem; }
.audio-box p { margin: 0.25rem 0 0.75rem; font-size: 0.9rem; }
.audio-box audio { width: 100%; display: block; }

/* Portfolio layout: profile, metrics, selected work, capabilities */
.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 0.9fr);
  gap: 2rem;
  border: 1px solid var(--brut-line);
  background: var(--brut-panel);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.hero-copy h1 { margin: 0.25rem 0 1rem; max-width: 18ch; }
.hero-lede {
  font-size: 1.05rem;
  color: var(--brut-fg);
  border-left: 4px solid var(--brut-red);
  padding-left: 1rem;
  max-width: 60ch;
}
.hero-copy > p:not(.telemetry):not(.hero-lede) { color: var(--brut-dim); max-width: 62ch; }
.hero-card { border-left: 1px solid var(--brut-line); padding-left: 1.5rem; }
.quick-facts { margin: 1rem 0 0; }
.quick-facts div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--brut-line);
}
.quick-facts dt {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brut-dim);
}
.quick-facts dd { margin: 0; font-size: 0.9rem; }
.status-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--brut-red);
  margin-right: 0.4rem;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--brut-line);
  border: 1px solid var(--brut-line);
  margin: 1rem 0;
}
.metric { background: var(--brut-bg); padding: 1rem 1.25rem; }
.metric strong {
  display: block;
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--brut-red);
}
.metric span {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brut-dim);
}
.now-strip {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  border: 1px solid var(--brut-line);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.now-strip p { margin: 0; color: var(--brut-dim); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--brut-line);
}
.section-head h2 { margin: 0; padding: 0; border: none; }
.section-head h2::before { content: none; }
.section-head .telemetry { margin: 0 0 0.35rem; }
.section-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.section-lede { max-width: 65ch; color: var(--brut-dim); margin: 1rem 0 1.5rem; }
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--brut-line);
  border: 1px solid var(--brut-line);
  margin: 1.5rem 0;
}
.work-card { background: var(--brut-bg); padding: 1.5rem; }
.work-card.featured { grid-column: 1 / -1; }
.work-card h3, .cap-card h3, .timeline-body h3, .edu-card h3 { margin-top: 0; }
.work-card h3 { margin-bottom: 0.75rem; font-size: 1.15rem; }
.work-card p { color: var(--brut-dim); }
.work-card ul { margin: 0.75rem 0; padding-left: 1.1rem; color: var(--brut-dim); }
.work-card li { margin: 0.25rem 0; }
.work-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; }
.badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  border: 1px solid var(--brut-line);
  padding: 0.15rem 0.4rem;
  color: var(--brut-red);
}
.more-work { margin-top: 1rem; }

/* Product shots: real screens, cropped to one frame so cards line up. */
.shot { display: block; margin: 0 0 1rem; border: 1px solid var(--brut-line); background: var(--brut-panel); }
.shot img { display: block; width: 100%; height: auto; }
.shot--crop img { aspect-ratio: 16 / 9; object-fit: cover; object-position: top center; }
/* Diagrams are wide flowcharts: keep every node visible instead of cropping the ends. */
.shot--diagram img { aspect-ratio: 16 / 9; object-fit: contain; padding: 0.75rem; }
.shot figcaption, .shot-grid figcaption {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em;
  color: var(--brut-dim); padding: 0.5rem 0.6rem; border-top: 1px solid var(--brut-line);
}
.shot-grid {
  display: grid; gap: 1rem; margin: 1.5rem 0;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.shot-grid .shot { margin: 0; }

/* Research notebook: current project, paper metadata, and responsive tables */
.research-current {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(14rem, 0.7fr);
  gap: 2rem;
  border: 1px solid var(--brut-line);
  background: var(--brut-panel);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.research-current h2 { margin-top: 0; }
.research-lede { font-size: 1.05rem; border-left: 4px solid var(--brut-red); padding-left: 1rem; }
.research-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--brut-line);
  border: 1px solid var(--brut-line);
  align-self: start;
}
.research-stats div { background: var(--brut-bg); padding: 1rem; }
.research-stats strong {
  display: block;
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--brut-red);
}
.research-stats span {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brut-dim);
}
.paper-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; }
.paper-links a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--brut-line);
  padding: 0.4rem 0.6rem;
  text-decoration: none;
}
.paper-links a:hover { border-color: var(--brut-fg); }
.paper-abstract {
  border-left: 4px solid var(--brut-red);
  background: var(--brut-panel);
  padding: 1rem 1.25rem;
  margin: 0 0 2rem;
}
.paper-abstract p:last-child { margin-bottom: 0; color: var(--brut-dim); }
.paper-keywords {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--brut-dim);
}
.paper-keywords .meta { margin-right: 0.5rem; }
.paper-note {
  border-top: 1px solid var(--brut-line);
  margin-top: 2.5rem;
  padding-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--brut-dim);
}
.table-wrap { overflow-x: auto; margin: 1.5rem 0 0.5rem; }
.table-wrap table { margin: 0; min-width: 34rem; }
.table-caption {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--brut-dim);
  margin: 0.25rem 0 1.5rem;
}
.research-paper figure { max-width: none; }
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--brut-line);
  border: 1px solid var(--brut-line);
  margin: 1.5rem 0;
}
.cap-card { background: var(--brut-bg); padding: 1.25rem; }
.cap-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.cap-card p { color: var(--brut-dim); font-size: 0.9rem; }
.timeline {
  border-left: 2px solid var(--brut-line);
  margin: 1.5rem 0 1.5rem 0.5rem;
  padding-left: 1.5rem;
}
.timeline-item {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.95rem;
  top: 0.35rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--brut-red);
}
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--brut-red);
}
.timeline-body h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.timeline-body ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.timeline-body li { margin: 0.25rem 0; }
.impact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 2rem;
  max-width: none;
  border: 1px solid var(--brut-line);
  background: var(--brut-panel);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.impact-copy p { color: var(--brut-dim); }
.impact-copy p:last-child { margin-bottom: 0; }
.impact-chart {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  border-left: 1px solid var(--brut-line);
  padding-left: 1.5rem;
}
.bar-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
}
.bar-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brut-dim);
}
.bar-track {
  height: 2.25rem;
  border: 1px solid var(--brut-line);
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), var(--brut-line) calc(25% - 1px), var(--brut-line) 25%);
}
.bar-fill {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding-right: 0.5rem;
  background: var(--brut-fg);
  color: var(--brut-bg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}
.bar-fill.after { background: var(--brut-red); color: var(--brut-bg); }
.bar-callout {
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--brut-red);
}
.bar-callout span {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brut-dim);
}
.edu-card {
  border: 1px solid var(--brut-line);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.edu-card h3 { margin-bottom: 0.35rem; }
.contact-cta {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 2rem;
  border: 1px solid var(--brut-line);
  background: var(--brut-panel);
  padding: 1.5rem;
  margin-top: 3rem;
}
.contact-cta h2 { margin-top: 0; }
.contact-cta h2::before { content: none; }
.contact-links { font-family: var(--font-mono); font-size: 0.8rem; line-height: 2; }
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--brut-line);
  border: 1px solid var(--brut-line);
  margin: 1.5rem 0;
}
.project-card { background: var(--brut-bg); padding: 1.5rem; }
.project-card h2 { margin: 0.5rem 0 0.75rem; font-size: 1.15rem; }
.project-card h2::before { content: none; }
.project-card p { color: var(--brut-dim); }
.footer-links { display: flex; gap: 1rem; }

@media (max-width: 900px) {
  .profile-hero,
  .work-grid,
  .cap-grid,
  .impact-card,
  .edu-card,
  .contact-cta,
  .project-grid,
  .research-current { grid-template-columns: 1fr; }
  .hero-card { border-left: none; border-top: 1px solid var(--brut-line); padding-left: 0; padding-top: 1.25rem; }
  .impact-chart { border-left: none; border-top: 1px solid var(--brut-line); padding-left: 0; padding-top: 1.25rem; }
  .work-card.featured { grid-column: auto; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.35rem; }
}

@media (max-width: 640px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .now-strip { display: block; }
  .now-strip .telemetry { display: block; margin-bottom: 0.35rem; }
  .section-head { display: block; }
  .section-link { display: inline-block; margin-top: 0.75rem; }
  .contact-cta { padding: 1.25rem; }
  .paper-links a { flex: 1 1 auto; text-align: center; }
  .table-wrap table { min-width: 30rem; }

  /* The six-column results table becomes a stack of labelled rows on phones. */
  .results-table { overflow: visible; }
  .results-table table,
  .results-table tbody,
  .results-table tr,
  .results-table td { display: block; width: 100%; min-width: 0; }
  .results-table thead { display: none; }
  .results-table tr {
    border: 1px solid var(--brut-line);
    margin-bottom: 0.75rem;
    background: var(--brut-panel);
  }
  .results-table td {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: 0.5rem;
    border: none;
    border-bottom: 1px solid var(--brut-line);
    padding: 0.45rem 0.75rem;
    text-align: right;
  }
  .results-table td:last-child { border-bottom: none; }
  .results-table td::before {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brut-dim);
    text-align: left;
    content: "";
  }
  .results-table td:nth-child(1)::before { content: "Arrival rate"; }
  .results-table td:nth-child(2)::before { content: "Policy"; }
  .results-table td:nth-child(3)::before { content: "Deadline misses"; }
  .results-table td:nth-child(4)::before { content: "Mean latency"; }
  .results-table td:nth-child(5)::before { content: "Energy per task"; }
  .results-table td:nth-child(6)::before { content: "Offload fraction"; }
}

/* Search Modal - Brutalist Terminal Style */
.site-nav #search-container { display: flex; align-items: center; }
.site-nav #search-trigger {
  display: flex; align-items: center; gap: 0.4rem;
  background: none; border: 1px solid var(--brut-line); color: var(--brut-fg);
  font-family: var(--font-mono); font-size: 0.75rem; cursor: pointer;
  padding: 0.2rem 0.5rem; transition: all 0.1s;
}
.site-nav #search-trigger:hover { border-color: var(--brut-red); color: var(--brut-red); }
.site-nav #search-trigger svg { stroke: currentColor; }

#search-modal {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(10, 10, 10, 0.9); display: flex; align-items: center; justify-content: center;
  padding: 2rem; backdrop-filter: blur(4px);
}
#search-modal.hidden { display: none; }
.search-modal-inner {
  background: var(--brut-bg); border: 3px solid var(--brut-fg); width: 100%; max-width: 50rem;
  display: flex; flex-direction: column; max-height: 70vh;
}
.search-header {
  display: flex; border-bottom: 2px solid var(--brut-fg); background: var(--brut-panel);
}
.search-header input {
  flex: 1 1 0; min-width: 0; background: none; border: none; color: var(--brut-fg);
  font-family: var(--font-mono); font-size: 1.2rem; padding: 1rem; outline: none;
}
.search-header button {
  background: none; border: none; color: var(--brut-fg); cursor: pointer;
  padding: 0 1rem; font-size: 1.2rem;
}
.search-header button:hover { color: var(--brut-red); }
.search-header input::-webkit-search-cancel-button,
.search-header input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

#search-results {
  overflow-y: auto; padding: 1rem;
}
.search-result {
  display: block; border: 1px solid var(--brut-line); margin-bottom: 0.5rem; padding: 0.75rem;
  text-decoration: none; color: var(--brut-fg);
}
.search-result:hover, .search-result:focus-visible { border-color: var(--brut-red); outline: none; }
.search-result-title { display: block; font-weight: 700; font-family: var(--font-mono); }
.search-result-excerpt { display: block; color: var(--brut-dim); font-size: 0.9rem; margin-top: 0.25rem; }
.search-result-excerpt mark { background: var(--brut-red); color: var(--brut-bg); }
.search-result-url { display: block; color: var(--brut-red); font-family: var(--font-mono); font-size: 0.7rem; margin-top: 0.25rem; }
.search-note { padding: 1rem; margin: 0; color: var(--brut-dim); font-family: var(--font-mono); font-size: 0.85rem; }
.search-note--error { color: var(--brut-red); }
