:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #1a1d21;
  --muted: #5f6770;
  --line: #e1e2dc;
  --accent: #284b63;
  --accent-hover: #1a3446;
  --placeholder: #e4e7ea;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #121416;
  --surface: #1a1d20;
  --text: #e8ecef;
  --muted: #9aa4ae;
  --line: #2b3137;
  --accent: #8fb4d1;
  --accent-hover: #b5d0e4;
  --placeholder: #252a2f;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

img { max-width: 100%; height: auto; display: block; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }

.page {
  width: min(880px, 100% - 40px);
  margin: 0 auto;
  padding: 28px 0 40px;
}

/* Header */
.header { display: flex; justify-content: flex-end; align-items: center; gap: 1.25rem; }
.header nav { display: flex; gap: 1.25rem; font-size: .9rem; }
.header nav a { color: var(--muted); }
.header nav a:hover { color: var(--text); text-decoration: none; }

.icon {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.theme-toggle {
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: 50%;
  color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle[hidden] { display: none; }
.icon-sun, [data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }

/* Intro */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 48px;
  align-items: center;
  padding: 56px 0 64px;
}
h1 { margin: 0 0 1.1rem; font-size: clamp(2.1rem, 5vw, 2.8rem); line-height: 1.1; letter-spacing: -.02em; font-weight: 650; }
.intro p { margin: 0 0 .8rem; color: var(--muted); max-width: 58ch; }

.profile-links { display: flex; gap: .5rem; margin-top: 1.4rem; }
.profile-links a {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--muted); background: var(--surface);
  transition: color .15s, border-color .15s;
}
.profile-links a:hover { color: var(--accent); border-color: var(--accent); }

.portrait {
  width: 240px; aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
}
.portrait-placeholder {
  display: grid; place-items: center;
  background: var(--placeholder); color: var(--muted);
  font-size: 3.5rem; font-weight: 600; letter-spacing: .02em;
}

/* Publications */
.section-heading {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: .6rem; margin-bottom: .5rem;
}
h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.01em; font-weight: 650; }

.paper {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.paper:last-child { border-bottom: 0; }

.paper-visual {
  align-self: start;
  display: grid; place-items: center;
  aspect-ratio: 3 / 2;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.paper-visual img { width: 100%; height: 100%; object-fit: contain; transition: transform .25s ease; }
.paper-visual:hover img { transform: scale(1.03); }

.venue { margin: 0 0 .25rem; color: var(--accent); font-size: .8rem; font-weight: 600; letter-spacing: .03em; }
.paper h3 { margin: 0 0 .4rem; font-size: 1.05rem; line-height: 1.4; font-weight: 600; }
.paper h3 a { color: var(--text); }
.paper h3 a:hover { color: var(--accent); }
.authors { margin: 0 0 .5rem; color: var(--muted); font-size: .88rem; }
.authors strong { color: var(--text); font-weight: 600; }
.description { margin: 0 0 .7rem; font-size: .92rem; }

.paper-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.paper-links a {
  font-size: .8rem; font-weight: 500;
  padding: .2rem .7rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
}
.paper-links a:hover { border-color: var(--accent); text-decoration: none; }

/* Contact */
.contact {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px;
  margin-top: 48px; padding-top: 28px;
  border-top: 1px solid var(--line);
}
.contact p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.email { font-weight: 500; }

footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  margin-top: 64px; padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .8rem;
}

@media (max-width: 680px) {
  .intro { grid-template-columns: 1fr; gap: 28px; padding: 32px 0 44px; }
  .portrait { order: -1; width: 150px; }
  .portrait-placeholder { font-size: 2.4rem; }
  .paper, .contact { grid-template-columns: 1fr; gap: 16px; }
  .paper-visual { max-width: 420px; }
}
