/* ============================================================
   Nexus HOME - cinematic command-center
   A dark aurora HERO band + premium stat tiles, module launcher
   and radar bars. Every accent from a design token so both themes
   (light + dark, via [data-theme]) resolve. Motion is choreographed
   and fully disabled under prefers-reduced-motion.
   ============================================================ */

.home { display: flex; flex-direction: column; gap: 20px; }
/* spacing is owned by the flex gap above; neutralise inherited margins */
.home .section-gap { margin-top: 0; }
.home-section { display: flex; flex-direction: column; }
.home-section .card-head { margin-bottom: 14px; }

/* ---------- Choreographed entrance ----------
   Resting state is fully visible; the animation only plays while the
   root carries .home-animate (added by JS, never under reduced motion). */
.reveal { opacity: 1; }
.home-animate .reveal {
  animation: homeRise .62s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--d, 0) * 70ms);
}
@keyframes homeRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.home-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, .07);
  padding: 38px 40px 34px;
  min-height: 226px;
  display: flex;
  isolation: isolate;
  /* deep cinematic canvas - decorative band, tinted by brand/violet tokens */
  background:
    radial-gradient(120% 150% at 10% -30%, color-mix(in srgb, var(--brand) 42%, transparent) 0%, transparent 58%),
    radial-gradient(110% 150% at 108% 130%, color-mix(in srgb, var(--violet) 40%, transparent) 0%, transparent 55%),
    linear-gradient(152deg, #08201a 0%, #061412 46%, #05090c 100%);
  box-shadow:
    0 30px 60px -32px rgba(4, 20, 15, .9),
    inset 0 1px 0 rgba(255, 255, 255, .06);
  color: #eafaf3;
}
[data-theme="dark"] .home-hero {
  border-color: rgba(255, 255, 255, .06);
  background:
    radial-gradient(120% 150% at 10% -30%, color-mix(in srgb, var(--brand) 34%, transparent) 0%, transparent 58%),
    radial-gradient(110% 150% at 108% 130%, color-mix(in srgb, var(--violet) 32%, transparent) 0%, transparent 55%),
    linear-gradient(152deg, #0a1613 0%, #070d0f 48%, #04070a 100%);
}
/* animated aurora canvas */
.hh-aurora {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: -2; pointer-events: none; opacity: .9;
}
/* contrast veil + fine grain over the aurora so text stays crisp */
.hh-veil {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(105deg, rgba(3, 12, 9, .58) 0%, rgba(3, 12, 9, .12) 46%, transparent 72%),
    radial-gradient(140% 120% at 50% 120%, rgba(2, 8, 6, .5), transparent 60%);
}
.hh-veil::after {
  content: ""; position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hh-inner {
  position: relative; z-index: 1;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; flex-wrap: wrap; width: 100%;
}
.hh-lead { min-width: 0; max-width: 640px; }
.hh-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  color: rgba(234, 250, 243, .74);
}
.hh-eyebrow .tag { vertical-align: middle; }
.hh-eyebrow .hh-dot { opacity: .5; }
.hh-live {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-2, var(--brand));
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-2, var(--brand)) 80%, transparent);
  animation: hhPulse 2.4s ease-out infinite;
}
@keyframes hhPulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-2, var(--brand)) 70%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hh-greet {
  margin: 14px 0 0; font-size: 34px; line-height: 1.06; font-weight: 780;
  letter-spacing: -0.035em;
  background: linear-gradient(174deg, #ffffff 6%, #bff3df 128%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hh-tag {
  margin: 11px 0 0; font-size: 14.5px; line-height: 1.55;
  color: rgba(234, 250, 243, .72); max-width: 500px; font-weight: 450;
}

/* hero headline metrics (count up) */
.hh-metrics {
  display: flex; align-items: stretch; gap: 26px; flex: 0 0 auto;
  padding-bottom: 2px;
}
.hh-sep { width: 1px; align-self: stretch; margin: 4px 0;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .16), transparent); }
.hh-metric { min-width: 88px; opacity: 1; }
.hh-val {
  font-size: 32px; font-weight: 820; line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff, #b9ead9 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.hh-val small { font-size: 15px; font-weight: 650; color: rgba(234, 250, 243, .55);
  -webkit-text-fill-color: rgba(234, 250, 243, .55); margin-left: 1px; }
.hh-lab { margin-top: 9px; font-size: 11px; font-weight: 650; letter-spacing: .09em;
  text-transform: uppercase; color: rgba(234, 250, 243, .62); }
.hh-sub { margin-top: 3px; font-size: 11.5px; color: rgba(234, 250, 243, .46); font-weight: 450; }

.home-animate .hh-eyebrow { animation: hhFade .6s ease both; animation-delay: .06s; }
.home-animate .hh-greet   { animation: hhFade .6s ease both; animation-delay: .14s; }
.home-animate .hh-tag     { animation: hhFade .6s ease both; animation-delay: .22s; }
.home-animate .hh-metric  { animation: hhFade .7s ease both; animation-delay: calc(.30s + var(--d, 0) * .09s); }
@keyframes hhFade {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   PREMIUM STAT TILES
   ============================================================ */
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.home-stat {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 18px 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 14px 30px -22px rgba(16, 24, 40, .3);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s cubic-bezier(.2, .8, .2, 1), border-color .35s;
}
.home-stat:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 26px 46px -26px var(--brand-glow), 0 14px 26px -22px rgba(16, 24, 40, .28);
}
/* sheen sweep on hover */
.home-stat::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .16), transparent);
  transform: skewX(-16deg); transition: left .7s cubic-bezier(.2, .8, .2, 1); pointer-events: none;
}
[data-theme="dark"] .home-stat::after { background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .07), transparent); }
.home-stat:hover::after { left: 130%; }

