/* ==========================================================================
   DESIGN SYSTEM & THEME TOKENS
   ========================================================================== */

:root {
  /* Font Families */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Raw Colors - Light Theme */
  --light-bg: oklch(98% 0.005 240);
  --light-bg-card: rgba(255, 255, 255, 0.45);
  --light-bg-card-hover: rgba(255, 255, 255, 0.65);
  --light-text: oklch(18% 0.015 240);
  --light-text-muted: oklch(45% 0.015 240);
  --light-primary: oklch(55% 0.25 290); /* Deep royal purple */
  --light-primary-hover: oklch(45% 0.25 290);
  --light-secondary: oklch(62% 0.23 340); /* Vivid magenta pink */
  --light-border: rgba(0, 0, 0, 0.08);
  --light-glow-1: rgba(147, 51, 234, 0.12);
  --light-glow-2: rgba(219, 39, 119, 0.08);
  --light-glow-3: rgba(16, 185, 129, 0.08);

  /* Raw Colors - Dark Theme */
  --dark-bg: oklch(10% 0.01 250);
  --dark-bg-card: rgba(20, 20, 28, 0.45);
  --dark-bg-card-hover: rgba(25, 25, 38, 0.65);
  --dark-text: oklch(93% 0.01 240);
  --dark-text-muted: oklch(68% 0.01 240);
  --dark-primary: oklch(75% 0.18 290); /* Radiant pastel purple */
  --dark-primary-hover: oklch(82% 0.15 290);
  --dark-secondary: oklch(76% 0.18 340); /* Pastel pink */
  --dark-border: rgba(255, 255, 255, 0.08);
  --dark-glow-1: rgba(168, 85, 247, 0.25);
  --dark-glow-2: rgba(236, 72, 153, 0.18);
  --dark-glow-3: rgba(52, 211, 153, 0.15);

  /* Fallback definitions for browsers without light-dark() support */
  --color-bg: var(--light-bg);
  --color-bg-card: var(--light-bg-card);
  --color-bg-card-hover: var(--light-bg-card-hover);
  --color-text: var(--light-text);
  --color-text-muted: var(--light-text-muted);
  --color-primary: var(--light-primary);
  --color-primary-hover: var(--light-primary-hover);
  --color-secondary: var(--light-secondary);
  --color-border: var(--light-border);
  --orb-glow-1: var(--light-glow-1);
  --orb-glow-2: var(--light-glow-2);
  --orb-glow-3: var(--light-glow-3);

  @media (prefers-color-scheme: dark) {
    --header-scrolled-bg: rgba(10, 10, 15, 0.85);
    --color-bg: var(--dark-bg);
    --color-bg-card: var(--dark-bg-card);
    --color-bg-card-hover: var(--dark-bg-card-hover);
    --color-text: var(--dark-text);
    --color-text-muted: var(--dark-text-muted);
    --color-primary: var(--dark-primary);
    --color-primary-hover: var(--dark-primary-hover);
    --color-secondary: var(--dark-secondary);
    --color-border: var(--dark-border);
    --orb-glow-1: var(--dark-glow-1);
    --orb-glow-2: var(--dark-glow-2);
    --orb-glow-3: var(--dark-glow-3);
  }

  /* MANDATORY: Modern light-dark() support (will overwrite fallbacks in modern engines) */
  @supports (color: light-dark(white, black)) {
    --color-bg: light-dark(var(--light-bg), var(--dark-bg));
    --color-bg-card: light-dark(var(--light-bg-card), var(--dark-bg-card));
    --color-bg-card-hover: light-dark(var(--light-bg-card-hover), var(--dark-bg-card-hover));
    --color-text: light-dark(var(--light-text), var(--dark-text));
    --color-text-muted: light-dark(var(--light-text-muted), var(--dark-text-muted));
    --color-primary: light-dark(var(--light-primary), var(--dark-primary));
    --color-primary-hover: light-dark(var(--light-primary-hover), var(--dark-primary-hover));
    --color-secondary: light-dark(var(--light-secondary), var(--dark-secondary));
    --color-border: light-dark(var(--light-border), var(--dark-border));
    --orb-glow-1: light-dark(var(--light-glow-1), var(--dark-glow-1));
    --orb-glow-2: light-dark(var(--light-glow-2), var(--dark-glow-2));
    --orb-glow-3: light-dark(var(--light-glow-3), var(--dark-glow-3));
  }

  /* Header scrolled background — defined as custom property so @keyframes
     and fallback class both respond to :root.light / :root.dark overrides.
     light-dark() inside @keyframes is broken in Chrome (crbug/1445743). */
  --header-scrolled-bg: rgba(247, 247, 249, 0.92);

  /* Scrollbar Settings */
  --color-scrollbar-track: light-dark(rgba(0,0,0,0.02), rgba(255,255,255,0.02));
  --color-scrollbar-thumb: light-dark(#cbcbd6, #424255);
  scrollbar-color: var(--color-scrollbar-thumb) var(--color-scrollbar-track);
  scrollbar-width: thin;

  /* Global Layout Variables */
  --container-max-width: 1200px;
  --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  
  /* Declare viewport-wide color-scheme */
  color-scheme: light dark;
}

:root.light {
  color-scheme: light;
  --header-scrolled-bg: rgba(247, 247, 249, 0.92);
  --color-bg: var(--light-bg);
  --color-bg-card: var(--light-bg-card);
  --color-bg-card-hover: var(--light-bg-card-hover);
  --color-text: var(--light-text);
  --color-text-muted: var(--light-text-muted);
  --color-primary: var(--light-primary);
  --color-primary-hover: var(--light-primary-hover);
  --color-secondary: var(--light-secondary);
  --color-border: var(--light-border);
  --orb-glow-1: var(--light-glow-1);
  --orb-glow-2: var(--light-glow-2);
  --orb-glow-3: var(--light-glow-3);
}

:root.dark {
  color-scheme: dark;
  --header-scrolled-bg: rgba(10, 10, 15, 0.85);
  --color-bg: var(--dark-bg);
  --color-bg-card: var(--dark-bg-card);
  --color-bg-card-hover: var(--dark-bg-card-hover);
  --color-text: var(--dark-text);
  --color-text-muted: var(--dark-text-muted);
  --color-primary: var(--dark-primary);
  --color-primary-hover: var(--dark-primary-hover);
  --color-secondary: var(--dark-secondary);
  --color-border: var(--dark-border);
  --orb-glow-1: var(--dark-glow-1);
  --orb-glow-2: var(--dark-glow-2);
  --orb-glow-3: var(--dark-glow-3);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  accent-color: var(--color-primary);
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* Legacy Scrollbar Fallback */
@supports not (scrollbar-color: auto) {
  body::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  body::-webkit-scrollbar-thumb {
    background: var(--color-scrollbar-thumb);
    border-radius: 5px;
  }
  body::-webkit-scrollbar-track {
    background: var(--color-scrollbar-track);
  }
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

/* Typografie */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

p {
  color: var(--color-text-muted);
}

/* ==========================================================================
   AMBIENT GLOW EFFECTS
   ========================================================================== */

.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  animation: float 25s infinite alternate ease-in-out;
  will-change: transform;
}

.orb-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: var(--orb-glow-1);
}

.orb-2 {
  bottom: -15%;
  right: -10%;
  width: 55vw;
  height: 55vw;
  background: var(--orb-glow-2);
  animation-delay: -7s;
}

.orb-3 {
  top: 40%;
  left: 35%;
  width: 40vw;
  height: 40vw;
  background: var(--orb-glow-3);
  animation-delay: -14s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 7%) scale(1.1); }
  100% { transform: translate(-5%, -5%) scale(0.95); }
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

