/* =========================================================
   HERO GROWTH DASHBOARD
   Chart colours come from --chart-1 / --chart-2 (tokens.css), which are
   validated per theme — so the theme toggle recolours the chart for free.
   ========================================================= */

.dash {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.15rem, 2vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--gold) 7%, transparent), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px);
}

.dash--hero-video {
  padding: clamp(0.55rem, 1.4vw, 0.8rem);
}

.dash--hero-video .dash-head,
.dash--hero-video .dash-title,
.dash--hero-video .dash-note,
.dash--hero-video .dash-legend,
.dash--hero-video .dash-chart,
.dash--hero-video .dash-stats {
  display: none;
}

.hero-video-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--r-lg) - 0.45rem);
  background: #050403;
}

.hero-video-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.44), transparent 34%),
    radial-gradient(circle at 22% 16%, color-mix(in srgb, var(--gold) 20%, transparent), transparent 28%);
}

.hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050403;
}

.hero-video-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-pill);
  background: rgba(8, 7, 5, 0.62);
  backdrop-filter: blur(8px);
  color: #fff7e0;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-video-tag i {
  color: var(--gold);
}

/* Diagonal light sweep, top-left → bottom-right, then a long rest. */
.dash-shine {
  position: absolute;
  top: -60%;
  left: -60%;
  z-index: 3;
  width: 55%;
  height: 220%;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--gold) 26%, transparent),
    transparent
  );
  transform: rotate(25deg) translate3d(-260%, 0, 0);
  animation: dash-shine 7s var(--ease-in-out) infinite;
}
@keyframes dash-shine {
  0% {
    transform: rotate(25deg) translate3d(-260%, 0, 0);
  }
  /* Sweep happens in the first ~20%, then it waits off-screen. */
  22%,
  100% {
    transform: rotate(25deg) translate3d(320%, 0, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dash-shine {
    display: none;
  }
}

/* ---------- Header ---------- */
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.dash-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chart-2);
}
.dash-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--chart-2);
  animation: ping 2s var(--ease-out) infinite;
}
.dash-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--accent-wash);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.dash-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--text);
}
.dash-note {
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
}

/* ---------- Legend (identity is never colour-alone: swatch + text) ---------- */
.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0.85rem 0 0.35rem;
}
.dash-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  /* Text keeps text tokens; the swatch carries the series colour. */
  color: var(--text-muted);
}
.dash-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.dash-swatch--bars {
  background: var(--chart-1);
}
.dash-swatch--line {
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--chart-2);
}

/* ---------- Chart ---------- */
.dash-chart {
  margin-top: 0.25rem;
}
.dash-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Recessive grid + axis. */
.dash-grid,
.dash-axis {
  stroke: var(--line);
  stroke-width: 1;
}
.dash-axis {
  stroke: var(--line-strong);
}

.dash-bar {
  fill: var(--chart-1);
}
.dash-line {
  fill: none;
  stroke: var(--chart-2);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 2px surface ring so the marker reads over the bars it crosses. */
.dash-mark {
  fill: var(--chart-2);
  stroke: var(--surface);
  stroke-width: 2;
}
.dash-x {
  fill: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}
.dash-point-label {
  fill: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

/* ---------- Stat tiles ---------- */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hairline);
}
.dash-stat {
  display: flex;
  flex-direction: column-reverse; /* value above label, but <dt> stays first in DOM */
  gap: 0.1rem;
  text-align: center;
}
.dash-stat-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--gold);
}
.dash-stat-label {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
