:root {
  --bg: #ffffff;
  --text: #111111;
  --text-muted: #4b5563;
  --primary: #000000;
  --accent: #8b5cf6;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 4px 30px rgba(0,0,0,0.07);
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --primary: #ffffff;
  --accent: #a78bfa;
  --card: #171717;
  --border: #2d3748;
  --shadow: 0 4px 30px rgba(49, 49, 49, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  transition: background 0.35s ease, color 0.35s ease;
}

/* Respect reduced motion preference */
@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;
  }
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  background: rgba(139, 92, 246, 0.18);
  transform: translateY(-1px);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
  color: #c4b5fd;
}

/* Navigation */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s;
}

[data-theme="dark"] nav {
  background: rgba(15,15,15,0.92);
}

nav .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

nav ul {
  display: flex;
  justify-content: center;
  gap: 2.25rem;
  list-style: none;
  padding: 1.1rem 0;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: color 0.25s;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-radius: 2px;
}

nav a:hover::after,
nav a.active::after {
  width: 80%;
}

[data-theme="dark"] nav a::after {
  background: #c4b5fd;
}

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

/* Hero & Typo */
.hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1rem 3rem;
}

.hero-inner {
  max-width: 920px;
  animation: fadeInUp 1.3s ease-out forwards;
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

h1 {
  font-size: clamp(5.5rem, 15vw, 11rem);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.88;
  margin-bottom: 1.6rem;

  background: linear-gradient(90deg, #000 0%, #222 30%, var(--accent) 60%, #d8b4fe 90%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;

  background-size: 200% 100%;
  animation: gradientFlow 18s ease infinite alternate;
}

[data-theme="dark"] h1 {
  background: linear-gradient(90deg, #e0e0ff 0%, #c4b5fd 25%, var(--accent) 55%, #a78bfa 80%, #e0e7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  background-size: 200% 100%;
  animation: gradientFlow 18s ease infinite alternate;
}

@keyframes gradientFlow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.tagline {
  font-size: 1.6rem;
  color: var(--text-muted);
  margin-bottom: 3.5rem;
}

.tagline-main   { display: block; font-weight: 600; }
.tagline-sub    { display: block; font-size: 0.78em; opacity: 0.85; margin-top: 0.5rem; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);       /* immer 3 Spalten auf Desktop */
  gap: 1.8rem;
  margin: 2rem 0 4rem;
}

@media (max-width: 1023px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

.skill-card {
  background: var(--card);
  padding: 2.2rem 1.8rem;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  transition: all 0.28s ease;
}

.skill-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}

.skill-card h3 {
  font-size: 1.45rem;
  margin-bottom: 0.8rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.8rem 1.8rem;
  background: var(--accent);
  color: #ffffff !important;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.28s ease;
  box-shadow: 0 4px 18px rgba(139,92,246,0.28);
  border: 1px solid rgba(139,92,246,0.4);
}

.btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 30px rgba(139,92,246,0.45);
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  color: #ffffff !important;
}

[data-theme="dark"] .btn {
  background: linear-gradient(135deg, #a78bfa, #c4b5fd);
  border-color: rgba(196,181,253,0.5);
}

/* Sections */
.section {
  max-width: 920px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 1.6rem;
  color: var(--primary);
}

.experience-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin: 3rem 0 1.2rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
}

.experience-heading::before {
  content: "→ ";
  color: var(--accent);
  margin-right: 0.4rem;
}

.friend-section {
  text-align: center;
  padding: 5rem 1.5rem;
}

footer {
  padding: 5rem 1.5rem 3rem;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
  nav ul { gap: 1.4rem; font-size: 0.95rem; }
  .hero { min-height: 60vh; padding-top: 6rem; }
  h1 { font-size: clamp(4.2rem, 13vw, 7.5rem); }
}
