/* ============================================================
   Live Threat Board — homepage headline metrics.
   Replaces the old external-feed intel cards, which degraded to
   "No fresh item in cache" whenever an RSS source failed.
   ============================================================ */

.threat-board {
  --tb-accent: #bd5fff;
  --tb-accent-soft: rgba(189, 95, 255, .10);
  margin: 14px 0 6px;
}

.threat-board__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.threat-board__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, .92);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.threat-board__pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tb-accent);
  animation: tbPulse 2.4s ease-in-out infinite;
}

@keyframes tbPulse {
  0%   { box-shadow: 0 0 0 0 rgba(189, 95, 255, .5); }
  70%  { box-shadow: 0 0 0 8px rgba(189, 95, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(189, 95, 255, 0); }
}

.threat-board__note {
  color: var(--text-faint);
  font-size: 11.5px;
}

.threat-board__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 620px) {
  .threat-board__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* auto-fit so the row still fills edge to edge when a tile has no data
   (e.g. no Pulse signals yet) and only three are rendered. */
@media (min-width: 1080px) {
  .threat-board__grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

/* ---------- Tile ---------- */

.tb-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
  padding: 13px 14px 11px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01)),
    rgba(255, 255, 255, .02);
  cursor: pointer;
  transition: transform .28s cubic-bezier(.22, .61, .36, 1),
              border-color .28s ease,
              box-shadow .28s ease;
}

.tb-tile:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--tb-accent) 42%, transparent);
  box-shadow: 0 20px 40px -22px rgba(0, 0, 0, .8);
}

.tb-tile:focus-within {
  border-color: color-mix(in srgb, var(--tb-accent) 55%, transparent);
  box-shadow: 0 0 0 3px var(--tb-accent-soft);
}

/* ---------- Content ---------- */

.tb-tile__link {
  color: inherit;
  text-decoration: none;
}

/* Stretches the eyebrow anchor over the whole tile. */
.tb-tile__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 16px;
}

.tb-tile__link:focus-visible { outline: none; }

.tb-tile__eyebrow {
  display: block;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.tb-tile__figure {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.tb-tile__value {
  color: #fff;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.9px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.tb-tile__label {
  color: var(--text-faint);
  font-size: 12px;
}

/* ---------- Sparkline ---------- */

.tb-tile__spark {
  height: 26px;
  margin: -1px 0 -3px;
}

.tb-tile__spark svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.tb-tile__spark-line {
  fill: none;
  stroke: var(--tb-accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.tb-tile__spark-area {
  fill: var(--tb-accent);
  fill-opacity: .13;
  stroke: none;
}

/* ---------- Facts ---------- */

.tb-tile__facts {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tb-tile__facts li {
  position: relative;
  padding-left: 13px;
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.45;
}

.tb-tile__facts li::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
}

.tb-tile__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  transition: color .2s ease;
}

.tb-tile__cta svg { transition: transform .25s ease; }

.tb-tile:hover .tb-tile__cta { color: var(--tb-accent); }

.tb-tile:hover .tb-tile__cta svg { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
  .tb-tile,
  .tb-tile__cta svg { transition: none; }

  .tb-tile:hover { transform: none; }

  .threat-board__pulse { animation: none; }
}
