/* ══════════════════════════════════════════════════════════════════════
   V82 COCKPIT — Wave 2 Operational Centerpiece
   Posture Ring · Live Signal Feed · God Mode Escalation Atmosphere
   Every animation communicates posture, drift, confidence, or authority.
   ══════════════════════════════════════════════════════════════════════ */

/* ─── UNIFIED POSTURE RING ─────────────────────────────────────────── */
.v82-posture-ring {
  position: relative;
  width: 240px;
  height: 240px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.v82-posture-ring svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.v82-posture-track {
  fill: none;
  stroke: rgba(0,209,255,0.10);
  stroke-width: 6;
}
.v82-posture-progress {
  fill: none;
  stroke: var(--sovereign-blue);
  stroke-width: 6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(0,209,255,0.55));
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.55s cubic-bezier(0.22,1,0.36,1),
              stroke 0.4s ease,
              filter 0.4s ease;
}
.v82-posture-pulse {
  fill: none;
  stroke: rgba(0,209,255,0.30);
  stroke-width: 1.5;
  transform-origin: 50% 50%;
  animation: v82-posture-breath 3.4s ease-in-out infinite;
}
@keyframes v82-posture-breath {
  0%, 100% { transform: scale(1.00); opacity: 0.30; }
  50%      { transform: scale(1.04); opacity: 0.10; }
}

/* ── Posture states ──────────────────────────────────────────────── */
/* high-confidence: ring sharpens, glow tightens */
.v82-posture-ring.state-confident .v82-posture-progress {
  stroke: var(--sovereign-blue);
  stroke-width: 7;
  filter: drop-shadow(0 0 12px rgba(0,209,255,0.85));
}
.v82-posture-ring.state-confident .v82-posture-pulse { animation-duration: 5s; opacity: 0.25; }

/* instability: contracts — pulse tightens and quickens */
.v82-posture-ring.state-unstable .v82-posture-pulse {
  animation-duration: 1.6s;
  stroke: rgba(255,200,87,0.50);
}

/* volatility: fracture — segmented dasharray + amber tinge */
.v82-posture-ring.state-volatile .v82-posture-progress {
  stroke: var(--amber);
  stroke-dasharray: 18 6 !important;
  filter: drop-shadow(0 0 10px rgba(255,200,87,0.55));
}
.v82-posture-ring.state-volatile .v82-posture-pulse {
  stroke: rgba(255,200,87,0.55);
  animation-duration: 1.1s;
}

/* alert: penalty-red — for governance breach / drift detection */
.v82-posture-ring.state-alert .v82-posture-progress {
  stroke: var(--v82-penalty-red);
  filter: drop-shadow(0 0 12px rgba(255,59,48,0.70));
}
.v82-posture-ring.state-alert .v82-posture-pulse {
  stroke: rgba(255,59,48,0.50);
  animation-duration: 0.9s;
}

/* loading state: indeterminate sweep — replaces every spinner */
.v82-posture-ring.state-loading .v82-posture-progress {
  stroke-dasharray: 60 600;
  animation: v82-posture-sweep 1.4s linear infinite;
  transition: none;
}
@keyframes v82-posture-sweep {
  0%   { stroke-dashoffset: 0;    }
  100% { stroke-dashoffset: -660; }
}

/* governance/earned: Oracle Gold posture */
.v82-posture-ring.state-governance .v82-posture-progress {
  stroke: var(--v82-oracle-gold);
  filter: drop-shadow(0 0 12px rgba(255,215,0,0.65));
}

/* Ring center readout */
.v82-posture-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: 'IBM Plex Mono', monospace;
  text-align: center;
}
.v82-posture-value {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--sovereign-blue);
  line-height: 1;
  transition: color 0.4s ease;
}
.v82-posture-label {
  font-size: 9px;
  letter-spacing: 4px;
  color: rgba(255,255,255,0.50);
  margin-top: 10px;
  text-transform: uppercase;
}
.v82-posture-detail {
  font-size: 8px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.35);
  margin-top: 4px;
}
.v82-posture-ring.state-confident  .v82-posture-value { color: var(--sovereign-blue); }
.v82-posture-ring.state-volatile   .v82-posture-value { color: var(--amber); }
.v82-posture-ring.state-alert      .v82-posture-value { color: var(--v82-penalty-red); }
.v82-posture-ring.state-governance .v82-posture-value { color: var(--v82-oracle-gold); }

@media (prefers-reduced-motion: reduce) {
  .v82-posture-pulse, .v82-posture-progress { animation: none !important; }
}

/* Compact variant (inline loading replacement) */
.v82-posture-ring.size-sm  { width: 56px;  height: 56px;  }
.v82-posture-ring.size-sm  .v82-posture-value  { font-size: 12px; }
.v82-posture-ring.size-sm  .v82-posture-label  { display: none; }
.v82-posture-ring.size-sm  .v82-posture-detail { display: none; }
.v82-posture-ring.size-md  { width: 120px; height: 120px; }
.v82-posture-ring.size-md  .v82-posture-value  { font-size: 22px; }
.v82-posture-ring.size-md  .v82-posture-label  { font-size: 7px; letter-spacing: 2px; margin-top: 4px; }
.v82-posture-ring.size-md  .v82-posture-detail { display: none; }

