/* ============================================================
   WRKForce Connect — Animated Executive Dashboard (hero)
   Self-contained styles. Connect tokens: navy / lime / slate.
   ============================================================ */
:root {
  --navy: #0F172A; --navy-2: #1E293B; --navy-deep: #0B1322;
  --lime: #A8CF36; --lime-press: #94B82E;
  --blue: #3B82F6; --red: #EF4444; --amber: #F59E0B;
  --white: #FFFFFF;
  --s50: #F8FAFC; --s100: #F1F5F9; --s200: #E2E8F0; --s300: #CBD5E1;
  --s400: #94A3B8; --s500: #64748B; --s600: #475569; --s700: #334155;
  --display: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  background: var(--navy-deep);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* ============ Stage ============ */
.stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(30, 45, 75, .55), transparent 60%),
    var(--navy-deep);
}
.stage::before {
  content: "";
  position: absolute;
  width: 1180px; height: 760px;
  left: 50%; top: 50%;
  transform: translate(-50%, -52%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(168, 207, 54, .22), rgba(168, 207, 54, .05) 45%, transparent 72%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}
.stage::after {
  content: "";
  position: absolute;
  width: 1180px; height: 640px;
  left: 50%; top: 56%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(72, 110, 168, .26), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .stage::before { animation: glowPulse 9s ease-in-out infinite alternate; }
}
@keyframes glowPulse {
  0%   { opacity: .72; transform: translate(-50%, -52%) scale(1); }
  100% { opacity: 1;   transform: translate(-50%, -52%) scale(1.045); }
}

.scaler { position: relative; z-index: 1; transform-origin: center center; }

/* ============ Dashboard shell ============ */
.dash {
  width: 1180px;
  background: var(--s50);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 40px 100px rgba(0,0,0,.5);
  border: 1px solid rgba(15,23,42,.06);
}

/* topbar */
.d-top {
  height: 62px;
  background: var(--white);
  border-bottom: 1px solid var(--s200);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
}
.d-title { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--navy); letter-spacing: -0.01em; }
.d-title .tdot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(168,207,54,.18); }
.d-tabs { display: flex; gap: 4px; }
.d-tabs span { font-size: 13px; font-weight: 600; color: var(--s500); padding: 7px 13px; border-radius: 8px; }
.d-tabs span.active { color: var(--navy); background: var(--s100); }
.d-top .spacer { flex: 1; }
.d-live { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--s500); }
.d-live .ldot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
@media (prefers-reduced-motion: no-preference) { .d-live .ldot { animation: livePulse 2.4s ease-in-out infinite; } }
@keyframes livePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(168,207,54,.5); } 50% { box-shadow: 0 0 0 5px rgba(168,207,54,0); } }
.d-user { display: flex; align-items: center; gap: 9px; padding-left: 18px; border-left: 1px solid var(--s200); }
.d-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-family: var(--display); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.d-uname { font-size: 13px; font-weight: 600; color: var(--s700); }

/* body */
.d-body { padding: 24px; display: flex; flex-direction: column; gap: 18px; }

