/* BP Portfolio design system. One stylesheet for both pages, no vendor CSS. */

:root {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #161a21;
  --surface-alt: #1d232d;
  --text: #ecf0f7;
  --muted: #aeb7c6;
  --line: #2b3340;
  --line-strong: #3d4757;
  --accent: #8ad2ff;
  --accent-2: #79f7da;
  --accent-rgb: 138, 210, 255;
  --accent-2-rgb: 121, 247, 218;
  --grid: rgba(236, 240, 247, 0.055);
  --accent-ink: #0f1115;
  --accent-soft: rgba(138, 210, 255, 0.12);
  --header-bg: rgba(15, 17, 21, 0.88);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1160px;
  --gutter: clamp(20px, 4vw, 32px);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fa;
  --surface: #ffffff;
  --surface-alt: #eef1f6;
  --text: #12161f;
  --muted: #4f5a6b;
  --line: #d8dee8;
  --line-strong: #b9c2d0;
  --accent: #0b6bcb;
  --accent-2: #0a8f74;
  --accent-rgb: 11, 107, 203;
  --accent-2-rgb: 10, 143, 116;
  --grid: rgba(18, 22, 31, 0.07);
  --accent-ink: #ffffff;
  --accent-soft: rgba(11, 107, 203, 0.1);
  --header-bg: rgba(246, 247, 250, 0.88);
  --shadow: 0 24px 60px rgba(18, 22, 31, 0.12);
}

