/* ═══════════════════════════════════════════
   HERO — The Voltronic Core Spatial Layout
═══════════════════════════════════════════ */

.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + var(--sp-12));
  padding-bottom: var(--sp-24);
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Interactive Sunlight Background ── */
.hero__bg-lighting {
  position: absolute;
  inset: -50%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    circle 800px at calc(var(--mouse-x, 0.5) * 100%) calc(var(--mouse-y, 0.3) * 100%),
    rgba(25, 122, 64, 0.06) 0%,
    transparent 80%
  );
  transition: opacity 0.5s ease-out;
}

/* Underlying subtle grid */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--glass-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 0%, transparent 80%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-12);
}

@media (min-width: 1024px) {
  .hero__inner {
    min-height: 75vh;
  }
}

/* ── Floating Text Content ── */
.hero__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  z-index: 10;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: var(--brand-dark);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-6);
  animation: fadeSlideUp var(--dur-slower) var(--ease-out) 0.1s both;
}

.hero__badge-dot {
  width: 7px;
  height: 7px;
  background: var(--brand);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero__heading {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: var(--sp-5);
  animation: fadeSlideUp var(--dur-slower) var(--ease-out) 0.2s both;
}

.hero__heading em {
  font-style: normal;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__sub {
  font-size: var(--text-base);
  color: var(--ink-muted);
  line-height: 1.6;
  max-width: 48ch;
  margin-bottom: var(--sp-8);
  animation: fadeSlideUp var(--dur-slower) var(--ease-out) 0.3s both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-4);
  animation: fadeSlideUp var(--dur-slower) var(--ease-out) 0.4s both;
}

@media (min-width: 768px) {
  .hero__heading { font-size: var(--text-6xl); }
  .hero__sub { font-size: var(--text-lg); }
}
@media (min-width: 1024px) {
  .hero__heading { font-size: 5.5rem; }
}

/* ── 3D Voltronic Core Scene ── */
.hero__scene {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  perspective: 1200px;
  animation: fadeSlideUp var(--dur-slower) var(--ease-out) 0.6s both;
}

/* Apply 3D tilt based on JS data attributes */
.hero__scene[data-tilt="true"] {
  transform: rotateX(calc(var(--tilt-y, 0) * 15deg)) rotateY(calc(var(--tilt-x, 0) * -15deg));
  transform-style: preserve-3d;
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero__core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 180px;
  margin-top: -90px;
  margin-left: -90px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-top-color: rgba(255,255,255,0.9);
  border-left-color: rgba(255,255,255,0.7);
  border-radius: var(--radius-2xl);
  box-shadow: 
    0 30px 60px -10px rgba(25, 122, 64, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateZ(60px);
  z-index: 10;
  overflow: hidden;
}

.hero__core::after {
  content: '';
  position: absolute;
  inset: -100%;
  background: linear-gradient(135deg, rgba(255,255,255,0) 40%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0) 60%);
  transform: translateX(calc(var(--mouse-x, 0.5) * 50%));
  pointer-events: none;
}

.core-screen {
  padding: var(--sp-4);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.core-header {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: var(--ink);
  text-align: center;
  margin-bottom: var(--sp-3);
}

.core-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.core-stat {
  background: var(--bg);
  padding: var(--sp-1);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

.core-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--ink);
}
.core-val--amber { color: var(--amber); }
.core-val--green { color: var(--green); }

.core-lbl {
  font-size: 8px;
  text-transform: uppercase;
  color: var(--ink-300);
  font-weight: 600;
}

.core-center-ring {
  margin: auto;
  position: relative;
  width: 36px;
  height: 36px;
}
.ring-outer, .ring-inner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}
.ring-outer {
  border-top-color: var(--brand);
  border-bottom-color: var(--brand-light);
  animation: spin 4s linear infinite;
}
.ring-inner {
  inset: 8px;
  border-left-color: var(--amber);
  border-right-color: var(--amber-light);
  animation: spin 3s linear infinite reverse;
}

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

/* Orbiting Nodes */
.hero__node {
  position: absolute;
  width: 52px;
  height: 52px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 5;
  transform-style: preserve-3d;
}

.node-icon {
  width: 24px;
  height: 24px;
  background: var(--ink-50);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.node-icon svg {
  width: 14px;
  height: 14px;
}
.hero__node--solar .node-icon { background: var(--brand-xlight); }
.hero__node--battery .node-icon { background: var(--green-glow); }

.hero__node span {
  display: none; /* Hidden on mobile */
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-300);
  white-space: nowrap;
  position: absolute;
  bottom: -24px;
}

/* Mobile/Base positioning */
.hero__node--solar { top: -2%; left: -2%; transform: translateZ(10px); }
.hero__node--grid { top: -2%; right: -2%; transform: translateZ(-10px); }
.hero__node--battery { bottom: -2%; left: -2%; transform: translateZ(20px); }
.hero__node--load { bottom: -2%; right: -2%; transform: translateZ(-5px); }

