/* ==========================================================================
   forged-kit — step-player.css
   Chrome for the step player (see PLAYER.md) plus the four shared
   highlight classes. Requires forged.css to be loaded first: all colors
   come from the --fk-* tokens, and the player JS reuses .fk-card /
   .fk-btn / .fk-chip for the narration panel, nav buttons, and concept
   chips. Nothing here styles elements outside .fk-sp-* / .fk-hl-* /
   .fk-step-player scope.
   ========================================================================== */

/* ------------------------------------------------------------- container */
.fk-step-player {
  font-family: var(--fk-font-sans);
  color: var(--fk-text);
}

/* ----------------------------------------------------------- progress bar */
.fk-sp-progress {
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(var(--fk-accent-rgb), 0.12);
  margin-bottom: 0.875rem;
}

.fk-sp-progress-fill {
  height: 100%;
  width: 0;
  background: var(--fk-accent);
  box-shadow: 0 0 6px rgba(var(--fk-accent-rgb), 0.5);
  transition: width 0.25s ease;
}

/* ------------------------------------------------- step title + counter */
.fk-sp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.fk-sp-title {
  margin: 0;
  font-family: var(--fk-font-mono);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--fk-text);
}

.fk-sp-counter {
  font-family: var(--fk-font-mono);
  font-size: 0.8125rem;
  color: var(--fk-accent-dim);
  white-space: nowrap;
}

/* --------------------------------------------------------- narration panel
   The player JS adds .fk-card, which supplies fill/border/radius/hover;
   this class only adjusts typography and spacing inside the panel. */
.fk-sp-narration {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--fk-text-dim);
}

.fk-sp-narration p { margin: 0 0 0.625em; }
.fk-sp-narration p:last-child { margin-bottom: 0; }
.fk-sp-narration strong,
.fk-sp-narration b { color: var(--fk-text); }
.fk-sp-narration code {
  font-family: var(--fk-font-mono);
  font-size: 0.875em;
  color: var(--fk-accent-dim);
}

/* ---------------------------------------------------------- concept chips
   .fk-chip supplies the base look; this makes the chip a working link. */
.fk-sp-concepts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

a.fk-sp-concept {
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

a.fk-sp-concept::after { content: " \2197"; opacity: 0.6; }

a.fk-sp-concept:hover {
  color: var(--fk-accent);
  border-color: var(--fk-border-soft);
}

/* ------------------------------------------------------------ nav buttons
   .fk-btn supplies the outline-neon look; this handles layout + the
   disabled end-stop state. */
.fk-sp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.fk-sp-btn:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

.fk-sp-btn:disabled:hover {
  background: transparent;
  box-shadow: none;
}

/* ==========================================================================
   Highlight classes — toggled by FkStepPlayer.applyHighlights (or by the
   domain directly) on canvas elements. Domain-agnostic: outline/box-shadow/
   opacity only, so they compose with any element's own styling.
   ========================================================================== */

/* focus — accent border + slight glow (steady) */
.fk-hl-focus {
  outline: 1px solid var(--fk-accent);
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(var(--fk-accent-rgb), 0.35),
    inset 0 0 8px rgba(var(--fk-accent-rgb), 0.08);
}

/* pulse — brief accent pulse, runs once per application */
.fk-hl-pulse {
  animation: fk-hl-pulse 0.9s ease-out 1;
}

@keyframes fk-hl-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--fk-accent-rgb), 0.55);
    outline: 1px solid rgba(var(--fk-accent-rgb), 0.8);
  }
  70% {
    box-shadow: 0 0 14px 8px rgba(var(--fk-accent-rgb), 0);
    outline: 1px solid rgba(var(--fk-accent-rgb), 0.2);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--fk-accent-rgb), 0);
    outline: 1px solid transparent;
  }
}

/* dim — de-emphasize */
.fk-hl-dim {
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

/* reveal — fade in newly introduced content */
.fk-hl-reveal {
  animation: fk-hl-reveal 0.45s ease-out 1 both;
}

@keyframes fk-hl-reveal {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fk-sp-progress-fill { transition: none; }
  .fk-hl-dim { transition: none; }
  .fk-hl-pulse { animation: none; }
  .fk-hl-reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
  /* pulse degrades to a steady focus-style ring so the cue survives */
  .fk-hl-pulse {
    outline: 1px solid var(--fk-accent);
    outline-offset: 2px;
    box-shadow: 0 0 10px rgba(var(--fk-accent-rgb), 0.35);
  }
}
