/* ═══════════════════════════════════════════════════════════════
   JARVIS / E.D.I.T.H  —  HUD PORTFOLIO
   CSS Custom Properties + Full Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ── THEME: JARVIS/FRIDAY (Iron Man) ── */
:root,
body.jarvis {
  --bg: #020004;
  --primary: #CC0000;
  --secondary: #FFD700;
  --accent: #00E5FF;
  --accent2: #FF6B00;
  --text: #E0FFFF;
  --text-dim: #8EC5CE;
  --text-bright: #FFFFFF;
  --grid-col: rgba(0, 229, 255, 0.085);
  --vignette: rgba(160, 0, 0, 0.30);
  --panel-bg: rgba(0, 10, 18, 0.88);
  --panel-border: rgba(0, 229, 255, 0.22);
  --node-bg: rgba(204, 0, 0, 0.10);
  --node-border: rgba(0, 229, 255, 0.30);
  --node-glow: rgba(0, 229, 255, 0.35);
  --topbar-bg: rgba(2, 0, 4, 0.85);
  --tag-color: #CC0000;
  --timeline-col: #00E5FF;
  --corner-col: #CC0000;
  --bootbg: #020004;
  --scan-col: rgba(0, 229, 255, 0.5);
  --font-hud: 'Orbitron', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;
  --radius: 4px;
  --transition: 0.35s ease;
}

/* ── THEME: E.D.I.T.H (Peter Parker / Tony Stark teal) ── */
body.edith {
  --bg: #00060D;
  --primary: #00E5FF;
  --secondary: #00BCD4;
  --accent: #80FFFF;
  --accent2: #006064;
  --text: #E0FFFF;
  --text-dim: #7DD8E0;
  --text-bright: #FFFFFF;
  --grid-col: rgba(0, 229, 255, 0.095);
  --vignette: rgba(0, 80, 100, 0.35);
  --panel-bg: rgba(0, 10, 18, 0.90);
  --panel-border: rgba(0, 229, 255, 0.28);
  --node-bg: rgba(0, 188, 212, 0.10);
  --node-border: rgba(0, 229, 255, 0.35);
  --node-glow: rgba(0, 229, 255, 0.45);
  --topbar-bg: rgba(0, 6, 13, 0.85);
  --tag-color: #00E5FF;
  --timeline-col: #00BCD4;
  --corner-col: #00E5FF;
  --bootbg: #00060D;
  --scan-col: rgba(0, 229, 255, 0.09);
}

/* ════════════════════  RESET & BASE  ════════════════════ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  cursor: crosshair;
  user-select: none;
}

body.panel-open {
  cursor: default;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
}

/* ════════════════════  CANVAS  ════════════════════ */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ════════════════════  BOOT SCREEN  ════════════════════ */
#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bootbg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#boot-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--scan-col), transparent);
  box-shadow: 0 0 20px var(--scan-col), 0 0 60px var(--scan-col);
  top: 0;
  animation: none;
}

.boot-scanline.scanning {
  animation: scanSweep 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes scanSweep {
  from {
    top: 0%;
    opacity: 1;
  }

  to {
    top: 100%;
    opacity: 0;
  }
}

.boot-content {
  width: min(520px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.boot-content.visible {
  opacity: 1;
}

.boot-logo {
  text-align: center;
  border: 1px solid var(--panel-border);
  padding: 24px 32px;
  border-top: 3px solid var(--primary);
  position: relative;
}

.boot-logo::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20px;
  width: 60px;
  height: 3px;
  background: var(--secondary);
}

.boot-logo-brand {
  display: block;
  font-family: var(--font-hud);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.15em;
  text-shadow: 0 0 30px var(--primary);
}

.boot-logo-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.25em;
  margin-top: 8px;
}

.boot-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.boot-line {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.boot-line.visible {
  opacity: 1;
  transform: translateX(0);
}

.boot-line.done .bc-icon {
  color: var(--secondary);
}

.bc-icon {
  color: var(--primary);
  font-size: 0.7rem;
}

.boot-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.boot-progress-track {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.boot-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 0 12px var(--accent);
  transition: width 0.05s linear;
}

.boot-pct {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}

.boot-final {
  font-family: var(--font-hud);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: var(--accent);
  text-align: center;
  letter-spacing: 0.2em;
  text-shadow: 0 0 20px var(--accent);
  min-height: 1.5em;
}

.boot-skip {
  position: absolute;
  bottom: 24px;
  right: 28px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.2s;
}

.boot-skip:hover {
  opacity: 1;
}

/* ════════════════════  HUD FRAME  ════════════════════ */
#hud-frame {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

/* Scanlines overlay */
#hud-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.04) 2px,
      rgba(0, 0, 0, 0.04) 4px);
  pointer-events: none;
  z-index: 1;
}

