:root {
  --ink: #0a1020;
  --ink-soft: #27334c;
  --muted: #61708a;
  --paper: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef3f9;
  --line: #dce4ef;
  --line-strong: #c6d2e2;
  --navy: #08111f;
  --navy-2: #0d1b31;
  --navy-3: #142742;
  --accent: #2563eb;
  --accent-2: #06b6d4;
  --accent-3: #7c3aed;
  --accent-soft: #e8f0ff;
  --success: #0e9f6e;
  --shadow: 0 24px 70px rgba(20, 39, 66, 0.13);
  --shadow-soft: 0 12px 34px rgba(20, 39, 66, 0.08);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 30px;
  --max: 1180px;
  --header: 78px;
}

[data-theme="dark"] {
  --ink: #f5f8fc;
  --ink-soft: #d5deeb;
  --muted: #95a6be;
  --paper: #07101d;
  --surface: #0d1828;
  --surface-2: #101f33;
  --line: #20324a;
  --line-strong: #2b405b;
  --navy: #040a12;
  --navy-2: #081422;
  --navy-3: #10243d;
  --accent: #6ea1ff;
  --accent-2: #38d2ec;
  --accent-3: #a78bfa;
  --accent-soft: #102950;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body::selection { background: var(--accent); color: #fff; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.site-shell { overflow: clip; }
.container { width: min(calc(100% - 44px), var(--max)); margin-inline: auto; }
.narrow { width: min(calc(100% - 44px), 850px); margin-inline: auto; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 1000; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
  height: var(--header);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
}
.nav-wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; text-decoration: none; min-width: max-content; }
.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-2), #1d4ed8 70%, var(--accent-2));
  color: white;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.brand-mark::after { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(255,255,255,.22), transparent 50%); }
.brand-mark span:first-child { transform: translate(-4px, -4px); }
.brand-mark span:last-child { transform: translate(4px, 4px); }
.brand-copy { display: grid; line-height: 1.2; }
.brand-copy strong { font-size: .91rem; letter-spacing: -.015em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: .68rem; letter-spacing: .035em; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.nav-link { position: relative; padding: 8px 11px; color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 750; letter-spacing: .01em; border-radius: 9px; transition: color .2s, background .2s; }
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }
.theme-toggle, .menu-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.theme-toggle { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; box-shadow: var(--shadow-soft); }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
.menu-toggle { display: none; width: 42px; height: 42px; border-radius: 12px; padding: 10px; }
.menu-toggle span { display: block; width: 100%; height: 2px; margin: 4px 0; background: currentColor; border-radius: 3px; }

