/* ============================================================
   LEA — Executive Orchestrator (page-scoped styles)
   Reuses master tokens / classes from styles.css + premium.css.
   Neural intelligence tone: full phoenix gradient (cyan-magenta-purple).
   Namespaced .lea-* only. Body text stays white/silver (WCAG AA).
   ============================================================ */

/* ---- HERO: interactive brain stage ---- */
.eyebrow--phoenix {
  background: var(--phoenix-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* The hero is now a full-viewport interactive stage */
.hero--leastage {
  min-height: 100svh;
  align-items: center;
  padding-block: var(--sp-8);
}
/* ambient backdrop (no full-bleed video; brain lives in the core) */
.hero__bg--leastage {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(80% 70% at 62% 50%, rgba(138,46,255,0.16) 0%, transparent 60%),
    radial-gradient(70% 60% at 70% 38%, rgba(0,207,255,0.12) 0%, transparent 60%),
    linear-gradient(180deg, rgba(5,8,22,0.55) 0%, rgba(5,8,22,0.25) 45%, rgba(5,8,22,0.96) 100%);
}

.leastage {
  position: relative; z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--sp-3);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: var(--sp-6);
}
.leastage__text { position: relative; z-index: 2; max-width: 560px; }
.leastage__text::before {
  content: ''; position: absolute; z-index: -1;
  left: -8%; right: -8%; top: -10%; bottom: -10%;
  background: radial-gradient(70% 75% at 35% 50%, rgba(5,8,22,0.78) 0%, rgba(5,8,22,0.45) 45%, transparent 80%);
  filter: blur(10px); pointer-events: none;
}
.leastage__text h1 { margin-block: var(--sp-2) var(--sp-3); }
.leastage__note {
  grid-column: 1 / -1;
  text-align: center;
  margin: var(--sp-3) auto 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.leastage__note span { color: var(--text-secondary); }
.leastage__readout-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: var(--text-base);
  background: var(--phoenix-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  display: block; margin-bottom: 0.2rem;
}
.leastage__readout-line {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 0.4rem;
}

/* ---- orbit field ---- */
.leaorbit {
  position: relative;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 1 / 1;
  margin-inline: auto;
}
.leaorbit__svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; overflow: visible; pointer-events: none;
}

/* ---- brain core ---- */
.leacore {
  position: absolute;
  left: 50%; top: 50%;
  width: 38%; aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%) scale(var(--lea-core-scale, 1));
  border-radius: 50%;
  z-index: 5;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  overflow: visible;
  transition: transform 0.18s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.leacore__video {
  position: absolute; inset: 6%;
  width: 88%; height: 88%;
  object-fit: cover;
  border-radius: 50%;
  z-index: 2;
  border: 1px solid rgba(179,71,255,0.5);
  box-shadow: inset 0 0 26px rgba(0,207,255,0.28);
}
.leacore__glow {
  position: absolute; inset: -18%;
  border-radius: 50%;
  z-index: 1;
  background: radial-gradient(circle at 50% 45%, rgba(138,46,255,0.55) 0%, rgba(0,207,255,0.22) 48%, transparent 72%);
  filter: blur(6px);
  opacity: var(--lea-core-glow, 0.85);
  transition: opacity 0.2s ease;
}
.leacore__ring {
  position: absolute; inset: -4%;
  border-radius: 50%;
  z-index: 3;
  border: 1.5px solid transparent;
  background: var(--phoenix-gradient) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.85;
  animation: leaCoreSpin 16s linear infinite;
}
.leacore__ring--2 {
  inset: -13%;
  border-style: dashed;
  opacity: 0.4;
  animation: leaCoreSpin 26s linear infinite reverse;
}
@keyframes leaCoreSpin { to { transform: rotate(360deg); } }
.leacore__hint {
  position: absolute;
  bottom: 14%; left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  max-width: 88%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--white);
  background: rgba(10,14,31,0.9);
  border: 1px solid rgba(179,71,255,0.6);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  z-index: 7;
  pointer-events: none;
  box-shadow: 0 6px 20px -8px rgba(0,0,0,0.8);
  transition: opacity 0.3s ease;
}
/* when showing a capability one-liner, allow wrapping + a wider pill */
.leacore__hint.is-cap {
  white-space: normal;
  border-radius: 14px;
  bottom: 6%;
  max-width: 78%;
  line-height: 1.35;
}
/* focus + thinking states */
.leacore:focus-visible { outline: none; }
.leacore:focus-visible .leacore__glow { opacity: 1; }
.leacore.is-thinking .leacore__glow { opacity: 1; animation: leaCorePulse 1.1s ease-in-out infinite; }
.leacore.is-thinking .leacore__video { box-shadow: inset 0 0 34px rgba(0,207,255,0.5), 0 0 30px rgba(138,46,255,0.45); }
@keyframes leaCorePulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
/* touch idle pulse */
.leacore.is-idlepulse { animation: leaIdlePulse 2.8s ease-in-out infinite; }
@keyframes leaIdlePulse {
  0%,100% { transform: translate(-50%,-50%) scale(1); }
  50% { transform: translate(-50%,-50%) scale(1.04); }
}


