/* Default (no JS / reduced motion): a plain sticky bar with the logo.
   With html.fly-logo the bar is fixed and transparent over the hero, the
   logo flies in from the hero (js/header-logo.js) and the bar fades in once
   you scroll past the hero. */
.site-header {
  --bar: 1;
  --inv: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* no backdrop-filter here: the header is sticky/fixed for the entire
     rest of the page, so a blur behind it has to be recomposited against
     whatever's scrolling underneath (the WebGL hero, the SVG line art, the
     3D-tilted portfolio cards) on every single scroll frame for as long as
     it's on screen — one of the more expensive things a real GPU can be
     asked to do continuously, even though it costs nothing in software
     rendering. A near-opaque flat background reads almost the same. */
  background: color-mix(in oklab, var(--background) 97%, transparent);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  opacity: var(--bar);
}

#diensten,
#portfolio,
#reviews,
#contact {
  scroll-margin-top: 5.5rem;
}

.nav-inner,
.container.nav-inner {
  /* the controls sit in the screen's own top-right corner, not inside the
     centred content column */
  max-width: none;
  padding-inline: clamp(1rem, 2.2vw, 2rem);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-block: 0.6rem;
}

/* absolutely centered on the header's own box — independent of the controls
   on the right, so the logo stays exactly centered regardless of their
   width, instead of being centered only in the leftover space beside them */
.nav-logo-link {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
}
.nav-logo {
  width: 100px;
  height: auto;
  display: inline-block;
  filter: invert(var(--inv));
}
:root[data-theme="dark"] .nav-logo { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-logo { filter: invert(1); }
}

.nav-controls {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* base colour tuned for a light header bar; the same --inv the logo uses
     flips it to light over the dark hero, so both stay in sync */
  color: oklch(0.218 0 0);
  filter: invert(var(--inv));
}
:root[data-theme="dark"] .nav-controls { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-controls { filter: invert(1); }
}

.nav-lang,
.nav-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity var(--duration-fast) var(--ease-luxe),
              background-color var(--duration-fast) var(--ease-luxe);
}
.nav-lang:hover,
.nav-theme:hover {
  opacity: 1;
  background: color-mix(in oklab, currentColor 10%, transparent);
}
.nav-lang {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.nav-theme svg { width: 17px; height: 17px; }
.nav-theme .icon-sun { display: none; }
:root[data-theme="dark"] .nav-theme .icon-moon { display: none; }
:root[data-theme="dark"] .nav-theme .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-theme .icon-moon { display: none; }
  :root:not([data-theme="light"]) .nav-theme .icon-sun { display: block; }
}

.fly-logo .site-header {
  --bar: 0;
  --inv: 1;
  position: fixed;
  inset: 0 0 auto 0;
  pointer-events: none;
}
.fly-logo .nav-logo-link,
.fly-logo .nav-controls {
  pointer-events: auto;
  transform-origin: 0 0;
}
.fly-logo .nav-logo {
  opacity: 0;
  transform-origin: 0 0;
  will-change: transform, opacity;
}

/* "VDK Business Services" leaves the hero as text and turns into the logo up in the header */
.fly-text { display: none; }
.fly-logo .fly-text {
  display: block;
  position: fixed;
  left: 0;
  top: 0;
  opacity: 0;
  white-space: nowrap;
  transform-origin: 0 50%;
  pointer-events: none;
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: oklch(0.976 0.007 97.351);
  will-change: transform, opacity;
}
