/* Fonts are served from this site (fonts/, SIL Open Font License); no third-party requests. */
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "VT323"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/vt323-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "VT323"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/vt323-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* Layout: one terminal session. A tmux-style status bar, a neofetch hero with a live
   SRAM bit grid, then short panes. Each card opens its full text in a pager. */
:root {
  --font-display: "VT323", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.0625rem;
  --step-2: clamp(2rem, 1.7rem + 1.2vw, 2.6rem);
  --step-3: clamp(3.4rem, 2.4rem + 4.6vw, 5.75rem);
  --measure: 64ch;
  --measure-wide: 72ch;
}

/* Colorschemes. Each block sets the same tokens; the picker writes data-scheme on the
   root. "auto" sets nothing: phosphor in dark mode, greenbar in light mode. */
:root, [data-scheme="phosphor"] {
  --bg: #050a06; --pane: #0b160e; --line: #1b3d24; --fg: #b4f5c0; --muted: #62a870;
  --hi: #3dff7e; --hi2: #8ff0d0; --warn: #ffb000; --bad: #ff6a5c;
  --glow: 0 0 12px rgb(61 255 126 / 0.45); --scan: 0.16;
  --hot: #a8ffc4; --bit-glow: 0 0 5px rgb(110 255 155 / 0.85);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-scheme]) {
    --bg: #f4f8f1; --pane: #e3efdc; --line: #b8cfae; --fg: #10301a; --muted: #4a6a50;
    --hi: #0a7a36; --hi2: #0d6a74; --warn: #9a5800; --bad: #b42a1f;
    --glow: none; --scan: 0; --hot: var(--hi); --bit-glow: none;
    color-scheme: light;
  }
}
:root[data-theme="light"]:not([data-scheme]), [data-scheme="greenbar"] {
  --bg: #f4f8f1; --pane: #e3efdc; --line: #b8cfae; --fg: #10301a; --muted: #4a6a50;
  --hi: #0a7a36; --hi2: #0d6a74; --warn: #9a5800; --bad: #b42a1f;
  --glow: none; --scan: 0; --hot: var(--hi); --bit-glow: none;
  color-scheme: light;
}
[data-scheme="gruvbox"] {
  --bg: #1d2021; --pane: #282828; --line: #3c3836; --fg: #ebdbb2; --muted: #a89984;
  --hi: #fabd2f; --hi2: #8ec07c; --warn: #fe8019; --bad: #fb4934;
  --glow: none; --scan: 0; --hot: var(--hi); --bit-glow: none;
  color-scheme: dark;
}
[data-scheme="nord"] {
  --bg: #2e3440; --pane: #3b4252; --line: #4c566a; --fg: #eceff4; --muted: #a7b1c2;
  --hi: #88c0d0; --hi2: #a3be8c; --warn: #ebcb8b; --bad: #e5848e;
  --glow: none; --scan: 0; --hot: var(--hi); --bit-glow: none;
  color-scheme: dark;
}
[data-scheme="dracula"] {
  --bg: #282a36; --pane: #21222c; --line: #44475a; --fg: #f8f8f2; --muted: #a4abd3;
  --hi: #bd93f9; --hi2: #8be9fd; --warn: #ffb86c; --bad: #ff5555;
  --glow: none; --scan: 0; --hot: var(--hi); --bit-glow: none;
  color-scheme: dark;
}
[data-scheme="catppuccin-mocha"] {
  --bg: #1e1e2e; --pane: #181825; --line: #313244; --fg: #cdd6f4; --muted: #a6adc8;
  --hi: #cba6f7; --hi2: #94e2d5; --warn: #fab387; --bad: #f38ba8;
  --glow: none; --scan: 0; --hot: var(--hi); --bit-glow: none;
  color-scheme: dark;
}
[data-scheme="catppuccin-latte"] {
  --bg: #eff1f5; --pane: #e6e9ef; --line: #ccd0da; --fg: #4c4f69; --muted: #5c5f77;
  --hi: #8839ef; --hi2: #137a80; --warn: #b84f00; --bad: #d20f39;
  --glow: none; --scan: 0; --hot: var(--hi); --bit-glow: none;
  color-scheme: light;
}
[data-scheme="tokyonight"] {
  --bg: #1a1b26; --pane: #16161e; --line: #292e42; --fg: #c0caf5; --muted: #9aa5ce;
  --hi: #7aa2f7; --hi2: #9ece6a; --warn: #e0af68; --bad: #f7768e;
  --glow: none; --scan: 0; --hot: var(--hi); --bit-glow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  scroll-padding-top: 4rem;
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--step-0);
  line-height: 1.6;
}
body:has(dialog[open]) { overflow: hidden; }
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--pane);
}
/* CRT scanlines; only phosphor gives them any strength. */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 25;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgb(0 0 0 / var(--scan)) 2px 3px);
}
::selection { background: var(--hi); color: var(--bg); }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--hi2); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--hi); }
:focus-visible { outline: 2px solid var(--hi); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 40;
  background: var(--hi); color: var(--bg); padding: 0.5rem 1rem;
}
.skip:focus { left: max(16px, env(safe-area-inset-left, 0px)); }

