/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0; padding: 0;
}

body {
    font-family: Helvetica, Arial,sans-serif;
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    background: black;
    overflow:hidden;
}

/* Intro */
#intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
}

#intro-logo {
  opacity: 0;
}

#intro-logo svg {
  width: clamp(100px, 10vw, 10vw);
  height: auto;
  display: block;
}

/* Background Layer */
#background-layer {
  position: fixed;
  inset: -2.5%;
  z-index: 0;
  overflow: hidden;
  transition: filter 600ms ease;
  background:black;
}

@media (hover: hover) {
  body:has(#nav-root :is(.nav-panel li, .content-panel):hover) #background-layer {
    filter: blur(6px);
  }
}

.bg-slide {
  width: 105vw;
  opacity:0.8;
}
.bg-slide img,
.bg-slide video {
  width: 100%;
  height: auto;
  display: block;
}

/* Hover Image Layer (zwischen Background und Midground) */
#hover-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hover-image {
  position: absolute;
  inset: 0;
  background-image: var(--bg-desktop);
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 600ms ease;
  will-change: opacity;
}

@media (max-width: 768px) {
  .hover-image[data-has-mobile] {
    background-image: var(--bg-mobile);
  }
}

/* Midground Layer */
#midground-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#midground-logo {
  pointer-events: all;
  cursor: pointer;
  opacity: 0;
  filter: blur(6px);
  transition: filter 600ms ease, opacity 800ms ease;
}

#midground-logo:hover {
  filter: blur(0);
}

#midground-logo svg {
  width: clamp(100px, 10vw, 10vw);
  height: auto;
  display: block;
}

/* Nav open: alle Items zunächst scharf */
body.nav-open .nav-panel ul li:not(.active) {
  filter: none;
}

/* Nav open + ein Item gehovert: Geschwister blurren */
body.nav-open .nav-panel:has(li.active) ul li:not(.active) {
  filter: blur(6px);
}

/* Foreground Layer */
#foreground-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
}

#nav-root {
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms ease;
  display: flex;
  flex-direction: row;
  height: 100%;
  overflow: visible;
  position: relative;
}

body.nav-open #nav-root {
  pointer-events: all;
  opacity: 1;
}

body.nav-open #background-layer {
  filter: blur(6px);
}

/* Nav Panels – alle inaktiven unsichtbar */
.nav-panel {
  display: none;
  width: 200px;
  height: 100%;
  flex-shrink: 0;
}

.nav-panel.active {
  display: block;
}

.nav-panel ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.nav-panel ul li {
  /* flex: 1; */
  height:29px;
  display: flex;
  padding: 8px;
  transition: filter ease-in-out 600ms;
  text-transform: uppercase;
}

.nav-panel ul li a {
  color: inherit;
  text-decoration: none;
  display: flex;
  width: 100%;
}

#nav-root .nav-panel:first-child > ul:first-child > li:first-child {
    display:unset !important;
}

/* #nav-root .nav-panel:first-child > ul:first-child > li:first-child::after {
    content: '(Latin interjection)';
    white-space: pre;
    word-wrap: break-word;
    font-weight:normal;
} */

.nav-panel ul li:not(.active) {
    filter:blur(6px);
}

/* Sub-panel blur + fade in on appear, blur + fade out on leave */
.nav-panel[data-depth]:not([data-depth="0"]) {
  transition: filter 600ms ease, opacity 600ms ease;
}

.nav-panel[data-depth]:not([data-depth="0"]):not(.panel-visible) {
  filter: blur(6px);
  opacity: 0;
}

.nav-panel.panel-visible {
  filter: blur(0);
  opacity: 1;
}

.nav-panel.content-panel {
  height: auto;
  align-self: flex-start;
  overflow-y: auto;
  padding: 8px;
  flex-shrink: 0;
  font-weight: normal;
  text-transform: none;
}
.nav-panel.content-panel {
    max-width:500px
}

.nav-panel.content-panel[data-depth="1"] { width: calc(100vw - 1 * 200px); }
.nav-panel.content-panel[data-depth="2"] { width: calc(100vw - 2 * 200px); }
.nav-panel.content-panel[data-depth="3"] { width: calc(100vw - 3 * 200px); }
.nav-panel.content-panel[data-depth="4"] { width: calc(100vw - 4 * 200px); }
.nav-panel.content-panel[data-depth="5"] { width: calc(100vw - 5 * 200px); }


.nav-back { display: none; }

.legal-wrapper {
    position: fixed;
    padding:8px;
    bottom:0px;
    right:0px;
    z-index: 5;
}

.legal-wrapper * {
    text-decoration: none;
    color: white;
    opacity: 0.8;
    font-size: 8px;
    text-transform: uppercase;
}

body.nav-open .legal-wrapper,
body.nav-focused .legal-wrapper {
  filter: blur(6px);
}

a {
    color: inherit;
}

/* Nav Panels – Mobile */
@media (max-width: 768px) {
  #nav-root {
    position: relative;
    width: 100vw;
    overflow: hidden;
  }


  /* Logo auf Mobile ohne Hover-Blur */
  #midground-logo {
    filter: blur(6px) !important;
  }

  /* Desktop filter/opacity Transition deaktivieren, transform-Transition aktivieren */
  .nav-panel[data-depth]:not([data-depth="0"]) {
    transition: transform 400ms ease;
    filter: none !important;
    opacity: 1 !important;
  }

  /* Bilder hochformat bildschirmfüllend */
  #background-layer {
    inset: 0;
  }

  .bg-slide {
    width: 100vw;
    height: calc(100vw / 9 * 16);
    overflow: hidden;
  }

  .bg-slide img,
  .bg-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .nav-panel.active {
    position: absolute;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100%;
    transition: transform 400ms ease;
  }

  .nav-panel {
    width:100vw !important;
  }

  .nav-panel ul {
    height: auto;
    flex-direction: column;
  }

  .nav-panel ul li {
    flex: none;
    height: 29px;
    filter: blur(6px);
  }

  .nav-panel:not(.content-panel) ul li[data-target] {
    align-self: flex-start;
  }

  body.nav-focused .nav-panel ul li,
  body.nav-focused .nav-back {
    filter: none;
  }

  body.nav-focused #background-layer {
    filter: blur(6px) !important;
  }

  .nav-back {
    display: flex;
    height: 29px;
    width: 100%;
    padding: 8px;
    background: none;
    border: none;
    color: white;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
    text-align: left;
    filter: blur(6px);
    transition: filter 600ms ease;
  }

  .nav-open .nav-back {
    filter: none !important;
  }

  .content-panel .nav-back {
    padding: 0;
  }

}
