/**
 * Interactive Hero Demo Styles
 * Completely isolated from main site
 */

/* Scoped variables - using .demo-page wrapper instead of :root */
.demo-page--interactive-hero {
  --ih-color-bg: #06060a;
  --ih-color-text: #ffffff;
  --ih-color-text-muted: #7a7a8c;
  --ih-color-accent: #6366f1;
  --ih-color-accent-2: #22d3ee;
  --ih-color-accent-3: #a855f7;
  --ih-font-main: 'Space Grotesk', system-ui, sans-serif;

  /* Apply base styles to wrapper */
  height: 100%;
  font-family: var(--ih-font-main);
  background: var(--ih-color-bg);
  color: var(--ih-color-text);
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Reset scoped to demo */
.demo-page--interactive-hero *,
.demo-page--interactive-hero *::before,
.demo-page--interactive-hero *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Back Link */
.demo-page--interactive-hero .back-link {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  color: var(--ih-color-text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  cursor: pointer;
}

.demo-page--interactive-hero .back-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--ih-color-text);
}

.demo-page--interactive-hero .back-link svg {
  transition: transform 0.25s ease;
}

.demo-page--interactive-hero .back-link:hover svg {
  transform: translateX(-3px);
}

/* Hero */
.demo-page--interactive-hero .hero {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: none;
  background: linear-gradient(
    180deg,
    #0a0a12 0%,
    #050510 40%,
    #02020a 70%,
    #000004 100%
  );
}

.demo-page--interactive-hero .hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Static stars */
.demo-page--interactive-hero .hero__stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Interactive particles */
.demo-page--interactive-hero .hero__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Content */
.demo-page--interactive-hero .hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1200px;
  padding: 40px;
}

.demo-page--interactive-hero .hero__text {
  max-width: 520px;
}

.demo-page--interactive-hero .hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  margin-bottom: 32px;
}

.demo-page--interactive-hero .hero__badge-dot {
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  animation: ih-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

@keyframes ih-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.15); }
}

.demo-page--interactive-hero .hero__badge span {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.demo-page--interactive-hero .hero__title {
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.demo-page--interactive-hero .hero__title-line {
  display: block;
}

.demo-page--interactive-hero .hero__title-line--accent {
  background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(180,200,255,1) 50%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.demo-page--interactive-hero .hero__description {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ih-color-text-muted);
  font-weight: 400;
}

/* Interactive Planet */
.demo-page--interactive-hero .planet-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 320px;
  height: 320px;
  perspective: 1000px;
}

.demo-page--interactive-hero .planet {
  position: relative;
  width: 240px;
  height: 240px;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

.demo-page--interactive-hero .planet__sphere {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  transform-style: preserve-3d;
}

.demo-page--interactive-hero .planet__surface {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 25% 15% at 25% 55%, rgba(180, 83, 60, 0.7) 0%, transparent 70%),
    radial-gradient(ellipse 12% 8% at 70% 35%, rgba(210, 140, 90, 0.5) 0%, transparent 70%),
    repeating-linear-gradient(
      180deg,
      #d4a574 0px,
      #c9956a 8px,
      #e8c9a0 12px,
      #d4a574 16px,
      #a67c52 24px,
      #8b5a3c 28px,
      #bf8660 36px,
      #d4a574 40px,
      #c49066 48px,
      #e2b88a 52px,
      #d9a870 60px,
      #a06040 68px,
      #c98b60 76px,
      #dbb896 80px
    );
  transition: background-position 0.1s ease-out;
}

.demo-page--interactive-hero .planet__limb {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    transparent 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.3) 75%,
    rgba(0, 0, 0, 0.7) 90%,
    rgba(0, 0, 0, 0.9) 100%
  );
  pointer-events: none;
}

.demo-page--interactive-hero .planet__shadow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 40%,
    rgba(0, 0, 0, 0.4) 60%,
    rgba(0, 0, 0, 0.7) 80%,
    rgba(0, 0, 0, 0.85) 100%
  );
  transition: background 0.15s ease-out;
  pointer-events: none;
}

.demo-page--interactive-hero .planet__highlight {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.2) 20%,
    transparent 50%
  );
  transition: background 0.15s ease-out;
  pointer-events: none;
}