/* Core typography */
.eyebrow { margin: 0 0 14px; color: var(--accent); text-transform: uppercase; letter-spacing: .17em; font-size: .68rem; font-weight: 900; }
h1, h2, h3, p { text-wrap: pretty; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.035em; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.1rem, 4.3vw, 4rem); line-height: 1.04; font-weight: 500; }
h3 { line-height: 1.2; }
.section { position: relative; padding: 108px 0; }
.section-grid { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 44px 44px; background-position: center; }
.section-grid::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--paper) 91%, transparent); pointer-events: none; }
.section-grid > * { position: relative; }
.section-heading { margin-bottom: 48px; max-width: 800px; }
.section-heading.with-action { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.text-link { color: var(--accent); font-weight: 800; text-decoration: none; white-space: nowrap; }
.text-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 19px; border-radius: 12px; border: 1px solid transparent; text-decoration: none; font-size: .82rem; font-weight: 850; transition: transform .2s, box-shadow .2s, background .2s, color .2s; }
.button svg { width: 16px; }
.button:hover { transform: translateY(-2px); }
.button.primary { background: linear-gradient(135deg, var(--accent), #2353d5); color: #fff; box-shadow: 0 15px 32px rgba(37, 99, 235, .24); }
.button.ghost { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.button.light { background: #fff; color: #0a1630; }
.button.outline-light { color: #fff; border-color: rgba(255,255,255,.35); }

/* Home hero */
.hero { position: relative; min-height: calc(100vh - var(--header)); display: flex; align-items: center; background: radial-gradient(circle at 85% 15%, rgba(37,99,235,.12), transparent 34%), radial-gradient(circle at 8% 78%, rgba(6,182,212,.09), transparent 30%); }
.hero-grid-bg { position: absolute; inset: 0; opacity: .45; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 82%, transparent); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.25fr .75fr; gap: 76px; align-items: center; padding: 82px 0 92px; }
.status-line { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 28px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 78%, transparent); color: var(--muted); font-size: .72rem; font-weight: 750; box-shadow: var(--shadow-soft); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 15%, transparent); }
.hero h1 { max-width: 860px; margin: 0; font-size: clamp(3.45rem, 6.4vw, 6.8rem); line-height: .96; }
.hero h1 em { font-style: normal; background: linear-gradient(110deg, var(--accent), var(--accent-2) 55%, var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { max-width: 780px; margin: 30px 0 0; color: var(--ink-soft); font-size: clamp(1.03rem, 1.5vw, 1.22rem); line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 36px; }
.hero-proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 50px; max-width: 700px; }
.hero-proof div { border-left: 1px solid var(--line-strong); padding-left: 17px; }
.hero-proof strong { display: block; color: var(--ink); font-family: Georgia, serif; font-size: 1.65rem; line-height: 1; }
.hero-proof span { display: block; margin-top: 6px; color: var(--muted); font-size: .7rem; line-height: 1.3; }
.profile-panel { position: relative; padding: 18px; border: 1px solid color-mix(in srgb, var(--line-strong) 80%, transparent); border-radius: 30px; background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(14px); overflow: hidden; }
.profile-glow { position: absolute; width: 240px; height: 240px; right: -100px; top: -100px; border-radius: 50%; background: radial-gradient(circle, rgba(37,99,235,.25), transparent 68%); }
.portrait-wrap { position: relative; aspect-ratio: 4/4.4; overflow: hidden; border-radius: 22px; background: linear-gradient(145deg, var(--surface-2), var(--accent-soft)); }
.profile-image { width: 100%; height: 100%; object-fit: cover; }
.portrait-label { position: absolute; left: 14px; bottom: 14px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; background: rgba(6,16,31,.72); color: #fff; backdrop-filter: blur(8px); font-size: .67rem; font-weight: 800; }
.profile-meta { padding: 24px 8px 12px; }
.terminal-label { display: block; color: var(--accent-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .65rem; }
.profile-meta h2 { margin-top: 7px; font-size: 1.7rem; }
.profile-meta > p { margin: 6px 0 18px; color: var(--muted); font-size: .84rem; }
.profile-meta ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.profile-meta li { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .72rem; }
.profile-meta li span { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.profile-meta li strong { font-weight: 750; text-align: right; }
.quick-links { display: flex; gap: 8px; padding: 8px; }
.quick-links a { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); }
.quick-links a:hover { color: #fff; border-color: var(--accent); background: var(--accent); }

.signal-strip { border-block: 1px solid var(--line); background: var(--surface); }
.signal-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.signal-grid a { position: relative; min-height: 118px; padding: 24px; border-right: 1px solid var(--line); text-decoration: none; display: flex; flex-direction: column; justify-content: center; transition: background .2s; }
.signal-grid a:first-child { border-left: 1px solid var(--line); }
.signal-grid a::after { content: "↗"; position: absolute; top: 20px; right: 20px; color: var(--line-strong); }
.signal-grid a:hover { background: var(--accent-soft); }
.signal-grid span { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 850; }
.signal-grid strong { margin-top: 7px; font-size: .88rem; }

.editorial-split { display: grid; grid-template-columns: .92fr 1.08fr; gap: 100px; align-items: start; }
.prose-large p { margin: 0 0 22px; color: var(--ink-soft); font-size: 1.08rem; }
.pillar-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-soft); }
.pillar-card { position: relative; min-height: 410px; padding: 34px 28px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.pillar-card:last-child { border-right: 0; }
.pillar-no { position: absolute; right: 22px; top: 20px; color: var(--line-strong); font-size: .7rem; font-weight: 900; }
.pillar-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: var(--accent-soft); color: var(--accent); font-family: Georgia, serif; font-size: 1.45rem; }
.pillar-card h3 { margin: 46px 0 14px; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 500; }
.pillar-card p { margin: 0; color: var(--muted); font-size: .88rem; }
.pillar-card a { margin-top: auto; color: var(--accent); text-decoration: none; font-size: .78rem; font-weight: 850; }
.pillar-card:hover { background: var(--accent-soft); }

.feature-section { background: var(--navy); color: #fff; }
.feature-section h2 { color: #fff; }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.feature-copy > p:not(.eyebrow) { color: #b7c5d9; font-size: 1.02rem; }
.feature-stats { display: flex; flex-wrap: wrap; gap: 9px; margin: 30px 0; }
.feature-stats span { padding: 8px 11px; border: 1px solid #29415f; border-radius: 999px; color: #b7c5d9; font-size: .72rem; }
.feature-stats strong { color: #fff; }
.code-window { border: 1px solid #29415f; border-radius: 20px; overflow: hidden; background: #07111e; box-shadow: 0 35px 80px rgba(0,0,0,.35); transform: rotate(1.2deg); }
.code-window-bar { height: 48px; display: flex; align-items: center; gap: 7px; padding: 0 16px; border-bottom: 1px solid #203751; background: #0d1c30; }
.code-window-bar span { width: 9px; height: 9px; border-radius: 50%; background: #334965; }
.code-window-bar code { margin-left: 8px; color: #8da2bb; font-size: .67rem; }
.code-window pre { margin: 0; padding: 28px 24px 32px; overflow: auto; color: #c8d5e5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; line-height: 2.1; }
.code-comment { color: #60758f; }
.code-line { display: block; padding: 0 10px; border-radius: 6px; }
.code-line b { display: inline-block; width: 28px; color: #536c8a; }
.code-line.active { background: rgba(37,99,235,.18); color: #8bdcf0; }

.publication-stack { border-top: 1px solid var(--line-strong); }
.pub-row { display: grid; grid-template-columns: 100px 1fr; gap: 35px; padding: 38px 0; border-bottom: 1px solid var(--line); }
.pub-index { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; font-weight: 850; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pub-meta span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .63rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.pub-body h2, .pub-body h3 { margin: 0; font-family: Georgia, serif; font-weight: 500; font-size: clamp(1.35rem, 2.3vw, 2.08rem); }
.pub-body p { color: var(--muted); max-width: 920px; }
.authors { color: var(--ink-soft) !important; font-size: .88rem; }
.pub-actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 17px; }
.pub-actions a, .pub-actions span { color: var(--accent); font-size: .75rem; font-weight: 850; text-decoration: none; }
.pub-actions a:hover { text-decoration: underline; text-underline-offset: 4px; }
.publication-stack.detailed .pub-row { padding: 48px 0; }

.collaboration-section { padding-top: 0; }
.collaboration-card { display: flex; justify-content: space-between; align-items: center; gap: 50px; padding: 58px; border-radius: var(--radius-lg); color: #fff; background: radial-gradient(circle at 90% 10%, rgba(6,182,212,.25), transparent 31%), linear-gradient(135deg, #0b1c35, #133a73); box-shadow: var(--shadow); }
.collaboration-card h2 { color: #fff; max-width: 760px; font-size: clamp(2rem, 4vw, 3.55rem); }
.collaboration-card p:not(.eyebrow) { color: #c5d2e3; max-width: 760px; }
.collaboration-actions { min-width: max-content; display: flex; flex-direction: column; gap: 10px; }

/* Page hero */
.page-hero { position: relative; padding: 116px 0 92px; background: radial-gradient(circle at 80% 10%, rgba(37,99,235,.13), transparent 30%), linear-gradient(180deg, var(--surface), var(--paper)); border-bottom: 1px solid var(--line); }
.page-hero::after { content: ""; position: absolute; inset: 0; opacity: .35; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(to bottom, #000, transparent 85%); pointer-events: none; }
.page-hero > * { position: relative; z-index: 1; }
.page-hero-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 80px; align-items: end; }
.page-hero h1 { margin: 0; max-width: 950px; font-size: clamp(3.3rem, 6vw, 6.35rem); line-height: .98; }
.page-hero-aside { padding-bottom: 8px; }
.page-hero-aside > p { color: var(--ink-soft); font-size: 1rem; }
.mini-terminal { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-soft); }
.mini-terminal span { display: block; color: var(--muted); font-size: .65rem; }
.mini-terminal code { color: var(--accent); font-size: .77rem; }

/* Research */
.research-index-section { padding: 32px 0; border-bottom: 1px solid var(--line); }
.research-index { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.research-index > span { margin-right: 16px; color: var(--muted); font-size: .67rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 900; }
.research-index a { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-soft); text-decoration: none; font-size: .72rem; font-weight: 800; }
.research-index a:hover { border-color: var(--accent); color: var(--accent); }
.research-details { border-top: 1px solid var(--line); }
.research-block { display: grid; grid-template-columns: 115px 1fr; gap: 55px; padding: 86px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 100px; }
.research-number { color: var(--line-strong); font-family: Georgia, serif; font-size: 3.6rem; line-height: 1; }
.research-block h2 { max-width: 980px; font-size: clamp(2.4rem, 4.6vw, 4.5rem); }
.research-lead { max-width: 940px; color: var(--ink-soft); font-size: 1.1rem; }
.research-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 58px; margin-top: 38px; }
.research-columns h3 { font-family: Georgia, serif; font-size: 1.35rem; }
.research-columns p { color: var(--muted); }
.clean-list { margin: 0; padding: 0; list-style: none; }
.clean-list li { position: relative; padding-left: 19px; margin: 8px 0; color: var(--muted); }
.clean-list li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.method-tags, .project-tags, .topic-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.method-tags { margin-top: 30px; }
.method-tags span, .project-tags span, .topic-cloud span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .68rem; font-weight: 750; }
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.process-card { min-height: 280px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.process-card > span { color: var(--accent); font-family: ui-monospace, monospace; font-size: .7rem; font-weight: 900; }
.process-card h3 { margin: 70px 0 13px; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.process-card p { color: var(--muted); font-size: .86rem; }

/* Filters */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }
.filter-button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .72rem; font-weight: 850; cursor: pointer; }
.filter-button:hover, .filter-button.active { border-color: var(--accent); background: var(--accent); color: #fff; }
[data-publication][hidden], [data-project][hidden] { display: none !important; }

/* Projects */
.archive-note { font-size: .82rem !important; }
.archive-note a { color: var(--accent); }
.project-grid.premium { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.project-card { position: relative; min-height: 430px; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.project-card::before { content: ""; position: absolute; width: 170px; height: 170px; right: -80px; top: -90px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
.project-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow-soft); }
.project-featured { grid-column: span 2; min-height: 480px; padding-right: 42%; background: radial-gradient(circle at 92% 35%, rgba(6,182,212,.15), transparent 26%), radial-gradient(circle at 80% 70%, rgba(37,99,235,.18), transparent 34%), var(--surface); }
.project-featured::after { content: "Attention(Q,K,V)"; position: absolute; right: 7%; top: 43%; color: var(--accent); font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 4.2rem); transform: rotate(-7deg); opacity: .55; }
.project-top { position: relative; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 900; }
.project-top strong { color: var(--accent); }
.project-badge { width: max-content; margin-top: 34px; padding: 7px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .67rem; font-weight: 900; }
.project-card h2 { position: relative; margin: 54px 0 14px; max-width: 730px; font-family: Georgia, serif; font-size: clamp(1.65rem, 2.6vw, 2.65rem); font-weight: 500; }
.project-featured h2 { margin-top: 18px; }
.project-card > p { position: relative; color: var(--muted); font-size: .9rem; }
.project-tags { position: relative; margin: 17px 0 25px; }
.project-link, .project-status { position: relative; margin-top: auto; align-self: flex-start; color: var(--accent); font-size: .76rem; font-weight: 900; text-decoration: none; }
.project-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.project-status { color: var(--muted); }

/* Experience */
.timeline { display: flex; flex-direction: column; gap: 100px; }
.timeline-group { display: grid; grid-template-columns: 200px 1fr; gap: 70px; }
.timeline-label { position: sticky; top: 110px; align-self: start; }
.timeline-label span { color: var(--accent); font-family: ui-monospace, monospace; font-size: .7rem; font-weight: 900; }
.timeline-label h2 { margin-top: 12px; font-size: 2rem; }
.timeline-content { border-top: 1px solid var(--line-strong); }
.timeline-item { display: grid; grid-template-columns: 170px 1fr; gap: 38px; padding: 38px 0; border-bottom: 1px solid var(--line); }
.timeline-date { color: var(--accent); font-size: .72rem; font-weight: 850; }
.timeline-kicker { margin: 0; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 850; }
.timeline-item h3 { margin: 5px 0 15px; font-family: Georgia, serif; font-size: 1.65rem; font-weight: 500; }
.timeline-item p, .timeline-item li { color: var(--muted); font-size: .9rem; }
.skill-matrix { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.skill-card { min-height: 270px; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.skill-card > span { color: var(--accent); font-size: .7rem; font-weight: 900; }
.skill-card h3 { margin: 58px 0 12px; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 500; }
.skill-card p { color: var(--muted); font-size: .9rem; }

/* Contact */
.contact-layout { display: grid; grid-template-columns: .95fr 1.05fr; gap: 22px; }
.contact-card { min-height: 650px; padding: 48px; border-radius: var(--radius-lg); color: #fff; background: radial-gradient(circle at 80% 10%, rgba(6,182,212,.2), transparent 32%), linear-gradient(145deg, #071321, #123a72); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.contact-card h2 { color: #fff; font-size: clamp(2.4rem, 4vw, 4.3rem); }
.contact-status { width: max-content; display: flex; align-items: center; gap: 9px; margin-bottom: auto; padding: 7px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #c5d7ea; font-size: .68rem; }
.contact-status span { width: 8px; height: 8px; border-radius: 50%; background: #2ed49a; }
.contact-email { margin-top: 35px; color: #fff; font-family: Georgia, serif; font-size: clamp(1.35rem, 2.8vw, 2.2rem); text-decoration-thickness: 1px; text-underline-offset: 8px; word-break: break-word; }
.copy-button { width: max-content; margin-top: 18px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.24); border-radius: 9px; background: transparent; color: #fff; cursor: pointer; font-size: .72rem; font-weight: 800; }
.contact-context { margin-top: auto; padding-top: 30px; border-top: 1px solid rgba(255,255,255,.15); }
.contact-context span { color: #7fd8e9; font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 900; }
.contact-context p { color: #c5d7ea; }
.profile-directory { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.profile-directory a { min-height: 80px; padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 25px; text-decoration: none; }
.profile-directory a:last-child { border-bottom: 0; }
.profile-directory a:hover { background: var(--accent-soft); }
.profile-directory a div { display: grid; }
.profile-directory span { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.profile-directory strong { margin-top: 3px; font-size: .9rem; }
.profile-directory b { color: var(--accent); }
.topic-cloud { justify-content: center; max-width: 950px; margin-inline: auto; }
.topic-cloud span { padding: 11px 15px; font-size: .8rem; }

/* 404 */
.not-found { min-height: calc(100vh - var(--header)); display: grid; place-items: center; padding: 90px 0; text-align: center; }
.error-code { color: var(--accent-soft); font-family: Georgia, serif; font-size: clamp(8rem, 25vw, 18rem); line-height: .7; font-weight: 700; text-shadow: 0 0 0 var(--accent); }
.not-found h1 { margin: 42px 0 12px; font-size: clamp(2.4rem, 5vw, 4.8rem); }
.not-found p:not(.eyebrow) { color: var(--muted); }
.not-found .button { margin-top: 20px; }

/* Footer */
.site-footer { padding: 60px 0 24px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-main { display: grid; grid-template-columns: 1.5fr .7fr .7fr; gap: 60px; }
.footer-identity { display: flex; align-items: center; gap: 14px; }
.footer-monogram { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--navy-2); color: #fff; font-size: .72rem; font-weight: 900; }
.footer-identity p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.footer-nav, .footer-social { display: grid; gap: 7px; }
.footer-nav a, .footer-social a { color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 700; }
.footer-nav a:hover, .footer-social a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; gap: 30px; margin-top: 42px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .68rem; }

/* Motion */
.reveal {
  opacity: 1;
  transform: none;
}

/*
  Progressive-enhancement reveal system:
  Content is NEVER hidden just because JavaScript exists.
  JS adds `.reveal-ready` only after all above-the-fold elements
  have already been made visible synchronously.
*/
.js.reveal-ready .reveal:not(.visible) {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .65s ease, transform .65s ease;
}

.js.reveal-ready .reveal.visible {
  opacity: 1;
  transform: none;
}

/* Critical first viewport content must always render immediately. */
.site-header,
.hero .reveal,
.page-hero .reveal {
  opacity: 1 !important;
  transform: none !important;
}

@media (max-width: 1080px) {
  .site-nav { gap: 0; }
  .nav-link { padding-inline: 8px; }
  .hero-grid { grid-template-columns: 1fr .68fr; gap: 42px; }
  .hero h1 { font-size: clamp(3.2rem, 6vw, 5.6rem); }
  .pillar-grid { grid-template-columns: repeat(2, 1fr); }
  .pillar-card { border-bottom: 1px solid var(--line); }
  .pillar-card:nth-child(2) { border-right: 0; }
  .pillar-card:nth-child(3), .pillar-card:nth-child(4) { border-bottom: 0; }
  .feature-grid, .page-hero-grid { gap: 45px; }
}

@media (max-width: 880px) {
  :root { --header: 72px; }
  .menu-toggle { display: block; order: 2; }
  .theme-toggle { order: 3; }
  .site-nav { display: none; position: fixed; top: 78px; left: 18px; right: 18px; z-index: 200; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); flex-direction: column; align-items: stretch; }
  .site-nav.open { display: flex; }
  .nav-link { padding: 11px; }
  .hero { min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; padding: 72px 0 85px; }
  .profile-panel { max-width: 470px; }
  .signal-grid { grid-template-columns: repeat(2, 1fr); }
  .signal-grid a:nth-child(2) { border-right: 0; }
  .signal-grid a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .editorial-split, .feature-grid, .page-hero-grid, .contact-layout { grid-template-columns: 1fr; }
  .page-hero-aside { max-width: 700px; }
  .research-block { grid-template-columns: 80px 1fr; gap: 30px; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .project-featured { padding-right: 32px; }
  .project-featured::after { display: none; }
  .timeline-group { grid-template-columns: 1fr; gap: 25px; }
  .timeline-label { position: static; }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-identity { grid-column: span 2; }
  .collaboration-card { flex-direction: column; align-items: flex-start; }
  .collaboration-actions { flex-direction: row; }
}

@media (max-width: 650px) {
  .container, .narrow { width: min(calc(100% - 28px), var(--max)); }
  .brand-copy small { display: none; }
  .brand-copy strong { font-size: .78rem; }
  .hero-grid { padding-top: 58px; }
  .hero h1, .page-hero h1 { font-size: clamp(2.7rem, 12vw, 4.8rem); }
  .hero-lead { font-size: .98rem; }
  .hero-proof { grid-template-columns: 1fr; }
  .hero-proof div { display: flex; align-items: baseline; gap: 10px; }
  .signal-grid { grid-template-columns: 1fr; }
  .signal-grid a { min-height: 100px; border-right: 0; border-bottom: 1px solid var(--line); }
  .signal-grid a:first-child { border-left: 0; }
  .signal-grid a:last-child { border-bottom: 0; }
  .section { padding: 78px 0; }
  .pillar-grid { grid-template-columns: 1fr; }
  .pillar-card { min-height: 340px; border-right: 0; border-bottom: 1px solid var(--line) !important; }
  .pillar-card:last-child { border-bottom: 0 !important; }
  .feature-grid { gap: 40px; }
  .code-window { transform: none; }
  .pub-row { grid-template-columns: 1fr; gap: 8px; }
  .section-heading.with-action { align-items: flex-start; flex-direction: column; }
  .collaboration-card { padding: 35px 24px; }
  .collaboration-actions { width: 100%; flex-direction: column; }
  .page-hero { padding: 82px 0 70px; }
  .research-index { align-items: stretch; }
  .research-index > span { width: 100%; }
  .research-block { grid-template-columns: 1fr; padding: 62px 0; }
  .research-number { font-size: 1.2rem; }
  .research-columns, .process-grid, .project-grid.premium, .skill-matrix { grid-template-columns: 1fr; }
  .project-featured { grid-column: auto; }
  .timeline-item { grid-template-columns: 1fr; gap: 7px; }
  .contact-card { min-height: 570px; padding: 32px 24px; }
  .footer-main { grid-template-columns: 1fr; }
  .footer-identity { grid-column: auto; }
  .footer-bottom { flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .js.reveal-ready .reveal { opacity: 1; transform: none; transition: none; }
  .button, .project-card { transition: none; }
}

/* ========================================================================== */
/* Research field — interactive scientific/data-network background            */
/* ========================================================================== */
.research-field-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .92;
  contain: strict;
}

.research-field-aura {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 14%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 29%),
    radial-gradient(circle at 87% 24%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent 28%),
    radial-gradient(circle at 52% 84%, color-mix(in srgb, var(--accent-3) 5%, transparent), transparent 33%);
}

.site-shell {
  position: relative;
  z-index: 1;
}

/* Let the scientific network show through without expensive full-page blur. */
.hero,
.page-hero {
  background:
    radial-gradient(circle at 84% 14%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 32%),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--surface) 90%, transparent),
      color-mix(in srgb, var(--paper) 93%, transparent)
    );
}

.signal-strip {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

/* GPU-friendly micro-interactions: transform/paint only, no layout animation. */
.profile-panel,
.pillar-card,
.project-card,
.pub-row,
.skill-card,
.process-card,
.signal-grid a,
.profile-directory a {
  transition:
    transform .28s cubic-bezier(.2,.75,.2,1),
    border-color .28s ease,
    box-shadow .28s ease,
    background-color .28s ease;
}

@media (hover: hover) and (pointer: fine) {
  .profile-panel:hover,
  .pillar-card:hover,
  .project-card:hover,
  .skill-card:hover,
  .process-card:hover {
    transform: translate3d(0, -4px, 0);
  }

  .pub-row:hover {
    transform: translate3d(4px, 0, 0);
  }

  .signal-grid a:hover,
  .profile-directory a:hover {
    transform: translate3d(0, -2px, 0);
  }
}

/* Transformer project stays editor-dark in BOTH light and dark site themes. */
.home-feature .code-window {
  position: relative;
  overflow: hidden;
  transform: none;
  color: #dbeafe;
  border-color: rgba(148, 163, 184, .20);
  background:
    radial-gradient(circle at 88% 8%, rgba(59, 130, 246, .11), transparent 34%),
    linear-gradient(180deg, #0b1220 0%, #08111f 100%);
  box-shadow:
    0 24px 58px rgba(8, 17, 31, .18),
    inset 0 1px 0 rgba(255, 255, 255, .035);
}

.home-feature .code-window::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(148, 163, 184, .024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .018) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .55;
}

.home-feature .code-window-bar {
  position: relative;
  z-index: 1;
  color: #94a3b8;
  border-bottom-color: rgba(148, 163, 184, .14);
  background: rgba(15, 23, 42, .98);
}

.home-feature .code-window-bar code { color: #94a3b8; }
.home-feature .code-window-bar > span:nth-child(1) { background: #fb7185; }
.home-feature .code-window-bar > span:nth-child(2) { background: #fbbf24; }
.home-feature .code-window-bar > span:nth-child(3) { background: #34d399; }

.home-feature .code-window pre,
.home-feature .code-window pre code {
  position: relative;
  z-index: 1;
  color: #dbeafe;
  background: transparent;
}

.home-feature .code-window .code-comment { color: #64748b; }
.home-feature .code-window .code-line { color: #cbd5e1; }
.home-feature .code-window .code-line b { color: #60a5fa; }

.home-feature .code-window .code-line.active {
  color: #f8fafc;
  background: linear-gradient(90deg, rgba(37, 99, 235, .18), rgba(37, 99, 235, .04));
  border-left-color: #3b82f6;
}

.home-feature .code-window .code-line.active b { color: #93c5fd; }

@media (max-width: 700px) {
  .research-field-canvas { opacity: .70; }
  .research-field-aura { opacity: .72; }
}

@media (prefers-reduced-motion: reduce) {
  .research-field-canvas { opacity: .28; }

  .profile-panel,
  .pillar-card,
  .project-card,
  .pub-row,
  .skill-card,
  .process-card,
  .signal-grid a,
  .profile-directory a {
    transition: none !important;
  }
}