@keyframes shrink {
  to {
    height: 70px;
    background-color: var(--header-scrolled-bg);
    box-shadow: 0 10px 40px -15px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
  }
}

header {
  position: fixed;
  height: 105px;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background-color var(--transition-smooth), border var(--transition-smooth), height var(--transition-smooth), box-shadow var(--transition-smooth);
  border-bottom: 1px solid transparent;
}

/* Apply CSS scroll-driven animation natively if supported */
@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  header {
    animation: shrink auto linear both;
    animation-timeline: scroll(block root);
    animation-range: 0px 120px;
  }
}

/* Fallback class for browsers without scroll-driven animations support */
header.scrolled-fallback {
  height: 70px;
  background-color: var(--header-scrolled-bg);
  box-shadow: 0 10px 40px -15px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
}

.header-container {
  width: 90%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
}

.logo-accent {
  opacity: 0.8;
  font-weight: 500;
  margin: 0 2px;
}

/* Desktop Menu */
.desktop-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transition: var(--transition-smooth);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Header Actions & Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-btn {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  background: var(--color-bg-card-hover);
  transform: scale(1.05);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(147, 51, 234, 0.15);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Theme Toggle Icons Logic */
.moon-icon { display: block; }
.sun-icon { display: none; }

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

/* System preferences theme visibility if no class is present */
@media (prefers-color-scheme: dark) {
  :root:not([class="light"]) .moon-icon { display: none; }
  :root:not([class="light"]) .sun-icon { display: block; }
}

/* ==========================================================================
   MOBILE POPOVER DRAWER
   ========================================================================== */

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  
  .mobile-only {
    display: flex;
  }
}

