/* In-page section menu in the header, between the logo and the Kontakt button. */
html {
  scroll-behavior: smooth;
}

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

/* leave room for the fixed header when jumping to a section */
.fl-anchor {
  display: block;
  height: 0;
  scroll-margin-top: 140px;
}

#header-outer #top .fl-nav {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
}

#header-outer #top .fl-nav ul {
  display: flex !important;
  gap: clamp(18px, 2.4vw, 40px);
  margin: 0 !important;
  padding: 0;
  list-style: none;
}

#header-outer #top .fl-nav li {
  margin: 0 !important;
  padding: 0;
  list-style: none;
}

#header-outer #top .fl-nav a {
  position: relative;
  display: block;
  padding: 6px 0;
  color: #2d1854;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: color .25s ease;
}

#header-outer #top .fl-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: #7e22ce;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}

#header-outer #top .fl-nav a:hover,
#header-outer #top .fl-nav a[aria-current="true"] {
  color: #7e22ce;
}

#header-outer #top .fl-nav a:hover::after,
#header-outer #top .fl-nav a[aria-current="true"]::after {
  transform: scaleX(1);
}

#header-outer #top .fl-nav-toggle {
  display: none;
}

/* Below the theme's mobile breakpoint the links collapse into a "Menu" dropdown. */
@media only screen and (max-width: 999px) {
  /* responsive.css hides every header <nav> here with `#header-outer #top nav { display: none !important }`
     (the theme expects its own off-canvas menu), so this needs the extra #top to win. */
  #header-outer #top .fl-nav {
    display: block !important;
  }

  #header-outer #top .fl-nav-toggle {
    display: block;
    padding: 8px 14px;
    border: 1px solid rgba(45, 24, 84, .2);
    border-radius: 999px;
    background: #fff;
    color: #2d1854;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
  }

  #header-outer #top .fl-nav ul {
    display: none !important;
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    flex-direction: column;
    gap: 0;
    min-width: 200px;
    padding: 8px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(45, 24, 84, .18);
    transform: translateX(-50%);
  }

  #header-outer #top .fl-nav.is-open ul {
    display: flex !important;
  }

  #header-outer #top .fl-nav a {
    padding: 12px 16px;
  }

  #header-outer #top .fl-nav a::after {
    display: none;
  }
}

/* Full-width scroll-triggered video */
.fl-video-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

/* Mobile: natural 16:9, full width */
.fl-video {
  display: block;
  width: 100%;
  height: auto;
}

/* Desktop: 960×540 centered */
@media only screen and (min-width: 769px) {
  .fl-video-wrap {
    max-width: 960px;
    margin: 0 auto;
  }
  .fl-video {
    width: 960px;
    max-width: 100%;
    height: 540px;
    object-fit: cover;
  }
}

/* Custom controls overlay */
.fl-vc {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.fl-vc-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .5);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.fl-vc-btn:hover {
  background: rgba(0, 0, 0, .72);
}

/* Language toggle */
.fl-lang-item {
  display: flex !important;
  align-items: center !important;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
}

.fl-lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 10px;
  border: 1px solid rgba(45, 24, 84, .22);
  border-radius: 999px;
  background: transparent;
  color: #2d1854;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  cursor: pointer;
  transition: border-color .25s ease, background .25s ease;
  white-space: nowrap;
}

.fl-lang-toggle:hover {
  border-color: #7e22ce;
  background: rgba(126, 34, 206, .06);
}

.fl-lang-opt {
  transition: opacity .2s ease;
}

.fl-lang-sep {
  opacity: 0.3;
  font-weight: 400;
}

/* keep the toggle visible in the mobile header */
#menu-saas-pull-right .fl-lang-item {
  display: flex !important;
}

#menu-saas-pull-right .fl-lang-toggle {
  margin: 4px 0;
}
