/* =========================================================================
   HIRING RECORD DEMO (#hiringRecordDemo) — hero visual on
   /v2/headcount-planning-v2.
   See src/components/HiringRecordDemo.astro for the storyboard.
   Timeline: public/js/hiring-record-demo.js toggles `is-*` classes and
   positions `.hrdBadge` at runtime.

   A single steady scene, no crossfade — one shared twelve-month header
   above four stacked single-metric panel rows (Base / Tax / Benefits /
   Total). Same structure as StatementYearDemo, one more row. Same
   --xxx-canvas/card/border/accent palette (product likeness) as every
   other demo on the site.
   ========================================================================= */

.hrd {
  --hrd-canvas: #FAF9F5;
  --hrd-card: #FFFFFF;
  --hrd-border: #DBDBDE;
  --hrd-line: #EAEAEA;
  --hrd-head: #F6F6F7;
  --hrd-ink: #2B2B2B;
  --hrd-ink2: #777777;
  --hrd-accent: #6A5BC6;
  --hrd-accent-soft: #ECECFF;
}

.hrd__stage {
  position: relative; overflow: hidden; width: 100%;
  aspect-ratio: 3 / 2; min-height: 420px; max-width: 640px; margin: 0 auto;
  background: var(--hrd-canvas);
  display: flex; flex-direction: column;
  transition: opacity .5s ease;
}
.hrd.is-out .hrd__stage { opacity: 0; }

.hrd__topBar {
  flex: none; font-size: 11px; font-weight: 600; color: var(--hrd-ink);
  padding: 12px 14px 9px; border-bottom: 1px solid var(--hrd-line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.hrd__pane { flex: 1; min-height: 0; min-width: 0; padding: 14px 14px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }

.hrdGrid { display: grid; grid-template-columns: 96px repeat(12, 1fr); max-width: 100%; }
.hrdGrid--head {
  background: var(--hrd-head); border: 1px solid var(--hrd-border); border-radius: 6px 6px 0 0;
  border-bottom: 0;
}
.hrdCell {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 5px 4px; font-size: 8px; color: var(--hrd-ink2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background .3s ease, outline-color .3s ease;
  position: relative;
}
.hrdCell--corner { justify-content: flex-start; font-weight: 600; color: var(--hrd-ink); font-size: 7.5px; }
.hrdCell--head { font-weight: 500; }
.hrdCell--label { justify-content: flex-start; font-weight: 600; color: var(--hrd-ink); font-size: 7px; line-height: 1.25; white-space: normal; }
.hrdCell--val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--hrd-ink); }

.hrdPanel {
  border: 1px solid var(--hrd-border); border-top: 0;
  background: var(--hrd-card);
  padding: 4px 0 6px;
}
.hrdPanel:last-child { border-radius: 0 0 6px 6px; }
.hrdPanel + .hrdPanel { border-top: 1px solid var(--hrd-line); }
.hrdPanel--total { background: var(--hrd-head); }
.hrdPanel--total .hrdCell--label,
.hrdPanel--total .hrdCell--val { font-weight: 700; color: var(--hrd-ink); }

.hrdPanel__tag {
  display: inline-block; margin: 0 0 3px 96px;
  font-size: 7px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--hrd-ink2);
}

/* a cell the callout badge is currently pointing at. */
.hrdCell.is-flagged {
  outline: 1.5px solid var(--hrd-accent); outline-offset: -1.5px;
  background: var(--hrd-accent-soft); color: var(--hrd-accent);
}

/* ---------- callout badge — positioned at runtime (JS sets left/top in
   px via getBoundingClientRect against .hrd__stage), points at the cell
   boundary it's explaining. ---------- */
.hrdBadge {
  position: absolute; opacity: 0; pointer-events: none; z-index: 9;
  transform: translate(-50%, -100%) translateY(-8px);
  background: var(--hrd-ink); color: #fff; border-radius: 6px;
  padding: 5px 9px; font-size: 8.5px; font-weight: 600; white-space: nowrap;
  transition: left .6s cubic-bezier(.5, .05, .3, 1), top .6s cubic-bezier(.5, .05, .3, 1), opacity .35s ease;
}
.hrdBadge::after {
  content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--hrd-ink);
}
.hrd.is-badge-visible .hrdBadge { opacity: 1; }

@media (max-width: 460px) {
  .hrd__stage { aspect-ratio: auto; min-height: 480px; }
  .hrd__pane { padding: 14px 8px; }
  .hrdGrid { grid-template-columns: 46px repeat(12, 1fr); }
  .hrdCell { font-size: 5.2px; padding: 4px 1px; }
  .hrdCell--corner, .hrdCell--label { font-size: 5.2px; }
  .hrdPanel__tag { margin-left: 46px; }
  .hrdBadge { font-size: 7.5px; padding: 4px 7px; white-space: normal; max-width: 140px; text-align: center; }
}
