/* ---------------------------------------------------------
   Globale Design-Variablen
--------------------------------------------------------- */
:root {
  --primary: #0b6ea4;
  --primary-600: #0a6192;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 2px 6px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.04);
  --radius-s: .4rem;
  --radius-m: .75rem;
  --container: 1000px;
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem;
  --space-4: 1rem;   --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem;
  --fs-1: clamp(2rem, 1.6rem + 1.5vw, 2.75rem);
  --fs-2: 1.6rem; --fs-3: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --surface: #151b23;
    --text: #e5e7eb;
    --muted: #a3aab7;
    --border: #1f2937;
    --shadow: 0 2px 6px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.35);
    --primary: #5fb3ff;
    --primary-600: #4aa5f7;
  }
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--space-4); }
section { margin: var(--space-6) auto; }
h2 {
  font-size: var(--fs-2);
  color: var(--primary);
  margin: 0 0 var(--space-3) 0;
  border-bottom: 2px solid var(--border);
  padding-bottom: .35rem;
}

/* ---------------------------------------------------------
   Kopfbereich
--------------------------------------------------------- */
header {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-600) 100%);
  color: #fff;
  padding: var(--space-7) var(--space-4);
  box-shadow: var(--shadow);
}
.header-wrap {
  display: flex; align-items: center; gap: var(--space-6);
  max-width: var(--container); margin: 0 auto;
}
header .profilbild {
  width: 220px; height: 220px; border-radius: 50%;
  object-fit: cover; object-position: 50% 20%;
  border: 4px solid rgba(255,255,255,.9);
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  flex: 0 0 auto;
}
.header-text h1 { margin: 0 0 var(--space-2) 0; font-size: var(--fs-1); letter-spacing: .2px; }
.header-text p { margin: 0; font-size: 1.05rem; opacity: .95; }

@media (max-width: 720px) {
  .header-wrap { flex-direction: column; text-align: center; }
  header .profilbild { width: 140px; height: 140px; }
}

/* ---------------------------------------------------------
   Allgemeine Daten (Key-Value-Liste)
--------------------------------------------------------- */
.keyval { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.keyval .key { color: var(--muted); min-width: 10rem; display: inline-block; }
.keyval .val { font-weight: 600; }

/* ---------------------------------------------------------
   Schule & Studium (Zeitstrahl)
--------------------------------------------------------- */
#schule .timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
#schule .timeline li {
  display: grid; grid-template-columns: 16rem 1fr; gap: .75rem;
  padding: .5rem 0; border-bottom: 1px solid var(--border);
}
#schule .timeline li:last-child { border-bottom: 0; }
#schule .period { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
#schule .institution { font-weight: 700; }
#schule .program { color: var(--primary); font-weight: 700; }
#schule .abschluss { font-style: italic; }

@media (max-width: 720px) {
  #schule .timeline li { grid-template-columns: 1fr; }
  #schule .period { order: -1; }
}

/* ---------------------------------------------------------
   Beruflicher Werdegang (Zeitstrahl)
--------------------------------------------------------- */
#arbeit .timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
#arbeit .timeline li {
  display: grid; grid-template-columns: 16rem 1fr; gap: .75rem;
  padding: .5rem 0; border-bottom: 1px solid var(--border);
}
#arbeit .timeline li:last-child { border-bottom: 0; }
#arbeit .period { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
#arbeit .institution { font-weight: 700; }
#arbeit .position { color: var(--primary); font-weight: 700; }
#arbeit .detail { display: block; color: var(--muted); }

@media (max-width: 720px) {
  #arbeit .timeline li { grid-template-columns: 1fr; }
  #arbeit .period { order: -1; }
}

/* ---------------------------------------------------------
   Projekte (Karten im responsiven Grid)
--------------------------------------------------------- */
#projekte .projekte {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-5);
}

#projekte article {
  background: var(--surface);
  padding: var(--space-5);
  border-radius: var(--radius-m);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}

#projekte article:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

#projekte img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-s);
  margin-bottom: var(--space-3);
  object-fit: cover;
}

#projekte h3 {
  font-size: var(--fs-3);
  margin: 0 0 var(--space-3) 0;
  line-height: 1.35;
  color: var(--primary);
}

#projekte article p {
  margin: 0 0 var(--space-3) 0;
  line-height: 1.6;
}

#projekte article p.note {
  font-size: 0.9em;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* ---------------------------------------------------------
   Fußbereich
--------------------------------------------------------- */
footer {
  text-align: center;
  font-size: .95em;
  color: var(--muted);
  padding: var(--space-5) var(--space-4);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

/* ---------------------------------------------------------
   Sonstiges
--------------------------------------------------------- */
a { color: var(--primary); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

@media print {
  header, footer { box-shadow: none; background: #fff; color: #000; }
  a { text-decoration: underline; color: #000; }
  #projekte article { break-inside: avoid; box-shadow: none; }
}
