/*
  Webseite Neu – Michael Zettelmaier
  Design: Dark / Gold / Tech
*/

:root {
  --bg: #07070a;
  --bg2: #0c0c12;
  --text: #f2f2f5;
  --muted: rgba(242,242,245,0.75);
  --gold: #d4af37;
  --gold2: #b9912b;
  --line: rgba(212,175,55,0.18);
  --panel: rgba(10,10,16,0.62);
  --panel2: rgba(14,14,22,0.68);
  --shadow: 0 18px 60px rgba(0,0,0,0.55);
  --radius: 18px;
  --max: 1160px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Open Sans", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(212,175,55,0.12), transparent 58%),
    radial-gradient(1200px 800px at 80% 0%, rgba(212,175,55,0.06), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }

/* Fixed background layers */
#cesiumContainer,
#earth-canvas,
#matrix-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

/* Cesium must not block page interactions */
#cesiumContainer {
  z-index: -3;
  pointer-events: none;
}
#cesiumContainer canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
#cesiumContainer .cesium-widget-credits {
  opacity: 0.65;
  font-size: 10px;
  transform: scale(0.92);
  transform-origin: left bottom;
}

#earth-canvas { z-index: -3; }
#matrix-canvas {
  z-index: -2;
  opacity: var(--matrix-opacity, 0.35);
  mix-blend-mode: screen;
  transition: opacity 240ms ease;
}

/* Subtle vignette + glass haze */
.bg-haze {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 20% 25%, rgba(212,175,55,0.12), transparent 65%),
    radial-gradient(900px 520px at 80% 35%, rgba(0,160,255,0.10), transparent 68%),
    radial-gradient(1200px 800px at 50% 75%, rgba(0,0,0,0.55), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,0.30), rgba(0,0,0,0.62));
}

.container { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(7,7,10,0.58);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.4px;
}
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: var(--shadow); }
.brand .title { font-weight: 650; }
.brand .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.nav {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: rgba(242,242,245,0.88);
  font-size: 14px;
}
.nav a.active,
.nav a:hover {
  border-color: var(--line);
  background: rgba(212,175,55,0.07);
  color: var(--text);
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dropdown-toggle::after {
  content: "▾";
  font-size: 12px;
  opacity: 0.75;
}
.dropdown-content {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,10,16,0.92), rgba(14,14,22,0.94));
  box-shadow: var(--shadow);
  display: none;
  z-index: 80;
}
.dropdown-content a {
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
}
.dropdown-content a:hover {
  border-color: var(--line);
  background: rgba(212,175,55,0.07);
}
.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
  display: block;
}

.lang {
  display: inline-flex;
  gap: 8px;
  border-left: 1px solid var(--line);
  padding-left: 12px;
  margin-left: 6px;
}
.lang a {
  opacity: 0.85;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.lang a.active {
  opacity: 1;
  border-color: rgba(212,175,55,0.35);
  background: rgba(212,175,55,0.08);
}

/* Hero */
.hero { padding: 64px 0 28px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: start;
}
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel.pad { padding: 26px; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(212,175,55,0.06);
  color: rgba(212,175,55,0.95);
  font-weight: 600;
  font-size: 13px;
}

.h1 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.05;
  margin: 14px 0 10px;
  letter-spacing: -0.8px;
}
.lead { color: var(--muted); font-size: 16px; line-height: 1.65; max-width: 64ch; }

.typed {
  display: inline-block;
  min-height: 1.2em;
  border-right: 2px solid rgba(212,175,55,0.65);
  padding-right: 4px;
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: background-color 140ms ease, border-color 140ms ease, transform 120ms ease, box-shadow 140ms ease;
}
.btn.primary {
  background: linear-gradient(135deg, rgba(212,175,55,0.32), rgba(212,175,55,0.16));
  border-color: rgba(212,175,55,0.55);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}
.btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.04);
  border-color: rgba(212,175,55,0.45);
  box-shadow: 0 14px 36px rgba(0,0,0,0.55);
}

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stat { padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(0,0,0,0.18); }
.stat b { display: block; color: rgba(212,175,55,0.95); font-size: 16px; }
.stat span { color: var(--muted); font-size: 12px; }

/* Sections */
.section { padding: 28px 0; }
.section h2 { margin: 0 0 12px; letter-spacing: -0.3px; }
.section p { margin: 0 0 12px; color: var(--muted); line-height: 1.7; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
  position: relative;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(420px 240px at 20% 20%, rgba(212,175,55,0.16), transparent 60%);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}
.card:hover::after { opacity: 1; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card ul { margin: 10px 0 0 18px; color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(242,242,245,0.78);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(212,175,55,0.05);
}

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.thumb {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.20);
  overflow: hidden;
  cursor: pointer;
}
.thumb img,
.thumb video { width: 100%; height: 220px; object-fit: cover; display: block; }
.thumb .cap { padding: 10px 12px; color: var(--muted); font-size: 12px; }

/* Footer */
.footer {
  margin-top: 42px;
  border-top: 1px solid var(--line);
  padding: 18px 0 42px;
  background: rgba(0,0,0,0.16);
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-inner img { width: 30px; height: 30px; border-radius: 10px; }
.footer small { color: var(--muted); }

/* Forms */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { color: rgba(242,242,245,0.85); font-size: 13px; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(212,175,55,0.20);
  background: rgba(0,0,0,0.22);
  color: var(--text);
  outline: none;
}
.field input:focus, .field textarea:focus {
  border-color: rgba(212,175,55,0.55);
  box-shadow: 0 0 0 4px rgba(212,175,55,0.12);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,0.3);
  z-index: 100;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger span:nth-child(1) { margin-bottom: 5px; }
.hamburger span:nth-child(3) { margin-top: 5px; }

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Navigation */
@media (max-width: 980px) {

  .hamburger {
    display: flex;
  }

  .nav {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 80px 24px 24px;
    background: rgba(7,7,10,0.97);
    backdrop-filter: blur(20px);
    z-index: 90;
    overflow-y: auto;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
  }

  .nav.open {
    transform: translateY(0);
  }

  .nav > a,
  .nav .dropdown {
    width: 100%;
  }

  .nav > a {
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(0,0,0,0.2);
  }

  /* Dropdowns Mobile */
  .dropdown {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .dropdown-toggle {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(0,0,0,0.2);
    justify-content: space-between;
    cursor: pointer;
  }

  .dropdown-content {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(20,20,30,0.95);
    width: 100%;
    box-shadow: none;
  }

  .dropdown.open .dropdown-content {
    display: flex;
  }

  .dropdown-content a {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(0,0,0,0.15);
  }

  .dropdown-content a:hover {
    background: rgba(212,175,55,0.07);
    border-color: var(--line);
  }

  /* Language Switcher Mobile */
  .lang {
    display: flex;
    justify-content: center;
    border-left: none;
    border-top: 1px solid var(--line);
    padding-top: 16px;
    margin-top: 16px;
    gap: 12px;
  }

  .lang a {
    padding: 10px 20px;
    font-size: 15px;
  }
}
/* Tablet breakpoint */
@media (max-width: 768px) {
  .container { width: calc(100% - 32px); }
  .hero { padding: 40px 0 20px; }
  .panel.pad { padding: 20px; }
  .h1 { font-size: clamp(28px, 5vw, 40px); }
  .cta-row { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}

/* Small mobile */
@media (max-width: 480px) {
  .brand .title { font-size: 14px; }
  .brand img { width: 32px; height: 32px; }
  .header-inner { padding: 10px 0; }
}

.scroll-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.65);
  color: var(--text);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease, background-color 140ms ease, border-color 140ms ease;
}
.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.scroll-top:hover {
  background: rgba(0,0,0,0.8);
  border-color: rgba(212,175,55,0.5);
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ========================================
   PRELOADER
   ======================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.preloader-text {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.5px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   LIGHTBOX
   ======================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.active {
  opacity: 1;
  visibility: visible;
}
.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.lightbox.active .lightbox-content {
  transform: scale(1);
}
.lightbox img,
.lightbox video {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 12px;
  display: block;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.lightbox-close:hover {
  background: rgba(212,175,55,0.3);
  border-color: var(--gold);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.lightbox-nav:hover {
  background: rgba(212,175,55,0.3);
  border-color: var(--gold);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  max-width: 80%;
}

/* ========================================
   COOKIE BANNER
   ======================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: linear-gradient(180deg, rgba(10,10,16,0.98), rgba(7,7,10,0.99));
  border-top: 1px solid var(--line);
  padding: 16px 24px;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}
.cookie-banner.visible {
  transform: translateY(0);
}
.cookie-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.cookie-text {
  flex: 1;
  min-width: 280px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.cookie-text a {
  color: var(--gold);
  text-decoration: underline;
}
.cookie-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.cookie-btn:hover {
  border-color: var(--gold);
  background: rgba(212,175,55,0.1);
}
.cookie-btn.accept {
  background: linear-gradient(135deg, rgba(212,175,55,0.3), rgba(212,175,55,0.15));
  border-color: rgba(212,175,55,0.5);
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered animation delays for cards */
.card:nth-child(1) { transition-delay: 0.1s; }
.card:nth-child(2) { transition-delay: 0.2s; }
.card:nth-child(3) { transition-delay: 0.3s; }
.card:nth-child(4) { transition-delay: 0.4s; }
.card:nth-child(5) { transition-delay: 0.5s; }
.card:nth-child(6) { transition-delay: 0.6s; }

.thumb:nth-child(1) { transition-delay: 0.1s; }
.thumb:nth-child(2) { transition-delay: 0.2s; }
.thumb:nth-child(3) { transition-delay: 0.3s; }

/* ========================================
   PORTFOLIO FILTER
   ======================================== */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-btn:hover,
.filter-btn.active {
  border-color: var(--gold);
  background: rgba(212,175,55,0.15);
  color: var(--text);
}
.gallery-item {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.gallery-item.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  position: absolute;
}
/* =========================
   MOBILE LAYOUT: ALLES UNTEREINANDER
   ========================= */
@media (max-width: 780px) {

  /* Hero-Bereich untereinander */
  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* CTA-Buttons vertikal */
  .cta-row {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .btn { width: 100%; justify-content: center; }

  /* Stats vertikal */
  .stats {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Grids / Cards vertikal */
  .grid-3 {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Gallery vertikal */
  .gallery {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Panels und Karten: volle Breite */
  .panel, .card, .thumb {
    width: 100% !important;
  }

  /* Forms: volle Breite */
  .form, .field input, .field textarea {
    width: 100% !important;
  }

  /* Footer: vertikal */
  .footer-inner {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }

  /* Optional: Header Navigation bleibt wie bisher für Mobile */
  .nav {
    flex-direction: column !important;
    gap: 12px !important;
  }
}
/* MOBILE HERO GRID: Text und Bild einheitliche Größe */
@media (max-width: 780px) {
  .hero-grid {
    display: flex;
    flex-direction: column; /* Text oben, Bild unten */
    align-items: center;    /* zentriert */
    gap: 24px;
  }

  /* Einheitliche Breite für beide Panels */
  .hero-grid .panel,
  .hero-grid aside {
    width: 100%;       /* volle Breite des Containers */
    max-width: 480px;  /* gleiche Größe wie andere Panels */
    margin: 0 auto;
  }

  .hero-grid aside img {
    width: 100%;       /* Bild passt sich Panel an */
    height: auto;
    border-radius: 12px;
    object-fit: cover; /* proportional, keine Verzerrung */
  }

  .hero-grid .h1,
  .hero-grid .lead,
  .hero-grid p {
    font-size: 15px;   /* gleiche Schriftgröße wie andere Panels */
    line-height: 1.6;
  }

  .hero-grid .cta-row {
    flex-direction: column;
    gap: 12px;
  }
}
