:root {
  color-scheme: light;
  --background: #f7f6f2;
  --surface: #fcfbf8;
  --text: #171717;
  --muted: #676761;
  --subtle: #8c8b84;
  --line: #d9d7cf;
  --accent: #174ea6;
  --accent-hover: #0f3a82;
  --max-width: 1160px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --background: #111311;
  --surface: #151815;
  --text: #f1f1ec;
  --muted: #b2b3ab;
  --subtle: #85877f;
  --line: #343730;
  --accent: #8ab4f8;
  --accent-hover: #b5d0ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
img { display: block; max-width: 100%; }
button { font: inherit; }
.container { width: min(calc(100% - 48px), var(--max-width)); margin-inline: auto; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 8px 12px; background: var(--text); color: var(--background); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--background) 92%, transparent); backdrop-filter: blur(14px); }
.header-inner { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 32px; min-height: 76px; }
.brand { display: inline-flex; flex-direction: column; width: fit-content; color: var(--text); text-decoration: none; line-height: 1.2; }
.brand span { font-weight: 690; letter-spacing: -0.02em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--muted); font-size: 0.86rem; font-weight: 560; text-decoration: none; }
.nav-links a:hover { color: var(--text); }
.theme-toggle { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.theme-toggle:hover { color: var(--text); border-color: var(--subtle); }
.hero { padding: clamp(88px, 11vw, 148px) 0 clamp(96px, 12vw, 168px); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.55fr); align-items: end; gap: clamp(56px, 9vw, 128px); }
.section-label { margin: 0 0 24px; color: var(--subtle); font-size: 0.74rem; font-weight: 650; letter-spacing: 0.13em; text-transform: uppercase; }
.hero h1 { max-width: 830px; margin: 0; font-size: clamp(2.45rem, 4.6vw, 4rem); font-weight: 640; letter-spacing: -0.045em; line-height: 1.05; }
.hero-lead { max-width: 760px; margin: 28px 0 0; color: var(--muted); font-size: clamp(1.05rem, 1.7vw, 1.28rem); line-height: 1.72; }
.hero-meta { margin: 30px 0 0; color: var(--subtle); font-size: 0.84rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 30px; }
.hero-links a, .quiet-link, .publication-links a, .project a, .contact-details > a, .profile-links a { font-size: 0.88rem; font-weight: 620; }
.portrait-block { margin: 0; }
.portrait-block img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); background: var(--surface); }
.portrait-block figcaption { display: flex; flex-direction: column; gap: 3px; margin-top: 14px; font-size: 0.82rem; }
.portrait-block figcaption strong { font-weight: 650; }
.portrait-block figcaption span { color: var(--muted); }
.content-section, .contact-section { padding: clamp(88px, 10vw, 136px) 0; border-bottom: 1px solid var(--line); scroll-margin-top: 76px; }
.two-column { display: grid; grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.3fr); gap: clamp(56px, 10vw, 140px); }
.section-intro { align-self: start; }
.section-intro .section-label { margin-bottom: 0; }
h2 { max-width: 720px; margin: 0; font-size: clamp(2.15rem, 4.5vw, 4.25rem); font-weight: 610; letter-spacing: -0.05em; line-height: 1.04; }
.prose { max-width: 720px; }
.prose p { margin: 0 0 22px; color: var(--muted); font-size: 1.05rem; }
.research-topics { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 36px; }
.research-topics span { padding: 7px 10px; border: 1px solid var(--line); color: var(--muted); font-size: 0.75rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 58px; }
.section-heading .section-label { margin-bottom: 18px; }
.quiet-link { flex: 0 0 auto; color: var(--muted); }
.publication-list { border-top: 1px solid var(--line); }
.publication { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); padding: 44px 0 48px; border-bottom: 1px solid var(--line); }
.publication-index { display: flex; flex-direction: column; gap: 5px; }
.publication-index span { font-size: 1.05rem; font-weight: 650; }
.publication-index small { color: var(--subtle); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.publication-note, .project-type { margin: 0 0 12px; color: var(--accent); font-size: 0.7rem; font-weight: 680; letter-spacing: 0.11em; text-transform: uppercase; }
.publication h3 { max-width: 880px; margin: 0; font-size: clamp(1.3rem, 2.2vw, 1.75rem); font-weight: 610; letter-spacing: -0.025em; line-height: 1.28; }
.authors, .publication-summary { max-width: 900px; color: var(--muted); }
.authors { margin: 15px 0 0; font-size: 0.88rem; }
.authors strong { color: var(--text); font-weight: 620; }
.publication-summary { margin: 14px 0 0; font-size: 0.94rem; }
.publication-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; }
.publication-links a { color: var(--muted); }
.project-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.project { min-height: 270px; padding: 34px 34px 0 0; border-right: 1px solid var(--line); }
.project + .project { padding-left: 34px; }
.project:last-child { border-right: 0; }
.project h3 { margin: 0; font-size: 1.35rem; font-weight: 610; letter-spacing: -0.025em; }
.project p:not(.project-type) { margin: 18px 0 28px; color: var(--muted); font-size: 0.94rem; }
.contact-section { background: var(--surface); }
.contact-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); gap: clamp(56px, 10vw, 140px); align-items: end; }
.contact-details p { margin: 0 0 12px; color: var(--muted); }
.contact-details > a { font-size: clamp(1.05rem, 2vw, 1.35rem); }
.profile-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px; }
.profile-links a { color: var(--muted); }
.site-footer { padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; color: var(--subtle); font-size: 0.76rem; }
.footer-inner p { margin: 0; }

@media (max-width: 900px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .nav-links { grid-column: 1 / -1; order: 3; padding-bottom: 16px; overflow-x: auto; }
  .hero-grid, .two-column, .contact-inner { grid-template-columns: 1fr; }
  .hero-grid { align-items: start; }
  .portrait-block { width: min(100%, 320px); }
  .project-list { grid-template-columns: 1fr; }
  .project, .project + .project { min-height: 0; padding: 32px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .project:last-child { border-bottom: 0; }
}

@media (max-width: 620px) {
  .container { width: min(calc(100% - 32px), var(--max-width)); }
  .site-header { position: relative; }
  .header-inner { min-height: 68px; gap: 16px; }
  .brand small { display: none; }
  .nav-links { gap: 18px; padding-bottom: 14px; }
  .nav-links a { white-space: nowrap; }
  .hero { padding-top: 76px; }
  .hero h1 { font-size: clamp(2.35rem, 11vw, 3.25rem); }
  .section-heading { align-items: start; flex-direction: column; margin-bottom: 42px; }
  .publication { grid-template-columns: 1fr; gap: 18px; }
  .publication-index { flex-direction: row; align-items: baseline; gap: 12px; }
  .footer-inner { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
