/* ==========================================================================
   HERO ECOSYSTEM — the living technology scene surrounding the AI globe.
   Layer order (back to front): #hero-canvas (globe) → .hero-depth (grid/
   beams/particles) → .hero-ring-layer (cloud ring, satellites, connection
   beams + data packets) → .hero-scrim → .hero-product-cards /
   .hero-status-panel → .hero-content.

   Visual hierarchy is deliberate: the globe stays the one thing rendered
   in real WebGL and the only element with true depth/lighting. Everything
   here is transform/opacity CSS + a few SVG strokes — cheap to run, and
   quieter than the globe so it reads as orbiting infrastructure, not a
   second competing focal point. Every animation is slow (6s+ cycles) and
   low-amplitude, matching the "continuously evolving, never distracting"
   brief used across the rest of the site's living backgrounds.
   ========================================================================== */

/* ---- shared layer shell ---- */
.hero-ring-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(var(--fx, 0), var(--fy, 0), 0);
}

/* ==========================================================================
   Cloud infrastructure ring — a holographic instrument ring surrounding
   the globe. Two concentric tracks, tick marks like a dial, and two
   short bright arcs slowly sweeping around it independently.
   ========================================================================== */
.hero-cloud-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(64vmin, 640px);
  height: min(64vmin, 640px);
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: ring-materialize 2s var(--ease-out) 0.4s forwards;
}

.hero-cloud-ring svg { width: 100%; height: 100%; overflow: visible; }

.ring-track {
  fill: none;
  stroke: rgba(95, 212, 216, 0.16);
  stroke-width: 0.5;
}
.ring-inner { stroke: rgba(139, 124, 246, 0.12); }

.ring-ticks {
  animation: ring-spin 90s linear infinite;
  transform-origin: 100px 100px;
}
.tick {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 0.6;
}
.tick-major { stroke: rgba(95, 212, 216, 0.4); stroke-width: 0.9; }

.ring-arcs { transform-origin: 100px 100px; }
.ring-arc {
  fill: none;
  stroke-width: 1.1;
  stroke-linecap: round;
}
.ring-arc-a {
  stroke: var(--cyan);
  stroke-dasharray: 60 430;
  opacity: 0.55;
  filter: drop-shadow(0 0 4px rgba(95, 212, 216, 0.6));
  animation: ring-spin 34s linear infinite;
}
.ring-arc-b {
  stroke: var(--violet);
  stroke-dasharray: 34 550;
  opacity: 0.4;
  filter: drop-shadow(0 0 4px rgba(139, 124, 246, 0.55));
  animation: ring-spin 48s linear infinite reverse;
}

@keyframes ring-materialize { to { opacity: 1; } }
@keyframes ring-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Orbiting AI satellite nodes — small glowing points moving around the
   ring at different radii, speeds, and depths (size/opacity stand in
   for depth: smaller + dimmer reads as further away).
   ========================================================================== */
.hero-satellites {
  position: absolute;
  inset: 0;
}

.hero-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 1px;
}

.hero-satellite {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  box-shadow: 0 0 10px 2px currentColor;
}

.sat-cyan   { background: var(--cyan);   color: var(--cyan); }
.sat-violet { background: var(--violet); color: var(--violet); }
.sat-blue   { background: var(--blue);   color: var(--blue); }

.orbit-1 { animation: orbit-spin 22s linear infinite; }
.orbit-1 .hero-satellite { width: 5px; height: 5px; transform: translate(-50%, -50%) translateX(min(30vmin, 300px)); opacity: 0.9; }

.orbit-2 { animation: orbit-spin 34s linear infinite reverse; }
.orbit-2 .hero-satellite { width: 3.5px; height: 3.5px; transform: translate(-50%, -50%) translateX(min(38vmin, 380px)); opacity: 0.65; }

.orbit-3 { animation: orbit-spin 27s linear infinite; animation-delay: -8s; }
.orbit-3 .hero-satellite { width: 4px; height: 4px; transform: translate(-50%, -50%) translateX(min(22vmin, 220px)) translateY(6vmin); opacity: 0.75; }

.orbit-4 { animation: orbit-spin 45s linear infinite reverse; animation-delay: -20s; }
.orbit-4 .hero-satellite { width: 2.5px; height: 2.5px; transform: translate(-50%, -50%) translateX(min(45vmin, 440px)) translateY(-4vmin); opacity: 0.5; }

@keyframes orbit-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Connection beams — one curved path per product card, running back to
   the globe's centre, with a single travelling "data packet" glow per
   path (an SVG <circle> animated with <animateMotion> in index.php,
   riding the exact same <path> geometry).
   ========================================================================== */