/* Vignette */
#hud-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 85% at 50% 48%, transparent 45%, var(--vignette) 100%);
  pointer-events: none;
  z-index: 2;
}

/* ── Corner Brackets ── */
.corner {
  position: absolute;
  width: 55px;
  height: 55px;
  z-index: 20;
}

.corner::before,
.corner::after {
  content: '';
  position: absolute;
  background: var(--corner-col);
  box-shadow: 0 0 8px var(--corner-col);
}

.corner::before {
  width: 100%;
  height: 2px;
}

.corner::after {
  width: 2px;
  height: 100%;
}

.corner-tl {
  top: 14px;
  left: 14px;
}

.corner-tl::before {
  top: 0;
  left: 0;
}

.corner-tl::after {
  top: 0;
  left: 0;
}

.corner-tr {
  top: 14px;
  right: 14px;
}

.corner-tr::before {
  top: 0;
  right: 0;
}

.corner-tr::after {
  top: 0;
  right: 0;
}

.corner-bl {
  bottom: 14px;
  left: 14px;
}

.corner-bl::before {
  bottom: 0;
  left: 0;
}

.corner-bl::after {
  bottom: 0;
  left: 0;
}

.corner-br {
  bottom: 14px;
  right: 14px;
}

.corner-br::before {
  bottom: 0;
  right: 0;
}

.corner-br::after {
  bottom: 0;
  right: 0;
}

/* ── Top Status Bar ── */
#hud-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 42px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 70px;
  z-index: 50;
  pointer-events: all;
  backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ai-badge {
  font-family: var(--font-hud);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.12em;
  text-shadow: 0 0 14px var(--primary);
}

.ai-version {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.topbar-center {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
  letter-spacing: 0.12em;
  text-align: center;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
}

.sep {
  opacity: 0.3;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00FF88;
  box-shadow: 0 0 8px #00FF88;
  animation: statusPulse 2.5s ease-in-out infinite;
}

@keyframes statusPulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 8px #00FF88;
  }

  50% {
    opacity: 0.55;
    box-shadow: 0 0 3px #00FF88;
  }
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.signal-bars span {
  width: 3px;
  background: var(--primary);
  border-radius: 1px;
  opacity: 0.65;
}

.signal-bars span:nth-child(1) {
  height: 4px;
}

.signal-bars span:nth-child(2) {
  height: 7px;
}

.signal-bars span:nth-child(3) {
  height: 10px;
}

.signal-bars span:nth-child(4) {
  height: 14px;
}

/* ── Bottom AI Bar ── */
#hud-bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38px;
  background: var(--topbar-bg);
  border-top: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  padding: 0 70px;
  gap: 10px;
  z-index: 50;
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.ai-prompt {
  font-family: var(--font-hud);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.ai-dialogue {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  flex: 1;
}

.ai-cursor {
  font-size: 0.65rem;
  color: var(--accent);
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ── Side Data Strips ── */
.hud-strip {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  z-index: 20;
}

.hud-strip-left {
  left: 12px;
}

.hud-strip-right {
  right: 12px;
}

.strip-label {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  opacity: 0.6;
}

.strip-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.s-bar {
  width: 3px;
  height: calc(var(--h) * 0.35);
  min-height: 4px;
  max-height: 28px;
  background: var(--primary);
  border-radius: 2px;
  opacity: 0.35;
}

.strip-readout {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--accent);
  text-align: center;
  opacity: 0.7;
  line-height: 1.5;
}

/* ════════════════════  THEME TOGGLE (in topbar)  ════════════════════ */
#theme-toggle {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: transparent;
  transition: color var(--transition), border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

#theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}

/* ════════════════════  HINT TEXT  ════════════════════ */
#hint-text {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease;
  white-space: nowrap;
}

