/* Libron v0.31 by Nico Verbruggen (OFL, see fonts/OFL.txt). Self-hosted,
   official release files. It has two weights, 400 and 700, so the CSS
   below uses only those. */
@font-face { font-family: "Libron"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/Libron-Regular.woff2") format("woff2"); }
@font-face { font-family: "Libron"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/Libron-Italic.woff2") format("woff2"); }
@font-face { font-family: "Libron"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/Libron-Bold.woff2") format("woff2"); }
@font-face { font-family: "Libron"; font-style: italic; font-weight: 700; font-display: swap; src: url("fonts/Libron-BoldItalic.woff2") format("woff2"); }

/* Light is palette A ("paper"), dark is palette D. */
:root {
  --bg: #f8f3e8;
  --ink: #2a2420;
  --muted: #6b5f52;
  --accent: #8a2b1c;
  --rule: #d9cdb5;
  --card: #fffcf5;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1a17;
    --ink: #e8e2d6;
    --muted: #a89f8f;
    --accent: #e0a36b;
    --rule: #3a3530;
    --card: #28251f;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #1c1a17;
  --ink: #e8e2d6;
  --muted: #a89f8f;
  --accent: #e0a36b;
  --rule: #3a3530;
  --card: #28251f;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 960px;
  padding: 40px 24px 32px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Libron", Georgia, serif;
  font-size: 17px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
a:hover { border-bottom-color: var(--accent); }

h1 {
  font-size: 2.1rem;
  font-weight: 400;
  margin: 0 0 6px;
}

h2 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 32px 0 10px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  font-size: 0.95rem;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
nav [aria-current] { color: var(--muted); }
nav .spacer { flex: 1; }

nav .nav-btn {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1;
  padding: 5px 9px;
  cursor: pointer;
}
nav .nav-btn:hover { border-color: var(--accent); }
#notes-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  grid-template-areas:
    "bio side"
    "papers side";
  column-gap: 48px;
  margin-top: 28px;
}
.bio { grid-area: bio; }
.side { grid-area: side; }
.papers { grid-area: papers; }

.bio p { margin: 0 0 16px; }

.portrait { margin: 4px 0 0; }
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.portrait figcaption {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
}

.side h2 { margin-top: 24px; }
.side p, .side li { font-size: 0.92rem; }
.email { margin: 0 0 8px; }
.links { list-style: none; padding: 0; margin: 0; }
.links li { margin-bottom: 2px; }

.note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: -4px 0 14px;
}

.papers ol { list-style: none; padding: 0; margin: 0; }
.papers li { margin-bottom: 18px; }
.papers .title, .papers .authors, .papers .venue { display: block; }
.papers .title { font-weight: 400; }
.papers span.title { color: var(--ink); }
.papers a.title { width: fit-content; }
.papers .authors { font-size: 0.92rem; color: var(--muted); }
.papers .authors b { color: var(--ink); font-weight: 700; }
.papers .venue { font-size: 0.92rem; font-style: italic; color: var(--accent); }

.before { font-size: 0.95rem; }

footer {
  margin-top: 40px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  body { padding: 24px 16px; font-size: 16px; }
  main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "bio" "side" "papers";
  }
  /* Phones: photo on the left, contact and links beside it, top-aligned. */
  .side {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    grid-auto-rows: min-content;
    column-gap: 18px;
    align-items: start;
    margin-bottom: 8px;
  }
  .side > * { grid-column: 2; }
  .portrait { grid-column: 1; grid-row: 1 / span 4; margin: 0; }
  .portrait figcaption { text-align: left; }
  .side h2 { margin-top: 0; }
  /* Notes mode adds boxes after each item, so stack the sidebar again. */
  body.notes-on .side { display: block; }
  body.notes-on .portrait { max-width: 200px; margin-bottom: 8px; }
  body.notes-on .side h2 { margin-top: 24px; }
}

/* Themed tooltip, built by site.js from title="..." attributes. */
#tip {
  position: fixed;
  z-index: 10;
  max-width: 260px;
  padding: 8px 12px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.12s, transform 0.12s;
}
#tip.show { opacity: 1; transform: none; }
/* Paper summaries: wider and upright so a paragraph stays readable. */
#tip.long { max-width: min(380px, calc(100vw - 16px)); font-style: normal; }
#tip img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 140px;
  margin: 0 auto 6px;
  border-radius: 4px;
}
#tip::after {
  content: "";
  position: absolute;
  left: calc(var(--arrow-x, 50%) - 5px);
  top: 100%;
  border: 5px solid transparent;
  border-top-color: var(--rule);
}
#tip.below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--rule);
}

@media (prefers-reduced-motion: reduce) {
  #tip { transition: none; }
}

/* Notes mode: every hover note shown at once, grouped under its paragraph. */
.notes-box {
  display: none;
  margin: 6px 0 12px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink);
}
body.notes-on .notes-box { display: block; }
body.notes-on #tip { display: none; }
.notes-box .note + .note { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--rule); }
.notes-box img { display: block; max-width: 140px; max-height: 32px; margin-bottom: 3px; border-radius: 3px; }
.notes-box b { font-weight: 700; }