.demo-page--interactive-hero .planet__atmosphere {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    transparent 75%,
    rgba(255, 180, 120, 0.12) 85%,
    rgba(255, 150, 100, 0.06) 95%,
    transparent 100%
  );
  pointer-events: none;
  animation: ih-atmospherePulse 4s ease-in-out infinite;
}

@keyframes ih-atmospherePulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

.demo-page--interactive-hero .planet__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 340px;
  height: 80px;
  margin-left: -170px;
  margin-top: -40px;
  border: 2px solid rgba(210, 180, 140, 0.25);
  border-radius: 50%;
  transform: rotateX(75deg) rotateZ(-15deg);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(210, 180, 140, 0.06) 15%,
    rgba(230, 200, 160, 0.12) 35%,
    rgba(180, 140, 100, 0.08) 50%,
    rgba(230, 200, 160, 0.12) 65%,
    rgba(210, 180, 140, 0.06) 85%,
    transparent 100%
  );
  pointer-events: none;
}

/* Orbiting moons */
.demo-page--interactive-hero .moon {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.demo-page--interactive-hero .moon--1 {
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at 30% 30%, #e2e8f0 0%, #a0aec0 50%, #718096 100%);
  box-shadow:
    inset -4px -4px 8px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 255, 255, 0.2);
  animation: ih-orbit1 8s linear infinite;
}

.demo-page--interactive-hero .moon--2 {
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 30% 30%, #cbd5e0 0%, #718096 50%, #4a5568 100%);
  box-shadow:
    inset -2px -2px 4px rgba(0, 0, 0, 0.5),
    0 0 12px rgba(255, 255, 255, 0.15);
  animation: ih-orbit2 12s linear infinite reverse;
}

@keyframes ih-orbit1 {
  from { transform: rotate(0deg) translateX(200px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(200px) rotate(-360deg); }
}

@keyframes ih-orbit2 {
  from { transform: rotate(0deg) translateX(160px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(160px) rotate(-360deg); }
}

/* Custom Cursor */
.demo-page--interactive-hero .cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}

.demo-page--interactive-hero .cursor__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.demo-page--interactive-hero .cursor__ring {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
}

.demo-page--interactive-hero .cursor.is-hovering .cursor__ring {
  width: 56px;
  height: 56px;
  border-color: rgba(255, 255, 255, 0.9);
}

/* Responsive */
@media (max-width: 968px) {
  .demo-page--interactive-hero .hero__content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 48px;
    padding: 24px;
  }

  .demo-page--interactive-hero .hero__text {
    max-width: 100%;
  }

  .demo-page--interactive-hero .hero__badge {
    margin-left: auto;
    margin-right: auto;
  }

  .demo-page--interactive-hero .planet-wrapper {
    width: 280px;
    height: 280px;
  }

  .demo-page--interactive-hero .planet {
    width: 200px;
    height: 200px;
  }

  .demo-page--interactive-hero .planet__ring {
    width: 280px;
    height: 65px;
    margin-left: -140px;
    margin-top: -32px;
  }

  .demo-page--interactive-hero .moon--1 {
    width: 20px;
    height: 20px;
  }

  .demo-page--interactive-hero .moon--2 {
    width: 12px;
    height: 12px;
  }

  @keyframes ih-orbit1 {
    from { transform: rotate(0deg) translateX(165px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(165px) rotate(-360deg); }
  }

  @keyframes ih-orbit2 {
    from { transform: rotate(0deg) translateX(130px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(130px) rotate(-360deg); }
  }
}

@media (max-width: 640px) {
  .demo-page--interactive-hero .back-link {
    top: 16px;
    left: 16px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .demo-page--interactive-hero .hero__title {
    font-size: 40px;
  }

  .demo-page--interactive-hero .hero__description {
    font-size: 15px;
  }

  .demo-page--interactive-hero .planet-wrapper {
    width: 220px;
    height: 220px;
  }

  .demo-page--interactive-hero .planet {
    width: 160px;
    height: 160px;
  }

  .demo-page--interactive-hero .planet__atmosphere {
    inset: -10px;
  }

  .demo-page--interactive-hero .planet__ring {
    width: 220px;
    height: 50px;
    margin-left: -110px;
    margin-top: -25px;
  }

  @keyframes ih-orbit1 {
    from { transform: rotate(0deg) translateX(125px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(125px) rotate(-360deg); }
  }

  @keyframes ih-orbit2 {
    from { transform: rotate(0deg) translateX(100px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(100px) rotate(-360deg); }
  }
}
