/* Identitätswechsel: XyA / RvB */

.card {
  container-type: inline-size;
  container-name: identity-card;
}

html.identity-revealed:not(.identity-ready) .logo-images {
  opacity: 0;
}

html.identity-revealed:not(.identity-ready) button.logo {
  font-size: 0;
}

html.identity-revealed:not(.identity-ready) button.logo::after {
  content: "RvB";
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

button.logo {
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease, text-shadow 0.22s ease;
}

button.logo:hover,
button.logo:focus-visible {
  color: #f4feff;
  background: rgba(110, 231, 255, 0.22);
  text-shadow: 0 0 8px #ffffff, 0 0 16px #6ee7ff;
  box-shadow:
    0 0 0 1.5px #8ef6ff,
    0 0 18px #6ee7ff,
    inset 0 0 14px rgba(110, 231, 255, 0.5);
  outline: none;
}

header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
}

.brand {
  display: contents;
}

button.logo {
  justify-self: start;
}

.lang-switch {
  justify-self: end;
}

.logo-swap,
.brand > .logo-images {
  justify-self: center;
}

.logo-swap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.logo-images {
  position: relative;
  justify-content: center;
}

.logo-images img {
  transition: opacity 0.35s ease, filter 0.45s ease;
}

.logo-images.is-hidden {
  display: none;
}

.logo-plasma {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.logo-secret {
  display: none;
  margin: 0;
  font-family: 'FuturText', Orbitron, sans-serif;
  font-size: clamp(0.7rem, 4.14cqw, 2.25rem);
  line-height: 1.1;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.logo-swap.is-revealed .logo-secret {
  display: block;
}

.logo-secret.is-nudged {
  transform: translate(20px, 20px);
}

.logo-secret-char {
  display: inline-block;
  text-align: center;
  color: #7af0ff;
  text-shadow: 0 0 8px rgba(122, 240, 255, 0.9);
  animation: secret-hue 2.6s ease-in-out infinite;
}

.logo-secret-char.is-space {
  width: 0.38em;
}

.logo-secret-char:nth-child(3n) {
  animation-duration: 3.4s;
  animation-delay: -0.7s;
}

.logo-secret-char:nth-child(4n) {
  animation-duration: 1.9s;
  animation-delay: -1.2s;
}

.logo-secret-char:nth-child(5n) {
  animation-duration: 4.1s;
  animation-delay: -0.3s;
}

.logo-secret-char.will-flicker {
  animation-name: secret-hue, cyber-flicker;
  animation-duration: 2.4s, 2.8s;
  animation-timing-function: ease-in-out, steps(1, end);
  animation-iteration-count: infinite, infinite;
}

@keyframes secret-hue {
  0%, 100% {
    color: #7af0ff;
    text-shadow: 0 0 8px #7af0ff, 0 0 16px rgba(0, 210, 255, 0.65);
  }
  50% {
    color: #123a86;
    text-shadow: 0 0 2px #d9f7ff, 0 0 8px #7af0ff, 0 0 14px rgba(18, 58, 134, 0.9);
  }
}

@keyframes cyber-flicker {
  0%, 70%, 100% {
    opacity: 1;
    transform: none;
  }
  72% {
    opacity: 0.15;
  }
  76% {
    opacity: 1;
  }
  88% {
    opacity: 0.25;
  }
  91% {
    opacity: 1;
  }
}

@media (max-width: 838px) {
  .brand {
    display: contents;
  }

  .logo-images {
    align-items: center;
  }

  .logo-swap {
    min-width: 0;
  }

  .logo-secret {
    white-space: nowrap;
    letter-spacing: 0.01em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-secret-char,
  .logo-secret-char.will-flicker {
    animation: none;
    color: #7af0ff;
  }
}