@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f7fa;
    --surface: #ffffff;
    --surface-alt: #eef1f6;
    --text: #12161f;
    --muted: #4f5a6b;
    --line: #d8dee8;
    --line-strong: #b9c2d0;
    --accent: #0b6bcb;
    --accent-2: #0a8f74;
    --accent-rgb: 11, 107, 203;
    --accent-2-rgb: 10, 143, 116;
    --grid: rgba(18, 22, 31, 0.07);
    --accent-ink: #ffffff;
    --accent-soft: rgba(11, 107, 203, 0.1);
    --header-bg: rgba(246, 247, 250, 0.88);
    --shadow: 0 24px 60px rgba(18, 22, 31, 0.12);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--sans);
  font-feature-settings: "ss01", "cv11";
}
img { max-width: 100%; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
h1, h2, h3, h4, p, li { overflow-wrap: break-word; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 8px 12px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 800; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: var(--header-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.site-header__inner { max-width: var(--max); margin: auto; padding: 12px var(--gutter); display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.site-nav { display: flex; gap: 4px; margin-left: 8px; }
.site-nav a { padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 700; color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a.is-current { color: var(--text); background: var(--surface-alt); }
.site-header__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.portfolio-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.portfolio-switch a { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap; color: var(--muted); }
.portfolio-switch a[aria-current] { background: var(--accent); color: var(--accent-ink); }
.portfolio-switch a:not([aria-current]):hover { color: var(--text); background: var(--surface-alt); }
.theme-toggle { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.theme-toggle:hover { border-color: var(--line-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  html:not([data-theme]) .theme-toggle .icon-sun { display: block; }
  html:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}
.menu-toggle { display: none; }
.site-nav__switch { display: none; }

/* Layout */
main { max-width: var(--max); margin: auto; padding: 0 var(--gutter); }
.section { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); scroll-margin-top: 84px; }
.section-heading { max-width: 720px; margin-bottom: clamp(24px, 4vw, 40px); }
.section-heading h2 { font-size: clamp(32px, 4vw, 46px); line-height: 1.12; }
.section-heading .section-intro { margin-top: 12px; color: var(--muted); font-size: 17px; max-width: 60ch; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 12.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }

/* Buttons and chips */
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.button:hover { transform: translateY(-2px); border-color: var(--accent); }
.button--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button--primary:hover { filter: brightness(1.06); }
.button--small { min-height: 36px; padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.button svg { width: 14px; height: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-alt); font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: -0.01em; color: var(--muted); white-space: nowrap; transition: border-color 160ms ease, color 160ms ease; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip--accent { border-color: transparent; background: var(--accent-soft); color: var(--accent); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); align-items: center; gap: clamp(32px, 6vw, 80px); padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 72px); }
.hero h1 { max-width: 14ch; font-size: clamp(40px, 6vw, 78px); line-height: 1.04; letter-spacing: -0.04em; margin: 0 0 22px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { max-width: 60ch; color: var(--muted); font-size: clamp(17px, 1.4vw, 19px); line-height: 1.7; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero__links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 26px; font-size: 14px; font-weight: 700; color: var(--muted); }
.hero__links a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.hero__links a:hover { color: var(--accent); }
.hero__links svg { width: 15px; height: 15px; }
.hero__portrait { position: relative; justify-self: end; width: min(100%, 380px); aspect-ratio: 4 / 5; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); transform: rotate(2deg); }
.hero__portrait img { width: 100%; height: 100%; object-fit: cover; }
.hero__portrait span { position: absolute; left: 14px; bottom: 14px; padding: 6px 12px; border: 1px solid rgba(255,255,255,0.28); border-radius: 999px; background: rgba(15,17,21,0.78); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; }

/* Stats strip */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 clamp(40px, 6vw, 72px); }
.stat { display: flex; flex-direction: column; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat dt { order: 2; margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.stat dd { margin: 0 0 4px; font-family: var(--serif); font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; letter-spacing: -0.02em; color: var(--text); }
.stat dd small { font-size: 0.6em; color: var(--accent); }

/* Work */
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.work-card { display: flex; flex-direction: column; gap: 14px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color 160ms ease, transform 160ms ease; }
.work-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.work-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.work-card__kind { color: var(--accent); font-size: 12.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.work-card__date { color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.work-card h3 { font-size: clamp(24px, 2.2vw, 30px); line-height: 1.2; }
.work-card h3 a { text-decoration: none; }
.work-card h3 a:hover { color: var(--accent); }
.work-card__summary { color: var(--muted); font-size: 15.5px; }
.work-card__metric { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-alt); }
.work-card__metric strong { font-family: var(--serif); font-size: 26px; line-height: 1; letter-spacing: -0.02em; color: var(--accent); }
.work-card__metric span { color: var(--muted); font-size: 13px; font-weight: 700; }
.work-card__highlights { display: grid; gap: 8px; color: var(--muted); font-size: 14.5px; }
.work-card__highlights li { position: relative; padding-left: 18px; }
.work-card__highlights li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px; background: var(--accent); }
.work-card__footer { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.work-card__links { display: flex; flex-wrap: wrap; gap: 8px; }
.more-work { margin-top: 40px; }
.more-work h3 { font-family: var(--sans); font-size: 14px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mini-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; }
.mini-card__kind { color: var(--accent); font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.mini-card h4 { margin: 0; font-family: var(--sans); font-size: 16px; font-weight: 800; }
.mini-card h4 a { text-decoration: none; }
.mini-card h4 a:hover { color: var(--accent); }
.mini-card p { color: var(--muted); }
.mini-card__meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px 12px; padding-top: 6px; color: var(--muted); font-size: 12.5px; font-weight: 700; }

/* Experience */
.timeline { display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-top: 1px solid var(--line); }
.timeline-item:first-child { border-top: 0; padding-top: 0; }
.timeline-item__when { color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.5; }
.timeline-item__when small { display: block; font-weight: 600; opacity: 0.8; }
.timeline-item h3 { font-family: var(--sans); font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.timeline-item h3 span { font-weight: 600; color: var(--muted); }
.timeline-item h3 a { text-decoration: none; color: var(--accent); }
.timeline-item h3 a:hover { text-decoration: underline; }
.timeline-item__summary { margin-top: 6px; color: var(--muted); font-size: 15px; }
.timeline-item__highlights { display: grid; gap: 6px; margin-top: 12px; font-size: 14.5px; color: var(--text); }
.timeline-item__highlights li { position: relative; padding-left: 18px; }
.timeline-item__highlights li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px; background: var(--accent); }
.timeline-item .chips { margin-top: 14px; }
.also { margin-top: 28px; padding: 18px 22px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); font-size: 14px; }
.also strong { color: var(--text); }
.also li { display: inline; }
.also li + li::before { content: " · "; }

/* Research */
.paper-list { display: grid; gap: 14px; }
.paper-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.paper-card__marker { display: flex; flex-direction: column; justify-content: space-between; padding: 20px; border-right: 1px solid var(--line); background: var(--surface-alt); color: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: 0.1em; }
.paper-card__content { padding: 24px 28px; }
.paper-meta { margin-bottom: 8px; color: var(--accent); font-size: 13px; font-weight: 700; }
.paper-card h3 { max-width: 900px; margin-bottom: 8px; font-size: clamp(21px, 2.2vw, 27px); line-height: 1.25; }
.paper-authors { margin-bottom: 12px; font-size: 14px; font-weight: 700; }
.paper-authors strong { color: var(--accent); }
.paper-card__summary { max-width: 85ch; color: var(--muted); font-size: 15px; }
.paper-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.research-cta { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; color: var(--muted); font-size: 15px; }
.interests-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.interest-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.interest-card__number { display: inline-block; margin-bottom: 20px; color: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: 0.12em; }
.interest-card h3 { margin-bottom: 10px; font-size: 23px; line-height: 1.22; }
.interest-card p { color: var(--muted); font-size: 15px; }
.profile-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-links a { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; font-weight: 800; }
.profile-links a:hover { border-color: var(--accent); color: var(--accent); }
.profile-links a svg, .research-cta svg { width: 14px; height: 14px; flex: none; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.skill-group { padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.skill-group h3 { font-family: var(--sans); font-size: 14px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.skill-group .chip { font-size: 13px; color: var(--text); }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.about-copy { display: grid; gap: 18px; font-size: 17px; color: var(--muted); }
.about-copy p:first-child { color: var(--text); font-size: 19px; }
.about-photo { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); aspect-ratio: 3 / 4; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo figcaption { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.about-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.about-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.about-card h3 { font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.about-card p { color: var(--muted); font-size: 14.5px; }
.education { margin-top: 28px; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.education__when { color: var(--muted); font-size: 14px; font-weight: 700; }
.education h3 { font-family: var(--sans); font-size: 19px; font-weight: 800; }
.education h3 span { font-weight: 600; color: var(--muted); }
.education ul { display: grid; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 14.5px; }
.education li { position: relative; padding-left: 18px; }
.education li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px; background: var(--accent); }

/* Contact */
.contact { padding: clamp(28px, 4vw, 48px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.contact__intro { max-width: 720px; }
.contact__intro h2 { font-size: clamp(30px, 3.8vw, 46px); line-height: 1.1; margin-bottom: 12px; }
.contact__intro .lead { color: var(--muted); font-size: 17px; max-width: 56ch; }
.contact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.contact-tile { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: center; min-height: 92px; padding: 18px 44px 18px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-alt); text-decoration: none; transition: border-color 160ms ease, transform 160ms ease; }
.contact-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-tile > svg:first-child { grid-row: 1 / span 2; width: 22px; height: 22px; color: var(--accent); }
.contact-tile > svg:last-child { position: absolute; top: 16px; right: 16px; width: 14px; height: 14px; color: var(--muted); }
.contact-tile:hover > svg:last-child { color: var(--accent); }
.contact-tile__label { font-size: 15px; font-weight: 800; line-height: 1.3; }
.contact-tile__value { color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 18px; color: var(--muted); font-size: 14px; font-weight: 600; }
.contact__foot a { color: var(--accent); font-weight: 700; text-decoration: none; }
.contact__foot a:hover { text-decoration: underline; }
.link-button { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.copy-status { min-height: 1.4em; margin-top: 6px; color: var(--accent-2); font-size: 13px; font-weight: 700; }

/* Footer */
.site-footer { max-width: var(--max); margin: auto; padding: 32px var(--gutter) 56px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--accent); font-weight: 700; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 500ms ease, transform 500ms ease; }
.reveal.is-visible { opacity: 1; transform: none; }
html.no-js .reveal { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 1000px) {
  .work-grid { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-cards { grid-template-columns: 1fr; }
  .interests-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .site-nav { display: none; }
  .site-header__inner.is-open .site-nav { display: flex; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; padding: 10px var(--gutter) 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
  .site-header__inner { position: relative; }
  .menu-toggle { display: inline-flex; }
  .portfolio-switch a { padding: 6px 10px; font-size: 12.5px; }
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero__portrait { justify-self: start; width: min(100%, 300px); transform: none; }
  .timeline-item, .education { grid-template-columns: 1fr; gap: 8px; }
  .paper-card { grid-template-columns: 1fr; }
  .paper-card__marker { flex-direction: row; padding: 8px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .paper-card__content { padding: 20px 18px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 360px; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills-grid, .profile-links { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .contact-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat dd { font-size: 24px; }
  .stat dt { font-size: 12px; }
  .portfolio-switch { display: none; }
  .site-nav__switch { display: block; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--accent); }
  .mini-grid { grid-template-columns: 1fr; }
  .work-card { padding: 20px; }
  .brand { font-size: 15px; }
  .theme-toggle, .menu-toggle { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .work-card, .reveal { transition: none; }
  .reveal { opacity: 1; transform: none; }
}

/* Research page */
.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 clamp(40px, 6vw, 72px); }
.glance div { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.glance dt { margin: 0 0 4px; color: var(--accent); font-size: 11.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.glance dd { margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.45; }
.statement { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.statement__copy { display: grid; gap: 16px; color: var(--muted); font-size: 17px; }
.statement__copy p:first-child { color: var(--text); font-size: 19px; }
.statement .interests-grid { grid-template-columns: 1fr; gap: 10px; }
.statement .interest-card { padding: 18px 20px; }
.statement .interest-card h3 { font-size: 19px; margin-bottom: 4px; }
.statement .interest-card p { font-size: 14px; }
.statement .interest-card__number { margin-bottom: 8px; }
.pub { display: grid; grid-template-columns: 96px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.pub__marker { display: flex; flex-direction: column; justify-content: space-between; padding: 20px; border-right: 1px solid var(--line); background: var(--surface-alt); color: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: 0.1em; }
.pub__content { padding: 26px 30px 28px; }
.pub h3 { max-width: 900px; margin-bottom: 8px; font-size: clamp(22px, 2.3vw, 28px); line-height: 1.25; }
.pub__tldr { margin: 14px 0 0; padding: 12px 16px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--accent-soft); font-size: 15px; font-weight: 600; }
.pub__results { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.pub__results div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.pub__results dd { margin: 0; font-family: var(--serif); font-size: 24px; line-height: 1.1; letter-spacing: -0.02em; }
.pub__results dt { order: 2; margin: 2px 0 0; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.pub__results div { display: flex; flex-direction: column; }
.pub__abstract { margin-top: 18px; }
.pub__abstract summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 800; list-style: none; }
.pub__abstract summary::-webkit-details-marker { display: none; }
.pub__abstract summary::before { content: "+ "; }
.pub__abstract[open] summary::before { content: "− "; }
.pub__abstract p { max-width: 85ch; margin-top: 10px; color: var(--muted); font-size: 15px; }
.pub__contribution { margin-top: 12px; color: var(--muted); font-size: 14px; }
.pub__contribution strong { color: var(--text); }
.pub__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.bibtex { margin-top: 12px; }
.bibtex summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 800; list-style: none; }
.bibtex summary::-webkit-details-marker { display: none; }
.bibtex summary:hover { color: var(--accent); }
.bibtex pre { position: relative; margin: 10px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font: 12.5px/1.6 var(--mono); color: var(--muted); overflow-x: auto; }
.bibtex .link-button { display: inline-block; margin-top: 8px; font-size: 13px; }
.rtimeline { display: grid; }
.rtimeline-item { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-top: 1px solid var(--line); }
.rtimeline-item:first-child { border-top: 0; padding-top: 0; }
.rtimeline-item__when { color: var(--muted); font-size: 14px; font-weight: 700; }
.rtimeline-item h3 { font-family: var(--sans); font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.rtimeline-item__org { margin-top: 2px; color: var(--muted); font-size: 15px; }
.rtimeline-item__org strong { color: var(--text); font-weight: 700; }
.rtimeline-item ul { display: grid; gap: 6px; margin-top: 12px; font-size: 14.5px; }
.rtimeline-item li { position: relative; padding-left: 18px; }
.rtimeline-item li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px; background: var(--accent); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.plain-card { padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.plain-card h3 { font-family: var(--sans); font-size: 14px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.plain-card ul { display: grid; gap: 12px; }
.plain-card li strong { display: block; font-size: 15px; }
.plain-card li span { color: var(--muted); font-size: 14px; }
.plain-card ul.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.plain-card .chips .chip { font-size: 13px; color: var(--text); }
.coursework { margin-top: 14px; color: var(--muted); font-size: 14px; }
.coursework strong { color: var(--text); }
@media (max-width: 1000px) { .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pub__results { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .statement, .two-col { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; }
  .pub__marker { flex-direction: row; padding: 8px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pub__content { padding: 20px 18px 22px; }
  .rtimeline-item { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 560px) { .glance { grid-template-columns: 1fr; } }

/* ---------- Tech layer: backdrop, terminal line, motion, spotlight ---------- */
.progress { position: fixed; top: 0; left: 0; z-index: 30; width: 100%; height: 2px; background: transparent; pointer-events: none; }
.progress::before { content: ""; display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(var(--progress, 0)); background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.hero { position: relative; isolation: isolate; }
.hero::before, .hero::after { content: ""; position: absolute; top: -80px; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); z-index: -1; pointer-events: none; }
.hero::before { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse 62% 78% at 50% 0%, #000 10%, transparent 72%); mask-image: radial-gradient(ellipse 62% 78% at 50% 0%, #000 10%, transparent 72%); }
.hero::after { background: radial-gradient(520px 320px at 78% 22%, rgba(var(--accent-rgb), 0.16), transparent 70%), radial-gradient(420px 300px at 12% 88%, rgba(var(--accent-2-rgb), 0.10), transparent 70%); filter: blur(10px); animation: heroGlow 18s ease-in-out infinite alternate; }
@keyframes heroGlow { from { transform: translateX(-50%) translateY(0); } to { transform: translateX(-52%) translateY(-24px); } }

.hero__portrait { animation: floatY 7s ease-in-out infinite; box-shadow: 0 30px 80px -24px rgba(var(--accent-rgb), 0.35), var(--shadow); }
@keyframes floatY { 0%, 100% { transform: rotate(2deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-8px); } }

.term { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin-top: 22px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(var(--accent-rgb), 0.05); font-family: var(--mono); font-size: 14px; color: var(--muted); }
.term__prompt { color: var(--accent-2); font-weight: 700; }
.term__arrow { color: var(--line-strong); }
.term__word { color: var(--text); font-weight: 600; }
.term__caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; background: var(--accent-2); vertical-align: -0.2em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.status { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 700; color: var(--muted); }
.status__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); }
.status__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent-2); opacity: 0.6; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { from { transform: scale(0.6); opacity: 0.7; } to { transform: scale(1.6); opacity: 0; } }

.stat dd, .pub__results dd, .work-card__metric strong { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat dd { font-variant-numeric: tabular-nums; }

.site-nav a { position: relative; }
.site-nav a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 200ms ease; }
.site-nav a.is-current::after, .site-nav a:hover::after { transform: scaleX(1); }
.site-nav a.is-current { background: transparent; }

.spot { position: relative; }
.spot::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 240ms ease; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), 0.14), transparent 62%); }
.spot:hover::after { opacity: 1; }
.spot > * { position: relative; z-index: 1; }

.timeline, .rtimeline { position: relative; padding-left: 26px; }
.timeline::before, .rtimeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), var(--accent-2), transparent); opacity: 0.6; }
.timeline-item, .rtimeline-item { position: relative; }
.timeline-item::before, .rtimeline-item::before { content: ""; position: absolute; left: -24px; top: 32px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15); }
.timeline-item:first-child::before, .rtimeline-item:first-child::before { top: 6px; background: var(--accent-2); border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(var(--accent-2-rgb), 0.2); }

.section-heading .eyebrow { font-family: var(--mono); letter-spacing: 0.08em; }
.section-heading .eyebrow::before { content: "// "; color: var(--line-strong); }

.site-footer__sig { flex-basis: 100%; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.site-footer__sig kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; font: inherit; color: var(--text); }

::selection { background: rgba(var(--accent-rgb), 0.35); }

@media (max-width: 820px) {
  .hero__portrait { animation: none; }
  .timeline, .rtimeline { padding-left: 22px; }
  .timeline-item::before, .rtimeline-item::before { top: 30px; left: -20px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero::after, .hero__portrait, .term__caret, .status__dot::after { animation: none; }
  .spot::after, .site-nav a::after, .chip { transition: none; }
}

/* ---------- Portrait: detection frame + entrance ---------- */
.frame { position: relative; justify-self: end; width: min(100%, 380px); margin: 0; perspective: 900px; }
.hero__portrait { transform: none; animation: none; }
.frame__inner { position: relative; aspect-ratio: 4 / 5; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--surface); box-shadow: 0 30px 80px -24px rgba(var(--accent-rgb), 0.35), var(--shadow); transform: rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); transition: transform 180ms ease; transform-style: preserve-3d; will-change: transform; }
.frame__inner img { width: 100%; height: 100%; object-fit: cover; }
.frame__ring { position: absolute; inset: -14px; border-radius: 30px; border: 1px dashed rgba(var(--accent-rgb), 0.35); pointer-events: none; animation: ringSpin 40s linear infinite; }
.frame__ghost { position: absolute; inset: 0; border-radius: 22px; border: 1px solid rgba(var(--accent-2-rgb), 0.4); transform: translate(14px, 14px); pointer-events: none; z-index: -1; }
.frame__corner { position: absolute; width: 22px; height: 22px; border: 2px solid var(--accent); pointer-events: none; z-index: 3; opacity: 0; animation: cornerIn 500ms ease 1.1s forwards; }
.frame__corner--tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.frame__corner--tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.frame__corner--bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.frame__corner--br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.frame__scan { position: absolute; left: 0; right: 0; top: 0; height: 22%; z-index: 2; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(var(--accent-2-rgb), 0.22) 60%, rgba(var(--accent-2-rgb), 0.55) 100%); border-bottom: 1px solid rgba(var(--accent-2-rgb), 0.9); opacity: 0; animation: scan 1.4s ease-in-out 0.9s 1 forwards; }
.frame__tag { position: absolute; top: 18px; left: 18px; z-index: 3; padding: 4px 9px; border-radius: 6px; background: rgba(15, 17, 21, 0.82); border: 1px solid rgba(var(--accent-rgb), 0.55); color: #fff; font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; opacity: 0; animation: fadeUp 400ms ease 1.5s forwards; }
.frame__tag b { color: var(--accent-2); font-weight: 700; }
.frame__loc { position: absolute; left: 14px; bottom: 14px; z-index: 3; padding: 6px 12px; border: 1px solid rgba(255,255,255,0.28); border-radius: 999px; background: rgba(15,17,21,0.78); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; }
.frame__grid { position: absolute; inset: 0; z-index: 1; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px); background-size: 25% 20%; opacity: 0; animation: gridFlash 1.6s ease 0.9s 1; }
@keyframes scan { 0% { top: -22%; opacity: 1; } 90% { top: 100%; opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes cornerIn { from { opacity: 0; transform: scale(1.35); } to { opacity: 1; transform: scale(1); } }
@keyframes ringSpin { to { transform: rotate(360deg); } }
@keyframes gridFlash { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes frameIn { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }

/* Hero entrance: staggered on first paint (JS-free) */
.hero__copy > * { opacity: 0; animation: riseIn 700ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.hero__copy > :nth-child(1) { animation-delay: 60ms; }
.hero__copy > :nth-child(2) { animation-delay: 160ms; }
.hero__copy > :nth-child(3) { animation-delay: 280ms; }
.hero__copy > :nth-child(4) { animation-delay: 380ms; }
.hero__copy > :nth-child(5) { animation-delay: 470ms; }
.hero__copy > :nth-child(6) { animation-delay: 550ms; }
.hero__copy > :nth-child(7) { animation-delay: 630ms; }
.frame { opacity: 0; animation: frameIn 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 250ms forwards; }
.frame:hover .frame__ring { border-color: rgba(var(--accent-rgb), 0.7); }

@media (max-width: 820px) {
  .frame { justify-self: start; width: min(calc(100% - 12px), 300px); }
  .frame__ghost { transform: translate(8px, 8px); }
  .frame__ring { inset: -8px; border-radius: 26px; animation: none; }
  .frame__inner { transition: none; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__copy > *, .frame { opacity: 1; animation: none; }
  .frame__corner, .frame__tag { opacity: 1; animation: none; }
  .frame__scan, .frame__grid, .frame__ring { animation: none; display: none; }
  .frame__inner { transition: none; transform: none; }
}
