/* ── TOKENS ── */
:root {
  --background-body: #eef2f5;
  --text-main:       #363636;
  --text-bright:     #000;
  --text-muted:      #70777f;
  --links:           #0076d1;
  --border:          #dbdbdb;
  --font-size:       clamp(1rem, 2vw + 0.5rem, 18px);
  --line-height:     1.75;
  --max-width:       90ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-body: #1b2229;
    --text-main:       #dbdbdb;
    --text-bright:     #fff;
    --text-muted:      #a9b1ba;
    --links:           #41adff;
    --border:          #526980;
  }
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── BASE ── */
body {
  font-family: system-ui, serif;
  background: var(--background-body);
  color: var(--text-main);
  font-size: var(--font-size);
  line-height: var(--line-height);
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

a, a:visited     { color: var(--links); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

p { margin: 0 0 1em; font-size: 0.92rem; line-height: 1.65; }
p:last-child { margin-bottom: 0; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── HEADER ── */
header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-text { flex: 1; }

.site-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.site-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 400;
  color: var(--text-bright);
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin-bottom: 0.3rem;
}

.site-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.site-affil {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-links {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.75rem;
}

.site-links a {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.site-links a:hover { color: var(--text-bright); }

.site-links svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

/* ── SECTION HEADINGS (pandoc renders ## as h2) ── */
h2 {
  font-family: system-ui, serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-bright);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
  margin: 2rem 0 1rem;
}

h2:first-child { margin-top: 0; }

/* ── SUBSECTION HEADINGS (### for research areas, affiliations) ── */
h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 1.2rem 0 0.2rem;
}

h3:first-child { margin-top: 0; }

/* ── PUBLICATIONS (ordered list) ── */
ol {
  padding-left: 1.4rem;
  margin: 0;
}

ol li {
  margin-bottom: 1.2rem;
  font-size: 0.92rem;
  line-height: 1.65;
}

ol li:last-child { margin-bottom: 0; }

ol li em:first-child {        /* pub title — first em in each item */
  color: var(--text-bright);
}

ol li strong {                /* bold author name */
  color: var(--text-main);
}

/* ── SKILLS (unordered list) ── */
ul {
  padding-left: 1.4rem;
  margin: 0;
}

ul li {
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
  line-height: 1.65;
}

ul li:last-child { margin-bottom: 0; }

/* ── CAREER (definition list from pandoc) ── */
dl { margin: 0; }

dt {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1rem;
}

dt:first-child { margin-top: 0; }

dd {
  margin: 0.1rem 0 0 0;
  padding-left: 0;
  font-size: 0.92rem;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
  margin-top: 2.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem;
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--links); text-decoration: underline; }

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
  footer { flex-direction: column; }
}
