/* Factor Home shared palette and selector styles.
 *
 * This is the canonical colour identity for Factor Home. Every Manifestation
 * should derive its tones from these variables so the creature stays coherent
 * even when its form changes.
 */

@font-face {
  font-family: "FH Manrope";
  src: url("fonts/manrope/Manrope-Variable.ttf") format("truetype-variations");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "FH Instrument Sans";
  src: url("fonts/instrument-sans/InstrumentSans-Variable.ttf") format("truetype-variations");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "FH IBM Plex Mono";
  src: url("fonts/ibm-plex-mono/IBMPlexMono-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "FH IBM Plex Mono";
  src: url("fonts/ibm-plex-mono/IBMPlexMono-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  /* Typography: Manrope at Home, quiet sans UI, precise instrument data. */
  --fh-font-home: "FH Manrope", "Avenir Next", -apple-system, sans-serif;
  --fh-font-display: "FH Instrument Sans", "Avenir Next", -apple-system, sans-serif;
  --fh-font-ui: "FH Instrument Sans", "Avenir Next", -apple-system, sans-serif;
  --fh-font-data: "FH IBM Plex Mono", "SFMono-Regular", ui-monospace, monospace;

  /* Ground */
  --fh-bg: #02040a;
  --fh-bg-soft: #071018;
  --fh-surface: linear-gradient(145deg, rgba(9, 16, 31, 0.94), rgba(3, 8, 19, 0.97));

  /* Text */
  --fh-text: #e2e8f0;
  --fh-muted: #94a3b8;

  /* Signal tones */
  --fh-accent: #38bdf8;
  --fh-accent-soft: rgba(56, 189, 248, 0.12);

  /* Creature states */
  --fh-mytho: #f59e0b;
  --fh-mytho-soft: rgba(245, 158, 11, 0.14);
  --fh-danger: #ef4444;
  --fh-warning: #fbbf24;
  --fh-life: #a78bfa;
  --fh-life-soft: rgba(167, 139, 250, 0.16);

  /* Extended chromatic identity */
  --fh-ice: #e0f2fe;
  --fh-cyan: #22d3ee;
  --fh-deep: #1e3a8a;
  --fh-violet: #7c3aed;
  --fh-magenta: #c026d3;
  --fh-amber: #f59e0b;
  --fh-ember: #f97316;

  /* Light hierarchy */
  --fh-ambient: #0b1220;
  --fh-core: #ffffff;
  --fh-trace: rgba(148, 163, 184, 0.22);

  /* Spacing */
  --fh-radius: 0.75rem;
  --fh-gap: 1rem;
}

/* Manifestation selector: small luminous nodes that feel part of the work. */
.fh-selector {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(2, 6, 16, 0.45);
  border: 1px solid var(--fh-trace);
  backdrop-filter: blur(8px);
}

.fh-selector-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--fh-muted);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s, background 0.25s;
}

.fh-selector-node:hover { color: var(--fh-text); }

.fh-selector-node.active {
  color: var(--fh-accent);
  background: var(--fh-accent-soft);
}

.fh-selector-node.active .fh-selector-glow {
  box-shadow: 0 0 8px 2px var(--fh-accent);
}

.fh-selector-glow {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
  transition: box-shadow 0.25s, opacity 0.25s;
}

.fh-selector-node.active .fh-selector-glow { opacity: 1; }

.fh-selector-label {
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 640px) {
  .fh-selector { gap: 0.4rem; padding: 0.35rem 0.55rem; }
  .fh-selector-node { padding: 0.22rem 0.45rem; font-size: 0.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .fh-selector,
  .fh-selector-node,
  .fh-selector-glow { transition: none; }
}