/* ---- status bar --------------------------------------------------- */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--pane); border-bottom: 1px solid var(--line);
  font-size: var(--step--1);
}
.bar-inner {
  display: flex; align-items: center; gap: 0.75rem;
  max-width: 70rem; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0.4rem;
}
.session {
  flex: none; background: var(--hi); color: var(--bg); font-weight: 600;
  padding: 0 0.55rem; border-radius: 2px;
}
.windows {
  flex: 1 1 auto; min-width: 0; display: flex; gap: 0.15rem;
  overflow-x: auto; scrollbar-width: none;
}
.windows::-webkit-scrollbar { display: none; }
.windows a {
  flex: none; color: var(--muted); text-decoration: none; padding: 0.1rem 0.45rem; border-radius: 2px;
}
.windows a:hover { color: var(--fg); background: var(--line); }
.windows a[aria-current="true"] { color: var(--fg); background: var(--line); }
.windows a[aria-current="true"]::after { content: "*"; color: var(--hi); }
.windows .n { color: var(--hi); }
.keys { display: none; flex: none; color: var(--muted); }
@media (min-width: 62rem) { .keys { display: inline; } }

/* ---- colorscheme picker ------------------------------------------- */
.scheme { position: relative; flex: none; }
.scheme-btn {
  display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer;
  color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 2px;
  padding: 0.1rem 0.5rem;
}
.scheme-btn:hover, .scheme-btn[aria-expanded="true"] { border-color: var(--hi); }
.scheme-btn .lbl { color: var(--muted); }
.scheme-btn .dot { width: 0.6rem; height: 0.6rem; background: var(--hi); box-shadow: var(--glow); }
@media (max-width: 34rem) { .scheme-btn .lbl { display: none; } }
.scheme-menu {
  position: absolute; right: 0; top: calc(100% + 0.6rem); z-index: 30;
  width: min(20rem, calc(100vw - 32px));
  background: var(--bg); border: 1px solid var(--hi); border-radius: 3px; padding: 0.4rem;
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.35);
}
.scheme-menu fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 2px; min-width: 0; }
.scheme-menu legend { color: var(--muted); font-size: 0.75rem; padding: 0.2rem 0.5rem 0.4rem; }
.opt {
  position: relative; display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 0.75rem;
  align-items: center; padding: 0.3rem 0.5rem; border-radius: 2px; cursor: pointer;
}
.opt:hover { background: var(--pane); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.opt .nm { color: var(--fg); overflow-wrap: anywhere; }
.opt .ds { display: block; color: var(--muted); font-size: 0.75rem; }
.opt input:checked ~ .txt .nm { color: var(--hi); }
.opt input:checked ~ .txt .nm::before { content: "> "; }
.opt input:focus-visible ~ .txt .nm { text-decoration: underline; }
.opt:has(input:checked) { background: var(--pane); }
.opt:has(input:focus-visible) { outline: 2px solid var(--hi); outline-offset: -2px; }
.opt:has(input:focus-visible) .nm { text-decoration: none; }
.sws { display: flex; gap: 3px; }
.sw {
  display: inline-flex; padding: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 2px;
}
.sw i { display: block; width: 0.7rem; height: 0.95rem; }
.sws.half .sw i { width: 0.4rem; }
.sw i:nth-child(1) { background: var(--fg); }
.sw i:nth-child(2) { background: var(--hi); }
.sw i:nth-child(3) { background: var(--hi2); }
.sw i:nth-child(4) { background: var(--warn); }
.sw i:nth-child(5) { background: var(--bad); }

/* ---- page frame --------------------------------------------------- */
main {
  max-width: 70rem; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 2rem 4rem;
  display: grid; gap: 4rem;
}
section { display: grid; gap: 1.5rem; min-width: 0; }
.prompt { font-size: var(--step--1); color: var(--muted); overflow-wrap: anywhere; }
.prompt .u { color: var(--hi); }
.prompt .p { color: var(--hi2); }
.prompt .c { color: var(--fg); }
.cursor {
  display: inline-block; width: 0.6em; height: 1.1em; vertical-align: text-bottom;
  background: var(--hi); margin-left: 0.15em; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.head { display: grid; gap: 0.1rem; }
h2 {
  font-family: var(--font-display); font-weight: 400; font-size: var(--step-2);
  color: var(--hi); text-shadow: var(--glow); letter-spacing: 0.01em;
}
h3 { font-size: var(--step-1); font-weight: 600; }
.dim { color: var(--muted); }

/* Panes: bordered boxes with the title set into the top border, like a TUI window. */
.pane {
  position: relative; border: 1px solid var(--line); border-radius: 3px;
  padding: 1.4rem 1.15rem 1.1rem; background: var(--bg); min-width: 0;
}
.pane-title {
  position: absolute; top: -0.8em; left: 0.85rem; max-width: calc(100% - 1.7rem);
  padding: 0 0.5ch; background: var(--bg);
  font-size: var(--step--1); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pane-title b { color: var(--fg); font-weight: 500; }

/* ---- hero / neofetch ---------------------------------------------- */
.fetch { display: grid; gap: 2rem; align-items: center; grid-template-columns: minmax(0, 1fr); }
/* On narrow screens the name comes first and the grid second. */
@media (max-width: 51.99rem) { .fetch .whoami { order: -1; } }
@media (min-width: 52rem) { .fetch { grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); gap: 3rem; } }
.bits-fig { margin: 0; display: grid; gap: 0.6rem; }
.bits {
  display: grid; grid-template-columns: repeat(32, 1fr); grid-template-rows: repeat(16, 1fr); gap: 2px;
  width: 100%; max-width: 24rem; aspect-ratio: 2 / 1;
}
.bits i { display: block; border-radius: 1px; background: var(--line); background: color-mix(in srgb, var(--fg) 6%, var(--bg)); }
.bits i.on { background: var(--muted); background: color-mix(in srgb, var(--fg) 20%, var(--bg)); }
.bits i.u { background: var(--line); background: color-mix(in srgb, var(--hi) 14%, var(--bg)); }
.bits i.u.on { background: var(--muted); background: color-mix(in srgb, var(--hi) 42%, var(--bg)); }
.bits i.d { background: var(--hot); box-shadow: var(--bit-glow); }
.bits-fig figcaption { font-size: 0.75rem; color: var(--muted); max-width: 24rem; }
.bits-fig figcaption b { color: var(--hi); font-weight: 500; }

.whoami { display: grid; gap: 0.6rem; min-width: 0; }
h1 {
  font-family: var(--font-display); font-weight: 400; font-size: var(--step-3);
  line-height: 0.9; color: var(--hi); text-shadow: var(--glow); overflow-wrap: anywhere;
}
.rule { color: var(--line); overflow: hidden; white-space: nowrap; }
.fetch-dl {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.1rem 1.25rem; margin: 0;
  font-size: var(--step--1);
}
.fetch-dl dt { color: var(--hi); font-weight: 600; }
.fetch-dl dd { margin: 0; min-width: 0; }
.fetch-dl dd.ok { color: var(--hi2); }
.swatches { display: flex; margin-top: 0.3rem; }
.swatches span { width: 1.6rem; height: 0.85rem; }
.swatches .c-line { background: var(--line); }
.swatches .c-bad { background: var(--bad); }
.swatches .c-hi { background: var(--hi); }
.swatches .c-warn { background: var(--warn); }
.swatches .c-hi2 { background: var(--hi2); }
.swatches .c-muted { background: var(--muted); }
.swatches .c-fg { background: var(--fg); }
.lede { font-size: var(--step-1); text-wrap: balance; }
.lede em { font-style: normal; color: var(--hi); }
.lede-sm { max-width: var(--measure); }
.lede-sm code { color: var(--hi2); }

.contact { display: grid; gap: 0.75rem; }
.links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.links a, .copy-btn {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--step--1);
  color: var(--fg); text-decoration: none; background: var(--bg);
  border: 1px solid var(--line); border-radius: 2px; padding: 0.3rem 0.65rem;
}
.links a:hover, .copy-btn:hover { border-color: var(--hi); color: var(--hi); }
.links .g { color: var(--hi); }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: var(--step--1); }
.email-row .addr { color: var(--fg); user-select: all; }
.copy-btn { cursor: pointer; }
.copy-status { color: var(--hi2); }