.hs-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 16px -10px currentColor;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.hs-ic svg { width: 20px; height: 20px; }
.home-stat:hover .hs-ic { transform: scale(1.08) rotate(-4deg); }
.hs-ic.brand  { background: var(--brand-soft);  color: var(--brand); }
.hs-ic.green  { background: var(--green-soft);  color: var(--green); }
.hs-ic.cyan   { background: var(--cyan-soft);   color: var(--cyan); }
.hs-ic.amber  { background: var(--amber-soft);  color: var(--amber); }
.hs-ic.violet { background: var(--violet-soft); color: var(--violet); }
.hs-ic.red    { background: var(--red-soft);    color: var(--red); }

.hs-label { color: var(--text-faint); font-size: 12.5px; font-weight: 550; }
.hs-val { margin-top: 4px; font-size: 30px; font-weight: 780; letter-spacing: -0.03em; line-height: 1.08;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--brand-ink, var(--brand)), var(--brand));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hs-val small { font-size: 14px; font-weight: 650; color: var(--text-faint); -webkit-text-fill-color: var(--text-faint); }
.hs-foot { margin-top: 9px; font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }

.home-animate .home-stat { animation: homeRise .55s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(.16s + var(--d, 0) * .06s); }

/* ============================================================
   MODULE LAUNCHER - keep the gradient icons + data-go, add polish
   ============================================================ */
.home-modules .module-card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface), var(--surface));
  border-radius: 16px;
}
/* top hairline accent that lights up on hover */
.home-modules .module-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 2;
  background: linear-gradient(90deg, var(--brand-2, var(--brand)), var(--brand));
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.home-modules .module-card:hover::before { opacity: .9; }
/* diagonal sheen sweep */
.home-modules .module-card::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 55%; height: 100%; z-index: 1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .14), transparent);
  transform: skewX(-16deg); transition: left .75s cubic-bezier(.2, .8, .2, 1); pointer-events: none;
}
[data-theme="dark"] .home-modules .module-card::after { background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .06), transparent); }
.home-modules .module-card:hover::after { left: 130%; }
.home-modules .module-card .m-ic {
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.home-modules .module-card:hover .m-ic { transform: scale(1.07) rotate(-4deg); }
.home-modules .module-card h3 { position: relative; z-index: 2; }
.home-modules .module-card .m-desc, .home-modules .module-card .m-foot { position: relative; z-index: 2; }

.home-animate .home-modules .module-card { animation: homeRise .55s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(.30s + var(--d, 0) * .06s); }

/* ============================================================
   UPWORK RADAR BY PROFILE - bars
   ============================================================ */
.home-radar .hr-list { display: flex; flex-direction: column; }
.hr-row {
  display: grid; grid-template-columns: 168px 1fr auto; align-items: center; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--border-soft);
}
.hr-row:last-child { border-bottom: 0; }
.hr-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.hr-off { font-size: 11px; color: var(--text-faint); }
.hr-track { height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hr-fill { display: block; height: 100%; border-radius: 999px; min-width: 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); transform-origin: left center; }
.hr-count { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.hr-count small { font-size: 11px; font-weight: 550; color: var(--text-faint); margin-left: 4px; }
.hr-lastrun { margin-top: 12px; font-size: 12px; color: var(--text-faint); font-weight: 500;
  display: flex; align-items: center; gap: 7px; }
.hr-lastrun svg { color: var(--brand); flex: none; }

.home-animate .hr-fill { animation: hrGrow .9s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(.42s + var(--d, 0) * .07s); }
@keyframes hrGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .home-stats { grid-template-columns: repeat(2, 1fr); }
  .home-modules { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .home-hero { padding: 28px 22px 26px; min-height: 0; }
  .hh-inner { align-items: flex-start; gap: 22px; }
  .hh-greet { font-size: 27px; }
  .hh-metrics { gap: 18px; flex-wrap: wrap; }
  .hh-val { font-size: 26px; }
}
@media (max-width: 640px) {
  .home-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .home-modules { grid-template-columns: 1fr; }
  .hh-metrics { width: 100%; }
  .hr-row { grid-template-columns: 120px 1fr auto; gap: 10px; }
}
@media (max-width: 420px) {
  .home-stats { grid-template-columns: 1fr; }
  .hr-row { grid-template-columns: 1fr auto; }
  .hr-track { display: none; }
}

/* ============================================================
   REDUCED MOTION - instant, no ambient animation, no sheen sweep
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .home-animate .reveal,
  .home-animate .home-stat,
  .home-animate .home-modules .module-card,
  .home-animate .hh-eyebrow, .home-animate .hh-greet,
  .home-animate .hh-tag, .home-animate .hh-metric,
  .home-animate .hr-fill { animation: none !important; }
  .home-stat::after, .home-modules .module-card::after { display: none; }
  .hh-live { animation: none; }
  .hr-fill { transform: none !important; }
}
