/* WUFLE brand finish: a darker wordmark, ordered letter shimmer, then emblem sweep. */
.brand-mark {
  --brand-frame-color: #e9aa55;
  position: relative;
  flex-shrink: 0;
  isolation: isolate;
}

.brand-logo {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.brand-word {
  position: relative;
  top: 6px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .015em;
  color: var(--brand-frame-color);
  font-family: Inter, "Arial Black", ui-sans-serif, sans-serif;
  font-size: 9px;
  font-weight: 950;
  line-height: 8px;
  letter-spacing: .045em;
  font-kerning: normal;
  text-indent: 0;
  white-space: nowrap;
  transform: scaleX(1.34) scaleY(.8) skewX(-3deg);
  transform-origin: center center;
  text-shadow:
    0 0 2px color-mix(in srgb, var(--brand-frame-color) 78%, transparent),
    0 0 5px color-mix(in srgb, var(--brand-frame-color) 38%, transparent),
    0 1px 0 color-mix(in srgb, var(--bg) 58%, transparent);
  -webkit-text-stroke: .48px color-mix(in srgb, var(--brand-frame-color) 100%, var(--bg));
  paint-order: stroke fill;
}

.brand-letter {
  display: inline-block;
  min-width: .58em;
  color: var(--brand-frame-color);
  font: inherit;
  text-align: center;
  background: linear-gradient(
    112deg,
    color-mix(in srgb, var(--brand-frame-color) 100%, var(--space-white)) 0 27%,
    color-mix(in srgb, var(--brand-frame-color) 92%, var(--space-white)) 36%,
    color-mix(in srgb, var(--space-white) 100%, var(--brand-frame-color)) 45% 51%,
    color-mix(in srgb, var(--brand-frame-color) 78%, var(--space-white)) 57%,
    color-mix(in srgb, var(--space-white) 96%, var(--brand-frame-color)) 61%,
    color-mix(in srgb, var(--brand-frame-color) 100%, var(--space-white)) 69% 100%
  );
  background-size: 330% 100%;
  background-position: 145% 0;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: wufleLetterShine 5.4s ease-in-out infinite;
  animation-delay: calc(var(--letter-order) * 145ms);
  filter: saturate(1.28) brightness(1.2) contrast(1.04);
}

/* A clipped diagonal light band crosses the emblem only after W-U-F-L-E. */
.brand-mark::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 4px;
  left: 5px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    112deg,
    transparent 18%,
    color-mix(in srgb, var(--space-white) 20%, transparent) 40%,
    var(--space-white) 51%,
    color-mix(in srgb, var(--brand-frame-color) 55%, transparent) 60%,
    transparent 80%
  );
  background-size: 240% 100%;
  background-position: 145% 0;
  mix-blend-mode: screen;
  clip-path: circle(50% at 50% 50%);
  animation: wufleEmblemShine 7s ease-in-out infinite;
  animation-delay: 1.22s;
}

@keyframes wufleLetterShine {
  0%, 2%, 100% {
    background-position: 160% 0;
    text-shadow:
      0 0 2px color-mix(in srgb, var(--brand-frame-color) 90%, transparent),
      0 0 6px color-mix(in srgb, var(--brand-frame-color) 48%, transparent),
      0 1px 0 color-mix(in srgb, var(--bg) 48%, transparent);
  }
  5% {
    background-position: 18% 0;
    text-shadow:
      0 0 3px color-mix(in srgb, var(--brand-frame-color) 100%, transparent),
      0 0 6px color-mix(in srgb, var(--space-white) 96%, transparent),
      0 0 12px color-mix(in srgb, var(--space-white) 72%, transparent),
      0 0 18px color-mix(in srgb, var(--brand-frame-color) 54%, transparent),
      0 1px 0 color-mix(in srgb, var(--bg) 46%, transparent);
  }
  10% {
    background-position: -160% 0;
    text-shadow:
      0 0 2px color-mix(in srgb, var(--brand-frame-color) 90%, transparent),
      0 0 6px color-mix(in srgb, var(--brand-frame-color) 48%, transparent),
      0 1px 0 color-mix(in srgb, var(--bg) 48%, transparent);
  }
}

@keyframes wufleEmblemShine {
  0%, 2%, 100% {
    opacity: 0;
    background-position: 145% 0;
  }
  7% {
    opacity: .92;
    background-position: 25% 0;
  }
  15% {
    opacity: 0;
    background-position: -145% 0;
  }
}

@media (max-width: 700px) {
  .brand-word {
    top: 5.5px;
    font-size: 8.5px;
    line-height: 7.5px;
    letter-spacing: .035em;
    transform: scaleX(1.28) scaleY(.8) skewX(-3deg);
    -webkit-text-stroke: .36px color-mix(in srgb, var(--brand-frame-color) 98%, var(--bg));
  }

  .brand-mark::after {
    top: 4px;
    left: 3px;
    width: 31px;
    height: 31px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-letter,
  .brand-mark::after {
    animation: none;
  }
}