#hint-text.visible {
  opacity: 1;
}

.hint-label {
  font-family: var(--font-hud);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--text-dim);
  animation: hintPulse 3.0s ease-in-out infinite;
}

.hint-arrows {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  line-height: 1;
}

.hint-arr {
  display: block;
  font-size: 1.1rem;
  color: var(--accent);
  opacity: 0;
  animation: hintArrFade 1.6s ease-in-out infinite;
  transform: rotateZ(90deg);
  /* point downward */
}

.arr-1 {
  animation-delay: 0s;
}

.arr-2 {
  animation-delay: 0.2s;
}

.arr-3 {
  animation-delay: 0.4s;
}

@keyframes hintPulse {

  0%,
  100% {
    opacity: 0.45;
  }

  50% {
    opacity: 1.00;
  }
}

@keyframes hintArrFade {
  0% {
    opacity: 0;
    transform: rotateZ(90deg) translateX(-4px);
  }

  40% {
    opacity: 0.9;
    transform: rotateZ(90deg) translateX(2px);
  }

  70% {
    opacity: 0.55;
    transform: rotateZ(90deg) translateX(5px);
  }

  100% {
    opacity: 0;
    transform: rotateZ(90deg) translateX(8px);
  }
}

/* ════════════════════  RADIAL NAV  ════════════════════ */
#radial-nav {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

#radial-nav.hidden {
  opacity: 0;
  pointer-events: none;
}

/* When a section is active, shift nav to centre of the left gap */
#radial-nav.nav-shifted {
  transform: translateX(-28.5vw) scale(0.62);
}

/* Outer decorative rings */
.nav-outer-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--primary);
  pointer-events: none;
}

.ring-1 {
  width: 540px;
  height: 540px;
  border-color: var(--primary);
  opacity: 0.34;
  animation: ringRotate 40s linear infinite;
}

.ring-2 {
  width: 480px;
  height: 480px;
  border-color: var(--accent);
  border-style: dashed;
  border-width: 1px;
  opacity: 0.40;
  animation: ringRotate 28s linear infinite reverse;
}

.ring-3 {
  width: 310px;
  height: 310px;
  border-color: var(--secondary);
  opacity: 0.44;
  animation: ringRotate 22s linear infinite;
  mask-image: radial-gradient(circle, transparent 120px, black 160px);
  -webkit-mask-image: radial-gradient(circle, transparent 120px, black 160px);
}

@keyframes ringRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Tick ring (SVG) */
.nav-tick-ring {
  position: absolute;
  animation: ringRotate 60s linear infinite;
  pointer-events: none;
  mask-image: radial-gradient(circle, transparent 100px, black 150px);
  -webkit-mask-image: radial-gradient(circle, transparent 100px, black 150px);
}

/* Connector SVG */
#nav-lines {
  position: absolute;
  width: 520px;
  height: 520px;
  pointer-events: none;
  overflow: visible;
  mask-image: radial-gradient(circle, transparent 100px, black 150px);
  -webkit-mask-image: radial-gradient(circle, transparent 100px, black 150px);
}

/* Center ── Target Reticle */
#nav-center {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: all;
  width: 280px;
  height: 280px;
  justify-content: center;
}

/* Background blocker — prevents decorative rings from overlapping the avatar */
#nav-center::before {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bg) 60%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

/* Targeting reticle SVG overlay */
#target-reticle {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  height: 280px;
  pointer-events: none;
  z-index: 10;
}

/* Outer dashed ring rotates */
.reticle-outer {
  animation: reticleRotate 20s linear infinite;
  transform-origin: 140px 140px;
}

/* Pulsing targeting circle */
.reticle-circle-pulse {
  animation: circlePulse 3s ease-in-out infinite;
  transform-origin: 140px 140px;
}

