/* ---------- Fonts (Source Sans 3, SIL Open Font License; see fonts/OFL.txt) ---------- */

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3-Roman.woff") format("woff");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3-Italic.woff") format("woff");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* ---------- Settings ---------- */

:root {
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text: #1e2427;
  --muted: #5a6468;
  --accent: #004953;
  --accent-hover: #317873;
  --accent-tint: #eef4f4;
  --accent-soft: rgba(0, 73, 83, 0.3);
  --rule: #dde2e3;
  --background: #ffffff;
  --sidebar-width: 15rem;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 106.25%; /* 17px */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
  font-kerning: normal;
}

p { margin: 0 0 1em; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(0, 73, 83, 0.35);
}

a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3 { font-weight: 600; line-height: 1.25; color: var(--text); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
}

.skip-link:focus {
  left: 0.75rem;
  z-index: 10;
  padding: 0.4rem 0.75rem;
  background: var(--background);
  outline: 2px solid var(--accent);
}

/* ---------- Page layout ---------- */

.site {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  column-gap: 4.5rem;
  max-width: 66rem;
  margin: 0 auto;
  padding: 4rem 2.5rem 3rem;
}

.sidebar {
  position: sticky;
  top: 3rem;
  align-self: start;
}

.content {
  grid-column: 2;
  max-width: 40rem;
}

.site-footer {
  grid-column: 2;
  max-width: 40rem;
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer p { margin: 0; }

/* ---------- Sidebar ---------- */

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.name {
  margin: 1.4rem 0 0.6rem;
  font-size: 1.55rem;
}

.positions {
  font-size: 0.95rem;
  line-height: 1.38;
  color: var(--muted);
}

.positions p { margin: 0 0 0.6rem; }

.positions a { color: var(--muted); text-decoration-color: var(--rule); }
.positions a:hover { color: var(--accent); }

.profile-links ul {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--rule);
}

.profile-links li { margin: 0 0 0.3rem; }

.profile-links a { text-decoration: none; font-weight: 500; }
.profile-links a:hover { text-decoration: underline; }

/* ---------- Content ---------- */

.content > p:first-of-type { margin-top: 0; }

/* Tabs (Research, Teaching, Projects) */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  margin: 2.4rem 0 0;
  border-bottom: 1px solid var(--rule);
}

.tabs a {
  display: inline-block;
  margin-bottom: -1px;
  padding: 0 0 0.55rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
}

.tabs a:hover { color: var(--accent); }

.tabs a:focus-visible {
  outline-offset: 5px;
  border-radius: 2px;
}

.tabs a[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.content h2 {
  margin: 2.4rem 0 1rem;
  font-size: 1.25rem;
  scroll-margin-top: 1.5rem;
}

/* List headings */
.content h3 {
  margin: 2.1rem 0 0.75rem;
  font-size: 1.2rem;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  color: var(--accent);
  scroll-margin-top: 1.5rem;
}

/* Panel headings: visually hidden when tabs are active */
@media screen {
  html.tabs-ready .tab-panel { padding-top: 1.6rem; }

  html.tabs-ready .tab-panel h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  html.tabs-ready .tab-panel h2 + h3,
  html.tabs-ready .tab-panel h2 + section > h3 { margin-top: 0; }
}

/* Lists */
.content ul {
  margin: 0 0 1.2rem;
  padding-left: 1.15rem;
}

.content li { margin: 0 0 0.3rem; }
.content li::marker { color: var(--accent); }

/* ---------- Entries ---------- */

.entry { margin: 0 0 1.15rem; }

.entry-title { font-weight: 600; line-height: 1.32; }
/* Linked titles */
.entry-title a {
  color: inherit;
  text-decoration: none;
}

.entry-title a:hover {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
}

.entry-authors,
.entry-venue { line-height: 1.38; }

.entry-note {
  font-size: 0.94rem;
  line-height: 1.38;
  color: var(--muted);
}

.entry-title p,
.entry-authors p,
.entry-venue p,
.entry-note p { margin: 0; }

.entry > p { margin: 0.4rem 0 0; }

.entry-actions p,
.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.entry-actions { margin-top: 0.45rem; }

.abstract-toggle,
.entry-link {
  display: inline-block;
  padding: 0.05rem 0.65rem 0.1rem;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background: var(--background);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.abstract-toggle:hover,
.entry-link:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

.abstract-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.abstract {
  margin-top: 0.6rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  font-size: 0.95rem;
  line-height: 1.5;
}

.abstract p { margin: 0 0 0.6rem; }
.abstract p:last-child { margin-bottom: 0.2rem; color: var(--muted); }

/* Abstract toggles (JS only) */
.abstract-toggle { display: none; }
html.js .abstract-toggle { display: inline-block; }
html.js .abstract:not(.is-open) { display: none; }

/* ---------- Imprint ---------- */

.page-simple {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

.page-simple h1 { font-size: 1.6rem; margin: 1.5rem 0 1.5rem; }
.page-simple h2 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }
.page-simple h3 { font-size: 1rem; margin: 1.25rem 0 0.25rem; }
.back-link { text-decoration: none; font-weight: 500; }

/* ---------- Narrow screens ---------- */

@media (max-width: 820px) {
  .site {
    display: block;
    max-width: 40rem;
    padding: 2rem 1.25rem 2.5rem;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    column-gap: 1.25rem;
    align-items: center;
    margin-bottom: 2rem;
  }

  .portrait { grid-row: 1 / span 2; }
  .name { margin: 0 0 0.3rem; font-size: 1.4rem; align-self: end; }
  .positions { align-self: start; font-size: 0.9rem; }
  .positions p { margin-bottom: 0.3rem; }

  .profile-links { grid-column: 1 / -1; }
  .profile-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.1rem;
    margin-top: 1.1rem;
    padding-top: 0.8rem;
  }
  .profile-links li { margin: 0; }

  .site-footer { margin-top: 3rem; }
}

/* ---------- Print ---------- */

@media print {
  html { font-size: 10.5pt; }
  .site { display: block; padding: 0; max-width: none; }
  .sidebar { position: static; }
  .portrait, .tabs, .abstract-toggle, .skip-link, .profile-links { display: none !important; }
  .tab-panel[hidden] { display: block !important; }
  html.js .abstract:not(.is-open), .abstract { display: block !important; }
  a { color: inherit; text-decoration: none; }
  .entry { break-inside: avoid; }
}