/* banner */
.banner {
  background: linear-gradient(110deg, var(--navy-deep) 0%, #15203A 60%, #1B2C4A 100%);
  border-radius: 16px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.banner::after { content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(closest-side, rgba(168,207,54,.16), transparent 70%); pointer-events: none; }
.b-mark { width: 50px; height: 50px; border-radius: 13px; background: rgba(168,207,54,.16); border: 1px solid rgba(168,207,54,.32); color: var(--lime); font-family: var(--display); font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; flex: none; }
.b-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(168,207,54,.9); }
.b-title { font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: #fff; margin-top: 2px; }
.b-sub { font-size: 13px; color: #93A4C4; margin-top: 3px; }
.banner .spacer { flex: 1; }
.b-side { text-align: right; position: relative; z-index: 1; }
.b-tag { font-family: var(--display); font-size: 13px; font-weight: 800; letter-spacing: .1em; color: var(--lime); }
.b-tag b { color: rgba(168,207,54,.5); margin: 0 4px; }
.b-meta { font-size: 11.5px; color: #93A4C4; margin-top: 5px; }

/* section label */
.d-label { font-family: var(--display); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--s400); margin: 2px 0 -4px; }

/* KPI cards */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi {
  background: var(--white);
  border: 1px solid var(--s200);
  border-radius: 14px;
  padding: 18px 18px 17px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.kpi-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.kpi-ic svg { width: 22px; height: 22px; }
.t-lime { background: rgba(168,207,54,.16); color: var(--lime-press); }
.t-navy { background: rgba(15,23,42,.08); color: var(--navy); }
.t-blue { background: rgba(59,130,246,.12); color: var(--blue); }
.t-purple { background: rgba(139,92,246,.13); color: #7C3AED; }
.kpi-v { font-family: var(--display); font-size: 25px; font-weight: 800; letter-spacing: -0.03em; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.05; }
.kpi-l { font-size: 12.5px; font-weight: 600; color: var(--s600); margin-top: 2px; }
.kpi-s { font-size: 11.5px; color: var(--s400); margin-top: 3px; }
.kpi-s b { color: var(--s600); font-weight: 700; }
.delta-up { color: var(--lime-press); font-weight: 700; }
.ring { width: 44px; height: 44px; flex: none; }
.ring circle { transform: rotate(-90deg); transform-origin: 50% 50%; }

/* card */
.card { background: var(--white); border: 1px solid var(--s200); border-radius: 16px; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 14px; }
.card-title { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-size: 15.5px; font-weight: 700; color: var(--navy); letter-spacing: -0.01em; }
.card-title svg { width: 18px; height: 18px; color: var(--s500); }
.card-sub { font-size: 12px; color: var(--s400); margin-top: 3px; }
.card-head .spacer { flex: 1; }
.legend { display: flex; gap: 16px; }
.key { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--s500); }
.sw { width: 11px; height: 11px; border-radius: 3px; }
.sw-lime { background: var(--lime); } .sw-slate { background: var(--s300); }
.sw-blue { background: var(--blue); } .sw-red { background: var(--red); }
.card-body { padding: 6px 22px 22px; }

/* budget band */
.band-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.band { border: 1px solid var(--s200); border-left-width: 3px; border-radius: 10px; padding: 13px 15px; }
.b-navy { border-left-color: var(--navy); } .b-lime { border-left-color: var(--lime); }
.b-blue { border-left-color: var(--blue); } .b-amber { border-left-color: var(--amber); }
.band-l { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--s400); }
.band-v { font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: -0.025em; color: var(--navy); font-variant-numeric: tabular-nums; margin-top: 4px; }
.band-x { font-size: 11px; color: var(--s400); margin-top: 3px; }
.progress { position: relative; height: 14px; border-radius: 8px; background: var(--s100); margin: 18px 0 12px; overflow: hidden; }
.progress .fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--lime-press), var(--lime)); transform-origin: left center; }
.progress .marker { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--navy); opacity: .55; }
.band-note { display: flex; justify-content: space-between; font-size: 12px; color: var(--s500); }
.band-note b { color: var(--navy); font-weight: 700; }

/* charts row */
.charts { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 18px; }

