/* hero-card.css — the hero visual card (image/illustration card on the right of the hero).
   hero-card.js wraps every .hero-visual-card in a .hc-stage (tilt + halo + chips) and injects
   .hc-ring (animated border), .hc-glare (cursor reflection + periodic sheen), .hc-live (panel dot)
   and .hc-chip elements. Everything animates with transform/opacity only.
   The OS "reduce motion" setting intentionally does not switch these off (site-wide decision). */

/* ------------------------------------------------------------------ tokens */
.hc-stage {
  --hc-accent: var(--primary);
  --hc-accent-2: #22d3ee;
  --hc-halo-o: .55;
  --hc-glare-o: .4;
  --hc-chip-bg: color-mix(in srgb, var(--card) 82%, transparent);
  position: relative;
  min-width: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.hc-stage.hc-game { --hc-accent: var(--game-accent); --hc-accent-2: #60a5fa; }
html[data-theme="light"] .hc-stage {
  --hc-halo-o: .30;
  --hc-glare-o: .38;
  --hc-chip-bg: color-mix(in srgb, #fff 92%, transparent);
}

/* ------------------------------------------------------------------ halo behind the card */
.hc-stage::before {
  content: "";
  position: absolute;
  inset: 8% 6% 4%;
  border-radius: 40px;
  background:
    radial-gradient(60% 60% at 30% 35%, color-mix(in srgb, var(--hc-accent) 70%, transparent), transparent 70%),
    radial-gradient(55% 55% at 75% 70%, color-mix(in srgb, var(--hc-accent-2) 45%, transparent), transparent 70%);
  filter: blur(42px);
  opacity: var(--hc-halo-o);
  transform: translateZ(-40px) scale(1.04);
  pointer-events: none;
  animation: hcHalo 7s ease-in-out infinite alternate;
}
@keyframes hcHalo {
  from { opacity: calc(var(--hc-halo-o) * .55); transform: translateZ(-40px) scale(.98); }
  to   { opacity: var(--hc-halo-o);             transform: translateZ(-40px) scale(1.06); }
}

/* ------------------------------------------------------------------ the card */
.hc-stage > .hero-visual-card {
  isolation: isolate;
  border-color: color-mix(in srgb, var(--hc-accent) 28%, var(--border-strong));
  box-shadow:
    0 30px 60px -18px rgba(0, 0, 0, .55),
    0 18px 50px -20px color-mix(in srgb, var(--hc-accent) 55%, transparent);
}
html[data-theme="light"] .hc-stage > .hero-visual-card {
  border-color: color-mix(in srgb, var(--hc-accent) 22%, var(--border-strong));
  box-shadow:
    0 28px 56px -22px rgba(15, 23, 42, .28),
    0 16px 44px -22px color-mix(in srgb, var(--hc-accent) 45%, transparent);
}

/* Ken Burns: slow zoom/pan on the photo or illustration (overrides the old hover scale) */
.hc-stage .hero-img-wrap > img,
.hc-stage .cs-hero-art,
.hc-stage .cs2-hero-art {
  transform-origin: 60% 40%;
  animation: hcKenBurns 22s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes hcKenBurns {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.12) translate3d(-2.2%, 1.4%, 0); }
}

/* ------------------------------------------------------------------ animated gradient border */
.hc-ring {
  position: absolute;
  inset: 0;
  z-index: 6;
  padding: 1.5px;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.hc-ring::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220%;
  aspect-ratio: 1;
  margin-left: -110%;
  margin-top: -110%;
  background: conic-gradient(from 0deg,
    transparent 0deg,
    transparent 200deg,
    color-mix(in srgb, var(--hc-accent) 80%, transparent) 260deg,
    #fff 292deg,
    color-mix(in srgb, var(--hc-accent-2) 80%, transparent) 318deg,
    transparent 360deg);
  animation: hcSpin 9s linear infinite;
}
html[data-theme="light"] .hc-ring::before {
  background: conic-gradient(from 0deg,
    transparent 0deg,
    transparent 200deg,
    var(--hc-accent) 270deg,
    color-mix(in srgb, var(--hc-accent-2) 90%, #000 10%) 315deg,
    transparent 360deg);
}
@keyframes hcSpin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ glare / light reflection */
.hc-glare {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.hc-glare-spot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140%;
  aspect-ratio: 1;
  margin-left: -70%;
  margin-top: -70%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .25) 22%, transparent 48%);
  opacity: 0;
  transition: opacity .45s ease;
  will-change: transform, opacity;
  mix-blend-mode: soft-light;
}
.hc-stage.is-tilting .hc-glare-spot { opacity: var(--hc-glare-o); }
html[data-theme="light"] .hc-glare-spot { mix-blend-mode: normal; }
/* periodic diagonal sheen (runs on every device) */
.hc-glare::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 38%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .13) 45%, rgba(255, 255, 255, .22) 50%, rgba(255, 255, 255, .13) 55%, transparent 100%);
  transform: translateX(-160%) skewX(-12deg);
  animation: hcSheen 9s cubic-bezier(.6, 0, .25, 1) 2.2s infinite;
}
html[data-theme="light"] .hc-glare::after {
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .35) 45%, rgba(255, 255, 255, .55) 50%, rgba(255, 255, 255, .35) 55%, transparent 100%);
}
@keyframes hcSheen {
  0%   { transform: translateX(-160%) skewX(-12deg); }
  18%  { transform: translateX(330%) skewX(-12deg); }
  100% { transform: translateX(330%) skewX(-12deg); }
}

