.hero-engine {
  width: min(39vw, 470px);
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.hero-engine .instrument {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(232,119,34,.35);
  background:
    linear-gradient(#ffffff04 1px, transparent 1px),
    linear-gradient(90deg, #ffffff04 1px, transparent 1px);
  background-size: 32px 32px;
  cursor: crosshair;
  touch-action: manipulation;
}

.hero-engine svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-engine .orbit {
  fill: none;
  stroke: #e87722;
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}

.hero-engine .orbit:nth-child(2) { opacity: .65; }
.hero-engine .orbit:nth-child(3) { opacity: .4; }

.hero-engine .living-frame {
  fill: none;
  stroke: #e87722;
  stroke-width: 1.1;
  opacity: .48;
  vector-effect: non-scaling-stroke;
}

.hero-engine .center { fill: #e87722; }

.hero-engine .instrument-label {
  position: absolute;
  left: 15px;
  bottom: 15px;
  font-size: 9px;
  letter-spacing: 2px;
  color: #b6a18d;
  pointer-events: none;
}

@media (max-width: 900px) {
  .hero-engine {
    position: relative;
    width: min(100%, 460px);
    right: auto;
    top: auto;
    transform: none;
    margin-top: 55px;
  }

  .hero {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-engine .instrument {
    cursor: default;
  }
}

/* BVTDynamix laboratory — balanced hero composition */
@media (min-width: 1050px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 5%;
    align-items: center;
  }

  .hero-content {
    max-width: none;
    min-width: 0;
  }

  .hero h1 {
    font-size: clamp(58px, 6vw, 92px);
    letter-spacing: -4px;
  }

  .hero-engine {
    position: relative;
    width: 100%;
    max-width: 470px;
    top: auto;
    right: auto;
    transform: none;
    justify-self: end;
  }
}

@media (min-width: 901px) and (max-width: 1049px) {
  .hero-engine {
    width: 36%;
    right: 4%;
  }

  .hero h1 {
    font-size: clamp(55px, 6vw, 75px);
  }

  .hero-content {
    max-width: 58%;
  }
}

/* ==================================================
   DYNAMIX ENGINE V5 — INTERACTIVE GEOMETRY
   ================================================== */

.hero-engine .instrument {
  touch-action: none;
}

.hero-engine .instrument.dragging {
  cursor: grabbing;
}

/* Yellow interactive corner anchors */

.hero-engine .corner-handle {
  fill: #ffcc45;
  stroke: #202224;
  stroke-width: 2;
  opacity: 1;
  filter: drop-shadow(0 0 3px rgba(255,204,69,.45));
  pointer-events: none;
}

.hero-engine .instrument:hover .corner-handle {
  fill: #ffe27a;
  filter: drop-shadow(0 0 6px rgba(255,204,69,.8));
}

/* Magnetic filaments */

.hero-engine .energy-filament {
  fill: none;
  stroke: #ffb347;
  stroke-width: 1.15;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(255,179,71,.65));
  pointer-events: none;
}

.hero-engine .filament-layer {
  pointer-events: none;
}

/* Keep geometry visually consistent */

.hero-engine .orbit {
  pointer-events: none;
}


/* Keep V5 SVG orbits independent of legacy homepage orbit styling. */
.hero-engine svg path.orbit {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  border: none;
  border-radius: 0;
}


/* BVTDynamix logo integrated into the Dynamix Engine */

.hero-engine .engine-logo {
  position: absolute;
  width: 38%;
  max-width: 180px;
  height: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  filter: drop-shadow(0 0 12px rgba(0, 0, 0, .8));
  transition: filter .3s ease;
}

.hero-engine .instrument:hover .engine-logo {
  filter:
    drop-shadow(0 0 12px rgba(0, 0, 0, .8))
    drop-shadow(0 0 10px rgba(255, 130, 0, .25));
}

@media (prefers-reduced-motion: reduce) {
  .hero-engine .engine-logo {
    transition: none;
  }
}

/* Dynamix Engine — gently animated central logo */

.hero-engine .engine-logo {
  width: 44%;
  max-width: 205px;
  animation: dynamixLogoFloat 9s ease-in-out infinite;
  will-change: transform;
}

@keyframes dynamixLogoFloat {
  0%, 100% {
    transform: translate(-50%, -50%)
               translate(0, 0)
               rotate(-1deg)
               scale(1);
  }

  25% {
    transform: translate(-50%, -50%)
               translate(4px, -5px)
               rotate(1deg)
               scale(1.015);
  }

  50% {
    transform: translate(-50%, -50%)
               translate(-3px, 2px)
               rotate(1.5deg)
               scale(1.02);
  }

  75% {
    transform: translate(-50%, -50%)
               translate(2px, 4px)
               rotate(-0.5deg)
               scale(1.01);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-engine .engine-logo {
    animation: none;
    will-change: auto;
  }
}


/* Responsive logo displacement layered over gentle floating */
@keyframes dynamixLogoFloat {
  0%, 100% {
    transform: translate(
      calc(-50% + var(--logo-response-x, 0px)),
      calc(-50% + var(--logo-response-y, 0px))
    ) rotate(calc(-1deg + var(--logo-response-tilt, 0deg))) scale(1);
  }

  25% {
    transform: translate(
      calc(-50% + 4px + var(--logo-response-x, 0px)),
      calc(-50% - 5px + var(--logo-response-y, 0px))
    ) rotate(calc(1deg + var(--logo-response-tilt, 0deg))) scale(1.015);
  }

  50% {
    transform: translate(
      calc(-50% - 3px + var(--logo-response-x, 0px)),
      calc(-50% + 2px + var(--logo-response-y, 0px))
    ) rotate(calc(1.5deg + var(--logo-response-tilt, 0deg))) scale(1.02);
  }

  75% {
    transform: translate(
      calc(-50% + 2px + var(--logo-response-x, 0px)),
      calc(-50% + 4px + var(--logo-response-y, 0px))
    ) rotate(calc(-0.5deg + var(--logo-response-tilt, 0deg))) scale(1.01);
  }
}


/* Dynamix Engine — circular constellation */

/* Hide the old square and its connecting filaments */
.hero-engine .living-frame,
.hero-engine .energy-filament {
  display: none;
}

/* Independent dots arranged around the moving rings */
.hero-engine .constellation {
  pointer-events: none;
}

.hero-engine .constellation-dot {
  fill: #e87722;
  opacity: 0.48;
  pointer-events: none;
}

.hero-engine .constellation-dot.major {
  fill: #FFD447;
  opacity: 0.85;
}

/* Keep the original interactive corner dots */
.hero-engine .corner-handle {
  display: block;
}


/* BVTDynamix mobile engine-first layout */
@media (max-width: 900px) {
  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-engine {
    order: 0;
    position: relative;
    width: min(100%, 390px);
    max-width: 100%;
    margin: 0 auto 42px;
    top: auto;
    right: auto;
    transform: none;
  }

  .hero-content {
    order: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero-index {
    order: 2;
  }
}

@media (max-width: 600px) {
  .hero {
    padding-top: 30px;
  }

  .hero-engine {
    width: min(100%, 350px);
    margin-bottom: 38px;
  }

  .hero h1 {
    font-size: clamp(44px, 12vw, 64px);
    letter-spacing: -2px;
  }
}


/* Dynamix Engine — floating circular instrument */

/* Remove the rectangular enclosure */
.hero-engine .instrument {
  border: none;
  background: transparent;
}

/* Make constellation points easier to recognize */
.hero-engine .constellation-dot {
  opacity: .65;
  transition: fill .2s ease, opacity .2s ease;
}

.hero-engine .constellation-dot.major {
  opacity: 1;
}

.hero-engine .constellation-dot.active {
  fill: #FFE88A;
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(255, 212, 71, .9));
}

/* The instrument handles pointer interactions centrally */
.hero-engine .constellation {
  pointer-events: none;
}