/* ---- cards (research and projects) -------------------------------- */
.card { display: flex; flex-direction: column; gap: 0.55rem; transition: border-color 0.15s; }
.card:hover { border-color: var(--hi); }
.card .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem; align-items: baseline; }
.card .when, .card .meta { font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }
.open {
  padding: 0; border: 0; background: none; color: inherit; font-weight: inherit; text-align: left; cursor: pointer;
}
.js .open::after { content: ""; position: absolute; inset: 0; border-radius: 3px; }
.card .one { color: var(--fg); max-width: var(--measure); }
.tags { display: flex; flex-wrap: wrap; gap: 0.2rem 0.75rem; font-size: 0.8125rem; color: var(--hi2); }
.hint { margin-top: auto; padding-top: 0.15rem; font-size: 0.75rem; color: var(--muted); }
.card:hover .hint { color: var(--hi); }
.no-js-hide { display: none; }
.js .no-js-hide { display: inline; }
.card .ext { position: relative; z-index: 1; font-size: var(--step--1); width: fit-content; }
.js .more { display: none; }
.more { display: grid; gap: 0.75rem; padding-top: 0.5rem; border-top: 1px dashed var(--line); }

.research-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 56rem) {
  .research-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
  .research-grid .wide { grid-column: 1 / -1; }
}
.stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 1.5rem; font-size: var(--step--1); color: var(--muted); }
.stats b {
  font-family: var(--font-display); font-weight: 400; font-size: 2.1rem; line-height: 1;
  color: var(--hi); text-shadow: var(--glow); margin-right: 0.35rem;
}

