/* iChip.gr — codexhome cinematic 3D hero (additive layer, v1)
   Loaded only on the homepage. Everything here is scoped to .codexhome-hero.
   If JS/WebGL never runs, the hero looks exactly like the previous static version. */

.codexhome-hero-stage {
  position: relative;
}

.codexhome-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.codexhome-hero__scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 900ms ease;
}

.codexhome-hero__scene canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.codexhome-hero.is-3d-ready .codexhome-hero__scene {
  opacity: 1;
}

.codexhome-hero__content,
.codexhome-hero__aside {
  position: relative;
  z-index: 1;
}

/* Keep copy readable over the scene without changing its layout */
.codexhome-hero.is-3d-ready .codexhome-hero__content {
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}

.codexhome-hero.is-3d-ready .codexhome-hero-card {
  background: rgba(20, 24, 28, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Scroll hint, only when the scene is live and the hero is pinned */
.codexhome-hero__hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 1;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 10px;
  font: 500 11px/1 Roboto, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(185, 194, 181, 0.85);
  pointer-events: none;
  transition: opacity 400ms ease;
}

.codexhome-hero__hint::before {
  content: "";
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, rgba(136, 227, 0, 0), rgba(136, 227, 0, 0.9));
  animation: codexhome-hint 1.8s ease-in-out infinite;
}

@keyframes codexhome-hint {
  0%, 100% { transform: translateY(-4px); opacity: 0.4; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* Desktop: taller, pinned scene. Progress of the pin drives the camera. */
@media (min-width: 1025px) {
  .codexhome-hero-stage.is-pinned {
    height: 165vh;
  }

  .codexhome-hero-stage.is-pinned .codexhome-hero {
    position: sticky;
    top: 12px;
    min-height: calc(100vh - 24px);
    max-height: 860px;
  }

  .codexhome-hero-stage.is-pinned .codexhome-hero__hint {
    display: flex;
  }

  .codexhome-hero-stage.is-pinned.is-complete .codexhome-hero__hint {
    opacity: 0;
  }
}

/* Motion preference: never start the scene, keep normal document flow */
@media (prefers-reduced-motion: reduce) {
  .codexhome-hero__scene,
  .codexhome-hero__hint {
    display: none !important;
  }
}