.mobile-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  width: 320px;
  height: 100vh;
  margin: 0;
  border: none;
  border-left: 1px solid var(--color-border);
  background: light-dark(rgba(255, 255, 255, 0.95), rgba(12, 12, 17, 0.95));
  backdrop-filter: blur(24px);
  padding: 30px;
  box-shadow: -15px 0 50px -10px rgba(0, 0, 0, 0.3);
  z-index: 200;
  
  /* Native sliding entrance transition */
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), display 0.4s allow-discrete, overlay 0.4s allow-discrete;
  transition-behavior: allow-discrete;
}

.mobile-drawer:popover-open {
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  
  @starting-style {
    transform: translateX(100%);
  }
}

.mobile-drawer::backdrop {
  background-color: rgba(0, 0, 0, 0);
  transition: display 0.4s allow-discrete, overlay 0.4s allow-discrete, background-color 0.4s ease-out;
}

.mobile-drawer:popover-open::backdrop {
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  
  @starting-style {
    background-color: rgba(0, 0, 0, 0);
  }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.drawer-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.drawer-nav ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  gap: 1.5rem;
}

.drawer-link {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-muted);
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.drawer-link:hover {
  color: var(--color-primary);
  transform: translateX(8px);
}

/* ==========================================================================
   GLOBAL LAYOUT & COMPONENT CLASSES
   ========================================================================== */

section {
  padding: 120px 0;
  position: relative;
}

.section-container {
  width: 90%;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.section-header {
  margin-bottom: 4rem;
  text-align: center;
}

.section-subtitle {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -1px;
}

/* Buttons */
.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.btn.primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  box-shadow: 0 10px 25px -5px rgba(147, 51, 234, 0.3);
}

.btn.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px -5px rgba(147, 51, 234, 0.45);
}

.btn.secondary {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  backdrop-filter: blur(8px);
}

.btn.secondary:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-primary);
  transform: translateY(-3px);
}

.btn.full-width {
  width: 100%;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  transition: var(--transition-smooth);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05);
}

.glass-card:hover {
  background: var(--color-bg-card-hover);
  border-color: rgba(147, 51, 234, 0.25);
  box-shadow: 0 30px 50px -15px rgba(147, 51, 234, 0.1);
}

.badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  background: rgba(147, 51, 234, 0.1);
  border: 1px solid rgba(147, 51, 234, 0.2);
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 50px;
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 140px;
  padding-bottom: 60px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-lead {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 2.5rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Hero visual code card decoration */
.hero-card-wrapper {
  position: relative;
}

.hero-card-wrapper::after {
  content: '';
  position: absolute;
  inset: -15px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: calc(var(--border-radius-lg) + 5px);
  z-index: -1;
  opacity: 0.2;
  filter: blur(20px);
}

.decorative-card {
  padding: 30px;
  font-family: monospace;
  font-size: 0.9rem;
  text-align: left;
}

.card-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 1.5rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: #22c55e; }

.decorative-code {
  color: var(--color-text-muted);
}

.code-keyword { color: #db2777; font-weight: bold; }
.code-variable { color: var(--color-primary); }
.code-string { color: #16a34a; }
.code-comment { color: #88889b; font-style: italic; }

/* Scroll Indicator Mouse */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  text-align: center;
}

.scroll-indicator a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-text-muted);
}

.scroll-indicator a:hover {
  color: var(--color-primary);
}

.mouse {
  width: 26px;
  height: 44px;
  border: 2px solid var(--color-text-muted);
  border-radius: 20px;
  position: relative;
  transition: var(--transition-smooth);
}

.scroll-indicator a:hover .mouse {
  border-color: var(--color-primary);
}

.wheel {
  width: 4px;
  height: 8px;
  background-color: var(--color-text-muted);
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollMouse 1.8s infinite;
}

.scroll-indicator a:hover .wheel {
  background-color: var(--color-primary);
}

@keyframes scrollMouse {
  0% { opacity: 0; transform: translate(-50%, 0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 15px); }
}

@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-card-wrapper {
    max-width: 500px;
    margin: 0 auto;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2.75rem;
  }
}

