:root {
  --cinematic-core-x: 0px;
  --cinematic-core-y: 0px;
  --cinematic-core-scale: 1;
  --presence-energy: 0;
  --presence-pitch: 0.5;
  --presence-alpha: 0.34;
}

/* Keep the information projected and quiet instead of boxing every surface. */
.action-rail,
.operations-pane,
.audit-pane,
.system-ribbon,
.holo-panel,
.trace-card,
.metric-node,
.voice-console,
.voice-readout,
.mode-button,
.rail-button,
.process-console,
.interaction-status,
.telemetry-node,
.chip,
.hologram-stage {
  border-color: transparent !important;
  box-shadow: none !important;
}

.action-rail,
.operations-pane,
.audit-pane {
  background-color: rgba(3, 10, 14, 0.22);
  backdrop-filter: blur(9px) saturate(1.08);
}

.system-ribbon {
  background:
    linear-gradient(90deg, rgba(0, 212, 255, 0.08), transparent 38%, rgba(255, 176, 32, 0.055)),
    rgba(2, 8, 11, 0.58);
  box-shadow: inset 0 -1px 0 rgba(0, 212, 255, 0.12) !important;
}

.holo-panel,
.trace-card,
.metric-node,
.voice-console,
.voice-readout,
.process-console,
.interaction-status,
.telemetry-node {
  background-color: rgba(3, 13, 18, 0.28);
}

.mode-button,
.rail-button {
  border: 0;
  border-radius: 2px;
  background: rgba(3, 12, 16, 0.28);
  box-shadow: inset 2px 0 0 rgba(0, 212, 255, 0.08) !important;
}

.mode-button:hover,
.rail-button:hover,
.mode-button:focus-visible,
.rail-button:focus-visible,
.ptt-button:focus-visible {
  outline: none;
  background: rgba(0, 212, 255, 0.075);
  box-shadow: inset 2px 0 0 rgba(0, 212, 255, 0.62), 0 0 20px rgba(0, 212, 255, 0.09) !important;
}

.hologram-stage {
  --cinematic-core-x: 0px;
  --cinematic-core-y: 0px;
  --cinematic-core-scale: 1;
  border: 0;
  border-radius: 2px;
  background:
    radial-gradient(circle at calc(50% + var(--cinematic-core-x)) calc(52% + var(--cinematic-core-y)), rgba(255, 176, 32, 0.065), transparent 38%),
    linear-gradient(180deg, rgba(0, 212, 255, 0.045), transparent 24%, rgba(0, 0, 0, 0.28)),
    linear-gradient(90deg, rgba(255, 176, 32, 0.045), transparent 30%, rgba(0, 212, 255, 0.04));
  box-shadow: inset 0 0 88px rgba(0, 212, 255, 0.055) !important;
}

.hologram-stage:hover,
.hologram-stage:focus-visible,
.hologram-stage.is-interacting,
body.is-processing .hologram-stage,
body.is-gesture .hologram-stage {
  border-color: transparent !important;
  outline: none;
  box-shadow:
    inset 0 0 96px hsl(var(--voice-hue) 96% 58% / calc(0.07 + var(--voice-bg-alpha-wash))),
    0 0 42px hsl(var(--voice-hue) 96% 58% / 0.09) !important;
}

.holo-engine-canvas,
.reactor-hud {
  left: calc(50% + var(--cinematic-core-x));
  top: calc(52% + var(--cinematic-core-y));
  transform:
    translate(calc(-50% + var(--hud-pan-x)), calc(-50% + var(--hud-pan-y)))
    rotateX(var(--hud-tilt-y))
    rotateY(var(--hud-tilt-x))
    scale(var(--hud-scale))
    scale(var(--cinematic-core-scale))
    scale(var(--voice-core-scale));
}

.core-state-band {
  left: calc(50% + var(--cinematic-core-x));
  top: calc(52% + var(--cinematic-core-y) + 72px);
}

.gsap-energy-ring,
.gsap-orbital-arc {
  left: calc(50% + var(--cinematic-core-x));
  top: calc(52% + var(--cinematic-core-y));
}

