/* Grundaufbau: Inhaltsbreite, Kopfzeile, Navigation, Seitenraster und Fußzeile.
   Bei mehrfach definierten Selektoren gilt die CSS-Kaskade: spätere bzw. spezifischere Regeln können frühere überschreiben. */
/* NOTE: Header, Navigation, Footer, allgemeine Container und Grid-Regeln */
.container {
  width: min(100% - 2rem, 1120px);
  margin-inline: auto;
}

/* Kopfzeile: Positionierung und Hintergrund der gemeinsamen Navigation. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem 0 0;
}

.header-bar {
  display: grid;
  grid-template-columns: minmax(0, clamp(180px, 20vw, 280px)) minmax(0, 1fr) 44px;
  align-items: center;
  gap: 1.25rem;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(167, 139, 250, 0.28);
  border-radius: 18px;
  background: rgba(12, 10, 19, 0.97);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.brand {
  display: flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  flex: 0 0 280px;
}

.brand-logo-box {
  display: flex;
  align-items: center;
  width: min(280px, 100%);
  aspect-ratio: 4 / 1;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Hauptnavigation: Anordnung der Seitenlinks. */
.main-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.nav-btn,
.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.nav-btn {
  min-width: 0;
  height: 44px;
  padding: 0.7rem 0.35rem;
  border: 1px solid #8c52ff;
  border-radius: 999px;
  background: #8c52ff;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 10px 28px rgba(140, 82, 255, 0.2);
  transition:
    transform 0.25s var(--ee),
    background 0.25s var(--ee),
    color 0.25s var(--ee),
    border-color 0.25s var(--ee),
    box-shadow 0.25s var(--ee);
}

.nav-btn:hover {
  border-color: #ffffff;
  background: #ffffff;
  color: #8c52ff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(140, 82, 255, 0.3);
}

.nav-btn.active {
  border-color: #ffffff;
  background: #ffffff;
  color: #8c52ff;
  box-shadow: 0 0 18px rgba(140, 82, 255, 0.3);
}

.nav-btn.active:hover {
  border-color: #ffffff;
  background: #ffffff;
  color: #8c52ff;
  transform: none;
}

.nav-btn:focus-visible {
  outline: 3px solid rgba(140, 82, 255, 0.75);
  outline-offset: 3px;
}

/* Sprachwechsel im gleichen Stil wie die mobilen Header-Buttons. */
.lang-switch {
  justify-self: end;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 12px;
  background: rgba(167, 139, 250, 0.07);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background 180ms ease, border-color 180ms ease;
}

/* Bildschirmabhängige Anpassungen: gelten nur bei der folgenden Breite bzw. Systemeinstellung. */
@media (hover: hover) {
  .lang-switch:hover {
    background: rgba(167, 139, 250, 0.16);
    border-color: rgba(167, 139, 250, 0.5);
  }
}

.lang-switch:focus-visible {
  outline: 2px solid #c4b5fd;
  outline-offset: 3px;
}

.lang-flag {
  display: block;
  width: 24px;
  height: 16px;
  max-width: none;
  object-fit: cover;
  border: 0;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
  filter: none;
  transform: none;
}

.page {
  padding: 2rem 0 4rem;
}

.hero {
  padding: 4rem 0 2rem;
}

.section {
  padding: 2rem 0;
}

/* Fußzeile: gemeinsame Abschlussfläche der Seiten. */
.footer {
  padding: 1.5rem 0 3rem;
}

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* Bildschirmabhängige Anpassungen: gelten nur bei der folgenden Breite bzw. Systemeinstellung. */
@media (max-width: 900px) {
  .header-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .main-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* Bildschirmabhängige Anpassungen: gelten nur bei der folgenden Breite bzw. Systemeinstellung. */
@media (max-width: 640px) {
  .site-header {
    position: relative;
    top: auto;
    padding-top: 0.75rem;
  }

  .container {
    width: min(100% - 1.25rem, 1120px);
  }

  .header-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
  }

  .brand {
    flex: initial;
    width: 100%;
    min-width: 0;
  }

  .brand-logo-box {
    width: min(220px, 100%);
  }

  .lang-switch {
    width: auto;
    height: auto;
    min-height: 0;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .lang-flag {
    width: 32px;
    height: 24px;
  }

  .main-nav {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
    gap: 0.45rem;
  }

  .nav-btn {
    min-height: 40px;
    padding: 0.55rem 0.72rem;
    font-size: 0.76rem;
  }

  .page {
    padding: 1.25rem 0 3rem;
  }

  .hero {
    padding: 2.5rem 0 1.5rem;
  }

  .section {
    padding: 1.5rem 0;
  }

  .footer {
    padding: 1rem 0 2rem;
  }

  .footer-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.9rem 0;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
  }
}