/* Inner dashed circle counter-rotates */
.reticle-circle-inner {
  animation: reticleRotate 15s linear infinite reverse;
  transform-origin: 140px 140px;
}

/* Rotating tick marks */
.reticle-ticks {
  animation: reticleRotate 30s linear infinite;
  transform-origin: 140px 140px;
}

/* Crosshair line subtle pulse */
.crosshair-line {
  animation: crosshairPulse 2.5s ease-in-out infinite;
}

@keyframes reticleRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes circlePulse {
  0%, 100% {
    stroke-opacity: 0.6;
    r: 90;
  }
  50% {
    stroke-opacity: 0.35;
    r: 92;
  }
}

@keyframes crosshairPulse {
  0%, 100% { stroke-opacity: 0.5; }
  50% { stroke-opacity: 0.8; }
}

/* Avatar ring — subtle, no glow */
#nav-avatar-ring {
  position: absolute;
  width: 172px;
  height: 172px;
  border-radius: 50%;
  border: 1px solid var(--primary);
  opacity: 0.2;
  box-shadow: none;
  animation: none;
  z-index: 2;
}

/* Avatar — slightly dimmed to blend with HUD but still clearly visible */
#nav-avatar {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--node-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 3;
}

#nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.55;
  filter: grayscale(15%) brightness(0.7);
  mix-blend-mode: luminosity;
  transition: opacity 0.4s ease, filter 0.4s ease;
}

#nav-center:hover #nav-avatar img {
  opacity: 0.7;
  filter: grayscale(5%) brightness(0.8);
}

#avatar-initials {
  display: none;
  font-family: var(--font-hud);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent);
  opacity: 0.5;
}

/* JARVIS: Single color glow for initials */
body.jarvis #avatar-initials {
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary);
  animation: none;
}

/* ── Target Scanline ── */
#target-scanline {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 1px;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg,
    transparent 0%,
    var(--accent) 20%,
    var(--accent) 80%,
    transparent 100%);
  opacity: 0;
  z-index: 12;
  pointer-events: none;
  animation: targetScan 4s ease-in-out infinite;
}

@keyframes targetScan {
  0% {
    top: 30%;
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  50% {
    top: 70%;
    opacity: 0.35;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    top: 30%;
    opacity: 0;
  }
}

/* ── Target Labels ── */
.target-label {
  position: absolute;
  z-index: 15;
  pointer-events: none;
}

#target-label-top {
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
}

#target-label-bottom {
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
}

.target-tag {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  opacity: 0.65;
  white-space: nowrap;
  text-shadow: 0 0 8px var(--accent);
  animation: tagPulse 3s ease-in-out infinite;
}

.target-tag-confirmed {
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary);
  font-weight: 600;
  animation: confirmedPulse 2.5s ease-in-out infinite;
}

@keyframes tagPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.9; }
}

@keyframes confirmedPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.nav-center-label {
  font-family: var(--font-hud);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.18em;
  margin-top: 16px;
  text-shadow: 0 0 12px var(--text-bright);
}

.nav-center-sub {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  margin-top: 4px;
}

/* Stats Panel */
#stats-panel {
  position: fixed;
  left: 18px;
  top: 52px;
  z-index: 35;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

body.panel-open #stats-panel {
  opacity: 0;
  transform: translateX(-16px);
  pointer-events: none;
}

/* Stats Panel layout */
#stats-panel {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-bottom: 3px solid var(--primary);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  max-width: 420px;
  min-width: 340px;
}

/* Avatar */
.stats-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  box-shadow: 0 0 12px var(--primary);
  opacity: 0.7;
}

.stats-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--node-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.stats-avatar-initials {
  display: none;
  font-family: var(--font-hud);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent);
}

body.jarvis .stats-avatar-initials {
  color: var(--primary);
  text-shadow: 0 0 12px var(--primary);
}

/* Info */
.stats-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.stats-name {
  font-family: var(--font-hud);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-shadow: 0 0 18px var(--accent);
  line-height: 1.1;
}

