/* ═══════════════════════════════════════════════════════════
   GLOBAL & BASE
   ═══════════════════════════════════════════════════════════ */

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

::selection {
  background: rgba(6, 182, 212, 0.3);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   SECTION SCROLL OFFSET
   ═══════════════════════════════════════════════════════════ */

section[id] {
  scroll-margin-top: 100px;
}

/* ═══════════════════════════════════════════════════════════
   ANNOUNCEMENT TICKER
   ═══════════════════════════════════════════════════════════ */

.ticker-track {
  animation: tickerScroll 30s linear infinite;
  width: max-content;
}

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-track:hover {
  animation-play-state: paused;
}

/* ═══════════════════════════════════════════════════════════
   GRADIENT TEXT
   ═══════════════════════════════════════════════════════════ */

.gradient-text {
  background: linear-gradient(135deg, #06b6d4, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════════════════════════════════════════════════════
   GLASSMORPHISM
   ═══════════════════════════════════════════════════════════ */

.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ═══════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════ */

#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ═══════════════════════════════════════════════════════════
   HERO DOT GRID BACKGROUND
   ═══════════════════════════════════════════════════════════ */

.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
  animation: dotDrift 20s linear infinite;
}

@keyframes dotDrift {
  0%   { background-position: 0 0; }
  100% { background-position: 32px 32px; }
}

/* ═══════════════════════════════════════════════════════════
   HERO GLOW
   ═══════════════════════════════════════════════════════════ */

.hero-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, rgba(59, 130, 246, 0.04) 40%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 6s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.1); }
}

/* ═══════════════════════════════════════════════════════════
   CTA SECTION GLOW
   ═══════════════════════════════════════════════════════════ */

.cta-glow {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   SCROLL ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children in grids */
.animate-on-scroll:nth-child(2) { transition-delay: 0.08s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.16s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.24s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.32s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.40s; }

/* ═══════════════════════════════════════════════════════════
   FEATURE CARDS
   ═══════════════════════════════════════════════════════════ */

.feature-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════════
   CURSOR BLINK (AI section)
   ═══════════════════════════════════════════════════════════ */

.cursor-blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   SECTION DIVIDER
   ═══════════════════════════════════════════════════════════ */

.section-divider-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2), transparent);
}

/* ═══════════════════════════════════════════════════════════
   CODE BLOCKS
   ═══════════════════════════════════════════════════════════ */

pre code {
  display: block;
  white-space: pre;
  overflow-x: auto;
}

pre {
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE MENU ANIMATION
   ═══════════════════════════════════════════════════════════ */

#mobile-menu {
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobile-menu.open {
  max-height: 300px;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE REFINEMENTS
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .hero-glow {
    width: 300px;
    height: 300px;
  }

  .dot-grid {
    background-size: 24px 24px;
  }
}

/* ═══════════════════════════════════════════════════════════
   SMOOTH SCROLL OVERRIDE FOR REDUCED MOTION
   ═══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ═══════════════════════════════════════════════════════════
   HANNOVER MESSE POPUP
   ═══════════════════════════════════════════════════════════ */

#messe-popup.active {
  opacity: 1;
  pointer-events: auto;
}

#messe-popup.active #messe-card {
  transform: scale(1);
}

@media (max-width: 640px) {
  #messe-popup {
    align-items: center;
  }
}
