/* Qué es GNIA — hero: copy izquierda + núcleo a la derecha */

#hero.qe-hero {
  position: relative;
  margin-top: 0;
  min-height: calc(100vh - 44px);
  padding: 0 3vw 20px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  background: transparent;
  -webkit-mask-image: none;
  mask-image: none;
}

.qe-hero-inner {
  width: 100%;
  max-width: min(1520px, 96vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.18fr);
  grid-template-areas:
    "intro stage"
    "copy stage";
  align-items: center;
  column-gap: clamp(16px, 2.2vw, 36px);
  row-gap: 14px;
  text-align: left;
}

.qe-hero-intro {
  grid-area: intro;
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 42rem;
}

.qe-hero-title {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(2.05rem, 4.2vw, 3.35rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.05;
  color: #ffd700;
  background: linear-gradient(120deg, #b8860b 0%, #ffd700 45%, #fff4b0 55%, #ffd700 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (min-width: 901px) {
  .qe-hero-title {
    font-size: clamp(1.9rem, 3.7vw, calc(3.35rem - 10px));
  }
}

.qe-lead {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(0.88rem, 1.25vw, 1.05rem);
  font-weight: 500;
  line-height: 1.5;
  color: rgba(248, 250, 252, 0.9);
}

.qe-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- FAB pulsante GNIA AGENT ---------- */

.qe-agent-fab {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 -6px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(8, 12, 24, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  animation: qe-fab-pulse 2.4s ease-in-out infinite;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.qe-agent-fab::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--qe-neon-angle, 0deg),
    transparent 0%,
    rgba(255, 215, 0, 0.05) 6%,
    rgba(255, 215, 0, 0.95) 11%,
    rgba(255, 244, 176, 1) 13%,
    rgba(255, 215, 0, 0.95) 15%,
    rgba(255, 215, 0, 0.05) 20%,
    transparent 28%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: qe-neon-spin 4.5s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.qe-agent-fab-label {
  position: relative;
  z-index: 1;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(0.85rem, 2.2vw, 1.05rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  color: #ffd700;
  background: linear-gradient(120deg, #b8860b 0%, #ffd700 45%, #fff4b0 55%, #ffd700 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.qe-agent-fab:hover,
.qe-agent-fab:focus-visible {
  transform: translateY(-1px) scale(1.03);
  border-color: rgba(255, 215, 0, 0.65);
  outline: none;
}

.qe-agent-fab:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.35);
}

@keyframes qe-fab-pulse {
  0%,
  100% {
    box-shadow:
      0 0 10px rgba(255, 215, 0, 0.22),
      0 0 0 0 rgba(255, 215, 0, 0.28);
  }
  50% {
    box-shadow:
      0 0 22px rgba(255, 215, 0, 0.48),
      0 0 0 12px rgba(255, 215, 0, 0);
  }
}

@property --qe-neon-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes qe-neon-spin {
  to {
    --qe-neon-angle: 360deg;
  }
}

@supports not (background: conic-gradient(from var(--qe-neon-angle), red, blue)) {
  .qe-agent-fab::before {
    animation: qe-neon-rotate 4.5s linear infinite;
  }

  @keyframes qe-neon-rotate {
    to {
      transform: rotate(360deg);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .qe-agent-fab,
  .qe-agent-fab::before {
    animation: none;
  }
}

/* ---------- Modal GNIA AGENT ---------- */

.qe-agent-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.qe-agent-modal[hidden] {
  display: none !important;
}

.qe-agent-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 18, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.qe-agent-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  padding: clamp(22px, 4vw, 32px) clamp(20px, 4vw, 30px);
  border-radius: 18px;
  background: rgba(8, 12, 24, 0.92);
  border: 1px solid rgba(255, 215, 0, 0.22);
  box-shadow:
    0 0 28px rgba(255, 215, 0, 0.14),
    0 20px 50px rgba(0, 0, 0, 0.45);
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  transform: translateY(8px) scale(0.96);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.qe-agent-modal.is-open .qe-agent-modal-dialog {
  transform: none;
  opacity: 1;
}

.qe-agent-modal-dialog::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--qe-neon-angle, 0deg),
    transparent 0%,
    rgba(255, 215, 0, 0.05) 6%,
    rgba(255, 215, 0, 0.95) 11%,
    rgba(255, 244, 176, 1) 13%,
    rgba(255, 215, 0, 0.95) 15%,
    rgba(255, 215, 0, 0.05) 20%,
    transparent 28%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: qe-neon-spin 4.5s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.qe-agent-modal-content {
  position: relative;
  z-index: 1;
}

.qe-agent-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.qe-agent-modal-close:hover,
.qe-agent-modal-close:focus-visible {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  outline: none;
}

.qe-modal-h {
  margin: 0 0 12px;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  color: #ffd700;
  background: linear-gradient(120deg, #b8860b 0%, #ffd700 45%, #fff4b0 55%, #ffd700 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.qe-agent-modal .qe-lead {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(0.92rem, 1.7vw, 1.05rem);
  font-weight: 500;
  line-height: 1.55;
  color: rgba(248, 250, 252, 0.92);
}

body.qe-agent-modal-open {
  overflow: hidden;
}

/* ---------- Nucleus + orbit (2 capas: detrás / delante del canvas) ---------- */

.qe-nucleus-stage {
  grid-area: stage;
  position: relative;
  width: min(100%, 74vh, 780px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  z-index: 2;
  touch-action: manipulation;
  overflow: visible;
  perspective: 980px;
  perspective-origin: 50% 48%;
  justify-self: center;
}

.qe-orbit-back,
.qe-orbit-front {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  isolation: isolate;
  transform-style: preserve-3d;
}

.qe-orbit-back {
  z-index: 10;
}

#qe-hero-canvas {
  position: absolute;
  inset: 10%;
  width: 80%;
  height: 80%;
  margin: auto;
  display: block;
  border-radius: 50%;
  z-index: 20;
  pointer-events: auto;
}

.qe-orbit-front {
  z-index: 40;
  transform: translate3d(0, 0, 0);
  transform-style: preserve-3d;
}

.qe-orbit-item {
  position: absolute;
  left: 50%;
  top: 50%;
  /* Ancho fijo: el tamaño lo controla solo scale (evita salto al featured) */
  width: clamp(160px, 26vw, 280px);
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: contain;
  image-rendering: auto;
  margin: 0;
  border: none;
  outline: none;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%) scale(0.4);
  transform-origin: center center;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  backface-visibility: hidden;
  mix-blend-mode: normal;
  filter: none;
  opacity: 0.5;
  transition: none;
}

.qe-orbit-item.is-featured {
  opacity: 1 !important;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.65)) !important;
  mix-blend-mode: normal !important;
  background: radial-gradient(
    ellipse at center,
    rgba(6, 10, 22, 0.94) 35%,
    rgba(6, 10, 22, 0.55) 62%,
    transparent 78%
  );
  box-shadow: 0 0 36px 18px rgba(6, 10, 22, 0.45);
  z-index: 90 !important;
  pointer-events: none;
  rotate: none;
}

.qe-orbit-item.is-behind {
  filter: brightness(0.88);
}

/* ---------- Titles + CTA ---------- */

.qe-hero-copy {
  grid-area: copy;
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 42rem;
  margin-top: 0;
}

.qe-hero-copy .qe-subtitle {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(0.9rem, 1.6vw, 1.15rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
}

.qe-rotating-title {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  min-height: 1.3em;
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.45rem, 3.2vw, 2.35rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.2;
  letter-spacing: 0.03em;
}

.qe-rotating-title .qe-word {
  display: inline-block;
  color: #ffd700;
  text-shadow: 0 0 18px rgba(255, 215, 0, 0.35);
  background: none;
  -webkit-text-fill-color: #ffd700;
  opacity: 1;
  transform: none;
  white-space: pre;
}

.qe-rotating-title .qe-cursor {
  display: inline-block;
  margin-left: 2px;
  color: #ffd700;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.qe-rotating-title .qe-cursor.is-typing {
  opacity: 1;
  animation: qe-cursor-blink 0.7s step-end infinite;
}

@keyframes qe-cursor-blink {
  50% {
    opacity: 0;
  }
}

.qe-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
  margin-top: 10px;
}

.qe-hero-actions .info-embed-cta {
  display: none;
}

@media (max-width: 900px) {
  #hero.qe-hero {
    margin-top: 8px;
    min-height: auto;
    padding: 36px 16px 28px;
    overflow: hidden;
    align-items: flex-start;
  }

  .qe-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    max-width: 100%;
  }

  .qe-hero-intro,
  .qe-hero-copy {
    align-items: center;
    text-align: center;
    max-width: 100%;
  }

  .qe-hero-title {
    font-size: clamp(1.45rem, 7.2vw, 1.9rem);
  }

  .qe-lead {
    font-size: 0.78rem;
    line-height: 1.4;
    padding: 0 4px;
    max-width: 38em;
  }

  .qe-nucleus-stage {
    width: min(92vw, 340px);
    margin-top: 4px;
  }

  .qe-orbit-item {
    width: clamp(110px, 32vw, 170px);
    border-radius: 8px;
  }

  .qe-hero-copy .qe-subtitle {
    font-size: clamp(0.82rem, 3.6vw, 1rem);
  }

  .qe-rotating-title {
    font-size: clamp(1.35rem, 7.2vw, 1.85rem);
    justify-content: center;
  }

  .qe-hero-actions {
    justify-content: center;
    margin-top: 8px;
  }
}

/* Embed SPA */
html.gnia-embed #hero.qe-hero,
body.gnia-embed #hero.qe-hero {
  margin-top: 8px;
  min-height: auto;
  padding: 12px 16px 32px;
  overflow: hidden !important;
}

@media (max-width: 900px) {
  html.gnia-embed #hero.qe-hero,
  body.gnia-embed #hero.qe-hero,
  html.gnia-lab-standalone #hero.qe-hero,
  body.gnia-lab-standalone #hero.qe-hero {
    padding-top: 36px !important;
  }
}

html.gnia-embed .qe-hero-actions .chefs-cta-levitate {
  display: none !important;
}

html.gnia-embed .qe-hero-actions .info-embed-cta {
  display: inline-flex !important;
}