/* Card visuals. The SRAM strip and the QRNG diagram replay with the hero grid (site.js);
   the bars grow once they scroll into view. */
.bits.strip { grid-template-rows: repeat(3, 1fr); max-width: none; aspect-ratio: 32 / 3.1; margin-block: 0.2rem; }
.bars {
  display: grid; grid-template-columns: max-content minmax(0, 1fr) 4ch; gap: 0.4rem 0.75rem;
  align-items: center; font-size: 0.75rem; color: var(--muted); margin-block: 0.2rem;
}
.bars .track { height: 0.8rem; border-radius: 1px; background: var(--line); background: color-mix(in srgb, var(--fg) 6%, var(--bg)); }
.bars i { display: block; height: 100%; border-radius: 1px; background: var(--muted); transform-origin: left; }
.bars .w90 { width: 90%; background: var(--hi); box-shadow: var(--bit-glow); }
.bars .w65 { width: 65%; }
.bars .pct.hi { color: var(--hi); }
.js .bars i { transform: scaleX(0); transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s; }
.js .bars.seen i { transform: none; }
.qd svg { display: block; width: 100%; height: auto; overflow: visible; }
.qd text { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); }
.qd .wire { fill: var(--muted); }
.qd .gate { fill: var(--bg); stroke: var(--hi2); }
.qd .gate-t { fill: var(--hi2); }
.qd .meter { fill: none; stroke: var(--hi2); }
.qd .c { fill: var(--line); fill: color-mix(in srgb, var(--fg) 6%, var(--bg)); }
.qd .c.on { fill: var(--muted); fill: color-mix(in srgb, var(--fg) 20%, var(--bg)); }
.qd .c.u { fill: var(--line); fill: color-mix(in srgb, var(--hi) 14%, var(--bg)); }
.qd .c.u.on { fill: var(--muted); fill: color-mix(in srgb, var(--hi) 42%, var(--bg)); }
.qd .box { fill: var(--pane); stroke: var(--line); }
.qd .box-t { fill: var(--hi); font-weight: 600; font-size: 12.5px; }
.qd .box-s { font-size: 10.5px; }
.qd .flow { fill: none; stroke: var(--line); stroke-width: 1.2; }
.qd .arrow { fill: none; stroke: var(--muted); }
@media (min-width: 56rem) {
  .card.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); column-gap: 2.5rem; align-content: start; }
  .card.split > * { grid-column: 1; }
  .card.split > .qd { grid-column: 2; grid-row: 1 / span 6; align-self: center; }
}
@media (prefers-reduced-motion: reduce) { .js .bars i { transition: none; } }