/* ==========================================================================
   ÜBER MICH (ABOUT ME) SECTION
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.about-bio-panel h3,
.about-timeline-panel h3 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 10px;
}

.about-bio-panel p {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.skill-tag {
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--color-scrollbar-track);
  border: 1px solid var(--color-border);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  color: var(--color-text);
  transition: var(--transition-smooth);
}

.skill-tag:hover {
  background: rgba(147, 51, 234, 0.08);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

/* Career Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  padding-left: 20px;
}

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

.timeline-item {
  position: relative;
}

.timeline-badge {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: -24px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-primary);
  transition: var(--transition-smooth);
}

.timeline-item:hover::after {
  background: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary);
}

.timeline-content h4 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.timeline-content p {
  font-size: 0.95rem;
}

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

/* ==========================================================================
   PROJEKTE (PORTFOLIO) SECTION
   ========================================================================== */

.portfolio-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: var(--transition-smooth);
}

.filter-btn:hover,
.filter-btn.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  border-color: transparent;
  box-shadow: 0 10px 20px -5px rgba(147, 51, 234, 0.25);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2.5rem;
}

.project-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-img-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: calc(var(--border-radius-md));
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* Premium gradient visual placeholders */
.project-visual-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-smooth);
}

.gradient-blue-purple {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.gradient-sunset {
  background: linear-gradient(135deg, #f43f5e, #f97316);
}

.gradient-emerald {
  background: linear-gradient(135deg, #10b981, #06b6d4);
}

.placeholder-icon {
  width: 50px;
  height: 50px;
  opacity: 0.9;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.15));
}

.project-card:hover .project-visual-placeholder {
  transform: scale(1.08);
}

.project-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-category {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.project-info h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.project-info p {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tags span {
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--color-scrollbar-track);
  border: 1px solid var(--color-border);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
}

/* Animated category filter hide/show logic */
.project-card.hidden {
  display: none;
}

/* ==========================================================================
   NEWS & UPDATES SECTION
   ========================================================================== */

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2.5rem;
}

.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.news-meta time {
  color: var(--color-text-muted);
}

.news-tag {
  color: var(--color-secondary);
}

.news-card h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.news-snippet {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.text-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  transition: var(--transition-smooth);
}

.text-link:hover {
  color: var(--color-secondary);
  transform: translateX(5px);
}

/* ==========================================================================
   KONTAKT (CONTACT) SECTION
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4rem;
  align-items: stretch;
}

.contact-info-panel h3,
.contact-form-panel h3 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.contact-info-panel p {
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.detail-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(147, 51, 234, 0.1);
  color: var(--color-primary);
  padding: 10px;
  flex-shrink: 0;
  border: 1px solid rgba(147, 51, 234, 0.2);
}

.detail-item span {
  font-weight: 500;
}

/* Form Styling & Floating Labels */
.contact-form-panel {
  position: relative;
  overflow: hidden;
}

.input-group {
  position: relative;
  margin-bottom: 2rem;
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--color-scrollbar-track);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  transition: var(--transition-smooth);
}

.input-group textarea {
  resize: vertical;
}

/* Floating Label Animation */
.input-group label {
  position: absolute;
  left: 1.25rem;
  top: 1rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  pointer-events: none;
  transition: var(--transition-smooth);
}

/* Float logic based on focus and placeholder hack */
.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:focus ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
  top: -0.6rem;
  left: 0.75rem;
  font-size: 0.75rem;
  padding: 0 0.5rem;
  background: var(--color-bg);
  border-radius: 4px;
  color: var(--color-primary);
  font-weight: 600;
}

/* Validation border colors */
.input-group input:focus,
.input-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(147, 51, 234, 0.1);
}

.input-group input.is-invalid,
.input-group textarea.is-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.1) !important;
}

.input-group input.is-invalid ~ label,
.input-group textarea.is-invalid ~ label {
  color: #ef4444 !important;
}

/* Error message styles */
.error-msg {
  position: absolute;
  bottom: -1.25rem;
  left: 0.5rem;
  font-size: 0.75rem;
  color: #ef4444;
  font-weight: 500;
  display: block;
}