.gsap-energy-field {
  opacity: calc(0.46 + var(--presence-energy) * 0.34);
}

.visual-video-texture {
  left: calc(50% + var(--cinematic-core-x));
  top: calc(52% + var(--cinematic-core-y));
}

.jarvis-state-panel {
  top: 54px;
  background: transparent;
}

.jarvis-presence-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint style;
  mix-blend-mode: screen;
}

.presence-pointer,
.presence-pointer-ring,
.presence-pointer-dot,
.presence-wave,
.presence-scan,
.presence-flash,
.presence-packet,
.presence-sector {
  will-change: transform, opacity;
}

.presence-pointer {
  position: absolute;
  left: 0;
  top: 0;
  width: 74px;
  height: 74px;
  opacity: 0.42;
  transform: translate3d(-120px, -120px, 0) translate(-50%, -50%);
}

.presence-pointer::before,
.presence-pointer::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: linear-gradient(90deg, transparent, rgba(110, 231, 255, 0.74), transparent);
  filter: drop-shadow(0 0 7px rgba(0, 212, 255, 0.56));
}

.presence-pointer::before {
  width: 118px;
  height: 1px;
  transform: translate(-50%, -50%);
}

.presence-pointer::after {
  width: 1px;
  height: 118px;
  background: linear-gradient(180deg, transparent, rgba(110, 231, 255, 0.68), transparent);
  transform: translate(-50%, -50%);
}

.presence-pointer-ring {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(110, 231, 255, 0.48);
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, rgba(110, 231, 255, 0.58) 0 8deg, transparent 8deg 82deg, rgba(255, 176, 32, 0.42) 82deg 90deg, transparent 90deg 172deg, rgba(110, 231, 255, 0.58) 172deg 180deg, transparent 180deg 262deg, rgba(255, 176, 32, 0.42) 262deg 270deg, transparent 270deg);
  mask-image: radial-gradient(circle, transparent 66%, black 68%);
}

.presence-pointer-ring.secondary {
  inset: 19px;
  opacity: 0.7;
  transform: rotate(45deg);
}

.presence-pointer-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #eafcff;
  box-shadow: 0 0 12px rgba(110, 231, 255, 0.9), 0 0 28px rgba(0, 212, 255, 0.48);
  transform: translate(-50%, -50%);
}

.presence-wave,
.presence-sector {
  position: absolute;
  left: calc(50% + var(--cinematic-core-x));
  top: calc(52% + var(--cinematic-core-y));
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.presence-wave {
  width: min(50vw, 560px);
  opacity: calc(0.06 + var(--presence-energy) * 0.28);
  background:
    conic-gradient(from 0deg, transparent 0 18deg, hsl(var(--voice-hue) 98% 65% / 0.48) 22deg 25deg, transparent 28deg 82deg, hsl(calc(var(--voice-hue) + 34) 96% 61% / 0.32) 86deg 89deg, transparent 92deg 360deg);
  mask-image: radial-gradient(circle, transparent 67%, black 68%, black 69%, transparent 70%);
}

.presence-wave.wave-two {
  width: min(58vw, 650px);
  opacity: calc(0.04 + var(--presence-energy) * 0.2);
  transform: translate(-50%, -50%) rotate(90deg);
}

.presence-wave.wave-three {
  width: min(67vw, 740px);
  opacity: calc(0.025 + var(--presence-energy) * 0.14);
  transform: translate(-50%, -50%) rotate(180deg);
}

.presence-sector {
  width: min(69vw, 760px);
  opacity: 0.22;
  background:
    repeating-conic-gradient(from 0deg, rgba(0, 212, 255, 0.5) 0 1deg, transparent 1deg 15deg);
  mask-image: radial-gradient(circle, transparent 76%, black 77%, black 77.5%, transparent 78.5%);
}

.presence-scan {
  position: absolute;
  inset: -10% auto -10% 0;
  width: 16%;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(110, 231, 255, 0.08), rgba(255, 226, 143, 0.42), rgba(110, 231, 255, 0.08), transparent);
  filter: blur(0.2px) drop-shadow(0 0 20px rgba(0, 212, 255, 0.34));
  transform: translateX(-140%);
}

