/* ==========================================================================
   Iso hero — shared styles for all isometric industry hero animations.
   Every visual uses the same stage (1185 × 800 artboard from Figma);
   positions are percentages, so the stage scales to any width. The
   .iso-hero box is the crop window (872 × 872 desktop crop by default, its
   aspect ratio is set by the engine); the stage sits inside it.
   ========================================================================== */

.iso-hero {
  /* Pink shades used for the pulsing flow lines and arrows (from Figma) */
  --iso-pink-1: #af0aaf;   /* base magenta (Figma variable) */
  --iso-pink-2: #d10ed1;
  --iso-pink-3: #ff14ff;
  --iso-pink-4: #bb0bbb;

  --iso-grid-color: #262e38;
  --iso-grid-opacity: 0.39;
  --iso-pulse-duration: 3.2s;

  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
}

.iso-hero__stage {
  position: absolute;
}

.iso-hero__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---- Grid --------------------------------------------------------------- */

.iso-hero__grid {
  opacity: var(--iso-grid-opacity);
  pointer-events: none;
}

.iso-hero__grid line {
  stroke: var(--iso-grid-color);
  stroke-width: 1;
}

/* Radial white wash that fades the grid towards the edges (Figma "Grid fade") */
.iso-hero__grid-fade {
  background: radial-gradient(
    ellipse 50% 50% at 50% 50%,
    rgba(255, 255, 255, 0.65) 0%,
    rgba(255, 255, 255, 0.99) 69.23%
  );
}

/* ---- Elements (isometric objects) -------------------------------------- */

.iso-hero__el {
  position: absolute;
  opacity: 1; /* static: shown straight away */
  will-change: transform, opacity;
}

.iso-hero__el img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

/* Drop-in visuals (config.dropIn): keep elements hidden until the drop starts */
.iso-hero--drop:not(.is-started) .iso-hero__el {
  opacity: 0;
}

/* Shown only while an image file is missing, so the timing can be reviewed */
.iso-hero__el.is-missing {
  border: 1px dashed rgba(38, 46, 56, 0.35);
  border-radius: 4px;
  background: rgba(38, 46, 56, 0.03);
}

.iso-hero__el.is-missing::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 4px;
  font: 11px/1.3 system-ui, sans-serif;
  color: rgba(38, 46, 56, 0.6);
  text-align: center;
}

.iso-hero__el.is-missing img {
  display: none;
}

/* ---- Shader layers (WebGL effects such as chimney smoke) --------------- */

.iso-hero__shader {
  position: absolute;
  opacity: 0; /* revealed by the fade-in at the start of the intro */
  pointer-events: none;
}

.iso-hero__shader canvas,
.iso-hero__shader img {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---- Flow lines & arrows ----------------------------------------------- */

.iso-hero__flow {
  pointer-events: none;
  overflow: visible;
  visibility: hidden; /* until the intro starts, so the lines don't flash fully drawn on load */
}

.iso-hero.is-started .iso-hero__flow {
  visibility: visible;
}

.iso-hero__flow path.iso-line {
  fill: none;
  stroke-width: 1;
  stroke-linecap: butt;
}

/* Pulsing gradient stops — each line gets its own animation-delay */
.iso-hero__flow stop.iso-pulse {
  stop-color: var(--iso-pink-1); /* base colour, also used when the pulse is off (reduced motion) */
  animation: iso-stop-pulse var(--iso-pulse-duration) ease-in-out infinite;
}

.iso-hero__flow .iso-arrow-shape {
  fill: var(--iso-pink-1);
  animation: iso-fill-pulse var(--iso-pulse-duration) ease-in-out infinite;
}

.iso-hero__flow .iso-arrow-pop {
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes iso-stop-pulse {
  0%, 100% { stop-color: var(--iso-pink-1); }
  30%      { stop-color: var(--iso-pink-2); }
  55%      { stop-color: var(--iso-pink-3); }
  80%      { stop-color: var(--iso-pink-4); }
}

@keyframes iso-fill-pulse {
  0%, 100% { fill: var(--iso-pink-1); }
  30%      { fill: var(--iso-pink-2); }
  55%      { fill: var(--iso-pink-3); }
  80%      { fill: var(--iso-pink-4); }
}

/* ---- Reduced motion: final frame, no looping -------------------------- */

@media (prefers-reduced-motion: reduce) {
  .iso-hero__flow stop.iso-pulse,
  .iso-hero__flow .iso-arrow-shape {
    animation: none;
  }
}
