/**
 * CRT standard UI typography — load LAST in <head> (after page <style> blocks).
 *
 * Category headers: --crt-cat-* — 12px DM Mono 500, uppercase, letter-spacing 0.14em.
 * Pill labels only: --crt-pill-* — 13px Outfit medium (500) on chips / rounded pills /
 * compact toggles (.chip, tab-btn, .ca-sort-btn, .ca-region-chip, .ff-reg-btn, etc.).
 */
html {
  -webkit-font-smoothing: antialiased;
}

/* ── 12px uppercase category labels ─────────────────────────────── */
.hero-label {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
}

.sort-row label,
.ff-origins-title,
.sort-controls label,
.scatter-title,
.hm-legend-title,
.hm-sum-l,
.hm-sort-caption {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
  color: var(--text3);
}

.rp-help summary {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
}

.rp-eyebrow:not(.rp-eyebrow--tagline) {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
}

.sample-kpi-label,
.kpi-label {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
}

.preview-card-title {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
}

.roi-table th {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
}

.gap-hl-title {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
}

.journey-node-title {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
}

.toolbar-note {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
}

.sum-doc .sum-section-title,
.sum-doc .sum-prepared-label {
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
}

.sum-doc .table th {
  font-size: var(--crt-cat-fs);
  letter-spacing: var(--crt-cat-ls);
  font-weight: var(--crt-cat-fw);
}

.props-label {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
}

#class-analysis .ca-chart-rail-label {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
  color: var(--text3);
}

#class-analysis .ca-region-callout-title.is-prompt {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
}

#class-analysis .ca-sort-row label,
.ca-sort-row label {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
  color: var(--text-muted);
}

.pick-sel-hdr {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
}

.chip-box-title:not(.chip-title-fw) {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
}

.chip-box-title.chip-title-fw {
  font-family: var(--outfit);
  font-size: var(--crt-pill-fs);
  font-weight: var(--crt-pill-fw);
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.35;
}

.rm-badge {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
  color: var(--text3);
}

.fw-card-cat {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
  color: var(--text3);
}


.results-count {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
  color: var(--text3);
}

#class-analysis .ca-results-count,
.ca-results-count {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
  color: var(--text-muted);
}

.sum-doc .sum-kpi-label {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
}

.ca-inp-row label {
  font-family: var(--mono);
  font-size: var(--crt-cat-fs);
  font-weight: var(--crt-cat-fw);
  letter-spacing: var(--crt-cat-ls);
  text-transform: uppercase;
}


/* ── 13px Outfit medium pill / chip captions ─────────────────────── */
.tab-btn {
  font-family: var(--outfit);
  font-size: var(--crt-pill-fs);
  font-weight: var(--crt-pill-fw);
}

.sort-btn,
.view-btn {
  font-family: var(--outfit);
  font-size: var(--crt-pill-fs);
  font-weight: var(--crt-pill-fw);
}

.fw-add-btn {
  font-family: var(--outfit);
  font-size: var(--crt-pill-fs);
  font-weight: var(--crt-pill-fw);
}

.tag {
  font-family: var(--outfit);
  font-size: var(--crt-pill-fs);
  font-weight: var(--crt-pill-fw);
}

.pick-chip {
  font-family: var(--outfit);
  font-size: var(--crt-pill-fs);
  font-weight: var(--crt-pill-fw);
}

.chip {
  font-family: var(--outfit);
  font-size: var(--crt-pill-fs);
  font-weight: var(--crt-pill-fw);
}

#class-analysis .ca-region-chip,
.ca-region-chip {
  font-family: var(--outfit);
  font-size: var(--crt-pill-fs);
  font-weight: var(--crt-pill-fw);
}

#class-analysis .ca-sort-btn,
.ca-sort-btn {
  font-family: var(--outfit);
  font-size: var(--crt-pill-fs);
  font-weight: var(--crt-pill-fw);
}

.chip-e,
.chip-t {
  font-family: var(--outfit);
  font-size: var(--crt-pill-fs);
  font-weight: var(--crt-pill-fw);
}

.ff-region-filters .ff-reg-btn {
  font-family: var(--outfit);
  font-size: var(--crt-pill-fs);
  font-weight: var(--crt-pill-fw);
}

.ff-region-filters .ff-reg-btn.active {
  font-weight: 600;
}

.tab-btn.active,
.sort-btn.active,
.view-btn.active {
  font-weight: 600;
}

#class-analysis .ca-sort-btn.active,
.ca-sort-btn.active {
  font-weight: 600;
}


/* ─────────────────────────────────────────────────────────────────────────
   Card hover — subtle lift only. The "shimmer" lives on the top accent
   line of each card (animated gradient), not on the whole body.
   .hm-cell excluded (color-coded bg + own hover).
   ───────────────────────────────────────────────────────────────────────── */