.presence-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle at calc(50% + var(--cinematic-core-x)) calc(52% + var(--cinematic-core-y)), hsl(var(--voice-hue) 98% 72% / 0.2), transparent 42%),
    linear-gradient(90deg, transparent, rgba(244, 247, 250, 0.1), transparent);
}

.presence-packet {
  position: absolute;
  left: calc(var(--packet-x) * 1%);
  top: calc(var(--packet-y) * 1%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(110, 231, 255, 0.8);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
  opacity: 0.18;
}

.cinematic-view-nav {
  position: absolute;
  left: 50%;
  top: 12px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 2px;
  transform: translateX(-50%);
  pointer-events: auto;
}

.cinematic-view-button {
  position: relative;
  min-height: 28px;
  border: 0;
  border-radius: 0;
  padding: 5px 10px 7px;
  background: rgba(3, 12, 16, 0.2);
  color: rgba(166, 176, 190, 0.72);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 750;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
}

.cinematic-view-button::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 2px;
  height: 1px;
  background: rgba(0, 212, 255, 0.12);
  transform: scaleX(0.36);
  transition: transform 180ms ease-out, background-color 180ms ease-out, box-shadow 180ms ease-out;
}

.cinematic-view-button:hover,
.cinematic-view-button:focus-visible,
.cinematic-view-button[aria-current="true"] {
  outline: none;
  color: #f4f7fa;
  background: rgba(0, 212, 255, 0.055);
}

.cinematic-view-button[aria-current="true"]::after {
  background: var(--core-accent, var(--accent));
  box-shadow: 0 0 12px var(--core-glow, rgba(0, 212, 255, 0.42));
  transform: scaleX(1);
}

