/* Shared logo + hero chain mark */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.logo-mark {
  width: 28px;
  height: 14px;
  flex-shrink: 0;
  background: currentColor;
  color: var(--brand);
  -webkit-mask: url("../assets/mark.svg") center / contain no-repeat;
  mask: url("../assets/mark.svg") center / contain no-repeat;
  opacity: 0.95;
}

.logo-word {
  font-family: var(--font-brand);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  letter-spacing: -0.04em;
  color: var(--brand);
  min-width: 0;
}

/* Horizontal chain lockup — centered on its own axis */
.logo-hero {
  --mark-w: clamp(148px, 38vw, 220px);
  width: var(--mark-w);
  height: calc(var(--mark-w) * 0.34);
  margin: 0 auto;
  color: #f5f5f5;
  overflow: visible;
  display: grid;
  place-items: center;
  animation: mark-rise 0.35s ease-out both;
}

.chain-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 0;
}

.chain-flow-link {
  display: block;
  box-sizing: border-box;
  border: 3.5px solid #6a6a6a;
  border-radius: 999px;
  background: transparent;
  flex: 0 0 auto;
  animation-duration: 1.6s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-delay: calc(var(--i, 0) * -0.32s);
}

.chain-flow-link--v {
  width: 14px;
  height: 28px;
  margin-inline: -3px;
  z-index: 1;
}

.chain-flow-link--h {
  width: 36px;
  height: 14px;
  margin-inline: -3px;
  z-index: 2;
}

@keyframes mark-rise {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/*
 * Landing hero — white / gray pulse (same motion as analyzing, colder palette).
 */
.logo-hero--pulse {
  color: #f5f5f5;
  animation:
    mark-rise 0.45s ease-out both,
    chain-flow-breathe 2.8s ease-in-out 0.45s infinite;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.18));
}

.logo-hero--pulse .chain-flow-link {
  border-color: #6a6a6a;
  animation-name: chain-flow-color-white;
}

@keyframes chain-flow-color-white {
  0%,
  100% {
    border-color: #2e2e2e;
    opacity: 0.62;
  }
  25% {
    border-color: #6e6e6e;
    opacity: 0.85;
  }
  50% {
    border-color: #d8d8d8;
    opacity: 1;
  }
  75% {
    border-color: #ffffff;
    opacity: 1;
  }
}

/*
 * Analyzing / Key·BPM busy — teal palette.
 */
.logo-hero--cycle {
  --mark-w: clamp(148px, 32vw, 210px);
  width: var(--mark-w) !important;
  max-width: var(--mark-w);
  height: calc(var(--mark-w) * 0.34) !important;
  margin: 0 auto;
  color: #6ec4b4;
  display: grid !important;
  place-items: center;
  animation: chain-flow-breathe 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(110, 196, 180, 0.4));
}

.logo-hero--cycle .chain-flow-link {
  border-color: #3f8f84;
  animation-name: chain-flow-color;
}

@keyframes chain-flow-color {
  0%,
  100% {
    border-color: #1f524c;
    opacity: 0.7;
  }
  25% {
    border-color: #3f8f84;
    opacity: 0.9;
  }
  50% {
    border-color: #6ec4b4;
    opacity: 1;
  }
  75% {
    border-color: #e8fffa;
    opacity: 1;
  }
}

/* Scale + opacity only — filter stays static so this composites on mobile */
@keyframes chain-flow-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-hero,
  .logo-hero--pulse,
  .logo-hero--cycle {
    animation: none;
    filter: none;
  }

  .logo-hero--pulse .chain-flow-link {
    animation: none;
    border-color: #d0d0d0;
    opacity: 0.92;
  }

  .logo-hero--cycle .chain-flow-link {
    animation: none;
    border-color: #6ec4b4;
    opacity: 0.92;
  }
}