/* ---- SVG capability links (core -> node) ---- */
.lealink {
  stroke: rgba(194,203,214,0.16);
  stroke-width: 0.5;
  fill: none;
  transition: stroke 0.3s ease, stroke-width 0.3s ease, opacity 0.3s ease;
}
.lealink.is-active {
  stroke: url(#leaLinkGrad);
  stroke-width: 1;
  filter: drop-shadow(0 0 4px rgba(138,46,255,0.7));
}
.lealink.is-pulsing {
  stroke: url(#leaLinkGrad);
  stroke-width: 0.9;
  stroke-dasharray: 4 8;
  animation: leaPulseFlow 1.1s linear;
}
@keyframes leaPulseFlow {
  from { stroke-dashoffset: 24; opacity: 0.9; }
  to   { stroke-dashoffset: 0; opacity: 0.2; }
}

/* ---- orbit capability nodes ---- */
.leanode {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.36rem 0.66rem;
  border-radius: 999px;
  background: rgba(10,14,31,0.92);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.25s ease, border-color 0.25s ease,
              color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.leanode__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
  flex: 0 0 auto;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.leanode:hover,
.leanode:focus-visible,
.leanode.is-active {
  color: var(--white);
  border-color: rgba(179,71,255,0.7);
  background: rgba(20,16,40,0.96);
  box-shadow: 0 0 22px rgba(138,46,255,0.4);
  transform: translate(-50%, -50%) scale(1.07);
  outline: none;
}
.leanode:hover .leanode__dot,
.leanode:focus-visible .leanode__dot,
.leanode.is-active .leanode__dot {
  background: var(--con-blue);
  box-shadow: 0 0 10px rgba(0,207,255,0.9);
}

/* ---- thought-trace overlay (in hero, around the core) ---- */
.leatrace {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 7;
  width: min(78%, 360px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.leatrace[hidden] { display: none; }
.leatrace__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}
.leastep {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.26rem 0.56rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(8,11,26,0.92);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  opacity: 0.55;
  transition: opacity 0.3s ease, border-color 0.3s ease,
              color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.leastep__num {
  width: 15px; height: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 0.56rem;
  border: 1px solid var(--border-strong);
  flex: 0 0 auto;
}
.leastep.is-running {
  opacity: 1;
  color: var(--white);
  border-color: rgba(179,71,255,0.75);
  background: rgba(20,16,40,0.95);
  box-shadow: 0 0 16px rgba(138,46,255,0.45);
}
.leastep.is-running .leastep__num {
  color: var(--white); border-color: rgba(179,71,255,0.9);
}
.leastep.is-done {
  opacity: 1;
  color: var(--con-blue);
  border-color: rgba(0,207,255,0.4);
}
.leastep.is-done .leastep__num {
  color: var(--con-blue); border-color: rgba(0,207,255,0.5);
}
.leatrace__bar {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  pointer-events: auto;
}
.leatrace__status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: rgba(8,11,26,0.86);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.24rem 0.6rem;
}
.leatrace__status.is-done { color: var(--con-blue); border-color: rgba(0,207,255,0.45); }
.leatrace__reset {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--white);
  background: rgba(255,0,122,0.14);
  border: 1px solid rgba(255,0,122,0.5);
  border-radius: 999px;
  padding: 0.24rem 0.7rem;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.leatrace__reset:hover,
.leatrace__reset:focus-visible {
  background: rgba(255,0,122,0.24);
  border-color: rgba(255,0,122,0.8);
  outline: none;
}
.leatrace__note {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 0;
}
/* dim nodes while trace runs so the flow reads clearly */
.leaorbit.is-thinking .leanode { opacity: 0.5; }
.leaorbit.is-thinking .leanode.is-active { opacity: 1; }

/* ============================================================
   Responsive — no horizontal overflow at 375px
   ============================================================ */
@media (max-width: 900px) {
  .leastage {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
    text-align: center;
  }
  .leastage__text { max-width: 640px; margin-inline: auto; }
  .leastage__text .btn-row { justify-content: center; }
  .leaorbit { max-width: 440px; order: 2; }
}
@media (max-width: 560px) {
  .hero--leastage { padding-block: var(--sp-6); }
  .leaorbit { max-width: 320px; }
  .leanode { font-size: 0.55rem; padding: 0.22rem 0.42rem; gap: 0.26rem; letter-spacing: 0; }
  .leanode__dot { width: 5px; height: 5px; }
  .leacore__hint { font-size: 0.6rem; padding: 0.22rem 0.55rem; bottom: 12%; }
  .leatrace { width: 90%; }
  .leastep { font-size: 0.56rem; padding: 0.2rem 0.4rem; gap: 0.24rem; }
  .leastep__num { width: 13px; height: 13px; font-size: 0.5rem; }
  .leatrace__status { font-size: 0.6rem; }
}

/* ---- reduced motion: static; nodes still hoverable, brain still clickable ---- */
@media (prefers-reduced-motion: reduce) {
  .leacore__ring,
  .leacore__ring--2,
  .leacore.is-thinking .leacore__glow,
  .leacore.is-idlepulse,
  .lealink.is-pulsing { animation: none; }
  .lealink.is-pulsing { stroke-dasharray: none; }
  .leacore, .leanode, .leastep { transition: none; }
}
