/* ========================= HOME PAGE HERO: GROWTH CHART =========================
   The "chart" hero layout (HOME_HERO_LAYOUT): headline, a readout row that doubles as the
   legend, and the hypothetical growth of $10,000 drawn by static/js/model/hero-growth.js.
   Built from the theme.css tokens so it follows the light/dark switch without a redraw.

   Series colours are checked for colour-blind separation on each surface: the theme's brand
   and second-series colours in light; in dark the benchmark is amber, because the dark
   second-series cyan sits too close to the brand blue to tell two thin lines apart.
   ============================================================================== */
.uf .uz-hero .hg {
  --hg-model: var(--brand);
  --hg-bench: var(--brand-2);
  --hg-ring: var(--surface);          /* the ring that lifts a dot off the line under it */
  --hg-ref: var(--tx-3);              /* the optional third line (long/short pages): present, but behind the two it is read against */
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
:root[data-theme="dark"] .uf .uz-hero .hg {
  --hg-model: #6b8df2;
  --hg-bench: #bf8730;
  --hg-ring: #0d1222;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .uf .uz-hero .hg {
    --hg-model: #6b8df2;
    --hg-bench: #bf8730;
    --hg-ring: #0d1222;
  }
}
/* In the two-slide deck the slides share a height: let the chart block take the slack. The deck
   also sets the button row's top margin to auto, which is zero on the taller slide (this one, on
   a phone), so the space between the range presets and the button has to come from here. */
.uz-deck.has-cotw .uz-slide > .hg { flex: 1 1 auto; margin-bottom: 20px; }

/* Readout row: date, then each series with its dollar value, then the lead. */
.uf .hg-read { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 26px; }
.uf .hg-ser { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.uf .hg-ser[hidden] { display: none; }   /* the reference slot, while the live range is on */
.uf .hg-ser .nm { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--tx-2); }
.uf .hg-ser .sw { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.uf .hg-ser .sw.is-model { background: var(--hg-model); }
.uf .hg-ser .sw.is-bench { background: var(--hg-bench); }
.uf .hg-ser .sw.is-ref { height: 0; border-top: 2px dashed var(--hg-ref); border-radius: 0; }
.uf .hg-ser.is-ref .val { font-size: clamp(16px, 2vw, 19px); font-weight: 600; color: var(--tx-2); }
.uf .hg-ser .val {
  font-family: var(--font-mono);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--tx);
}
.uf .hg-ser .chg { font-family: var(--font-mono); font-size: 12px; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--tx-3); }
.uf .hg-lead {
  margin-bottom: 3px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--tx);
}
.uf .hg-lead.is-up { border-color: color-mix(in srgb, var(--up) 55%, transparent); }
.uf .hg-lead.is-down { border-color: color-mix(in srgb, var(--down) 55%, transparent); }
.uf .hg-when {
  margin-left: auto;
  padding-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--tx-2);
}
@media (max-width: 560px) {
  /* The date leads on its own line, so the two dollar figures stay side by side under it. */
  .uf .hg-when { order: -1; flex-basis: 100%; margin-left: 0; padding-bottom: 0; }
}

/* Plot. The height is reserved before the series arrives so the card does not jump. */
.uf .hg-chart { position: relative; min-width: 0; min-height: 340px; }
@media (max-width: 620px) { .uf .hg-chart { min-height: 240px; } }
.uf .hg-chart svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; cursor: crosshair; }
.uf .hg-chart text { font-family: var(--font-ui); font-size: 11px; fill: var(--tx-3); }
.uf .hg-chart .hg-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.uf .hg-chart .hg-grid { stroke: var(--line); stroke-width: 1; opacity: .6; }
.uf .hg-chart .hg-base { stroke: var(--line); stroke-width: 1; }
.uf .hg-chart .hg-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.uf .hg-chart .hg-line.is-model { stroke: var(--hg-model); }
.uf .hg-chart .hg-line.is-bench { stroke: var(--hg-bench); }
.uf .hg-chart .hg-line.is-ref { stroke: var(--hg-ref); stroke-width: 1.5; stroke-dasharray: 5 4; }
.uf .hg-chart .hg-dot { stroke: var(--hg-ring); stroke-width: 2; }
.uf .hg-chart .hg-dot.is-model { fill: var(--hg-model); }
.uf .hg-chart .hg-dot.is-bench { fill: var(--hg-bench); }
.uf .hg-chart .hg-dot.is-ref { fill: var(--hg-ref); }
.uf .hg-chart .hg-cross { stroke: var(--tx-2); stroke-width: 1; stroke-dasharray: 3 3; }
.uf .hg-chart .hg-band { fill: var(--tx); opacity: .07; }
.uf .hg-chart .hg-band-label { fill: var(--tx-2); font-weight: 700; }
.uf .hg-chart .hg-live { stroke: var(--up); stroke-width: 1; stroke-dasharray: 4 3; }
.uf .hg-chart .hg-live-label { fill: var(--tx-2); }
.uf .hg-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 16px;
  text-align: center;
  font-size: 13px;
  color: var(--tx-3);
}

/* Range presets: one segmented control. */
.uf .hg-ranges { display: inline-flex; align-self: flex-start; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.uf .hg-ranges button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 13px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--tx-2);
  cursor: pointer;
}
.uf .hg-ranges button + button { border-left: 1px solid var(--line); }
.uf .hg-ranges button:hover { color: var(--tx); }
.uf .hg-ranges button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.uf .hg-ranges button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* Under the range presets while the Live range is on: what the reader is now looking at. */
.uf .hg-live-note { margin: 0; max-width: 62ch; font-size: 12.5px; line-height: 1.45; color: var(--tx-2); }
.uf .hg-live-note a { color: inherit; text-decoration: underline; }