.cards { display: grid; gap: 1.75rem 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40rem) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards .wide { grid-column: span 2; }
}
@media (min-width: 62rem) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.glabel { grid-column: 1 / -1; font-size: 0.75rem; color: var(--muted); letter-spacing: 0.08em; margin-bottom: -0.5rem; }
.glabel::before { content: "## "; color: var(--hi); }
.card.wide .pane-title b { color: var(--hi); }

/* Log lines, shared by the research cards' full text. */
.log { display: grid; gap: 0.5rem; }
.log li { display: grid; grid-template-columns: 8ch minmax(0, 1fr); gap: 0.75rem; align-items: baseline; }
.tag { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.tag::before { content: "["; color: var(--muted); font-weight: 400; }
.tag::after { content: "]"; color: var(--muted); font-weight: 400; }
.t-data { color: var(--hi2); }
.t-ok { color: var(--hi); }
.t-vuln { color: var(--bad); }
.t-warn { color: var(--warn); }
.t-next { color: var(--fg); }
.go { font-size: var(--step--1); }
.go::before { content: "\2192\00a0"; color: var(--muted); }
.gos { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }

/* ---- papers ------------------------------------------------------- */
.refs { display: grid; gap: 0.9rem; }
.refs li { display: grid; grid-template-columns: 5ch minmax(0, 1fr); gap: 0.75rem; align-items: baseline; }
.refs .key { font-size: var(--step--1); color: var(--hi); }
.refs .title { font-weight: 600; }
.refs .me { font-weight: 600; }
.refs .by { color: var(--muted); }
.state {
  display: inline-block; font-size: 0.75rem; color: var(--warn); border: 1px solid currentColor;
  border-radius: 2px; padding: 0 0.35rem; margin-left: 0.4rem; vertical-align: 0.1em; white-space: nowrap;
}
.state.reg { color: var(--hi2); }
.fold > summary { color: var(--muted); font-size: var(--step--1); width: fit-content; }
.fold > summary:hover { color: var(--hi); }
.fold > summary::before { content: "+ "; color: var(--hi); }
.fold[open] > summary::before { content: "- "; }
.fold[open] > summary { margin-bottom: 0.9rem; }

/* ---- experience: green-bar rows that expand ------------------------ */
.xp { display: grid; border-block: 1px solid var(--line); }
.xp > li:nth-child(odd) { background: var(--pane); }
.xp summary, .xp .sum {
  display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: 0.1rem 0.75rem;
  padding: 0.55rem 0.6rem; align-items: baseline;
}
.xp summary::before, .xp .sum::before { grid-column: 1; grid-row: 1; color: var(--muted); }
.xp summary::before { content: "+"; color: var(--hi); }
.xp details[open] summary::before { content: "-"; }
.xp .sum::before { content: "\00b7"; }
.xp .when { grid-column: 2; font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }
.xp .ro { grid-column: 2; min-width: 0; }
.xp .role { font-weight: 600; }
.xp .org { color: var(--muted); }
.xp summary:hover .role { color: var(--hi); }
.xp .what { padding: 0 0.6rem 0.8rem calc(0.6rem + 1.25rem + 0.75rem); max-width: calc(var(--measure) + 3rem); color: var(--fg); }
@media (min-width: 46rem) {
  .xp summary, .xp .sum { grid-template-columns: 1.25rem 17ch minmax(0, 1fr); }
  .xp .when, .xp .ro { grid-row: 1; }
  .xp .ro { grid-column: 3; }
  .xp .what { padding-left: calc(0.6rem + 1.25rem + 17ch + 1.5rem); }
}
.xp .now { color: var(--hi); font-weight: 400; }

/* ---- cv ----------------------------------------------------------- */
.cv-grid { display: grid; gap: 2rem 1.5rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 62rem) { .cv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cv-grid .wide { grid-column: 1 / -1; }
.edu { display: grid; gap: 1rem; }
.edu .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.1rem 1rem; align-items: baseline; }
.edu .meta { font-size: var(--step--1); color: var(--muted); }
.skills { display: grid; gap: 0.5rem; }
.skills li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.05rem; }
@media (min-width: 40rem) { .skills li { grid-template-columns: 10ch minmax(0, 1fr); gap: 1rem; } }
.skills .k { font-size: var(--step--1); color: var(--hi); padding-top: 0.25rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chips span {
  font-size: 0.8125rem; line-height: 1.5; padding: 0.05rem 0.6rem;
  background: var(--pane); border: 1px solid var(--line); border-radius: 999px;
}
.honors { display: grid; gap: 0.35rem; }
.honors li { display: grid; grid-template-columns: 10ch minmax(0, 1fr); gap: 1rem; align-items: baseline; }
.honors-more { margin-top: 0.9rem; }
.honors .yr { font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }
.pdf { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; }
.pdf a.btn {
  font-size: var(--step--1); text-decoration: none; font-weight: 600;
  color: var(--bg); background: var(--hi); border-radius: 2px; padding: 0.45rem 0.9rem;
}
.pdf a.btn:hover { color: var(--bg); background: var(--hi2); }
.note { color: var(--muted); font-size: var(--step--1); }

/* ---- pager (the full text behind each card) ------------------------ */
.pager {
  padding: 0; border: 1px solid var(--hi); border-radius: 3px;
  background: var(--bg); color: var(--fg);
  width: min(46rem, calc(100% - 32px)); max-width: none;
  max-height: min(85vh, 50rem); max-height: min(85dvh, 50rem);
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.45);
}
.pager[open] { display: flex; flex-direction: column; }
.pager::backdrop { background: rgb(0 0 0 / 0.6); }
.pager-bar, .pager-foot {
  flex: none; display: flex; align-items: center; gap: 0.5rem 0.9rem; flex-wrap: wrap;
  padding: 0.45rem 0.75rem; background: var(--pane); font-size: var(--step--1);
}
.pager-bar { border-bottom: 1px solid var(--line); }
.pager-foot { border-top: 1px solid var(--line); justify-content: space-between; color: var(--muted); }
.pager-path { flex: 1 1 auto; min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.pager-path b { color: var(--hi); font-weight: 600; }
.pbtn {
  cursor: pointer; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 2px; padding: 0.05rem 0.55rem;
}
.pbtn:hover { border-color: var(--hi); color: var(--hi); }
.pager-nav { display: flex; gap: 0.5rem; align-items: center; }
.pager-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 1.25rem 1.25rem 1.5rem; display: grid; gap: 1rem; align-content: start; }
.pager-body h3 {
  font-family: var(--font-display); font-weight: 400; font-size: 2.1rem; line-height: 1;
  color: var(--hi); text-shadow: var(--glow);
}
.pager-meta { color: var(--muted); font-size: var(--step--1); margin-top: -0.5rem; }
.pager-text { display: grid; gap: 0.9rem; max-width: var(--measure); }
.pager-text .end { color: var(--muted); font-size: var(--step--1); }

