:root {
  --ink: hsl(211 25% 10%);
  --muted: hsl(211 10% 40%);
  --link: hsl(211 75% 40%);
  --person-link: #42769e;
  --paper: hsl(0 0% 98%);
  --surface: rgba(255, 255, 255, .72);
  --surface-strong: rgba(255, 255, 255, .9);
  --border: hsl(211 10% 88%);
  --shadow: 0 24px 80px rgba(22, 38, 55, .08);
  --blue: 40 104 160;
  --amber: 184 120 48;
  --violet: 112 86 148;
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: hsl(210 25% 92%);
  --muted: hsl(210 10% 66%);
  --link: hsl(206 72% 67%);
  --person-link: #91bfdf;
  --paper: hsl(211 26% 8%);
  --surface: rgba(18, 29, 40, .72);
  --surface-strong: rgba(20, 31, 43, .92);
  --border: hsl(211 14% 22%);
  --shadow: 0 24px 80px rgba(0, 0, 0, .28);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 7rem; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  transition: color .3s ease, background .3s ease;
  isolation: isolate;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
h1 { margin-bottom: .65rem; font-size: clamp(2.8rem, 6vw, 5.4rem); font-weight: 650; }
h2 { margin-bottom: 1rem; font-size: clamp(1.85rem, 3vw, 2.65rem); font-weight: 620; }
h3 { margin-bottom: .65rem; font-size: clamp(1.2rem, 2vw, 1.65rem); font-weight: 620; }

.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .6rem .9rem; background: var(--ink); color: var(--paper); border-radius: .5rem; }
.skip-link:focus { top: 1rem; }
#dot-grid { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .9; }
.ambient { position: fixed; z-index: 0; width: 35rem; height: 35rem; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .11; }
.ambient-a { left: -14rem; top: -12rem; background: rgb(var(--blue)); }
.ambient-b { right: -16rem; top: 42vh; background: rgb(var(--violet)); }
#progress { position: fixed; inset: 0 auto auto 0; width: 0; height: 2px; z-index: 80; background: var(--link); }

.site-nav {
  position: fixed; left: 50%; top: 1rem; z-index: 50;
  width: min(1180px, calc(100% - 2rem)); min-height: 64px; padding: .65rem .75rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transform: translateX(-50%); border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 18px; background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
  backdrop-filter: blur(20px) saturate(155%); box-shadow: 0 16px 50px rgba(22, 38, 55, .07);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 620; letter-spacing: -.02em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: var(--paper); background: var(--ink); border-radius: 11px; font-size: .75rem; letter-spacing: .02em; }
.site-nav nav { display: flex; align-items: center; gap: .25rem; }
.site-nav nav a, .theme-toggle { padding: .6rem .75rem; border-radius: 10px; color: var(--muted); font-size: .9rem; transition: .2s ease; }
.site-nav nav a:hover, .site-nav nav a:focus-visible, .theme-toggle:hover { color: var(--ink); background: color-mix(in srgb, var(--border) 42%, transparent); }
.theme-toggle { min-width: 62px; border: 1px solid var(--border); background: transparent; cursor: pointer; }
.menu-toggle { display: none; padding: .6rem .75rem; min-height: 44px; border: 1px solid var(--border); border-radius: 10px; color: var(--ink); background: var(--surface); cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }

main, footer { position: relative; z-index: 1; }
main { padding-top: 7.25rem; }
.section-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 3.5rem 0; }
.hero { display: grid; grid-template-columns: minmax(260px, 300px) minmax(0, 1fr); align-items: start; gap: clamp(2rem, 5vw, 4.5rem); padding-top: 1.25rem; padding-bottom: 1.5rem; }
.profile-card, .paper-card, .research-card, .service-card {
  position: relative; border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow); overflow: hidden; transform-style: preserve-3d;
}
.profile-card { width: 100%; max-width: 300px; justify-self: start; border-radius: 24px; padding: .6rem; }
.portrait-wrap { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 1 / 1; background: var(--border); }
.portrait-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 17%; }
.status { position: absolute; left: .6rem; right: .6rem; bottom: .6rem; display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .6rem; border: 1px solid rgba(255,255,255,.55); border-radius: 12px; background: rgba(250,250,250,.88); color: hsl(211 25% 10%); backdrop-filter: blur(14px); font-size: .76rem; font-weight: 600; }
.status i { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: #3e9364; box-shadow: 0 0 0 4px rgba(62,147,100,.14); }
.profile-copy { padding: 1.15rem .95rem .9rem; }
.profile-copy h1 { max-width: 100%; margin-bottom: .85rem; font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1; white-space: nowrap; }
.role { max-width: 30rem; color: var(--muted); font-size: 1.02rem; }
.eyebrow, .section-index { margin-bottom: .75rem; color: var(--link); font-size: .76rem; font-weight: 700; letter-spacing: .105em; text-transform: uppercase; }
.link-row, .paper-links { display: flex; flex-wrap: wrap; gap: .55rem; }
.profile-copy .link-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .4rem; }
.profile-copy .link-row a { min-width: 0; padding-inline: .3rem; text-align: center; overflow-wrap: anywhere; }
.profile-copy .link-row + .link-row { margin-top: .55rem; }
.link-row a, .paper-links a { padding: .48rem .72rem; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface-strong) 75%, transparent); font-size: .82rem; transition: .2s ease; }
.link-row a:hover, .paper-links a:hover { border-color: var(--link); color: var(--link); transform: translateY(-1px); }
.hero-content { max-width: 730px; }
.hero-content h2 { max-width: 650px; }
.hero-content > .lead, .hero-content > .muted { text-wrap: pretty; }
.hero-content .person-link { color: var(--person-link); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--person-link) 30%, transparent); text-underline-offset: 3px; transition: color .2s ease, text-decoration-color .2s ease; }
.hero-content .person-link:hover, .hero-content .person-link:focus-visible { color: var(--link); text-decoration-color: currentColor; }
.intern-note { margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .875rem; line-height: 1.6; }
.intern-note strong { font-weight: 650; }
.intern-note a { color: var(--person-link); text-decoration: underline; text-underline-offset: 3px; }
.lead { max-width: 700px; font-size: clamp(1.08rem, 1.7vw, 1.25rem); line-height: 1.6; letter-spacing: -.015em; }
.muted, .authors, .section-heading > p { color: var(--muted); }
.signal-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.signal-row span { padding: .48rem .7rem; border-left: 2px solid var(--link); background: color-mix(in srgb, var(--surface) 70%, transparent); font-size: .82rem; font-weight: 600; }
#research { padding-top: 1.5rem; }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2.25rem; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { max-width: 340px; margin-bottom: .35rem; text-align: right; }
.research-heading { margin-bottom: 1.6rem; }
.section-link { flex-shrink: 0; color: var(--link); font-size: .875rem; padding: .5rem 0; }
.section-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.research-overview { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: clamp(1.25rem, 3vw, 2.5rem); }
.news-panel { min-width: 0; padding: 1.5rem; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.directions-panel { min-width: 0; padding-top: 1.5rem; }
.research-subheading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: 1.15rem; }
.research-subheading h3 { margin: 0; font-size: 1.25rem; letter-spacing: -.025em; }
.research-subheading > span { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-year { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.news-year:first-child { padding-top: .25rem; }
.news-year:last-child { padding-bottom: .15rem; border-bottom: 0; }
.news-year time { padding-top: .15rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .875rem; }
.news-year:first-child time { color: var(--link); }
.news-items p { margin: 0; line-height: 1.6; }
.news-items p + p { margin-top: .3rem; }
.news-items a { color: var(--link); font-weight: 620; text-underline-offset: 4px; }
.news-items a:hover { text-decoration: underline; }
.news-items strong { font-weight: 600; }
.news-items .news-context { color: var(--muted); font-size: .875rem; }
.honor-badge { display: inline-block; margin-left: .3rem; padding: .08rem .45rem; border: 1px solid rgba(144, 91, 24, .24); border-radius: 5px; color: #805016; background: rgba(184, 120, 48, .09); font-size: .8125rem; font-weight: 650; line-height: 1.55; white-space: nowrap; vertical-align: baseline; }
html[data-theme="dark"] .honor-badge { color: #edc17d; border-color: rgba(237, 193, 125, .26); background: rgba(237, 193, 125, .09); }
.research-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.research-card { min-height: 0; padding: 1.1rem; border-radius: 14px; display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: .65rem; box-shadow: none; }
.research-card h4 { margin: 0 0 .45rem; font-size: 1.06rem; font-weight: 620; line-height: 1.3; letter-spacing: -.02em; }
.research-card p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.research-card .direction-work { margin-top: .6rem; color: var(--link); font-size: .875rem; }
.card-number { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .78rem; }

.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.filter { padding: .55rem .8rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface); cursor: pointer; transition: .2s ease; }
.filter:hover, .filter.is-active { color: var(--paper); border-color: var(--ink); background: var(--ink); }
.paper-list { display: grid; gap: 1.15rem; }
.paper-card { min-height: 340px; padding: .7rem; border-radius: 22px; display: grid; grid-template-columns: minmax(320px, 1.08fr) 1fr; gap: 2rem; transition: opacity .25s ease, transform .25s ease; }
.paper-card.reverse { grid-template-columns: 1fr minmax(320px, 1.08fr); }
.paper-card.reverse .paper-media { order: 2; }
.paper-card.is-hidden { display: none; }
.paper-media { position: relative; min-width: 0; min-height: 310px; height: 310px; align-self: center; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: .6rem; padding: .85rem; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: #fff; }
.paper-media img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.media-label { justify-self: start; max-width: 100%; padding: .45rem .65rem; border: 1px solid rgba(255,255,255,.44); border-radius: 8px; color: white; background: #263442; font-size: .73rem; font-weight: 650; }
.paper-copy { padding: 2rem 1.2rem 1.7rem 0; align-self: center; }
.reverse .paper-copy { padding-left: 1.2rem; padding-right: 0; }
.paper-copy > p:not(.eyebrow):not(.authors) { color: var(--muted); }
.authors { font-size: .85rem; line-height: 1.55; }
.authors strong { color: var(--ink); }
.paper-card.compact { min-height: 260px; grid-template-columns: minmax(280px, .8fr) 1.2fr; }
.paper-card.compact.reverse { grid-template-columns: 1.2fr minmax(280px, .8fr); }
.paper-card.compact .paper-media { min-height: 235px; height: 235px; }

.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.service-card { min-height: 185px; padding: 1.5rem; border-radius: 18px; }
.service-card span { color: var(--link); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.service-card h3 { margin-top: 2.6rem; }
.service-card p { margin-bottom: 0; color: var(--muted); }
.contact { margin-top: 4rem; margin-bottom: 4rem; padding: 3rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--border); display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.contact h2 { max-width: 720px; margin-bottom: 0; }
.contact-button { flex: 0 0 auto; padding: .9rem 1.1rem; border: 1px solid var(--ink); border-radius: 10px; transition: .2s ease; }
.contact-button:hover { color: var(--paper); background: var(--ink); }
.contact-button span { margin-left: 1.5rem; }
footer { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 3rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .78rem; }

.interactive-card { --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 50%; transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .18s ease-out, border-color .25s ease, box-shadow .25s ease; will-change: transform; }
.interactive-card:hover { border-color: color-mix(in srgb, var(--link) 44%, var(--border)); box-shadow: 0 28px 88px rgba(22, 38, 55, .13); }
.glow-border::before { content: ""; position: absolute; inset: -1px; z-index: 3; pointer-events: none; border-radius: inherit; padding: 1px; background: radial-gradient(220px circle at var(--gx) var(--gy), color-mix(in srgb, var(--link) 75%, white), transparent 65%); opacity: 0; transition: opacity .22s ease; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.glow-border:hover::before { opacity: 1; }
.reveal { transition: opacity .65s ease, transform .65s ease; }
.reveal.is-pending { opacity: 0; transform: translateY(18px); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .site-nav { flex-wrap: wrap; gap: .5rem; }
  .site-nav .brand { margin-right: auto; }
  .site-nav nav { order: 4; width: 100%; flex-wrap: wrap; }
  .site-nav.nav-ready .menu-toggle { display: inline-flex; align-items: center; }
  .site-nav.nav-ready nav { display: none; }
  .site-nav.nav-ready.is-open nav { display: flex; border-top: 1px solid var(--border); padding-top: .5rem; }
  .site-nav nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 1rem; }
  .profile-card { max-width: 300px; }
  .research-overview, .service-grid { grid-template-columns: 1fr; }
  .directions-panel { padding-top: .25rem; }
  .paper-card, .paper-card.reverse, .paper-card.compact, .paper-card.compact.reverse { grid-template-columns: 1fr; }
  .paper-card.reverse .paper-media { order: 0; }
  .paper-media, .paper-card.compact .paper-media { min-height: 0; height: clamp(230px, 52vw, 390px); }
  .paper-copy, .reverse .paper-copy { padding: 1rem 1rem 1.4rem; }
  .contact { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .brand > span:last-child { display: none; }
  .site-nav { min-height: 58px; }
  .section-shell { padding: 2.5rem 0; }
  .hero { padding-top: .75rem; padding-bottom: 1.25rem; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading > p { text-align: left; }
  .publication-heading { gap: 1rem; }
  .filters { justify-content: flex-start; }
  .news-panel { padding: 1.1rem; }
  .news-year { grid-template-columns: 2.7rem minmax(0, 1fr); gap: .65rem; }
  .profile-card { border-radius: 20px; }
  .portrait-wrap { aspect-ratio: 1 / 1; }
  .contact { padding: 2rem 0; }
  .contact-button { width: 100%; display: flex; justify-content: space-between; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .ambient { display: none; }
  .reveal.is-pending { opacity: 1; transform: none; }
  .interactive-card { transform: none !important; }
}
