/* ============================================
   Tinybrickboy Inspired — Glassmorphism Theme
   ============================================ */

:root {
  /* Primäre Farben */
  --primary: #2f74ff;
  --primary-2: #6366f1;
  --accent: #a855f7;
  --accent-2: #ec4899;

  /* Hintergrund & Text (Light Mode) */
  --bg: #eef2f9;
  --bg-2: #e3e9f5;
  --text: #0b1020;
  --text-2: #51607a;
  --text-3: #8a97ad;

  /* Glass Materials */
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-soft: rgba(255, 255, 255, 0.38);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-border-2: rgba(15, 23, 42, 0.08);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  --glass-blur: blur(28px) saturate(180%);

  /* Shadows */
  --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.10);
  --shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 30px 70px -24px rgba(15, 23, 42, 0.28);
  --shadow-glow: 0 24px 60px -24px rgba(47, 116, 255, 0.45);

  /* Radius */
  --radius-sm: 0.625rem;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --radius-pill: 9999px;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #2f74ff 0%, #6366f1 50%, #a855f7 100%);
  --grad-warm: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #a855f7 100%);
}

.dark {
  /* Dark Mode */
  --bg: #060912;
  --bg-2: #0a0f1f;
  --text: #f2f5fb;
  --text-2: #9aa6bd;
  --text-3: #5d6b86;

  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(22, 29, 51, 0.62);
  --glass-soft: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-2: rgba(255, 255, 255, 0.08);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.04);

  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 40px 80px -24px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 30px 80px -24px rgba(99, 102, 241, 0.5);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  position: relative;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

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

button {
  font: inherit;
  cursor: pointer;
}

::selection {
  background: rgba(47, 116, 255, 0.28);
  color: var(--text);
}

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

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   Ambient Background — Animated Blobs
   ============================================ */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.ambient::before {
  content: '';
  position: absolute;
  width: 50vw;
  height: 50vw;
  max-width: 640px;
  max-height: 640px;
  background: radial-gradient(circle, #2f74ff 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(90px);
  top: -10%;
  left: -10%;
  opacity: 0.5;
  animation: float 25s infinite ease-in-out;
}

.dark .ambient::before {
  opacity: 0.25;
}

.ambient::after {
  content: '';
  position: absolute;
  width: 46vw;
  height: 46vw;
  max-width: 600px;
  max-height: 600px;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(90px);
  bottom: -12%;
  right: -10%;
  opacity: 0.5;
  animation: float-reverse 30s infinite ease-in-out;
}

.dark .ambient::after {
  opacity: 0.25;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}

@keyframes float-reverse {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-40px, 40px); }
}

/* ============================================
   Header — Sticky Glassmorphism Nav
   ============================================ */
.site-header {
  position: sticky;
  top: 0.75rem;
  z-index: 100;
  margin: 0.75rem auto 0;
  max-width: 1180px;
  padding: 0 1.5rem;
}

.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 3.5rem;
  padding: 0 0.5rem 0 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), 0 8px 24px -12px rgba(15, 23, 42, 0.18);
  transition: all 0.3s ease;
}

.site-header.scrolled .header-nav {
  box-shadow: var(--glass-highlight), var(--shadow-lg);
}

.site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.nav-menu {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.4rem;
  padding: 0 1rem;
  border-radius: var(--radius-pill);
  color: var(--text-2);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  position: relative;
}

.nav-menu a:hover {
  color: var(--text);
  background: var(--glass);
}

.nav-menu a.active {
  color: var(--primary);
  background: var(--glass-soft);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-2);
  cursor: pointer;
  font-size: 0.95rem;
  box-shadow: var(--glass-highlight);
  transition: all 0.2s ease;
  margin-left: 0.5rem;
}

.icon-btn:hover {
  color: var(--text);
  transform: translateY(-2px);
  background: var(--glass-strong);
}

/* ============================================
   Scroll Progress Bar
   ============================================ */
#scrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--grad-primary);
  transform-origin: left;
  z-index: 200;
  transform: scaleX(0);
  transition: transform 0.1s linear;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  color: var(--text-2);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-secondary {
  background: var(--glass);
  color: var(--primary);
  border-color: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-highlight);
}

.btn-secondary:hover {
  background: var(--glass-strong);
  transform: translateY(-2px);
}

/* ============================================
   Sections
   ============================================ */
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  scroll-margin-top: 6rem;
}

.section-title {
  font-size: clamp(1.875rem, 5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  display: inline-block;
  width: 100%;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--grad-primary);
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* ============================================
   Cards — Glass Effect
   ============================================ */
.glass-card {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-highlight), var(--shadow);
  padding: 2rem;
  transition: all 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-highlight), var(--shadow-lg);
  border-color: var(--glass-border);
}

/* ============================================
   Grid Layouts
   ============================================ */
.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

@media (max-width: 768px) {
  .grid,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Project Cards
   ============================================ */
.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--grad-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-bottom: 1.5rem;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.project-description {
  color: var(--text-2);
  margin-bottom: 1.5rem;
  flex-grow: 1;
  font-size: 0.95rem;
  line-height: 1.6;
}

.tag {
  display: inline-block;
  background: var(--glass-soft);
  color: var(--primary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--glass-border);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.project-link:hover {
  gap: 0.75rem;
}

/* ============================================
   Skills Section
   ============================================ */
.skill-category {
  padding: 2rem;
}

.skill-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.2s ease;
}

.skill-item::before {
  content: '→';
  color: var(--primary);
  font-weight: bold;
  transition: all 0.2s ease;
}

.skill-item:hover {
  color: var(--text);
}

.skill-item:hover::before {
  transform: translateX(4px);
}

/* ============================================
   Stats Section
   ============================================ */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  padding: 3rem;
  border-radius: var(--radius-lg);
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 900;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.stat-label {
  font-size: 1rem;
  color: var(--text-2);
  font-weight: 500;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  margin-top: 4rem;
  padding: 2.5rem 1.5rem 3rem;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
  text-align: center;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.footer-nav a {
  color: var(--text-2);
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--primary);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-3);
}

.heart {
  color: var(--accent-2);
}

/* ============================================
   Animations
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Spotlight effect */
[data-spot] {
  position: relative;
}

[data-spot]::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(800px circle at var(--mx, 0) var(--my, 0), rgba(47, 116, 255, 0.1) 0%, transparent 80%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

[data-spot]:hover::before {
  opacity: 1;
}

/* ============================================
   Koenig Editor Styles
   ============================================ */
.kg-width-wide {
  margin-left: -2rem;
  margin-right: -2rem;
  width: calc(100% + 4rem);
}

.kg-width-full {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}

.kg-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

.kg-card {
  margin: 2rem 0;
}

/* ============================================
   Mobile Styles
   ============================================ */
@media (max-width: 768px) {
  .site-header {
    top: 0.5rem;
    margin: 0.5rem auto 0;
    padding: 0 1rem;
  }

  .header-nav {
    height: 3rem;
    padding: 0 0.5rem 0 1rem;
  }

  .nav-menu {
    display: none;
  }

  .hero {
    padding: 3rem 0 2rem;
  }

  .section {
    padding: 3rem 1.5rem;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

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

  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 2rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .kg-width-wide {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    width: calc(100% + 3rem);
  }
}

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