.stats-subtitle {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.stats-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--primary), transparent);
  opacity: 0.4;
  margin: 4px 0;
}

.stats-titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stats-title {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.stats-key {
  font-size: 0.52rem;
  color: var(--primary);
  letter-spacing: 0.12em;
  min-width: 62px;
  opacity: 0.9;
}

.stats-val {
  color: var(--text);
  letter-spacing: 0.04em;
}

.stats-val-quote {
  color: var(--secondary);
  font-style: italic;
}

.stats-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.stats-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 5px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  pointer-events: all;
}

.stats-btn-primary {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

.stats-btn-primary:hover {
  background: transparent;
  color: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

.stats-btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--panel-border);
}

.stats-btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

@media (max-width: 1100px) {
  #stats-panel {
    min-width: 0;
    max-width: 340px;
    padding: 14px 16px;
    gap: 12px;
  }

  .stats-name {
    font-size: 1.1rem;
  }

  .stats-avatar-wrap {
    width: 58px;
    height: 58px;
  }

  .stats-avatar {
    width: 54px;
    height: 54px;
  }
}

@media (max-width: 768px) {
  #stats-panel {
    display: none;
  }
}

/* Orbital nodes ── */
.nav-node {
  position: absolute;
  --radius-orbit: 220px;
  transform:
    rotate(calc(var(--i) * 60deg)) translateX(var(--radius-orbit)) rotate(calc(var(--i) * -60deg));
  pointer-events: all;

  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--node-bg);
  border: 1.5px solid var(--node-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;

  opacity: 0;
  scale: 0.5;
}

.nav-node.revealed {
  opacity: 1;
  scale: 1;
}

.nav-node:hover,
.nav-node.active {
  background: rgba(0, 229, 255, 0.12);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--node-glow), inset 0 0 20px rgba(0, 229, 255, 0.06);
  z-index: 6;
}

.nav-node.active {
  transform:
    rotate(calc(var(--i) * 60deg)) translateX(var(--radius-orbit)) rotate(calc(var(--i) * -60deg)) scale(1.12);
}

/* When nav is shifted, make the active node even bigger */
.nav-shifted .nav-node.active {
  transform:
    rotate(calc(var(--i) * 60deg)) translateX(var(--radius-orbit)) rotate(calc(var(--i) * -60deg)) scale(1.35);
  box-shadow: 0 0 32px var(--accent), inset 0 0 24px rgba(0, 229, 255, 0.1);
  border-color: var(--accent);
}

/* Dim non-active nodes when shifted */
.nav-shifted .nav-node:not(.active) {
  opacity: 0.35;
  filter: brightness(0.6);
}

.node-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.node-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  transition: transform 0.2s, filter 0.2s;
}

.nav-node:hover .node-icon,
.nav-node.active .node-icon {
  transform: scale(1.15);
  filter: drop-shadow(0 0 5px var(--accent));
}

.node-label {
  font-family: var(--font-hud);
  font-size: 0.52rem;
  color: var(--text-dim);
  letter-spacing: 0.14em;
}

.nav-node:hover .node-label,
.nav-node.active .node-label {
  color: var(--accent);
}

.node-dot {
  position: absolute;
  bottom: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.2s, box-shadow 0.2s;
}

.nav-node.active .node-dot {
  opacity: 1;
  box-shadow: 0 0 8px var(--primary);
}

/* Mobile: vertical node list */
@media (max-width: 768px) {
  .nav-node {
    --radius-orbit: 170px;
    width: 65px;
    height: 65px;
  }

  .node-label {
    font-size: 0.42rem;
  }

  #nav-center {
    transform: scale(0.85);
  }
}

@media (max-width: 500px) {
  .nav-node {
    --radius-orbit: 145px;
    width: 58px;
    height: 58px;
  }
}

/* ════════════════════  CONTENT PANEL  ════════════════════ */
#content-panel {
  position: fixed;
  right: 2vw;
  top: 52px;
  width: min(55vw, 820px);
  height: calc(100vh - 92px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-top: 2px solid var(--primary);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  pointer-events: all;

  opacity: 0;
  transform: translateX(30px);
  visibility: hidden;
  transition: opacity 0.38s ease, transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.38s;
}