/* ─── LIVE SIGNAL FEED ─────────────────────────────────────────────── */
.v82-signal-feed {
  position: relative;
  height: 36px;
  background: rgba(10,10,10,0.55);
  border-top: 1px solid rgba(0,209,255,0.18);
  border-bottom: 1px solid rgba(0,209,255,0.18);
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: 'IBM Plex Mono', monospace;
}
.v82-signal-feed-track {
  display: flex;
  align-items: center;
  gap: 36px;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  animation: v82-signal-scroll 80s linear infinite;
  white-space: nowrap;
  padding-left: 100%;   /* start off-screen right */
  will-change: transform;
}
.v82-signal-feed:hover .v82-signal-feed-track { animation-play-state: paused; }
@keyframes v82-signal-scroll {
  0%   { transform: translateX(0%);    }
  100% { transform: translateX(-100%); }
}
.v82-signal-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.78);
  padding: 0 4px;
}
.v82-signal-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sovereign-blue);
  box-shadow: 0 0 6px rgba(0,209,255,0.7);
  flex-shrink: 0;
}
.v82-signal-item.tone-alert       .v82-signal-dot { background: var(--v82-penalty-red); box-shadow: 0 0 6px rgba(255,59,48,0.8); }
.v82-signal-item.tone-alert       { color: rgba(255,255,255,0.95); }
.v82-signal-item.tone-volatile    .v82-signal-dot { background: var(--amber); box-shadow: 0 0 6px rgba(255,200,87,0.8); }
.v82-signal-item.tone-governance  .v82-signal-dot { background: var(--v82-oracle-gold); box-shadow: 0 0 6px rgba(255,215,0,0.8); }
.v82-signal-pts {
  font-weight: 700;
  color: var(--sovereign-blue);
}
.v82-signal-item.tone-alert     .v82-signal-pts { color: var(--v82-penalty-red); }
.v82-signal-item.tone-volatile  .v82-signal-pts { color: var(--amber); }

.v82-signal-feed.is-empty::after {
  content: 'No active intelligence signals · system at rest';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.30);
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .v82-signal-feed-track { animation: none; padding-left: 16px; }
}

/* ─── GOD MODE ESCALATION ATMOSPHERE ───────────────────────────────── */
/* When any privileged action is pending approval, body gets
   .v82-escalation-active. Background dims, HUD sharpens, ambient drops.
   On approval, .v82-escalation-release fires a single clean flash. */

body.v82-escalation-active::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  background: radial-gradient(ellipse at center,
    rgba(0,0,0,0) 30%,
    rgba(0,0,0,0.55) 80%,
    rgba(0,0,0,0.78) 100%);
  animation: v82-escalation-dim 0.6s ease forwards;
}
@keyframes v82-escalation-dim {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* HUD sharpens — borders tighten across the app */
body.v82-escalation-active .zone-tab,
body.v82-escalation-active .gp-section,
body.v82-escalation-active .pd-board,
body.v82-escalation-active .artifact-face {
  border-color: rgba(255,215,0,0.45) !important;
  transition: border-color 0.6s ease;
}

/* Ghost layer drops to silence so the foreground reads as a directive */
body.v82-escalation-active .v82-ghost-layer { opacity: 0.015 !important; }

/* Awaiting Secure Approval banner — pinned top center */
.v82-escalation-banner {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  padding: 12px 28px;
  background: rgba(10,10,10,0.95);
  border: 1px solid var(--v82-oracle-gold);
  box-shadow:
    0 0 0 1px rgba(255,215,0,0.20),
    0 0 32px rgba(255,215,0,0.35);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--v82-oracle-gold);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: v82-escalation-pulse 2.2s ease-in-out infinite;
}
@keyframes v82-escalation-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,215,0,0.20), 0 0 32px rgba(255,215,0,0.35); }
  50%      { box-shadow: 0 0 0 1px rgba(255,215,0,0.45), 0 0 56px rgba(255,215,0,0.55); }
}
.v82-escalation-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--v82-oracle-gold);
  box-shadow: 0 0 12px rgba(255,215,0,0.9);
  animation: v82-escalation-blink 0.9s ease-in-out infinite;
}
@keyframes v82-escalation-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}
.v82-escalation-banner-countdown {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--v82-oracle-gold);
  min-width: 60px;
  text-align: right;
}

/* On approval — single clean flash, atmosphere releases */
body.v82-escalation-release::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 11000;
  background: var(--v82-oracle-gold);
  animation: v82-escalation-flash 0.42s ease-out forwards;
}
@keyframes v82-escalation-flash {
  0%   { opacity: 0;    }
  35%  { opacity: 0.18; }
  100% { opacity: 0;    }
}

@media (prefers-reduced-motion: reduce) {
  body.v82-escalation-active::before { animation: none; opacity: 0.85; }
  .v82-escalation-banner             { animation: none; }
  .v82-escalation-banner-dot         { animation: none; }
  body.v82-escalation-release::after { animation: none; opacity: 0; }
}
