/* Content is in index.md; identity and accent color are in _config.yml. */
:root {
  color-scheme: light;
  --ink: #242b32;
  --muted: #626970;
  --accent: #315d7e;
  --accent-hover: #163d5c;
  --line: #dfe4e8;
  --paper: #fff;
  --placeholder-bg: #f4f5f5;
  --placeholder-ink: #899299;
  --award-ink: #704b0a;
  --award-bg: #fff3cd;
  --award-border: #d5ae55;
  --award-star: #91620e;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

:root[data-accent="forest"] {
  --accent: #326252;
  --accent-hover: #194334;
}

@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e1e7ed;
    --muted: #a6b0bb;
    --accent: #94bfea;
    --accent-hover: #c4ddf7;
    --line: #35404c;
    --paper: #161b22;
    --placeholder-bg: #202833;
    --placeholder-ink: #a6b0bb;
    --award-ink: #f1cd79;
    --award-bg: #352b17;
    --award-border: #795d2e;
    --award-star: #e5b954;
  }
  :root[data-accent="forest"][data-theme="dark"] {
    --accent: #94cdb6;
    --accent-hover: #bce9d6;
  }
}

/* Follow the device preference even if JavaScript is unavailable. */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ink: #e1e7ed;
    --muted: #a6b0bb;
    --accent: #94bfea;
    --accent-hover: #c4ddf7;
    --line: #35404c;
    --paper: #161b22;
    --placeholder-bg: #202833;
    --placeholder-ink: #a6b0bb;
    --award-ink: #f1cd79;
    --award-bg: #352b17;
    --award-border: #795d2e;
    --award-star: #e5b954;
  }
  :root[data-accent="forest"]:not([data-theme]) {
    --accent: #94cdb6;
    --accent-hover: #bce9d6;
  }
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
a:focus-visible { border-radius: 2px; }
.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 10;
  padding: 8px 16px;
  background: var(--paper);
}
.skip-link:focus { top: 8px; }

.site-shell {
  width: min(1078px, calc(100% - 64px));
  margin: 30px auto 0;
  font-size: 17.6px;
}
.profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 175px;
  gap: 28px;
  align-items: start;
}
.profile-copy { min-width: 0; }
h1 {
  margin: 0;
  font: 600 38.5px/1.12 var(--sans);
  letter-spacing: -.8px;
}
.affiliation {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 15.4px;
  line-height: 1.5;
}
.profile-links { display: inline-flex; align-items: center; gap: 6px; vertical-align: baseline; white-space: nowrap; }
.profile-links a { font-weight: 500; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  margin-left: 4px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--accent-hover); border-color: currentColor; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }
.biography p { margin: 0; font-size: 17.05px; line-height: 1.5; }
.biography p + p { margin-top: 8.4px; }
.portrait {
  display: block;
  width: 175px;
  height: 221.6667px;
  min-height: 0;
  object-fit: cover;
  object-position: 50% 40%;
  border-radius: 3px;
}
.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--placeholder-bg);
  color: var(--placeholder-ink);
}
.placeholder-mark { font: 400 35px/1 Georgia, serif; letter-spacing: 2px; }
.placeholder-caption { font: 10px/1.4 var(--sans); }

.content { min-width: 0; outline: none; }
.content h2 {
  margin: 24px 0 14px;
  font: 600 25.3px/1.25 var(--sans);
  letter-spacing: -.3px;
}
.research { margin-top: 36px; }
.research-topic h2 {
  margin: 36px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font: 600 18.7px/1.3 var(--sans);
}
.research-topic:first-child h2 { margin-top: 0; }
.topic-intro { color: var(--ink); font-size: 17.05px; font-weight: 400; line-height: 1.5; }
.topic-intro p { margin: 0 0 12.6px; }
.paper-entry { margin: 0 0 15.75px; }
.paper-entry:last-child { margin-bottom: 0; }
.paper-entry h3 {
  margin: 0 0 3px;
  font: 600 17.6px/1.3 var(--sans);
  letter-spacing: -.05px;
}
.paper-entry p { margin: 0; font-size: 14.85px; line-height: 1.45; color: var(--muted); }
.paper-entry p + p { margin-top: 5px; font-size: 13.75px; }
.paper-entry em { color: var(--ink); font-style: normal; font-weight: 500; }
.venue-award { white-space: nowrap; }
.paper-entry strong {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 7px;
  border: 1px solid var(--award-border);
  border-radius: 3px;
  background: var(--award-bg);
  color: var(--award-ink);
  font: 700 12.1px/1.4 var(--sans);
  white-space: nowrap;
  vertical-align: 1px;
}
.paper-entry strong::before { content: "★"; margin-right: 5px; color: var(--award-star); }
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 21px;
  padding: 12px 0 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 400 12.1px/1.4 var(--sans);
}

@media (max-width: 700px) {
  .site-shell { width: calc(100% - 40px); margin-top: 23px; }
  .profile {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    justify-items: center;
  }
  .profile-copy { display: contents; }
  .portrait { grid-column: 1; grid-row: 1; width: 168px; height: 212.8px; }
  .identity {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    width: 100%;
    min-width: 0;
    text-align: center;
  }
  .biography { grid-column: 1; grid-row: 3; width: 100%; text-align: left; }
  h1 { font-size: 34.1px; }
  .affiliation { justify-content: center; margin-bottom: 0; font-size: 13.2px; }
  .research { margin-top: 32px; }
  .research-topic h2 { margin-top: 32px; }
}

@media (max-width: 430px) {
  .site-shell { width: calc(100% - 32px); margin-top: 20px; }
  h1 { font-size: 30.8px; }
  .paper-entry h3 { font-size: 17.05px; }
  .paper-entry p { font-size: 14.3px; }
}

@media (max-width: 350px) {
  .portrait { width: 154px; height: 195.0667px; }
}

@media (max-width: 380px) {
  .affiliation { display: block; }
  .profile-links { display: flex; justify-content: center; margin-top: 4px; }
  .profile-links > span:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .skip-link, .theme-toggle { display: none !important; }
  .site-shell { width: 100%; margin: 0; }
  .paper-entry { break-inside: avoid; }
}
