/* ==========================================================================
   Design-Tokens
   ========================================================================== */
:root {
  --bg: #f8fafc;
  --bg-alt: #eef2f7;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #dbe2ea;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-soft: #ccfbf1;
  --accent-contrast: #ffffff;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 8px 24px rgb(15 23 42 / 0.06);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120;
    --bg-alt: #0f172a;
    --surface: #131c2f;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #1f2a40;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: rgb(45 212 191 / 0.12);
    --accent-contrast: #042f2e;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --surface: #131c2f;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #1f2a40;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-soft: rgb(45 212 191 / 0.12);
  --accent-contrast: #042f2e;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); }
h3, .h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

a {
  color: var(--accent-strong);
  text-underline-offset: 3px;
}

ul { padding-left: 1.2em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

.muted { color: var(--text-muted); }
.small { font-size: 0.9rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
  margin-bottom: 0.75em;
}

/* ==========================================================================
   Buttons & Tags
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.75em 1.35em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.975rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover { background: var(--accent-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); }

.tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags li {
  font-size: 0.875rem;
  padding: 0.3em 0.8em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid transparent;
}
.tags-sm li { font-size: 0.8rem; padding: 0.2em 0.7em; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  margin-right: auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.nav-list a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-list a:hover,
.nav-list a.is-active {
  color: var(--text);
  background: var(--bg-alt);
}

.nav-toggle,
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle { display: none; }

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .icon-sun { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .site-nav { order: 2; }
  .theme-toggle { order: 1; }

  .nav-list {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-list.is-open { display: flex; }
  .nav-list a { padding: 12px; }
}

@media (max-width: 400px) {
  .brand-name { display: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: clamp(48px, 9vw, 112px) 0 clamp(56px, 8vw, 96px);
  background:
    radial-gradient(900px 400px at 85% 0%, var(--accent-soft), transparent 70%),
    var(--bg);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero-lead {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text-muted);
  max-width: 38ch;
}
.hero-lead strong { color: var(--text); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 36px;
}

.hero-facts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
}
.hero-facts li { display: flex; flex-direction: column; }
.fact-value { font-size: 1.4rem; font-weight: 700; }
.fact-label { font-size: 0.875rem; color: var(--text-muted); }

/* Visitenkarte */
.card-visit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.card-visit::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.card-visit-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.avatar {
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent);
  overflow: hidden;
}
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}

.card-name { font-weight: 700; font-size: 1.15rem; margin: 0; }
.card-role { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

.card-meta {
  margin: 0 0 20px;
  display: grid;
  gap: 10px;
}
.card-meta div {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.card-meta dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-top: 3px;
}
.card-meta dd { margin: 0; font-size: 0.95rem; }

.card-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgb(34 197 94 / 0.2);
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .card-visit { max-width: 480px; }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: clamp(64px, 9vw, 104px) 0; }
.section-alt { background: var(--bg-alt); }

.section-header { margin-bottom: 40px; max-width: 680px; }
.section-intro { color: var(--text-muted); }

/* Profil */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(32px, 5vw, 64px);
}
.prose p { color: var(--text-muted); }
.prose em { color: var(--text); font-style: normal; font-weight: 600; }

.values {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
.values li {
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.values h3 { margin-bottom: 0.25em; font-size: 1rem; }
.values p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* Kompetenzen */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.skill-card h3 { margin-bottom: 14px; }
.skill-card-wide { grid-column: 1 / -1; }

/* Leistungen */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 20px;
}
.service {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.service:hover { border-color: var(--accent); transform: translateY(-2px); }
.service p { color: var(--text-muted); margin: 0; font-size: 0.975rem; }

.service-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  margin-bottom: 16px;
}
.service-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Projekte */
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.filter-btn {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45em 1em;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.is-active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}
.project {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.project[hidden] { display: none; }
.project p { color: var(--text-muted); font-size: 0.975rem; }
.project .tags { margin-top: auto; }

.project-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
  margin-bottom: 0.5em;
}

.project-placeholder {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}

.project-links { display: flex; gap: 16px; margin-top: auto; }

/* Werdegang */
.timeline {
  --date-w: 170px;
  --gap: 24px;
  --dot: 12px;
  --line: 2px;
  list-style: none;
  padding: 0;
  margin: 0 0 64px;
  position: relative;
}
.timeline-item {
  display: grid;
  grid-template-columns: var(--date-w) 1fr;
  gap: var(--gap);
  padding-bottom: 32px;
  position: relative;
}
/* Linie und Punkt sitzen beide mittig in der Lücke zwischen Datum und Inhalt */
.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(var(--date-w) + var(--gap) / 2 - var(--line) / 2);
  top: 8px;
  bottom: -8px;
  width: var(--line);
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 2px;
  text-align: right;
}
.timeline-body {
  position: relative;
  padding-left: 12px;
}
.timeline-body::before {
  content: "";
  position: absolute;
  left: calc(var(--gap) / -2 - var(--dot) / 2);
  top: 7px;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline-body h3 { margin-bottom: 0.15em; }
.timeline-role { font-weight: 600; margin: 0.4em 0 0.3em; }
.timeline-role span { font-weight: 400; color: var(--text-muted); }
.timeline-body ul { margin: 0 0 0.5em; color: var(--text-muted); }
.timeline-body li { margin-bottom: 0.2em; }

@media (max-width: 640px) {
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
    padding-left: 24px;
  }
  .timeline-item::before { left: 0; transform: translateX(5px); }
  .timeline-date { text-align: left; }
  .timeline-body { padding-left: 0; }
  .timeline-body::before { left: -24px; top: -22px; }
}

.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
}
.edu-grid .h3 { margin-top: 0; }
.edu-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: grid;
  gap: 12px;
}
.edu-list span { color: var(--text-muted); font-size: 0.95rem; }

@media (max-width: 760px) {
  .edu-grid { grid-template-columns: 1fr; }
}

/* Kontakt */
.contact { text-align: center; }
.contact .section-header { margin-inline: auto; }
.contact-links {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.footer-inner p { margin: 0; }
.footer-links {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }

/* ==========================================================================
   Rechtliche Unterseiten
   ========================================================================== */
.legal { padding: clamp(48px, 8vw, 88px) 0; }
.legal .container { max-width: 760px; }
.legal h2 { font-size: 1.35rem; margin-top: 2em; }
.legal p, .legal li { color: var(--text-muted); }
.back-link { display: inline-block; margin-bottom: 24px; }

/* ==========================================================================
   Scroll-Reveal (nur wenn JS aktiv)
   ========================================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
