/* ------------------------------------------------------------------
   Söhne web fonts (Klim Type Foundry)
   The .woff2 files in /fonts are the Klim *trial* files. Replace them
   with the licensed web fonts, keeping the same file names, before
   the site goes public.
   ------------------------------------------------------------------ */
@font-face {
  font-family: "Söhne";
  src: url("fonts/soehne-leicht.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Söhne";
  src: url("fonts/soehne-leicht-kursiv.woff2") format("woff2");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Söhne";
  src: url("fonts/soehne-buch.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Söhne";
  src: url("fonts/soehne-buch-kursiv.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Söhne";
  src: url("fonts/soehne-kraftig.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Söhne";
  src: url("fonts/soehne-halbfett.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Söhne";
  src: url("fonts/soehne-dreiviertelfett.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ----------
   Spacing is based on one body line = 1.7rem (17px x 1.6).
   --line     1.7rem   paper gap, nav block gap
   --half     0.85rem  paragraph gap
   --two      3.4rem   section gap
   --three    5.1rem   footer gap
*/
:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --rule: #e4e4e4;
  --select: #e9e4dc;

  --line: 1.7rem;
  --half: 0.85rem;
  --two: 3.4rem;
  --three: 5.1rem;

  --sidebar: 16rem;
  --measure: 36rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --text: #d9d9d9;
    --muted: #8a8a8a;
    --rule: #2a2a2a;
    --select: #3a3632;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Söhne", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;        /* 17px */
  line-height: 1.6;
  font-weight: 300;            /* Leicht for running text */
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--select); color: var(--text); }

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  text-decoration-color: var(--muted);
}
a:hover { text-decoration-color: var(--text); }
a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 1px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Layout: left sidebar, content right ---------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, var(--measure));
  column-gap: 4rem;
  padding: 4rem clamp(1.25rem, 6vw, 5rem) var(--three);
}
.sidebar {
  position: sticky;
  top: 4rem;
  align-self: start;
}
main { padding-top: 0.55rem; }   /* optically aligns first line with the name */
footer { grid-column: 2; }

/* ---------- Sidebar ---------- */
.site-title {
  margin: 0;
  font-size: 2rem;             /* 32px; fits on one line in the 16rem column */
  font-weight: 700;            /* Dreiviertelfett */
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.site-title a { text-decoration: none; }

nav ul {
  list-style: none;
  margin: var(--line) 0 0;
  padding: 0;
}
nav li { margin: 0 0 0.3rem; }
nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 300;
}
nav a:hover { color: var(--text); }
nav a[aria-current] { color: var(--text); font-weight: 500; }

.sidebar-contact {
  margin: var(--line) 0 0;
  font-size: 0.9375rem;
  color: var(--muted);
}
.sidebar-contact a { color: var(--muted); text-decoration-color: var(--rule); }
.sidebar-contact a:hover { color: var(--text); text-decoration-color: var(--text); }

/* ---------- Content ----------
   One continuous page. Each <section> is a nav target.
   h2 = section title (Research, CV), h3 = subsection (Working Papers). */
section { scroll-margin-top: 4rem; }
section + section { margin-top: var(--three); }
h2 {
  font-size: 1.375rem;         /* 22px: section titles (Research, CV) */
  font-weight: 600;            /* Halbfett */
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0 0 var(--half);
}
h3 {
  font-size: 1.0625rem;
  font-weight: 600;            /* Halbfett */
  color: var(--text);
  margin: var(--two) 0 var(--half);
}
h2 + h3 { margin-top: var(--line); }
p { margin: 0 0 var(--half); }
.muted { color: var(--muted); }

/* Paper list: year hangs in a left gutter */
.paper {
  display: grid;
  grid-template-columns: 4rem 1fr;
  margin: 0 0 var(--line);
}
.paper-year {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.paper-title { font-weight: 600; margin: 0; }   /* Halbfett */
.paper-meta {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0.1rem 0 0;
}
.paper-meta b { font-weight: 300; color: var(--text); }
.paper-abstract {
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0.4rem 0 0;
  max-width: 34rem;
}
.paper-links {
  font-size: 0.9375rem;
  margin: 0.4rem 0 0;
}
.paper-links a { margin-right: 1rem; }

/* ---------- Footer ---------- */
footer {
  margin-top: var(--three);
  color: var(--muted);
  font-size: 0.8125rem;
}
footer p { margin: 0; }

/* ---------- Mobile: stack the sidebar on top ---------- */
@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
    row-gap: var(--line);
    padding: 2.25rem 1.25rem 3rem;
  }
  .sidebar { position: static; }
  main { padding-top: 0; }
  footer { grid-column: 1; }
  .site-title { font-size: 2.25rem; }
  nav ul { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: var(--half); }
  nav li { margin: 0; }
  .sidebar-contact { margin-top: var(--half); }
  .paper { grid-template-columns: 1fr; }
  .paper-year { font-size: 0.9375rem; }
}

/* ---------- Print ---------- */
@media print {
  nav, footer, .sidebar-contact, script { display: none; }
  section + section { margin-top: 2rem; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .layout { display: block; padding: 0; }
  .sidebar { position: static; margin-bottom: 1.5rem; }
  a { text-decoration: none; color: #000; }
}