/* Spinner for submitting state */
.spinner {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.opacity-25 { opacity: 0.25; }
.opacity-75 { opacity: 0.75; }

/* Success Overlay card styling */
.success-overlay {
  position: absolute;
  inset: 0;
  background: var(--color-bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 10;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.success-overlay:not(.hidden) {
  opacity: 1;
  transform: scale(1);
}

.success-icon-badge {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.success-icon-badge svg {
  width: 32px;
  height: 32px;
}

.text-center {
  text-align: center;
}

.success-content h3 {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}

.success-content p {
  margin-bottom: 2rem;
}

@media (max-width: 992px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}


/* ==========================================================================
   NEWS FEED (Compact Card Format)
   ========================================================================== */

.news-feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.news-feed-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-feed-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.news-feed-card h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
}

.news-feed-snippet {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  flex: 1;
}

.news-feed-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: auto;
  transition: var(--transition-smooth);
}

.news-feed-link:hover {
  gap: 0.5rem;
}

/* Two-row filter wrapper */
.news-filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 3rem;
}
.news-filters-wrapper .portfolio-filters {
  margin-bottom: 0;
}

/* Load More button */
.news-load-more {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}
.news-load-more-btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 0.75rem 2.5rem;
  border-radius: 50px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: var(--transition-smooth);
}
.news-load-more-btn:hover {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  border-color: transparent;
  box-shadow: 0 10px 20px -5px rgba(147, 51, 234, 0.25);
}

/* News card hidden (filter) */
.news-feed-card.hidden {
  display: none;
}

/* Meta: tag left, date right */
.news-feed-meta {
  justify-content: space-between;
}

.news-feed-meta time {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-left: auto;
}

/* Footer: source + read link */
.news-feed-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.news-source {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* Loading / empty state */
.news-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  padding: 3rem 0;
}

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

/* === NEWS: UNDER CONSTRUCTION (kept for archival reference) === */

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
  background: var(--color-scrollbar-track);
  border-top: 1px solid var(--color-border);
  padding: 50px 0;
}

.footer-container {
  width: 90%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.copyright {
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

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

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

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
}

/* ==========================================================================
   MODERN PORTAL DIALOGS (Top-layer animations)
   ========================================================================== */

dialog.news-dialog {
  border: 1px solid var(--color-border);
  background: light-dark(rgba(255, 255, 255, 0.92), rgba(15, 15, 22, 0.92));
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  max-width: 700px;
  width: 90%;
  margin: auto;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.4);
  color: var(--color-text);
  
  /* Initial exit/closed state */
  opacity: 0;
  transform: scale(0.96) translateY(20px);
  
  /* MANDATORY discrete transitions */
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.4s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  transition-behavior: allow-discrete;
}

dialog.news-dialog[open] {
  opacity: 1;
  transform: scale(1) translateY(0);
  
  /* MANDATORY starting style for entries */
  @starting-style {
    opacity: 0;
    transform: scale(0.96) translateY(20px);
  }
}

dialog.news-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  transition:
    display 0.4s allow-discrete,
    overlay 0.4s allow-discrete,
    background-color 0.4s ease-out,
    backdrop-filter 0.4s ease-out;
}

dialog.news-dialog[open]::backdrop {
  background-color: light-dark(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.7));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  
  @starting-style {
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
  }
}

.dialog-content {
  display: flex;
  flex-direction: column;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dialog-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.dialog-meta time {
  color: var(--color-text-muted);
}

.dialog-tag {
  color: var(--color-secondary);
}

.news-dialog h2 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 2rem;
  letter-spacing: -0.5px;
}

.dialog-body {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 15px;
}

/* Dialog body text elements */
.dialog-body p {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}

.dialog-body blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.5rem;
  background: var(--color-scrollbar-track);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--color-text);
  margin: 2rem 0;
}

.dialog-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.dialog-body li {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
  color: var(--color-text-muted);
}