.fw-card,
.kpi-card,
.hm-sum-card,
.neighbor-card,
.journey-time-card,
.prev-stat {
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.fw-card:hover,
.fw-card:focus-within,
.kpi-card:hover,
.hm-sum-card:hover,
.neighbor-card:hover,
.neighbor-card:focus-within,
.journey-time-card:hover,
.prev-stat:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 22px -8px rgba(245, 167, 0, 0.22),
    0 3px 10px -3px rgba(0, 0, 0, 0.45);
  border-color: rgba(245, 167, 0, 0.35);
}

/* ─────────────────────────────────────────────────────────────────────────
   Top accent line — continuous left→right gradient flow.
   Targets KPI cards' built-in top stripe, Framework Finder card stripe,
   and the Gap header narrative top bar.
   The gradient is symmetric so background-position can loop seamlessly.
   ───────────────────────────────────────────────────────────────────────── */
@keyframes crt-line-flow {
  from { background-position: 0% 50%; }
  to   { background-position: 200% 50%; }
}
:root {
  --crt-line-flow-duration: 12s;
}

/* Top accent line — static gradient by default.
   On hover, gently glides left→right. Subtle colors, slow tempo. */
.kpi-card::before,
.fw-card-accent,
.gap-fuse-inner::before,
.prev-stat::before,
.sum-kpi::before {
  background-image: linear-gradient(
    90deg,
    rgba(74, 158, 255, 0.55) 0%,
    rgba(245, 167, 0, 0.65) 25%,
    rgba(74, 158, 255, 0.55) 50%,
    rgba(245, 167, 0, 0.65) 75%,
    rgba(74, 158, 255, 0.55) 100%
  ) !important;
  background-size: 200% 100% !important;
  background-repeat: no-repeat !important;
  background-position: 0% 50%;
  animation: none;
}

/* Normalize top-bar stripe sizing inside card borders and animate via overlay.
   This keeps motion reliable even when pages set inline `background:` styles. */
.fw-card-top-bar,
.ca-fw-card-top-bar {
  --crt-topbar-radius: calc(var(--r2) - 1px);
  --crt-topbar-inset-x: 2px;
  --crt-topbar-inset-y: 1px;
  position: absolute;
  top: var(--crt-topbar-inset-y);
  left: var(--crt-topbar-inset-x);
  right: var(--crt-topbar-inset-x);
  height: 2px !important;
  border-radius: calc(var(--crt-topbar-radius) - 1px) calc(var(--crt-topbar-radius) - 1px) 0 0;
  overflow: hidden;
}
.ca-fw-card-top-bar {
  --crt-topbar-radius: calc(var(--radius-lg) - 1px);
  --crt-topbar-inset-x: 2px;
  --crt-topbar-inset-y: 1px;
}
.fw-card-top-bar::after,
.ca-fw-card-top-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    90deg,
    rgba(74, 158, 255, 0.55) 0%,
    rgba(245, 167, 0, 0.65) 25%,
    rgba(74, 158, 255, 0.55) 50%,
    rgba(245, 167, 0, 0.65) 75%,
    rgba(74, 158, 255, 0.55) 100%
  );
  background-size: 220% 100%;
  background-repeat: no-repeat;
  background-position: 0% 50%;
}

/* Add the same 2px top accent line to cards that don't have one natively */
.hm-sum-card,
.hrs-card,
.neighbor-card {
  position: relative;
  overflow: hidden;
}
.hm-sum-card::before,
.hrs-card::before,
.neighbor-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-image: linear-gradient(
    90deg,
    rgba(74, 158, 255, 0.55) 0%,
    rgba(245, 167, 0, 0.65) 25%,
    rgba(74, 158, 255, 0.55) 50%,
    rgba(245, 167, 0, 0.65) 75%,
    rgba(74, 158, 255, 0.55) 100%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  background-position: 0% 50%;
  pointer-events: none;
}

/* Hover animations — every card with a top line flows on hover */
.kpi-card:hover::before,
.fw-card:hover .fw-card-accent,
.fw-card:focus-within .fw-card-accent,
.fw-card:hover .fw-card-top-bar::after,
.fw-card:focus-within .fw-card-top-bar::after,
.gap-fuse-outer:hover .gap-fuse-inner::before,
.gap-fuse-inner:hover::before,
.hm-sum-card:hover::before,
.hrs-card:hover::before,
.neighbor-card:hover::before,
.neighbor-card:focus-within::before,
.prev-stat:hover::before,
.ca-fw-card:hover .ca-fw-card-top-bar::after,
.ca-fw-card:focus-within .ca-fw-card-top-bar::after,
.sum-kpi:hover::before {
  animation: crt-line-flow var(--crt-line-flow-duration) linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .fw-card,
  .kpi-card,
  .hm-sum-card,
  .neighbor-card,
  .journey-time-card,
  .prev-stat {
    transition: none;
  }
  .fw-card:hover,
  .kpi-card:hover,
  .hm-sum-card:hover,
  .neighbor-card:hover,
  .journey-time-card:hover,
  .prev-stat:hover {
    transform: none;
  }
  .kpi-card::before,
  .fw-card-accent,
  .gap-fuse-inner::before,
  .prev-stat::before,
  .fw-card-top-bar::after,
  .ca-fw-card-top-bar::after,
  .sum-kpi::before {
    animation: none;
  }
}
