/* ==========================================================================
   FairTech Homepage Hero — cinematic tech-showroom hero.
   Page-scoped (only index.php sets $extra_head to load this), built on the
   design-system.css tokens/utilities from Step 1 and reusing .ds-bg-premium.
   ========================================================================== */

.ds-hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 72px;
  color: var(--ds-text-primary);
}

/* ---- Background: deep navy, radial light, grid, particles ---- */

.ds-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.ds-hero__grid {
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(60% 70% at 68% 40%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(60% 70% at 68% 40%, #000 0%, transparent 75%);
}

.ds-hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  transition: opacity var(--ds-duration-slow) var(--ds-ease-standard);
}

.ds-hero__glow--1 {
  width: 46vw;
  height: 46vw;
  max-width: 620px;
  max-height: 620px;
  top: -12%;
  right: -8%;
  background: radial-gradient(circle, rgba(61, 139, 255, 0.32) 0%, rgba(61, 139, 255, 0) 70%);
  opacity: calc(0.9 - (var(--ds-hero-scroll, 0) * 0.35));
}

.ds-hero__glow--2 {
  width: 30vw;
  height: 30vw;
  max-width: 420px;
  max-height: 420px;
  bottom: -10%;
  left: 5%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, rgba(99, 102, 241, 0) 70%);
  opacity: calc(0.7 - (var(--ds-hero-scroll, 0) * 0.25));
}

.ds-hero__particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.ds-hero__particles::before {
  content: "";
  position: absolute;
  width: 2px;
  height: 2px;
  background: transparent;
  box-shadow:
    12vw 18% 0 0 rgba(255, 255, 255, 0.35),
    22vw 62% 0 0 rgba(255, 255, 255, 0.22),
    34vw 30% 0 0 rgba(255, 255, 255, 0.28),
    45vw 78% 0 0 rgba(255, 255, 255, 0.18),
    58vw 15% 0 0 rgba(255, 255, 255, 0.3),
    64vw 55% 0 0 rgba(255, 255, 255, 0.2),
    76vw 40% 0 0 rgba(255, 255, 255, 0.32),
    83vw 70% 0 0 rgba(255, 255, 255, 0.2),
    91vw 22% 0 0 rgba(255, 255, 255, 0.26),
    8vw 85% 0 0 rgba(255, 255, 255, 0.16),
    50vw 8% 0 0 rgba(255, 255, 255, 0.22),
    70vw 90% 0 0 rgba(255, 255, 255, 0.16);
  animation: ds-particles-drift 22s ease-in-out infinite alternate;
}

@keyframes ds-particles-drift {
  from { transform: translateY(0); }
  to   { transform: translateY(-18px); }
}

/* ---- Layout ---- */

.ds-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding-left: var(--ds-space-md);
  padding-right: var(--ds-space-md);
}

.ds-hero__content {
  padding-top: var(--ds-space-lg);
  padding-bottom: var(--ds-space-lg);
}

.ds-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ds-font-family);
  font-size: var(--ds-font-size-caption);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-accent);
  background: var(--ds-accent-soft);
  border: 1px solid var(--ds-border-accent);
  border-radius: var(--ds-radius-pill);
  padding: 6px 14px;
  margin-bottom: var(--ds-space-md);
}

.ds-hero__headline {
  font-family: var(--ds-font-family);
  font-size: var(--ds-font-size-display);
  line-height: var(--ds-line-height-tight);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ds-text-primary);
  margin: 0 0 var(--ds-space-md);
}

.ds-hero__sub {
  font-family: var(--ds-font-family);
  font-size: 17px;
  line-height: var(--ds-line-height-normal);
  color: var(--ds-text-secondary);
  max-width: 46ch;
  margin: 0 0 var(--ds-space-lg);
}

.ds-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-sm);
}

.ds-hero__btn {
  padding: 14px 26px;
  font-size: 15px;
}

.ds-hero__btn .material-symbols-outlined {
  font-size: 20px;
}

/* ---- 3D floating visual ---- */

.ds-hero__visual-col {
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ds-hero__stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 420px;
}

#dsHeroStage {
  transform-style: preserve-3d;
  transition: transform 320ms var(--ds-ease-out);
  will-change: transform;
}

.ds-hero__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(61, 139, 255, 0.28) 0%, rgba(61, 139, 255, 0) 68%);
  filter: blur(20px);
  z-index: 0;
}

.ds-hero__card {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--ds-radius-lg);
  background: var(--ds-surface-glass-strong);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--ds-border-strong);
  box-shadow: var(--ds-shadow-lg);
  color: var(--ds-text-primary);
}

.ds-hero__card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
}

.ds-hero__card .material-symbols-outlined {
  font-size: 34px;
  color: var(--ds-accent);
}

