/* ============================================================
   BuildMetrx — custom styles
   Only what the Tailwind CDN can't express: transitions tied to
   JS state, background textures, keyframes, and form error states.
   ============================================================ */

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Fixed navigation ---------- */

#site-header {
  background-color: rgba(15, 23, 42, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease,
    box-shadow 0.3s ease;
}

#site-header.is-scrolled {
  background-color: rgba(15, 23, 42, 0.95);
  border-bottom-color: rgba(148, 163, 184, 0.15);
  box-shadow: 0 12px 32px -16px rgba(2, 6, 23, 0.7);
}

/* ---------- Section textures ---------- */

.bg-blueprint {
  background-color: #0f172a;
  background-image: radial-gradient(
      ellipse 80% 55% at 50% -10%,
      rgba(245, 158, 11, 0.09),
      transparent 62%
    ),
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
}

/* ---------- Typography helpers ---------- */

.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #f59e0b;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0.8rem 1.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 3px;
}

.btn-amber {
  background-color: #f59e0b;
  color: #0f172a;
  box-shadow: 0 10px 24px -12px rgba(245, 158, 11, 0.65);
}

.btn-amber:hover {
  background-color: #fbbf24;
  transform: translateY(-1px);
}

.btn-blue {
  background-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 10px 24px -12px rgba(37, 99, 235, 0.55);
}

.btn-blue:hover {
  background-color: #3b82f6;
  transform: translateY(-1px);
}

.btn-outline-light {
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #ffffff;
}

.btn-outline-light:hover {
  border-color: rgba(226, 232, 240, 0.8);
  background-color: rgba(255, 255, 255, 0.06);
}

.btn-outline-dark {
  border: 1px solid #cbd5e1;
  color: #334155;
  background-color: #ffffff;
}

.btn-outline-dark:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Animated chart bars ---------- */

.bar-fill {
  width: 0;
  transition: width 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.bar-fill.is-filled {
  width: var(--w);
}

/* ---------- Live indicator ---------- */

.live-dot {
  animation: ci-pulse 2s ease-in-out infinite;
}

@keyframes ci-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ---------- Form validation states ---------- */

.field-error {
  display: none;
}

.field.has-error .field-error {
  display: block;
}

.field.has-error input,
.field.has-error select {
  border-color: #dc2626;
}

.field.has-error input:focus,
.field.has-error select:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .bar-fill {
    width: var(--w);
    transition: none;
  }

  .live-dot {
    animation: none;
  }

  .btn:hover {
    transform: none;
  }
}