body > footer {
  max-width: 70rem; margin: 0 auto; border-top: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 1.25rem 2.5rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between;
  font-size: var(--step--1); color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  html { scroll-behavior: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  body { transition: background-color 0.2s, color 0.2s; }
}

/* ---- blog ---------------------------------------------------------- */
/* The list of posts, on /blog/ (grouped by year) and on the home page (newest three). */
main.narrow { max-width: 48rem; }
h1.h2 {
  font-family: var(--font-display); font-weight: 400; font-size: var(--step-2);
  color: var(--hi); text-shadow: var(--glow); letter-spacing: 0.01em;
}
.posts { display: grid; gap: 1.1rem; max-width: var(--measure-wide); }
.posts .year { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.08em; margin-top: 0.6rem; }
.posts .year:first-child { margin-top: 0; }
.posts .year::before { content: "## "; color: var(--hi); }
.posts .entry { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.15rem; align-items: baseline; }
.posts .date { font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.posts .t { font-weight: 600; color: var(--fg); text-decoration: none; }
.posts .t:hover { color: var(--hi); }
.posts .t::before { content: "> "; color: var(--hi); }
.posts .desc { color: var(--fg); }
.posts .pm { font-size: 0.8125rem; color: var(--hi2); }
@media (min-width: 40rem) {
  .posts .entry { grid-template-columns: 7ch minmax(0, 1fr); column-gap: 1rem; }
  .posts .date { grid-column: 1; grid-row: 1; }
  .posts .t, .posts .desc, .posts .pm { grid-column: 2; }
}
#blog .posts .entry { grid-template-columns: 13ch minmax(0, 1fr); }
@media (max-width: 39.99rem) { #blog .posts .entry { grid-template-columns: minmax(0, 1fr); } }

/* A post, laid out like `less` on a Markdown file. */
.post { display: grid; gap: 1.5rem; }
.post-head { display: grid; gap: 0.6rem; }
.post-head h1 {
  font-family: var(--font-display); font-weight: 400; font-size: var(--step-2); line-height: 1.05;
  color: var(--hi); text-shadow: var(--glow); letter-spacing: 0.01em; overflow-wrap: anywhere;
}
.post-meta { color: var(--muted); font-size: var(--step--1); }
.post-body { display: grid; gap: 1rem; max-width: var(--measure-wide); }
.post-body > * { min-width: 0; }
.post-body h2, .post-body h3, .post-body h4 { font-weight: 600; margin-top: 1rem; scroll-margin-top: 4.5rem; }
.post-body h2 { font-size: var(--step-1); }
.post-body h3 { font-size: var(--step-0); margin-top: 0.5rem; }
.post-body h4 { font-size: var(--step-0); color: var(--muted); margin-top: 0.25rem; }
.post-body h2::before { content: "## "; color: var(--hi); font-weight: 400; }
.post-body h3::before { content: "### "; color: var(--hi); font-weight: 400; }
.post-body h4::before { content: "#### "; color: var(--hi); font-weight: 400; }
.anchor { color: var(--muted); text-decoration: none; font-weight: 400; opacity: 0; }
.post-body :is(h2, h3, h4):hover .anchor, .anchor:focus-visible { opacity: 1; }
.post-body strong { font-weight: 600; }
.post-body em { color: var(--hi2); font-style: normal; }
.post-body ul, .post-body ol { display: grid; gap: 0.35rem; padding-left: 2.5ch; }
.post-body ul { list-style: "- "; }
.post-body ol { list-style: decimal; padding-left: 3.5ch; }
.post-body ol ol { list-style: lower-alpha; }
.post-body li::marker { color: var(--hi); }
.post-body li > ul, .post-body li > ol { margin-top: 0.35rem; }
.post-body li > p { margin-bottom: 0.35rem; }
.post-body blockquote {
  margin: 0; padding: 0.1rem 0 0.1rem 1rem; border-left: 2px solid var(--hi); color: var(--muted);
  display: grid; gap: 0.6rem;
}
.post-body code {
  font-family: var(--font-mono); font-size: 0.9em; color: var(--hi2);
  background: var(--pane); border: 1px solid var(--line); border-radius: 2px; padding: 0 0.4ch;
  overflow-wrap: anywhere;
}
.post-body .code { margin: 0.4rem 0 0; padding: 1.05rem 0 0.55rem; }
.post-body .code pre { margin: 0; overflow-x: auto; padding: 0 1rem; font-size: var(--step--1); line-height: 1.55; tab-size: 4; }
.post-body .code code { font-size: inherit; color: var(--fg); background: none; border: 0; padding: 0; overflow-wrap: normal; }
.post-body .code .pane-title b { color: var(--muted); }
.post-body img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 3px; }
.post-body figure { margin: 0; display: grid; gap: 0.5rem; }
.post-body figcaption { font-size: 0.8125rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.post-body table { border-collapse: collapse; font-size: var(--step--1); min-width: 100%; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 0.3rem 0.65rem; text-align: left; vertical-align: top; }
.post-body th { background: var(--pane); color: var(--hi); font-weight: 600; }
.post-body td { font-variant-numeric: tabular-nums; }
.post-body hr { border: 0; border-top: 1px dashed var(--line); margin: 0.5rem 0; }
.post-body kbd {
  font-family: var(--font-mono); font-size: 0.85em; padding: 0 0.5ch; border: 1px solid var(--muted);
  border-bottom-width: 2px; border-radius: 2px;
}
.post-body details { border: 1px dashed var(--line); border-radius: 3px; padding: 0.5rem 0.9rem; }
.post-body summary { color: var(--muted); }
.post-body summary::before { content: "+ "; color: var(--hi); }
.post-body details[open] summary::before { content: "- "; }
.post-body details[open] summary { margin-bottom: 0.6rem; }
.post-body sup { line-height: 0; }
.post-foot { display: grid; gap: 1rem; border-top: 1px dashed var(--line); padding-top: 1rem; }
.post-foot .end { color: var(--muted); font-size: var(--step--1); }
.post-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; font-size: var(--step--1); }
.post-nav .newer { margin-left: auto; text-align: right; }

/* Syntax colors for code highlighted at build time; they follow the colorscheme. */
.hljs-comment, .hljs-quote { color: var(--muted); }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-type, .hljs-doctag { color: var(--hi); }
.hljs-string, .hljs-attr, .hljs-symbol, .hljs-bullet, .hljs-addition, .hljs-regexp, .hljs-link, .hljs-selector-attr, .hljs-selector-pseudo { color: var(--hi2); }
.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable, .hljs-params, .hljs-selector-id, .hljs-selector-class { color: var(--warn); }
.hljs-title, .hljs-section, .hljs-name, .hljs-title.function_, .hljs-title.class_ { color: var(--fg); font-weight: 600; }
.hljs-deletion { color: var(--bad); }
.hljs-meta, .hljs-punctuation, .hljs-operator { color: var(--muted); }
.hljs-meta .hljs-string, .hljs-meta .hljs-keyword { color: var(--hi2); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 600; }

/* ---- 404 page ------------------------------------------------------ */
.nf-bar .session { text-decoration: none; }
.nf-bar .here { flex: none; color: var(--fg); background: var(--line); padding: 0.1rem 0.45rem; border-radius: 2px; }
.nf-bar .here::after { content: "*"; color: var(--hi); }
.nf-bar .here .n { color: var(--bad); }
main.nf { max-width: 46rem; gap: 1.75rem; padding-block: 2.5rem 4rem; }
.nf-fig { display: none; margin: 0; gap: 0.6rem; }
.js .nf-fig { display: grid; }
.nf-grid {
  display: grid; grid-template-columns: repeat(42, 1fr); gap: 2px;
  width: 100%; max-width: 100%; aspect-ratio: 42 / 20;
}
.nf-grid i { display: block; border-radius: 1px; background: var(--line); background: color-mix(in srgb, var(--fg) 6%, var(--bg)); }
.nf-grid i.on { background: var(--muted); background: color-mix(in srgb, var(--fg) 20%, var(--bg)); }
.nf-grid i.u { background: var(--line); background: color-mix(in srgb, var(--hi) 14%, var(--bg)); }
.nf-grid i.u.on { background: var(--muted); background: color-mix(in srgb, var(--hi) 42%, var(--bg)); }
.nf-grid i.d { background: var(--hot); box-shadow: var(--bit-glow); }
.nf-fig figcaption { font-size: 0.75rem; color: var(--muted); }
.nf-fig figcaption b { color: var(--hi); font-weight: 500; }
.nf-h {
  font-family: var(--font-display); font-weight: 400; font-size: var(--step-2);
  color: var(--hi); text-shadow: var(--glow);
}
.nf-tty {
  margin: 0; font: inherit; line-height: 1.75;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.nf-tty .pu { color: var(--hi); }
.nf-tty .pp { color: var(--hi2); }
.nf-tty .err { color: var(--bad); }
.nf-tty a { color: var(--hi2); }
.nf-tty .cursor { vertical-align: -0.2em; }
.nf-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; }
.nf-actions a.btn {
  font-size: var(--step--1); text-decoration: none; font-weight: 600;
  color: var(--bg); background: var(--hi); border-radius: 2px; padding: 0.45rem 0.9rem;
}
.nf-actions a.btn:hover { color: var(--bg); background: var(--hi2); }