#content-panel.open {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
}

/* Panel Header */
#panel-header {
  flex-shrink: 0;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.panel-section-tag {
  font-family: var(--font-hud);
  font-size: 0.7rem;
  color: var(--tag-color);
  text-shadow: 0 0 10px var(--tag-color);
}

.panel-title {
  font-family: var(--font-hud);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.16em;
  flex: 1;
}

.panel-scan-bar {
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: panelScan 3s ease-in-out infinite;
}

@keyframes panelScan {
  from {
    left: -50%;
  }

  to {
    left: 120%;
  }
}

#panel-close {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: color 0.2s, border-color 0.2s;
  pointer-events: all;
}

#panel-close:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* Panel Body */
#panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

#panel-body::-webkit-scrollbar {
  width: 4px;
}

#panel-body::-webkit-scrollbar-track {
  background: transparent;
}

#panel-body::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 2px;
}

/* ════════════════════  PANEL CONTENT STYLES  ════════════════════ */

/* ── Generic ── */
.hud-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--primary);
  letter-spacing: 0.18em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--panel-border), transparent);
}

.hud-card {
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--primary);
  background: rgba(255, 255, 255, 0.02);
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hud-card:hover {
  border-left-color: var(--accent);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.08);
}

.data-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 5px;
}

.data-key {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.data-val {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  text-align: right;
}

.data-val.accent {
  color: var(--accent);
}

.data-val.gold {
  color: var(--secondary);
}

/* ── Profile Section ── */
.profile-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  overflow: hidden;
  box-shadow: 0 0 16px var(--primary);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.profile-info .name {
  font-family: var(--font-hud);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.08em;
}

.profile-info .role {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--primary);
  letter-spacing: 0.12em;
  margin-top: 4px;
}

.profile-info .bio {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 8px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: all 0.2s;
  text-decoration: none;
  cursor: pointer;
}

.contact-link:hover {
  border-color: var(--panel-border);
  color: var(--accent);
  background: rgba(0, 229, 255, 0.04);
}

.contact-link .cl-icon {
  color: var(--primary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.contact-link .cl-icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.contact-link .cl-copy {
  margin-left: auto;
  font-size: 0.55rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.contact-link:hover .cl-copy {
  opacity: 0.6;
}

.btn-resume {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 20px;
  font-family: var(--font-hud);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--bg);
  background: var(--primary);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-resume:hover {
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
}

/* ── Skills Section ── */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* skill-category: layout handled by children */
.skill-category {
  display: block;
}

.skill-cat-title {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--secondary);
  letter-spacing: 0.18em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-cat-title::before {
  content: '▹';
  color: var(--primary);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 5px 12px;
  border: 1px solid var(--node-border);
  border-radius: var(--radius);
  color: var(--text-dim);
  background: rgba(0, 229, 255, 0.04);
  transition: all 0.2s;
  opacity: 0;
  transform: translateY(6px);
}

.skill-tag.revealed {
  opacity: 1;
  transform: translateY(0);
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 229, 255, 0.1);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

/* JARVIS: hexagonal tags */
body.jarvis .skill-tag {
  clip-path: polygon(8px 0%, calc(100% - 8px) 0%, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0% 50%);
  border: none;
  padding: 5px 16px;
  background: rgba(204, 0, 0, 0.08);
  color: var(--text-dim);
  outline: 1px solid rgba(0, 229, 255, 0.2);
}

body.jarvis .skill-tag:hover {
  background: rgba(0, 229, 255, 0.12);
  outline-color: var(--accent);
  color: var(--accent);
}

/* ── Experience/Timeline Section ── */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--timeline-col), transparent);
  opacity: 0.4;
}

.timeline-entry {
  position: relative;
  margin-bottom: 14px;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.timeline-entry.revealed {
  opacity: 1;
  transform: translateX(0);
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.te-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3px;
  gap: 8px;
}

.te-role {
  font-family: var(--font-hud);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 0.06em;
}

.te-date {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--secondary);
  white-space: nowrap;
}