.dialog-body pre {
  background: #111118;
  color: #a78bfa;
  padding: 1.25rem;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   BORDER GLOW EFFECT (21st.dev Spotlight-Card style)
   Nur auf den 4 statischen Panels: Mein Weg, Werdegang, Kontakt (2×).
   Cursor-gesteuerter Rahmen-Glow via background-attachment: fixed —
   --x/--y sind globale Viewport-Koordinaten (clientX/clientY, gesetzt
   via JS auf :root). Eine CSS-Maske beschränkt den Schein auf den Rahmen.
   ========================================================================== */

/* Position-Kontext + Glow-Variablen für die 4 statischen Panels */
.about-bio-panel,
.about-timeline-panel,
.contact-info-panel,
.contact-form-panel {
  position: relative;
  --base: 280;
  --spread: 60;
  --size: 300;
  --border: 2;
  --saturation: 100;
  --lightness: 55;
  --border-spot-opacity: 0.75;
  --border-light-opacity: 0.4;
  --hue: calc(var(--base) + (var(--xp, 0) * var(--spread)));
  --border-size: calc(var(--border) * 1px);
  --spotlight-size: calc(var(--size) * 1px);
}

/* Dark Mode: stärkerer Glow */
:root.dark .about-bio-panel,
:root.dark .about-timeline-panel,
:root.dark .contact-info-panel,
:root.dark .contact-form-panel {
  --border-spot-opacity: 1;
  --border-light-opacity: 0.6;
  --lightness: 65;
}

@media (prefers-color-scheme: dark) {
  :root:not([class="light"]) .about-bio-panel,
  :root:not([class="light"]) .about-timeline-panel,
  :root:not([class="light"]) .contact-info-panel,
  :root:not([class="light"]) .contact-form-panel {
    --border-spot-opacity: 1;
    --border-light-opacity: 0.6;
    --lightness: 65;
  }
}

/* Gemeinsames Setup für beide Pseudo-Elemente:
   background-attachment: fixed → Gradient in Viewport-Koordinaten
   background-size: leicht größer als die Karte (kompensiert den Inset)
   background-position: 50% 50% → zentriert auf die Karte */
.about-bio-panel::before,
.about-bio-panel::after,
.about-timeline-panel::before,
.about-timeline-panel::after,
.contact-info-panel::before,
.contact-info-panel::after,
.contact-form-panel::before,
.contact-form-panel::after {
  pointer-events: none;
  content: "";
  position: absolute;
  inset: calc(var(--border-size) * -1);
  border: var(--border-size) solid transparent;
  border-radius: inherit;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: calc(100% + (2 * var(--border-size))) calc(100% + (2 * var(--border-size)));
  mask: linear-gradient(transparent, transparent), linear-gradient(white, white);
  mask-clip: padding-box, border-box;
  mask-composite: intersect;
}

/* ::before — farbiger Glow-Layer (Violett/Pink, brightness x2) */
.about-bio-panel::before,
.about-timeline-panel::before,
.contact-info-panel::before,
.contact-form-panel::before {
  background-image: radial-gradient(
    calc(var(--spotlight-size) * 0.75) calc(var(--spotlight-size) * 0.75) at
    calc(var(--x, -9999) * 1px)
    calc(var(--y, -9999) * 1px),
    hsl(
      var(--hue, 280)
      calc(var(--saturation, 100) * 1%)
      calc(var(--lightness, 55) * 1%) /
      var(--border-spot-opacity, 0.75)
    ),
    transparent 100%
  );
  filter: brightness(2);
}

/* ::after — weißer Helligkeits-Layer (Schärfe des Glow-Zentrums) */
.about-bio-panel::after,
.about-timeline-panel::after,
.contact-info-panel::after,
.contact-form-panel::after {
  background-image: radial-gradient(
    calc(var(--spotlight-size) * 0.5) calc(var(--spotlight-size) * 0.5) at
    calc(var(--x, -9999) * 1px)
    calc(var(--y, -9999) * 1px),
    hsl(0 100% 100% / var(--border-light-opacity, 0.4)),
    transparent 100%
  );
}

/* ==========================================================================
   ACCESSIBILITY & PREFERS-REDUCED-MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  body, html {
    scroll-behavior: auto;
  }

  /* Border-Glow-Effekt deaktivieren */
  .about-bio-panel::before,
  .about-bio-panel::after,
  .about-timeline-panel::before,
  .about-timeline-panel::after,
  .contact-info-panel::before,
  .contact-info-panel::after,
  .contact-form-panel::before,
  .contact-form-panel::after {
    display: none;
  }

  .orb {
    animation: none;
  }
  
  dialog.news-dialog,
  .mobile-drawer {
    transform: none !important;
    transition-duration: 0.1s !important;
  }
  
  dialog.news-dialog[open] {
    @starting-style {
      transform: none !important;
    }
  }
  
  .mobile-drawer:popover-open {
    @starting-style {
      transform: none !important;
    }
  }
  
  .mouse, .wheel {
    animation: none;
  }
  
  .project-visual-placeholder {
    transform: none !important;
  }
}

/* === PROFILE PHOTO === */
.profile-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 10px;
}

.profile-heading h3 {
  margin-bottom: 0 !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.profile-photo {
  width: 108px !important;
  height: 108px !important;
  max-width: 108px !important;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

/* === NEWS: UNDER CONSTRUCTION === */
.section-under-construction {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted, #a0a0b0);
  letter-spacing: 0.02em;
}