/* ------------------------------------------------------------------ glass stats panel */
.hc-stage .floating-telemetry {
  z-index: 4;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 60%),
    color-mix(in srgb, var(--card) 62%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
          backdrop-filter: blur(14px) saturate(1.5);
  border-color: rgba(255, 255, 255, .12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .10),
    0 14px 30px -12px rgba(0, 0, 0, .55);
}
html[data-theme="light"] .hc-stage .floating-telemetry {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .35)),
    color-mix(in srgb, #fff 55%, transparent);
  border-color: rgba(15, 23, 42, .10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 14px 30px -14px rgba(15, 23, 42, .25);
}
/* accent hairline across the top edge of the panel */
.hc-stage .floating-telemetry::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--hc-accent) 85%, transparent), transparent);
  opacity: .8;
}
/* soft column dividers */
.hc-stage .tele-item { position: relative; min-width: 0; }
.hc-stage .tele-item + .tele-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 2px;
  bottom: 2px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border-strong), transparent);
}
.hc-stage .tele-item span { letter-spacing: .06em; }
.hc-stage .tele-item strong { font-variant-numeric: tabular-nums; }

/* live dot in the panel corner */
.hc-live {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}
.hc-live::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--success);
  animation: hcPing 2s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes hcPing {
  0%   { transform: scale(1);   opacity: .65; }
  80%, 100% { transform: scale(3.2); opacity: 0; }
}

/* ------------------------------------------------------------------ floating chips */
.hc-chip {
  position: absolute;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px 8px 10px;
  border-radius: var(--radius-pill);
  background: var(--hc-chip-bg);
  border: 1px solid color-mix(in srgb, var(--hc-accent) 30%, var(--border-strong));
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  pointer-events: none;
  will-change: transform;
}
html[data-theme="light"] .hc-chip { box-shadow: 0 14px 30px -12px rgba(15, 23, 42, .28), inset 0 1px 0 #fff; }
.hc-chip-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--hc-tone, var(--hc-accent)) 18%, transparent);
  color: var(--hc-tone, var(--hc-accent));
}
.hc-chip-ico svg { width: 13px; height: 13px; stroke-width: 2.4; }
.hc-chip small { font-size: 10.5px; color: var(--text-dim); font-weight: 600; margin-left: -4px; }
.hc-chip-ping {
  --hc-tone: var(--success);
  top: 30px;
  right: -26px;
  animation: hcBobA 5.5s ease-in-out infinite;
}
.hc-chip-shield {
  --hc-tone: var(--hc-accent);
  top: 46%;
  left: -30px;
  animation: hcBobB 6.5s ease-in-out .8s infinite;
}
.hc-chip-ping .hc-ms { min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
@keyframes hcBobA {
  0%, 100% { transform: translate3d(0, 0, 60px); }
  50%      { transform: translate3d(0, -9px, 60px); }
}
@keyframes hcBobB {
  0%, 100% { transform: translate3d(0, -4px, 45px); }
  50%      { transform: translate3d(0, 6px, 45px); }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1240px) {
  .hc-chip-ping { right: -12px; }
  .hc-chip-shield { left: -14px; }
}
@media (max-width: 640px) {
  .hc-chip { padding: 6px 10px 6px 7px; font-size: 11px; gap: 6px; }
  .hc-chip-ico { width: 18px; height: 18px; }
  .hc-chip-ico svg { width: 11px; height: 11px; }
  .hc-chip-ping { top: 14px; right: 12px; }
  .hc-chip-shield { display: none; }
  /* the game-page engine badge sits top-left; keep the ping chip clear of it on narrow cards */
  .hc-game .hc-chip-ping { top: 58px; }
  .hc-stage::before { filter: blur(30px); inset: 10% 4% 6%; }
}

/* ------------------------------------------------------------------ client: one colour, no cursor light */
.hc-stage, .hc-stage.hc-game { --hc-accent: var(--primary); --hc-accent-2: var(--primary); }
.hc-ring::before, html[data-theme="light"] .hc-ring::before {
  background: conic-gradient(from 0deg, transparent 0deg, transparent 220deg,
    color-mix(in srgb, var(--primary) 85%, transparent) 300deg, transparent 360deg) !important;
}
.hc-live, .hc-live::before, .hc-live::after { background: var(--primary) !important; box-shadow: 0 0 8px var(--primary) !important; }
.hc-chip { --hc-tone: var(--primary) !important; }
.hc-glare-spot { display: none !important; }

/* client: calmer card — no halo, no glowing border, no sheen, neutral shadow */
.hc-stage::before, .hc-ring, .hc-glare { display: none !important; }
.hc-stage > .hero-visual-card { border-color: var(--border-strong) !important; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .55) !important; }
html[data-theme="light"] .hc-stage > .hero-visual-card { box-shadow: 0 20px 44px -22px rgba(15, 23, 42, .22) !important; }