.te-company {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--primary);
  margin-bottom: 6px;
}

.te-bullets {
  list-style: none;
}

.te-bullets li {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.55;
  padding: 2px 0 2px 12px;
  position: relative;
}

.te-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.55rem;
  top: 4px;
}

/* ── Projects ── */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-card {
  border: 1px solid var(--panel-border);
  border-left: 4px solid var(--primary);
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  transition: transform 0.18s, box-shadow 0.18s, border-left-color 0.18s;
  cursor: default;
}

.project-card:hover {
  transform: translateX(4px);
  box-shadow: -4px 0 20px rgba(0, 229, 255, 0.12);
  border-left-color: var(--accent);
}

.project-name {
  font-family: var(--font-hud);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.project-award {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--secondary);
  margin-bottom: 6px;
}

.project-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 10px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  padding: 2px 8px;
  border-radius: 2px;
  background: rgba(0, 229, 255, 0.07);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.project-links {
  display: flex;
  gap: 10px;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--panel-border);
  padding: 3px 10px;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.project-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.project-link-disabled {
  opacity: 0.30;
  cursor: not-allowed;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

/* ── Leadership ── */
.leadership-card {
  display: block;
  /* inherits hud-card styles */
}

/* ── Glitch on hover ── */
.project-card:hover .project-name {
  animation: glitch 0.3s steps(2) 1;
}

@keyframes glitch {
  0% {
    text-shadow: none;
    transform: translateX(0);
  }

  25% {
    text-shadow: -2px 0 var(--primary);
    transform: translateX(1px);
  }

  50% {
    text-shadow: 2px 0 var(--accent);
    transform: translateX(-1px);
  }

  75% {
    text-shadow: -1px 0 var(--secondary);
    transform: translateX(0);
  }

  100% {
    text-shadow: none;
    transform: translateX(0);
  }
}

/* ── Stagger reveal utility ── */
.stagger-item {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.stagger-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════  MOBILE RESPONSIVE  ════════════════════ */

/* ── Large tablet: hide ai-version to save space ── */
@media (max-width: 900px) {
  .ai-version {
    display: none;
  }
}

/* ── Tablet / mobile ── */
@media (max-width: 768px) {

  /* Topbar / bottombar padding */
  #hud-topbar {
    padding: 0 50px;
  }

  #hud-bottombar {
    padding: 0 50px;
  }

  /* Nav: don't shift off-screen when panel opens; just dim it */
  #radial-nav.nav-shifted {
    transform: scale(0.55);
    opacity: 0.18;
    pointer-events: none;
  }

  /* Content panel: full-width, exact height */
  #content-panel {
    right: 0;
    left: 0;
    width: 100%;
    top: 42px;
    height: calc(100vh - 84px);
    /* 42px topbar + 38px bottombar + 4px gap */
    border-left: none;
    border-right: none;
  }

  /* Panel body: tighter padding */
  #panel-body {
    padding: 14px;
  }
}

/* ── Small mobile ── */
@media (max-width: 600px) {

  /* Topbar: minimal padding */
  #hud-topbar {
    padding: 0 28px;
  }

  #hud-bottombar {
    padding: 0 28px;
  }

  /* Hide side strips to reclaim edge space */
  .hud-strip {
    display: none;
  }

  /* Boot logo: reduce padding */
  .boot-logo {
    padding: 16px 18px;
  }
}

/* ── Very narrow: keep topbar on one line ── */
@media (max-width: 480px) {

  /* Hide the date — keep just the time */
  #hud-date {
    display: none;
  }

  /* Hide the sep between clock and date */
  .topbar-center .sep {
    display: none;
  }

  /* Shrink topbar font slightly */
  .topbar-center {
    font-size: 0.68rem;
  }

  /* Compress status label */
  #status-label {
    display: none;
  }
}

/* ════════════════════  ANIMATIONS  ════════════════════ */
.reveal-in {
  animation: revealIn 0.4s ease forwards;
}

@keyframes revealIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  #hud-frame::before {
    display: none;
  }
}