/* spending bars */
.spend-plot { display: flex; align-items: flex-end; gap: 10px; height: 232px; padding-top: 24px; border-bottom: 1.5px solid var(--s200); }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.bar { width: 100%; max-width: 42px; border-radius: 5px 5px 0 0; align-self: center; transform-origin: bottom center; }
.bar.actual { background: linear-gradient(180deg, #B5DB48, #9CC02F); }
.bar.projected { background: var(--s300); }
.bar-val { position: absolute; top: -2px; left: 50%; transform: translate(-50%, -100%); font-family: var(--display); font-size: 10.5px; font-weight: 700; color: var(--s600); white-space: nowrap; }
.spend-x { display: flex; gap: 10px; margin-top: 8px; }
.spend-x span { flex: 1; text-align: center; font-size: 11px; font-weight: 600; color: var(--s400); }
.spend-x span.on { color: var(--s600); }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 18px; padding-top: 6px; }
.donut { width: 168px; height: 168px; flex: none; }
.donut circle { transform: rotate(-90deg); transform-origin: 50% 50%; }
.donut-num { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.02em; fill: var(--navy); }
.donut-cap { font-size: 11px; font-weight: 600; fill: var(--s400); letter-spacing: .02em; }
.dlegend { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.dl { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 9px; }
.dl .nm { font-size: 13px; font-weight: 600; color: var(--s700); }
.dl .vl { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--navy); font-variant-numeric: tabular-nums; }
.dl .pc { grid-column: 2 / 4; font-size: 11.5px; color: var(--s400); font-variant-numeric: tabular-nums; }
.card-foot { padding: 13px 22px; border-top: 1px solid var(--s100); font-size: 12.5px; color: var(--s500); background: var(--s50); }

/* ============ Entrance animation (final state is the DEFAULT; hidden only pre-play) ============ */
.stage.armed:not(.play) .dash { opacity: 0; transform: translateY(26px) scale(.992); }
.stage.armed.play .dash { transition: opacity 1.1s cubic-bezier(.22,.8,.3,1), transform 1.25s cubic-bezier(.22,.8,.3,1); }

.stage.armed:not(.play) .rise { opacity: 0; transform: translateY(16px); }
.stage.armed.play .rise { transition: opacity .95s cubic-bezier(.22,.8,.3,1), transform .95s cubic-bezier(.22,.8,.3,1); transition-delay: calc(var(--d, 0s) * 1.6); }

/* budget fill grows once */
.stage.armed:not(.play) .progress .fill { transform: scaleX(0); }
.stage.armed.play .progress .fill { transition: transform 2.1s cubic-bezier(.3,.7,.2,1); transition-delay: 1.6s; }
.stage.armed:not(.play) .progress .marker { opacity: 0; }
.stage.armed.play .progress .marker { transition: opacity .7s ease; transition-delay: 3.4s; }

/* spending bars grow once */
.stage.armed:not(.play) .bar { transform: scaleY(0); }
.stage.armed.play .bar { transition: transform 1.25s cubic-bezier(.3,.7,.2,1); transition-delay: calc(var(--bd, 1.2s) * 1.55); }
.stage.armed:not(.play) .bar-val { opacity: 0; }
.stage.armed.play .bar-val { transition: opacity .6s ease; transition-delay: calc(var(--vd, 1.8s) * 1.55); }

/* donut + ring draw once */
.stage.armed:not(.play) .donut .seg { stroke-dasharray: 0 464.96; }
.stage.armed.play .donut .seg { transition: stroke-dasharray 1.9s cubic-bezier(.3,.7,.2,1); transition-delay: 2s; }
.stage.armed:not(.play) .ring .rfill { stroke-dasharray: 0 100.53; }
.stage.armed.play .ring .rfill { transition: stroke-dasharray 1.7s cubic-bezier(.3,.7,.2,1); transition-delay: 1.1s; }

@media (prefers-reduced-motion: reduce) {
  .dash, .rise, .bar, .bar-val, .progress .fill, .progress .marker { opacity: 1 !important; transform: none !important; }
}

/* Hero embed shows the full dashboard statically (no pan) — height is governed by .hero-fold in marketing.css */

/* ============ Replay control ============ */
.replay {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 10;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(148,163,184,.28);
  color: #C2CEE3;
  font-family: var(--body); font-size: 13px; font-weight: 600;
  padding: 9px 15px; border-radius: 10px; cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.replay:hover { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(226,232,240,.5); }
.replay svg { width: 15px; height: 15px; }
