/* Klikr — hero device mockups */

.cosmic-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.cosmic-hero__content {
  text-align: left;
}

.cosmic-hero__content .cosmic-hero__headline {
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.cosmic-hero__content .hero-logo-spin {
  width: clamp(64px, 8vw, 88px);
  height: clamp(64px, 8vw, 88px);
  border-radius: 20px;
}

.cosmic-hero__content h1 {
  text-align: left;
}

.cosmic-hero__content .cosmic-hero__subtitle {
  margin-left: 0;
  margin-right: 0;
}

.cosmic-hero__content .cosmic-hero__actions {
  justify-content: flex-start;
}

/* Device cluster */
.hero-devices {
  position: relative;
  height: clamp(320px, 42vw, 480px);
  min-height: 300px;
  perspective: 1200px;
  transition: transform 0.15s ease-out;
  transform-style: preserve-3d;
}

.hero-device {
  position: absolute;
  background: #111827;
  border-radius: 16px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transform-style: preserve-3d;
}

.hero-device__screen,
.hero-device object.hero-device__screen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  background: #0a0f1e;
  pointer-events: none;
}

.hero-device__bezel {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Phone */
.hero-device--phone {
  width: clamp(100px, 14vw, 130px);
  height: clamp(200px, 28vw, 260px);
  border-radius: 22px;
  left: 4%;
  bottom: 8%;
  z-index: 3;
  padding: 8px 6px 10px;
  animation: deviceFloatPhone 5.5s ease-in-out infinite;
}

.hero-device--phone::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36%;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 2;
}

.hero-device--phone .hero-device__screen {
  border-radius: 16px;
}

/* Tablet */
.hero-device--tablet {
  width: clamp(160px, 22vw, 210px);
  height: clamp(220px, 30vw, 290px);
  border-radius: 18px;
  left: 28%;
  bottom: 14%;
  z-index: 2;
  padding: 10px 8px;
  animation: deviceFloatTablet 6.2s ease-in-out infinite 0.4s;
}

.hero-device--tablet .hero-device__screen {
  border-radius: 12px;
}

/* Desktop */
.hero-device--desktop {
  width: clamp(240px, 34vw, 340px);
  height: clamp(160px, 22vw, 220px);
  border-radius: 12px 12px 0 0;
  right: 0;
  top: 12%;
  z-index: 1;
  padding: 10px 10px 0;
  animation: deviceFloatDesktop 7s ease-in-out infinite 0.8s;
}

.hero-device--desktop::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  height: 12px;
  background: linear-gradient(180deg, #374151, #1f2937);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.hero-device--desktop .hero-device__screen {
  border-radius: 6px 6px 0 0;
}

.hero-devices__glow {
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(ellipse at center, rgba(191, 0, 255, 0.25), transparent 65%);
  filter: blur(40px);
  pointer-events: none;
  animation: deviceGlowPulse 4s ease-in-out infinite;
}

@keyframes deviceFloatPhone {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(-2deg); }
}

@keyframes deviceFloatTablet {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}

@keyframes deviceFloatDesktop {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

@keyframes deviceGlowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

[data-theme="light"] .hero-device {
  background: #e5e7eb;
  box-shadow:
    0 24px 64px rgba(124, 58, 237, 0.15),
    0 0 0 1px rgba(124, 58, 237, 0.12);
}

@media (max-width: 960px) {
  .cosmic-hero__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .cosmic-hero__content {
    text-align: center;
  }

  .cosmic-hero__content .cosmic-hero__headline {
    justify-content: center;
  }

  .cosmic-hero__content h1 {
    text-align: center;
  }

  .cosmic-hero__content .cosmic-hero__subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .cosmic-hero__content .cosmic-hero__actions {
    justify-content: center;
  }

  .hero-devices {
    height: clamp(260px, 55vw, 340px);
    max-width: 520px;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .hero-device--phone {
    left: 2%;
    width: 90px;
    height: 180px;
  }

  .hero-device--tablet {
    left: 24%;
    width: 140px;
    height: 190px;
  }

  .hero-device--desktop {
    width: 200px;
    height: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-device--phone,
  .hero-device--tablet,
  .hero-device--desktop,
  .hero-devices__glow {
    animation: none !important;
  }
}
