/* ═══════════════════════════════════════════════════════
   IKIGAI · Single-Screen Cockpit · v4
   Una sola pantalla (sin scroll): entidad + chat.
   + Vista Storytelling (12 secciones) con volver al chat.
   ═══════════════════════════════════════════════════════ */

/* Bloquea scroll de página en modo cockpit */
body.no-scroll {
  overflow: hidden;
  height: 100svh;
}

/* ───────────── Pantalla cockpit ───────────── */
.cockpit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  padding: clamp(90px, 14vh, 140px) 20px 40px;
  overflow: hidden;
}

.cockpit__center {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cockpit__title {
  font-size: clamp(2.1rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 10px 0 26px;
}

/* La zona de resultados nunca empuja scroll de página: scroll interno */
.cockpit .result-zone {
  width: 100%;
  max-height: 40vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding: 2px;
}
.cockpit .result-zone::-webkit-scrollbar { width: 6px; }
.cockpit .result-zone::-webkit-scrollbar-thumb {
  background: rgba(110, 168, 255, 0.3);
  border-radius: 999px;
}

/* ───────────── Liquid glass (utility reusable, adaptada a fondo claro) ───────────── */
.liquid-glass {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  background-blend-mode: luminosity;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
  overflow: hidden;
}
.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.2) 20%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0.2) 80%,
    rgba(255, 255, 255, 0.6) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/* ───────────── Entidad: orbe grande, abajo-derecha, latiendo ───────────── */
.cockpit__orb {
  position: fixed;
  right: clamp(-160px, -6vw, -40px);
  bottom: clamp(-180px, -8vh, -60px);
  z-index: 1;
  pointer-events: none;
  transform-origin: center;
  animation: orb-heartbeat 2.4s ease-in-out infinite;
  filter: drop-shadow(0 24px 80px rgba(110, 168, 255, 0.22));
}

/* Lente de cristal alrededor del orbe (efecto liquid-glass — se queda) */
.cockpit__orb .orb-glass {
  position: absolute;
  left: -9%;
  top: -9%;
  width: 118%;
  height: 118%;
  border-radius: 50%;
  z-index: -1;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    0 30px 90px rgba(110, 168, 255, 0.16);
}

/* Anillos visibles con esferas orbitando un poco más grandes (solo cockpit) */
.cockpit__orb .orb-ring__dot {
  width: 11px;
  height: 11px;
  top: -5.5px;
  box-shadow: 0 0 16px var(--orb-core);
}

/* Corazón / alma de IKIGAI: rojo translúcido en el centro del orbe (late con el corazón) */
.cockpit__orb .orb-heart {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30%;
  height: 30%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(255, 78, 96, 0.55) 0%,
    rgba(255, 96, 112, 0.32) 38%,
    rgba(255, 110, 120, 0) 70%
  );
  mix-blend-mode: normal;
  filter: blur(8px);
  animation: heart-glow 2.4s ease-in-out infinite;
}

@keyframes heart-glow {
  0%   { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
  12%  { opacity: 0.95; transform: translate(-50%, -50%) scale(1.12); }
  22%  { opacity: 0.6;  transform: translate(-50%, -50%) scale(1.0); }
  34%  { opacity: 0.85; transform: translate(-50%, -50%) scale(1.08); }
  48%  { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
}

/* Latido tipo corazón (lub-dub + reposo) */
@keyframes orb-heartbeat {
  0%   { transform: scale(1); }
  12%  { transform: scale(1.05); }
  22%  { transform: scale(0.99); }
  34%  { transform: scale(1.035); }
  48%  { transform: scale(1); }
  100% { transform: scale(1); }
}

/* ───────────── Vista Storytelling ───────────── */
.story-view {
  padding-top: 96px;
}

.story-back {
  position: fixed;
  top: 84px;
  left: 24px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(110, 168, 255, 0.28);
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
  color: var(--ikigai-ink-deep, #0b0d18);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(20, 30, 70, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.story-back:hover {
  transform: translateX(-2px);
  box-shadow: 0 12px 32px rgba(20, 30, 70, 0.18);
}
.story-back svg { transition: transform 0.2s ease; }
.story-back:hover svg { transform: translateX(-2px); }

/* Link activo del nav (Storytelling) */
.nav__links a.is-active {
  color: var(--ikigai-cosmic, #6EA8FF);
}

/* ───────────── Mobile ───────────── */
@media (max-width: 768px) {
  .cockpit {
    padding-top: clamp(78px, 12vh, 110px);
    justify-content: flex-start;
  }
  .cockpit__center { padding-top: 6vh; }
  .cockpit__orb {
    right: 50%;
    bottom: -22%;
    transform: translateX(50%);
    transform-origin: bottom center;
    opacity: 0.85;
    animation: none;                 /* en mobile el orbe queda quieto detrás */
  }
  .cockpit__orb .living-orb { transform: scale(0.62) translate3d(var(--ox,0), var(--oy,0), 0); }
  .cockpit .result-zone { max-height: 46vh; }
  .story-back { top: 76px; left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .cockpit__orb { animation: none; }
}
