/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === Light Theme (Default) === */
:root {
  --color-bg: #f8f9fb;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-accent: #3b82f6;
  --color-accent-hover: #2563eb;
  --color-accent-light: #eff6ff;
  --color-border: #e2e8f0;
  --color-footer-bg: #0f172a;
  --color-footer-text: #94a3b8;
  --color-header-bg: rgba(255,255,255,0.92);
  --max-width: 900px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
}

/* === Dark Theme: System-Preference === */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #1a1a1a;
    --color-surface: #262626;
    --color-text: #e5e5e5;
    --color-text-secondary: #a3a3a3;
    --color-accent: #60a5fa;
    --color-accent-hover: #93c5fd;
    --color-accent-light: rgba(96,165,250,0.1);
    --color-border: #333333;
    --color-footer-bg: #111111;
    --color-footer-text: #737373;
    --color-header-bg: rgba(26,26,26,0.88);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  }
}

/* === Dark Theme: Manuell per Toggle === */
:root[data-theme="dark"] {
  --color-bg: #1a1a1a;
  --color-surface: #262626;
  --color-text: #e5e5e5;
  --color-text-secondary: #a3a3a3;
  --color-accent: #60a5fa;
  --color-accent-hover: #93c5fd;
  --color-accent-light: rgba(96,165,250,0.1);
  --color-border: #333333;
  --color-footer-bg: #111111;
  --color-footer-text: #737373;
  --color-header-bg: rgba(26,26,26,0.88);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }

/* Sticky footer: body als flex-column, main wächst */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--color-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-accent-hover); text-decoration: underline; }

/* === Header === */
.site-header {
  background: var(--color-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s, border-color 0.3s;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.site-title a { color: inherit; }
.site-title a:hover { text-decoration: none; }

.site-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Navigation + Theme Toggle */
.nav-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 0.15rem;
}

nav a {
  display: block;
  padding: 0.4rem 0.7rem;
  font-size: 0.84rem;
  font-weight: 450;
  color: var(--color-text-secondary);
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

nav a:hover,
nav a.active {
  background: var(--color-accent-light);
  color: var(--color-accent);
  text-decoration: none;
}

/* Theme Toggle Button – fixiert oben rechts */
.theme-toggle {
  position: fixed;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 200;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* Icon-Wechsel: Sonne im Dark Mode, Mond im Light Mode */
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }

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

:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }

/* === Main Content === */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
  flex: 1;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

p { margin-bottom: 0.75rem; }

ul { margin: 0.5rem 0 1rem 1.25rem; }
li { margin-bottom: 0.25rem; }

/* === Startseite: Hero === */
.hero {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.hero-photo {
  width: 300px;
  min-width: 300px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.hero-text h1 {
  margin-bottom: 0.4rem;
}

.hero-text .subtitle {
  color: var(--color-accent);
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.hero-text p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

/* === Kompetenzen: Skill-Karten === */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.skill-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: box-shadow 0.2s, border-color 0.2s, background 0.3s;
}

.skill-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.skill-card h3 {
  margin-top: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.skill-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.skill-card li {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  padding: 0.15rem 0;
}

/* === Projekthistorie: XING-Style Timeline === */
.timeline {
  position: relative;
  margin-top: 1.5rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px 24px 1fr;
  gap: 0;
  margin-bottom: 0;
  position: relative;
}

.timeline-date {
  text-align: right;
  padding: 1.25rem 1rem 1.25rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.timeline-date .branch {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  opacity: 0.7;
  margin-top: 0.15rem;
}

.timeline-line {
  position: relative;
  display: flex;
  justify-content: center;
}

.timeline-line::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-line::after {
  content: '';
  position: absolute;
  top: 1.55rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-bg);
  z-index: 1;
}

.timeline-item:first-child .timeline-line::before { top: 1.55rem; }

.timeline-content {
  padding: 1rem 0 1.5rem 1.25rem;
}

.timeline-content h3 {
  margin-top: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.timeline-content ul {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
}

.timeline-content li {
  margin-bottom: 0.15rem;
}

.timeline-content .tech {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  opacity: 0.8;
  margin-top: 0.35rem;
  margin-bottom: 0;
}

/* === Impressum / Datenschutz === */
.legal-content h3 { margin-top: 2rem; }
.legal-content h4 { margin-top: 1.5rem; }

.legal-content h5 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

.legal-content p,
.legal-content li {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
}

/* === Footer === */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  border-top: 1px solid var(--color-border);
  transition: background 0.3s, color 0.3s;
}

.site-footer a { color: var(--color-footer-text); }

/* === Responsive === */
@media (max-width: 700px) {
  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-photo {
    width: 180px;
    min-width: auto;
  }

  .skills-grid { grid-template-columns: 1fr; }

  .header-inner {
    flex-direction: column;
    gap: 0.6rem;
  }

  .nav-wrap {
    width: 100%;
    justify-content: center;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }

  h1 { font-size: 1.4rem; }

  .timeline-item {
    grid-template-columns: 20px 1fr;
  }

  .timeline-date {
    grid-column: 2;
    text-align: left;
    padding: 0.75rem 0 0 0.75rem;
    font-size: 0.78rem;
  }

  .timeline-date .branch { display: inline; margin-left: 0.4rem; }

  .timeline-line {
    grid-row: span 2;
  }

  .timeline-content {
    padding: 0.25rem 0 1.25rem 0.75rem;
  }
}