.cinematic-view-label {
  position: absolute;
  left: calc(50% + var(--cinematic-core-x));
  top: calc(52% + var(--cinematic-core-y));
  z-index: 9;
  width: min(68%, 680px);
  opacity: 0;
  color: rgba(244, 247, 250, 0.96);
  font-family: var(--font-display);
  font-size: clamp(28px, 4.2vw, 64px);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 26px var(--core-glow, rgba(0, 212, 255, 0.44));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cinematic-view-context {
  position: absolute;
  z-index: 8;
  top: 96px;
  right: 34px;
  width: min(390px, 34%);
  display: grid;
  gap: 7px;
  padding-left: 14px;
  border-left: 1px solid color-mix(in srgb, var(--core-accent, var(--accent)) 54%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease-out, filter 220ms ease-out;
}

.cinematic-view-context span {
  color: var(--core-accent, var(--accent));
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.cinematic-view-context strong {
  color: rgba(244, 247, 250, 0.96);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.14;
  text-wrap: balance;
}

.cinematic-view-context p {
  margin: 0;
  color: rgba(199, 214, 224, 0.72);
  font-size: 11px;
  line-height: 1.45;
  text-wrap: pretty;
}

.cinematic-gesture-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 9;
  width: 160px;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  background: conic-gradient(from 0deg, transparent, rgba(255, 226, 143, 0.76), transparent 16%, rgba(110, 231, 255, 0.54), transparent 34%, rgba(255, 226, 143, 0.62), transparent 56%);
  mask-image: radial-gradient(circle, transparent 68%, black 70%, black 73%, transparent 75%);
  transform: translate(-50%, -50%) scale(0.6);
  pointer-events: none;
}

body[data-cinematic-view="pulse"] .home-attention,
body[data-cinematic-view="pulse"] .mission-stack,
body[data-cinematic-view="pulse"] .focus-lens,
body[data-cinematic-view="pulse"] .night-watch,
body[data-cinematic-view="pulse"] .briefing-strip,
body[data-cinematic-view="pulse"] .jarvis-state-panel {
  opacity: 0.055 !important;
  filter: blur(1px) saturate(0.65);
}

body[data-cinematic-view="pulse"] .global-pulse-mini {
  right: 34px;
  top: 260px;
  width: min(390px, 34%);
  height: min(310px, 54%);
  padding: 0;
  gap: 2px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
}

body[data-cinematic-view="pulse"] .global-pulse-mini canvas {
  min-height: 0;
  filter: saturate(1.28) brightness(1.08) drop-shadow(0 0 24px rgba(0, 212, 255, 0.28));
}

body[data-cinematic-view="pulse"] .process-console,
body[data-cinematic-view="pulse"] .interaction-status {
  opacity: 0.12 !important;
}

body[data-cinematic-view="pulse"] .cinematic-view-context,
body[data-cinematic-view="systems"] .cinematic-view-context {
  opacity: 0.92;
}

body[data-cinematic-view="systems"] .home-attention,
body[data-cinematic-view="systems"] .mission-stack,
body[data-cinematic-view="systems"] .focus-lens,
body[data-cinematic-view="systems"] .night-watch,
body[data-cinematic-view="systems"] .briefing-strip,
body[data-cinematic-view="systems"] .global-pulse-mini,
body[data-cinematic-view="systems"] .jarvis-state-panel {
  opacity: 0.04 !important;
  filter: blur(1px) saturate(0.58);
}

body[data-cinematic-view="systems"] .cinematic-view-context {
  left: 34px;
  right: auto;
  top: 96px;
}

body[data-cinematic-view="systems"] .processing-matrix {
  opacity: 0.58 !important;
}

body[data-cinematic-view="systems"] .process-console,
body[data-cinematic-view="systems"] .telemetry-node,
body[data-cinematic-view="systems"] .link-line,
body[data-cinematic-view="systems"] .signal-bus i {
  opacity: 0.86 !important;
}

body[data-cinematic-view="systems"] .process-console {
  width: min(330px, 32%);
}

body[data-voice-mode="listening"] .presence-pointer,
body[data-voice-mode="speaking"] .presence-pointer,
body.is-gesture .presence-pointer {
  opacity: calc(0.58 + var(--presence-energy) * 0.24);
}

body[data-voice-mode="speaking"] .presence-wave {
  filter: drop-shadow(0 0 16px hsl(var(--voice-hue) 96% 62% / 0.4));
}

.cinematic-reactive-target {
  --cinematic-local-x: 50%;
  --cinematic-local-y: 50%;
  position: relative;
  isolation: isolate;
  will-change: transform;
}

.cinematic-reactive-target::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--cinematic-local-x) var(--cinematic-local-y), rgba(110, 231, 255, 0.12), transparent 48%);
  transition: opacity 180ms ease-out;
}

.cinematic-reactive-target:hover::after,
.cinematic-reactive-target:focus-within::after {
  opacity: 1;
}

@media (max-height: 820px) and (min-width: 901px) {
  .cinematic-view-nav {
    left: 22px;
    top: 78px;
    transform: none;
  }

  .jarvis-state-panel {
    top: 40px;
  }

  .cinematic-view-context {
    top: 72px;
  }

  body[data-cinematic-view="systems"] .cinematic-view-context {
    top: 118px;
  }

  body[data-cinematic-view="pulse"] .global-pulse-mini {
    top: 220px;
    height: min(210px, 47%);
  }
}

@media (max-width: 900px) {
  .cinematic-view-nav {
    top: 8px;
    grid-template-columns: repeat(3, minmax(64px, 1fr));
  }

  .jarvis-state-panel {
    margin-top: 34px;
  }

  .cinematic-view-context {
    left: 14px !important;
    right: 14px !important;
    top: 88px !important;
    width: auto;
  }

  body[data-cinematic-view="pulse"] .global-pulse-mini {
    right: 14px;
    top: 210px;
    width: min(320px, 58%);
    height: 240px;
  }

  .holo-engine-canvas,
  .reactor-hud,
  .core-state-band,
  .gsap-energy-ring,
  .gsap-orbital-arc,
  .visual-video-texture,
  .presence-wave,
  .presence-sector {
    --cinematic-core-x: 0px !important;
    --cinematic-core-y: 0px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .presence-scan,
  .presence-packet,
  .presence-sector,
  .cinematic-gesture-burst {
    display: none;
  }

  .presence-pointer {
    opacity: 0.26;
  }
}
