/* 1. Custom Properties */
:root {
  /* Colors - Light Mode Default */
  --color-bg: #FFFFFF;
  --color-surface: #F4F4F5;
  --color-text: #111111;
  --color-text-muted: #4B5563;
  --color-accent: #0057A8;
  --color-accent-hover: #003F7A;
  --color-border: #D1D5DB;
  --color-timeline-dot: #0057A8;

  /* Spacing */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-24: 6rem;     /* 96px */

  /* Typography */
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --color-bg: #111111;
  --color-surface: #1E1E1E;
  --color-text: #F0F0F0;
  --color-text-muted: #9CA3AF;
  --color-accent: #60A5FA;
  --color-accent-hover: #93C5FD;
  --color-border: #374151;
  --color-timeline-dot: #60A5FA;
}

/* Auto Dark Mode: system preference ohne JS, kein FOUC */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --color-bg: #111111;
    --color-surface: #1E1E1E;
    --color-text: #F0F0F0;
    --color-text-muted: #9CA3AF;
    --color-accent: #60A5FA;
    --color-accent-hover: #93C5FD;
    --color-border: #374151;
    --color-timeline-dot: #60A5FA;
  }

  [data-theme="auto"] header {
    background-color: rgba(17, 17, 17, 0.85);
  }
}

/* 2. Reset / Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-stack);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 1rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 3. Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.75rem, 5vw, 3.5rem);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: var(--space-8);
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-4);
  max-width: 65ch;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

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

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

/* 4. Layout */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

main {
  padding-top: var(--space-16);
}

section {
  padding-block: var(--space-24);
}

@media (max-width: 768px) {
  section {
    padding-block: var(--space-16);
  }
}

/* 5. Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] header {
  background-color: rgba(17, 17, 17, 0.85);
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: var(--space-4);
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
}

.nav-links a:hover, .nav-links a:focus {
  color: var(--color-accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.lang-switcher ul {
  display: flex;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
}

.lang-switcher a {
  text-decoration: none;
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: 4px;
  border: 1px solid transparent;
}

.lang-switcher a[aria-current="page"] {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.lang-switcher a:hover:not([aria-current="page"]) {
  background-color: var(--color-surface);
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

#theme-toggle:hover {
  background-color: var(--color-surface);
}

/* Mobile Nav */
@media (max-width: 900px) {
  nav {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  
  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
    gap: var(--space-6);
    justify-content: flex-start;
  }

  .nav-links a {
    white-space: nowrap;
  }
}

/* 6. Hero */
#hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--space-8);
  background: radial-gradient(circle at top right, var(--color-surface), transparent 70%);
}

.hero-sub {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.hero-tagline {
  font-size: 1.5rem;
  color: var(--color-text);
  margin-bottom: var(--space-8);
  border-left: 4px solid var(--color-accent);
  padding-left: var(--space-4);
  font-style: italic;
}

.hero-cta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* 7. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: 4px; /* Slightly rounded, clean look */
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
  border: 1px solid var(--color-accent);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #fff;
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-surface);
  border-color: var(--color-text-muted);
}

/* 8. Timeline */
.timeline {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 900px;
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-8);
  padding-left: var(--space-6);
  border-left: 2px solid var(--color-border);
}

.timeline-item:last-child {
  border-left-color: transparent;
  margin-bottom: 0;
}

/* Mobile Dot */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -8px; /* Center on 2px border */
  top: 0.25em; /* Align with first line of text roughly */
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--color-bg);
  border: 3px solid var(--color-timeline-dot);
  z-index: 1;
}

.timeline-meta {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-accent); 
  margin-bottom: var(--space-1);
  font-variant-numeric: tabular-nums;
  display: block;
}

.timeline-content h3 {
  margin-top: 0;
}

.timeline-org {
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.timeline-footer {
  margin-top: var(--space-8);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Desktop Timeline (Split Layout) */
@media (min-width: 768px) {
  .timeline-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: var(--space-8);
    padding-left: 0;
    border-left: none;
    align-items: flex-start;
  }
  
  .timeline-item::before {
     display: none; /* Hide mobile dot */
  }

  .timeline-meta {
     text-align: right;
     margin-bottom: 0;
     padding-top: 0;
     color: var(--color-text-muted);
  }
  
  .timeline-content {
     position: relative;
     padding-left: var(--space-8);
     border-left: 2px solid var(--color-border);
  }
  
  .timeline-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 6px; /* Visual alignment with top of H3 */
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 3px solid var(--color-timeline-dot);
    z-index: 1;
  }
  
  .timeline-item:last-child .timeline-content {
    border-left-color: transparent;
  }
}

/* 9. Skill Chips */
.skill-category {
  margin-top: var(--space-6);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skill-chips {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.skill-chips li {
  background-color: var(--color-surface);
  color: var(--color-text);
  padding: var(--space-1) var(--space-3);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent; /* Align with border box */
}

/* 10. Footer */
footer {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-16);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* 11. Contact */
.contact-links-wrapper {
  margin-top: var(--space-6);
}
.contact-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.contact-links li {
    display: flex;
}

.contact-links a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* 12. Skip Link */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  z-index: 200;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
  font-weight: bold;
}

.skip-link:focus {
  top: 0;
}

/* 13. Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Scroll Margin for Sticky Header */
section {
  scroll-margin-top: 100px;
}
