/* Warro Intel — interim 3D-style hero showcase.
 *
 * Layered parallax hero built from the EXISTING mascot art
 * (/static/img/warro-mascot.jpg). This is the stand-in until a real
 * .glb mascot lands (see web/3D-MASCOT-REPORT.md): pointer tilt +
 * floating HUD layers at different depths, vanilla CSS/JS only.
 *
 * Locked palette only: Obsidian Black #080808, Chrome Silver #CDCBCA,
 * Laser Crimson Red #D41514 (plus tints/shades of those three).
 * No other hues. Lives in its own file so the palette work in
 * warro.css stays untouched.
 *
 * Behaviour guarantees:
 *  - prefers-reduced-motion: static art, no motion, no tilt.
 *  - below lg (1024px) the whole showcase is hidden by the template
 *    (hidden lg:block) and hero-3d.js never activates on touch.
 *  - without JS the art still renders fully (all transforms default
 *    to zero; animations are progressive enhancement).
 */

.hero3d {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 0;
  --my: 0;
  perspective: 1100px;
  perspective-origin: 50% 40%;
  position: relative;
}

.hero3d-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  /* JS drives --rx/--ry every frame with its own smoothing, so the
     scene itself needs no transition. */
  will-change: transform;
}

.hero3d-layer {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: translate3d(
    calc(var(--mx) * var(--depth, 0) * 1px),
    calc(var(--my) * var(--depth, 0) * 1px),
    var(--z, 0px)
  );
  pointer-events: none;
}

/* ---- back glow (deepest layer) ---- */
.hero3d-glow {
  --z: -70px;
  --depth: -12;
  inset: -14%;
}

.hero3d-glow-inner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgba(212, 21, 20, 0.30),
    rgba(212, 21, 20, 0.10) 55%,
    transparent 75%
  );
  filter: blur(22px);
  animation: hero3d-pulse 5.5s ease-in-out infinite alternate;
}

@keyframes hero3d-pulse {
  from { opacity: 0.65; transform: scale(0.96); }
  to   { opacity: 1;    transform: scale(1.04); }
}

/* ---- HUD rings ---- */
.hero3d-ring {
  --z: -35px;
  --depth: -7;
  inset: -5%;
}

.hero3d-ring-inner {
  position: absolute;
  inset: 0;
}

.hero3d-ring-dash {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(212, 21, 20, 0.55);
  animation: hero3d-spin 90s linear infinite;
}

.hero3d-ring-solid {
  position: absolute;
  inset: 5.5%;
  border-radius: 50%;
  border: 1px solid rgba(205, 203, 202, 0.20);
}

.hero3d-ring-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(212, 21, 20, 0.45),
    transparent 16%
  );
  /* Show only the ring band, not the filled disc. */
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: hero3d-spin 14s linear infinite;
}

@keyframes hero3d-spin {
  to { transform: rotate(360deg); }
}

/* ---- mascot frame ---- */
.hero3d-frame {
  --z: 30px;
  --depth: 0;
}

.hero3d-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.60),
    0 0 60px rgba(212, 21, 20, 0.18);
}

/* HUD corner ticks on the frame (own copy — warro.css is owned by the
   palette specialist, so the hero does not depend on its classes). */
.hero3d-tick {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 0 solid rgba(212, 21, 20, 0.75);
}

.hero3d-tick-tl { top: -7px; left: -7px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 0.6rem; }
.hero3d-tick-tr { top: -7px; right: -7px; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 0.6rem; }
.hero3d-tick-bl { bottom: -7px; left: -7px; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 0.6rem; }
.hero3d-tick-br { bottom: -7px; right: -7px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 0.6rem; }

/* ---- real 3D model mount (hero-model.js) ---- */
/* The canvas lives in the same frame as the 2D art and takes over
   only after the GLB loads (figure gains .hero3d--model). Until
   then — and on any failure — the 2D art shows as before. */
.hero3d-model {
  position: absolute;
  inset: 0;
  /* The frame layer disables pointer events; re-enable them here so
     the model can be dragged to rotate. */
  pointer-events: auto;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.hero3d-model:active {
  cursor: grabbing;
}

.hero3d--model .hero3d-model {
  opacity: 1;
}

.hero3d-model canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.60),
    0 0 60px rgba(212, 21, 20, 0.18);
}

.hero3d--model .hero3d-img {
  display: none;
}

/* ---- floating HUD chips ---- */
.hero3d-chip {
  --z: 70px;
  --depth: 10;
  display: flex;
}

.hero3d-chip-top { align-items: flex-start; justify-content: flex-end; }
.hero3d-chip-left { align-items: flex-start; justify-content: flex-start; }

.hero3d-chip-inner {
  margin: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chrome, #CDCBCA);
  background: rgba(8, 8, 8, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  animation: hero3d-float 6s ease-in-out infinite alternate;
}

.hero3d-chip-left .hero3d-chip-inner {
  animation-duration: 7s;
  animation-delay: 1.2s;
}

.hero3d-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #D41514;
  box-shadow: 0 0 10px rgba(212, 21, 20, 0.9);
  animation: hero3d-blink 2.4s ease-in-out infinite;
}

@keyframes hero3d-float {
  from { transform: translateY(-5px); }
  to   { transform: translateY(5px); }
}

@keyframes hero3d-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ---- caption card (front layer) ---- */
.hero3d-caption {
  --z: 55px;
  --depth: 6;
}

.hero3d-caption-card {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
}

/* ---- reduced motion: static art, no motion, no tilt ---- */
@media (prefers-reduced-motion: reduce) {
  .hero3d-scene,
  .hero3d-layer {
    transform: none;
  }
  .hero3d-glow-inner,
  .hero3d-ring-dash,
  .hero3d-ring-sweep,
  .hero3d-chip-inner,
  .hero3d-dot {
    animation: none;
  }
}
