:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --text: #182231;
  --muted: #647083;
  --line: #dfe5ed;
  --accent: #1765ad;
  --accent-hover: #0f4e89;
  --accent-soft: #edf5ff;
  --shadow-soft: 0 9px 28px rgba(32, 48, 67, 0.07);
  --max-width: 1080px;
}

[data-theme="dark"] {
  --bg: #11161d;
  --surface: #171e27;
  --surface-soft: #1d2631;
  --text: #eef3f8;
  --muted: #a9b5c2;
  --line: #2d3946;
  --accent: #82b4ef;
  --accent-hover: #aed0f5;
  --accent-soft: #1c2d42;
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
img, video { max-width: 100%; display: block; }

.container { width: min(calc(100% - 56px), var(--max-width)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 760;
  white-space: nowrap;
}
.brand:hover { color: var(--text); text-decoration: none; }

.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.nav-links a { color: var(--muted); font-size: 0.86rem; }
.nav-links a:hover,
.nav-links a.active { color: var(--accent); text-decoration: none; }

.theme-button {
  width: 36px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.theme-button:hover { border-color: var(--accent); }

main { padding: 48px 0 82px; }
section { scroll-margin-top: 78px; }
main > section:not(.hero) { margin-top: 72px; }

/* Hero: the portrait floats beside the introduction so later content can naturally
   use the space beneath it instead of leaving an empty left column. */
.hero {
  display: flow-root;
}

.profile-column {
  float: left;
  width: clamp(218px, 23vw, 248px);
  margin: 1px clamp(28px, 3.2vw, 42px) 18px 0;
}

.hero-content {
  min-width: 0;
}

.profile-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, h3 { color: var(--text); line-height: 1.22; }
h1 {
  margin: 0 0 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 5.4vw, 4.35rem);
  letter-spacing: -0.045em;
  font-weight: 600;
}
h2 {
  margin: 0 0 22px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 3vw, 2.25rem);
  letter-spacing: -0.025em;
  font-weight: 600;
}
h3 { margin: 0 0 6px; font-size: 1rem; }

.hero-role {
  max-width: 760px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.48;
}
.hero p:not(.eyebrow):not(.hero-role):not(.highlight-line) { margin: 0 0 12px; }
.highlight-line { margin: 3px 0 0; font-weight: 760; line-height: 1.5; }

.link-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 0.84rem;
  transition: transform .15s ease, border-color .15s ease, color .15s ease;
}
.link-pill:hover {
  border-color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.link-pill svg { width: 14px; height: 14px; flex: 0 0 auto; }

.callout {
  clear: both;
  margin-top: 17px;
  padding: 12px 15px;
  border-left: 3px solid var(--accent);
  border-radius: 0 9px 9px 0;
  background: var(--accent-soft);
  font-size: 0.9rem;
}

.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  gap: 17px;
  padding: 9px 0;
}
.news-date { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }

.publication {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 25px;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
}
.publication:first-of-type { padding-top: 2px; }
.pub-image {
  width: 248px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.pub-title { color: var(--text); font-size: 1rem; font-weight: 790; line-height: 1.42; }
.pub-authors { margin: 6px 0 2px; color: var(--muted); font-size: 0.88rem; }
.pub-venue { margin: 0 0 7px; font-size: 0.9rem; font-weight: 730; }
.pub-summary { margin: 7px 0 0; color: var(--muted); font-size: 0.9rem; }
.pub-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 0.88rem; font-weight: 720; }

.compact-publications { margin: 20px 0 0; padding-left: 1.25rem; }
.compact-publications li { padding: 6px 0; }
.compact-publications .meta { color: var(--muted); }

.timeline { display: grid; gap: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
  padding: 13px 0;
}
.timeline-date { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.timeline-copy p { margin: 3px 0 0; color: var(--muted); }

.media-figure { margin: 0 0 20px; }
.media-figure video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}
.media-figure figcaption { margin-top: 9px; color: var(--muted); font-size: 0.88rem; }

.awards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.award {
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.award strong { display: block; font-size: 0.96rem; }
.award span { display: block; margin-top: 3px; color: var(--muted); font-size: 0.84rem; }

.skills { display: flex; flex-wrap: wrap; gap: 8px; }
.skill {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
}

/* CV page */
.cv-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin: 4px 0 30px;
}
.cv-header p { margin: 6px 0 0; color: var(--muted); }
.cv-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
}
.button:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.cv-section { margin-top: 40px; }
.cv-entry { margin: 0 0 18px; }
.cv-entry-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.cv-entry-head strong { font-size: 1rem; }
.cv-entry-head span { color: var(--muted); white-space: nowrap; font-size: 0.88rem; }
.cv-entry em { color: var(--muted); }
.cv-entry ul { margin: 7px 0 0; padding-left: 1.25rem; }
.cv-entry li { margin: 3px 0; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 25px 0 38px;
  color: var(--muted);
  font-size: 0.86rem;
}
.footer-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .container { width: min(calc(100% - 36px), var(--max-width)); }
  .profile-column { width: 190px; margin-right: 25px; }
  h1 { font-size: clamp(2.65rem, 7vw, 3.45rem); }
  .publication { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
  .pub-image { width: 220px; }
}

@media (max-width: 680px) {
  .nav { padding: 10px 0; align-items: flex-start; }
  .nav-links { justify-content: flex-end; gap: 9px 13px; }
  main { padding: 30px 0 58px; }
  .hero { display: block; }
  .profile-column {
    float: none;
    width: min(72vw, 300px);
    margin: 0 auto 22px;
  }
  .profile-photo { border-radius: 13px; }
  .publication { grid-template-columns: 1fr; }
  .pub-image { width: 100%; }
  .timeline-item { grid-template-columns: 1fr; gap: 2px; }
  .cv-header { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .container { width: min(calc(100% - 36px), var(--max-width)); }
  .brand { display: none; }
  .nav { position: relative; justify-content: flex-start; padding-right: 40px; }
  .nav-links { width: 100%; justify-content: flex-start; gap: 6px 9px; }
  .nav-links a { font-size: 0.77rem; }
  .theme-button { position: absolute; right: 0; top: 9px; width: 31px; height: 27px; }
  main { padding: 26px 0 48px; }
  main > section:not(.hero) { margin-top: 44px; }
  h2 { margin-bottom: 18px; }
  .profile-column { width: min(70vw, 250px); }
  h1 { font-size: clamp(2.5rem, 13vw, 3.2rem); }
  .hero-role { font-size: 0.98rem; }
  .news-list li { grid-template-columns: 1fr; gap: 2px; padding: 8px 0; }
  .awards-grid { grid-template-columns: 1fr; gap: 8px; }
  .award { min-height: 0; padding: 12px 14px; }
}

@media print {
  .site-header, .site-footer, .cv-actions { display: none !important; }
  :root { --text: #000; --muted: #333; --line: #bbb; --bg: #fff; --surface: #fff; --surface-soft: #fff; }
  body { background: #fff; font-size: 10.5pt; line-height: 1.42; }
  main { padding: 0; }
  .container { width: 100%; max-width: none; }
  .cv-section { margin-top: 21px; }
  .cv-entry { break-inside: avoid; margin-bottom: 12px; }
  h2 { font-size: 15pt; margin-bottom: 10px; }
}