.hero-beams-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-beam-path {
  fill: none;
  stroke: url(#heroBeamGradient);
  stroke-width: 0.12;
  opacity: 0.5;
  stroke-dasharray: 0.6 1.4;
  animation: beam-flow 6s linear infinite;
}

@keyframes beam-flow { to { stroke-dashoffset: -20; } }

.hero-packet {
  fill: var(--cyan);
  filter: drop-shadow(0 0 3px var(--cyan)) drop-shadow(0 0 6px rgba(95, 212, 216, 0.6));
}

/* ==========================================================================
   Product cards — Skulgram, Staygram, Guardgram, Vaultgram, floating
   asymmetrically around the globe. Real links, styled decoratively.
   ========================================================================== */
.hero-product-cards {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.hero-product-card {
  position: absolute;
  top: var(--card-y);
  left: var(--card-x);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px 11px 12px;
  border-radius: 14px;
  pointer-events: auto;
  opacity: 0;
  box-shadow: 0 12px 34px -14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: card-fade-in 1s var(--ease-out) forwards, card-float 7s ease-in-out infinite;
  animation-delay: var(--card-delay), calc(var(--card-delay) + 1.1s);
}

.hero-product-card:hover {
  border-color: rgba(95, 212, 216, 0.35);
  box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(95, 212, 216, 0.2);
}

.hero-product-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(95, 212, 216, 0.1);
  color: var(--cyan);
  flex-shrink: 0;
}
.hero-product-icon svg { width: 16px; height: 16px; }

.hero-product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--paper);
  white-space: nowrap;
}

.hero-product-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px 1px currentColor;
}
.hero-product-status.status-live { background: var(--cyan); color: var(--cyan); animation: status-pulse 2.4s ease-in-out infinite; }
.hero-product-status.status-progress { background: var(--violet); color: var(--violet); animation: status-pulse 2.4s ease-in-out infinite; }

@keyframes card-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-float { 0%, 100% { transform: translate(-50%, -50%) translateY(0); } 50% { transform: translate(-50%, -50%) translateY(-9px); } }
@keyframes status-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* per-card look kept identical on purpose — the differentiator is the
   icon and label, not four different card colors competing for attention */

/* ==========================================================================
   Holographic status panel — compact live-reading telemetry, tertiary
   focus, tucked into a corner so it never competes with the headline.
   ========================================================================== */
.hero-status-panel {
  position: absolute;
  z-index: 3;
  right: 4%;
  bottom: 14%;
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  min-width: 170px;
  opacity: 0;
  animation: card-fade-in 1s var(--ease-out) 1.6s forwards;
}

.hero-status-title {
  font-size: 9.5px;
  color: var(--silver-dim);
  margin-bottom: 2px;
}

.hero-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--paper-dim);
}

.hero-status-pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px 1px rgba(95, 212, 216, 0.7);
  flex-shrink: 0;
  animation: status-pulse 2.2s ease-in-out infinite;
}
.hero-status-row:nth-child(3) .hero-status-pulse { animation-delay: 0.4s; }
.hero-status-row:nth-child(4) .hero-status-pulse { animation-delay: 0.8s; }
.hero-status-row:nth-child(5) .hero-status-pulse { animation-delay: 1.2s; }

/* ---- parallax response: near layer (cards + panel) moves a bit more
   than the far layer (ring/satellites/beams), driven by js/hero-premium.js
   via the same custom-property pattern used for the depth stack ---- */
.hero-product-cards,
.hero-status-panel {
  transform: translate3d(var(--nx, 0), var(--ny, 0), 0);
}
.hero-product-card { transform: translate(-50%, -50%) translate3d(var(--nx, 0), var(--ny, 0), 0); }

/* show desktop-only elements once there's room for them not to crowd
   the headline */
@media (min-width: 900px) {
  .hero-status-panel { display: flex; }
}

/* ==========================================================================
   Mobile — smaller ring, tighter card positions (pulled to the very
   edges via --card-mx/--card-my), status panel hidden to keep the fold
   uncluttered. The globe itself stays full prominence — see the
   sizeTarget change in js/hero-globe.js.
   ========================================================================== */
@media (max-width: 760px) {
  .hero-cloud-ring { width: min(78vmin, 420px); height: min(78vmin, 420px); }

  .hero-product-card {
    top: var(--card-my);
    left: var(--card-mx);
    padding: 8px 12px 8px 8px;
    gap: 7px;
    border-radius: 12px;
  }
  .hero-product-icon { width: 24px; height: 24px; border-radius: 7px; }
  .hero-product-icon svg { width: 13px; height: 13px; }
  .hero-product-name { font-size: 11px; }

  .orbit-2, .orbit-4 { display: none; }
  .orbit-1 .hero-satellite { transform: translate(-50%, -50%) translateX(38vmin); }
  .orbit-3 .hero-satellite { transform: translate(-50%, -50%) translateX(30vmin) translateY(4vmin); }
}

@media (max-width: 420px) {
  .hero-product-name { display: none; }
  .hero-product-card { padding: 7px; border-radius: 50%; }
  .hero-product-icon { width: 22px; height: 22px; }
}

/* ==========================================================================
   Reduced motion — freeze everything in place at a representative frame
   rather than hiding it, matching the rest of the site's contract.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hero-cloud-ring,
  .ring-ticks, .ring-arc-a, .ring-arc-b,
  .hero-orbit,
  .hero-beam-path,
  .hero-product-card,
  .hero-status-panel,
  .hero-product-status,
  .hero-status-pulse {
    animation: none !important;
    opacity: 1 !important;
  }
  .hero-packet { display: none; }
}