/* SVG Tracks */
.hero__tracks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.track {
  stroke: var(--ink-100);
  animation: flowLine 20s linear infinite;
}
.track--amber { stroke: var(--amber); }
.track--green { stroke: var(--green); }

@keyframes flowLine {
  to { stroke-dashoffset: -400; }
}

/* Scroll Indicator */
.hero__scroll {
  position: absolute;
  bottom: var(--sp-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--brand), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
  50% { opacity: 1; transform: scaleY(1); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Tablet/Desktop Restoration */
@media (min-width: 768px) {
  .hero__core {
    width: 260px;
    height: 260px;
    margin-top: -130px;
    margin-left: -130px;
  }
  .core-screen {
    padding: var(--sp-5);
  }
  .core-header {
    font-size: var(--text-sm);
    margin-bottom: var(--sp-5);
  }
  .core-stats {
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
  }
  .core-stat {
    padding: var(--sp-2) var(--sp-1);
  }
  .core-val {
    font-size: var(--text-base);
  }
  .core-lbl {
    font-size: 10px;
  }
  .core-center-ring {
    width: 60px;
    height: 60px;
  }
  .hero__node {
    width: 76px;
    height: 76px;
  }
  .node-icon {
    width: 34px;
    height: 34px;
  }
  .node-icon svg {
    width: 24px;
    height: 24px;
  }
  .hero__node span {
    display: block;
  }
  .hero__node--solar { top: 12%; left: 12%; }
  .hero__node--grid { top: 12%; right: 12%; }
  .hero__node--battery { bottom: 12%; left: 12%; }
  .hero__node--load { bottom: 12%; right: 12%; }
}

/* Desktop 3D Exploded Layout */
@media (min-width: 1024px) {
  .hero__scene {
    transform: rotateX(55deg) rotateZ(-15deg);
    transition: transform 0.8s cubic-bezier(0.2, 0, 0, 1);
  }
  
  /* When scrolled down, JS adds .is-flat */
  .hero__scene.is-flat {
    transform: rotateX(0deg) rotateZ(0deg);
  }

  .hero__node--solar { transform: translateZ(80px); }
  .hero__node--grid { transform: translateZ(-40px); }
  .hero__node--battery { transform: translateZ(120px); }
  .hero__node--load { transform: translateZ(0px); }
}

/* ═══════════════════════════════════════════
   HERO ENHANCEMENTS & SPOTLIGHT STYLES
═══════════════════════════════════════════ */

.gradient-text {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-coming-soon {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: 3px;
}

.nav-sparkle {
  margin-right: 2px;
}

.hero-stats-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
  padding: var(--sp-3) var(--sp-5);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 15px var(--brand-glow-sm);
  width: fit-content;
}

@media (max-width: 640px) {
  .hero-stats-row {
    width: 100%;
    justify-content: space-around;
  }
}

.hero-stat-item {
  display: flex;
  flex-direction: column;
}

.hero-stat-item strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-dark);
}

.hero-stat-item small {
  font-size: 0.72rem;
  color: var(--ink-500);
}

.hero-stat-sep {
  color: rgba(15, 23, 42, 0.15);
  font-weight: 300;
}

.node-live-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--brand-dark);
  margin-top: 2px;
}

/* ── Dongle Spotlight Section ── */
.dongle-spotlight-section {
  position: relative;
  z-index: 2;
  margin: var(--sp-8) auto var(--sp-12);
}

.dongle-spotlight-box {
  background: linear-gradient(135deg, #0F2817 0%, #061A0E 100%);
  color: white;
  border-radius: var(--radius-2xl);
  padding: var(--sp-8) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  flex-wrap: wrap;
  box-shadow: 0 25px 50px -15px var(--brand-glow), var(--shadow-lg);
  border: 1px solid rgba(167, 223, 192, 0.2);
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .dongle-spotlight-box {
    padding: var(--sp-10) var(--sp-10);
  }
}

.ds-left {
  flex: 1;
  min-width: 280px;
}

.ds-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(34, 197, 94, 0.2);
  color: #86EFAC;
  border: 1px solid rgba(34, 197, 94, 0.4);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-3);
}

.ds-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.95rem);
  font-weight: 700;
  color: white;
  margin: 0 0 var(--sp-3) 0;
  line-height: 1.25;
}

.ds-desc {
  font-size: 0.95rem;
  color: #CBD5E1;
  margin: 0 0 var(--sp-4) 0;
  line-height: 1.6;
}

.ds-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #A7DFC0;
}

.ds-right {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 240px;
}

.btn-ds-primary,
.btn-ds-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-ds-primary {
  background: var(--brand-mid);
  color: white;
  box-shadow: 0 4px 14px rgba(34, 163, 85, 0.4);
}

.btn-ds-primary:hover {
  background: #16A34A;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(34, 163, 85, 0.6);
}

.btn-ds-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ds-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ── Widget Coming Soon Badge ── */
.widget-coming-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  color: #92400E;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: var(--sp-3);
}

.w-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #D97706;
  animation: pulseDot 1.8s infinite ease-in-out;
}