.ds-hero__card-label {
  font-family: var(--ds-font-family);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Each card bakes its own base rotation into its keyframes/hover rule,
   rather than relying on the generic .hover-lift/.float-element utilities
   — those set a bare `transform` on :hover/animation that would otherwise
   replace (not add to) each card's own rotate()/translate() and either
   snap it out of position on hover or strip its tilt for the whole time
   the float animation runs (it's `infinite`, so this was permanent, not
   just a hover glitch). */

.ds-hero__card--main {
  width: 190px;
  height: 190px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  transition: transform 320ms var(--ds-ease-out), box-shadow 320ms var(--ds-ease-out);
}

.ds-hero__card--main .material-symbols-outlined {
  font-size: 46px;
}

.ds-hero__card--laptop {
  width: 120px;
  height: 120px;
  top: 6%;
  left: 4%;
  transform: rotate(-8deg);
  z-index: 3;
  animation: ds-hero-float-laptop var(--ds-duration-ambient) var(--ds-ease-in-out) infinite;
  animation-delay: 0.4s;
}

.ds-hero__card--gaming {
  width: 110px;
  height: 110px;
  bottom: 8%;
  left: 10%;
  transform: rotate(6deg);
  z-index: 2;
  animation: ds-hero-float-gaming var(--ds-duration-ambient) var(--ds-ease-in-out) infinite;
  animation-delay: 1.1s;
}

.ds-hero__card--audio {
  width: 116px;
  height: 116px;
  top: 10%;
  right: 2%;
  transform: rotate(9deg);
  z-index: 3;
  animation: ds-hero-float-audio var(--ds-duration-ambient) var(--ds-ease-in-out) infinite;
  animation-delay: 1.8s;
}

.ds-hero__card--back {
  width: 150px;
  height: 150px;
  bottom: 2%;
  right: 8%;
  transform: rotate(-5deg) scale(0.92);
  z-index: 1;
  filter: blur(1.5px);
  opacity: 0.65;
  transition: transform 320ms var(--ds-ease-out), box-shadow 320ms var(--ds-ease-out);
}

@keyframes ds-hero-float-laptop {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50%      { transform: rotate(-8deg) translateY(-8px); }
}
@keyframes ds-hero-float-gaming {
  0%, 100% { transform: rotate(6deg) translateY(0); }
  50%      { transform: rotate(6deg) translateY(-8px); }
}
@keyframes ds-hero-float-audio {
  0%, 100% { transform: rotate(9deg) translateY(0); }
  50%      { transform: rotate(9deg) translateY(-8px); }
}

@media (hover: hover) and (pointer: fine) {
  .ds-hero__card--main:hover {
    transform: translate(-50%, -50%) translateY(-6px);
    box-shadow: var(--ds-shadow-lg);
    z-index: 5;
  }
  .ds-hero__card--back:hover {
    transform: rotate(-5deg) scale(0.92) translateY(-6px);
    box-shadow: var(--ds-shadow-lg);
    z-index: 5;
  }
  .ds-hero__card--laptop:hover,
  .ds-hero__card--gaming:hover,
  .ds-hero__card--audio:hover {
    animation-play-state: paused;
    box-shadow: var(--ds-shadow-lg);
    z-index: 5;
  }
  .ds-hero__card--laptop:hover { transform: rotate(-8deg) translateY(-8px); }
  .ds-hero__card--gaming:hover { transform: rotate(6deg) translateY(-8px); }
  .ds-hero__card--audio:hover  { transform: rotate(9deg) translateY(-8px); }
}

/* ---- Scroll-linked visual drift (bounded, subtle) ---- */

.ds-hero__visual-col {
  transform: translateY(calc(var(--ds-hero-scroll, 0) * -22px));
  transition: transform 80ms linear;
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  .ds-hero__particles::before {
    animation: none;
  }
  .ds-hero__visual-col {
    transform: none;
  }
  #dsHeroStage {
    transition: none;
  }
  .ds-hero__card--laptop,
  .ds-hero__card--gaming,
  .ds-hero__card--audio {
    animation: none;
  }
  .ds-hero__card--main,
  .ds-hero__card--back {
    transition-duration: 1ms;
  }
}

/* ---- Mobile: stack, simplify, keep it fast ---- */

@media (max-width: 991px) {
  .ds-hero {
    padding: 40px 0 48px;
  }

  .ds-hero__headline {
    font-size: clamp(2.1rem, 1.7rem + 3vw, 2.75rem);
  }

  .ds-hero__sub {
    max-width: none;
  }

  .ds-hero__particles {
    display: none;
  }

  .ds-hero__grid {
    background-size: 40px 40px;
  }

  .ds-hero__visual-col {
    min-height: 300px;
    transform: none !important;
  }

  .ds-hero__stage {
    height: 300px;
    max-width: 340px;
  }

  .ds-hero__card--main {
    width: 140px;
    height: 140px;
  }

  .ds-hero__card--main .material-symbols-outlined {
    font-size: 36px;
  }

  .ds-hero__card--laptop,
  .ds-hero__card--gaming,
  .ds-hero__card--audio {
    width: 88px;
    height: 88px;
  }

  .ds-hero__card--back {
    display: none;
  }

  #dsHeroStage {
    transform: none !important;
  }
}

@media (max-width: 575px) {
  .ds-hero__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .ds-hero__btn {
    justify-content: center;
  }
}
