/* =========================================================
   René Theuerkauf — personal website · shared stylesheet
   Style: clean & academic (serif text, restrained accents).
   Edit the values in :root to recolour / restyle everything.
   Light + dark themes supported via prefers-color-scheme.
   ========================================================= */

:root {
  --max-width: 760px;
  --color-bg: #fbfaf7;
  --color-surface: #f3f1ec;
  --color-text: #1f1d1a;
  --color-muted: #6b665e;
  --color-accent: #6a4e2b;       /* warm academic brown */
  --color-accent-strong: #513a1e;
  --color-rule: #e4e0d8;
  --color-tag-bg: #ece7dd;
  --color-tag-text: #5a4a34;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 14px rgba(0,0,0,0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #171614;
    --color-surface: #201e1a;
    --color-text: #ece9e3;
    --color-muted: #a49d92;
    --color-accent: #cba36a;
    --color-accent-strong: #e0bd8a;
    --color-rule: #34302a;
    --color-tag-bg: #2a2620;
    --color-tag-text: #cbb996;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 14px rgba(0,0,0,0.4);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.4rem;
}

/* ---------- Header / navigation ---------- */
.site-header {
  border-bottom: 1px solid var(--color-rule);
  margin-bottom: 3rem;
  background: var(--color-bg);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding-top: 1.6rem;
  padding-bottom: 1.2rem;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}

.site-title a { color: var(--color-text); text-decoration: none; }
.site-title a:hover { color: var(--color-accent); }
.site-title .role {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-top: 0.15rem;
}

.site-nav {
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--color-muted);
  text-decoration: none;
  margin-left: 1.2rem;
  white-space: nowrap;
}

.site-nav a:first-child { margin-left: 0; }
.site-nav a:hover { color: var(--color-accent); }
.site-nav a.active {
  color: var(--color-text);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 2px;
}

/* ---------- Main content ---------- */
main { padding-bottom: 4rem; }

h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}

.lede {
  color: var(--color-muted);
  font-size: 1.17rem;
  margin-top: 0;
}

h2 {
  font-size: 1.4rem;
  margin: 2.6rem 0 0.7rem;
  letter-spacing: -0.005em;
}

h3 {
  font-size: 1.08rem;
  margin: 1.6rem 0 0.3rem;
}

a { color: var(--color-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--color-accent-strong); }

p { margin: 0 0 1.1rem; }

ul { padding-left: 1.2rem; }
li { margin-bottom: 0.4rem; }

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

.muted { color: var(--color-muted); }
.center { text-align: center; }

.placeholder {
  color: var(--color-muted);
  font-style: italic;
  background: var(--color-surface);
  border-left: 3px solid var(--color-rule);
  padding: 0.8rem 1.1rem;
  border-radius: 0 4px 4px 0;
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.6rem 0 0.4rem; }

.btn {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-accent);
  color: #fff;
  background: var(--color-accent);
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--color-accent-strong); border-color: var(--color-accent-strong); color: #fff; }

.btn.secondary { background: transparent; color: var(--color-accent); }
.btn.secondary:hover { background: var(--color-surface); color: var(--color-accent-strong); }

/* ---------- Tags / badges ---------- */
.tags { list-style: none; padding: 0; margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin: 0;
}

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.4rem 0 0.6rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}
.card p { overflow-wrap: anywhere; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card .card-lead {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 0.3rem;
}

/* ---------- Timeline (experience / education) ---------- */
.timeline { list-style: none; padding: 0; margin: 1rem 0 0; }
.timeline > li {
  position: relative;
  padding: 0 0 1.5rem 1.4rem;
  border-left: 2px solid var(--color-rule);
  margin: 0;
}
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
}
.timeline .when {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--color-muted);
  display: block;
}
.timeline .what { font-weight: 700; }
.timeline .where { color: var(--color-muted); }
.timeline .detail { margin: 0.3rem 0 0; font-size: 0.95rem; }

/* ---------- Publication list ---------- */
.pubs { list-style: none; padding: 0; margin: 1rem 0 0; }
.pubs > li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--color-rule);
  margin: 0;
}
.pubs > li:last-child { border-bottom: none; }
.pubs .year {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--color-accent);
  letter-spacing: 0.03em;
}
.pubs .venue { color: var(--color-muted); font-style: italic; }
.pubs .title { font-weight: 600; }

/* ---------- Definition-style rows (languages, facts) ---------- */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.2rem; margin: 0.8rem 0 0; font-size: 0.98rem; }
.facts dt { font-family: var(--font-sans); font-size: 0.85rem; color: var(--color-muted); letter-spacing: 0.02em; }
.facts dd { margin: 0; }

/* ---------- Portrait ---------- */
.portrait-figure { margin: 0 0 1.8rem; }
.portrait {
  display: block;
  width: 240px;
  height: 240px;
  max-width: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}
.portrait-figure figcaption {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
}

/* Home hero: portrait beside intro on wide screens */
.hero { display: flex; flex-wrap: wrap-reverse; align-items: flex-start; gap: 1.6rem 2rem; }
.hero .hero-text { flex: 1 1 300px; min-width: 260px; }
.hero .portrait-figure { flex: 0 0 auto; margin: 0; }
.hero .portrait { width: 190px; height: 190px; }

/* ---------- Callout ---------- */
.callout {
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  margin: 1.8rem 0;
}
.callout p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-rule);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-muted);
  padding: 1.6rem 0 2.4rem;
}
.site-footer a { color: var(--color-muted); }
.site-footer a:hover { color: var(--color-accent); }

/* ---------- Small screens ---------- */
@media (max-width: 540px) {
  body { font-size: 18px; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  .site-nav { margin-top: 0.2rem; }
  .site-nav a { margin-left: 0; margin-right: 1.1rem; display: inline-block; }
  h1 { font-size: 1.8rem; }
}
