/* ═══════════════════════════════════════════════════════════════════
   MX2K — INTERACTIVE ORBIT SYSTEM  v1.0
   Styles for the hero logo orbit nodes, SVG ring, tooltips,
   gestural feedback, and all responsive/touch tiers.
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   HERO LOGO WRAP — larger to accommodate orbit
───────────────────────────────────────────────────────────────── */
.hero-logo-wrap {
  position: relative !important;
  width: clamp(300px, 50vw, 420px);
  height: clamp(300px, 50vw, 420px);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* Override old margin-bottom/inline styles */
  margin-bottom: 24px !important;
}

/* ─────────────────────────────────────────────────────────────────
   SVG ORBIT RING
───────────────────────────────────────────────────────────────── */
.orbit-svg-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

/* Dashed track ring */
.orbit-ring-track {
  fill: none;
  stroke: rgba(0, 212, 255, 0.18);
  stroke-width: 1px;
  stroke-dasharray: 6 4;
  filter: drop-shadow(0 0 3px rgba(0, 212, 255, 0.3));
}

/* Animated signal pulse — a short bright arc travelling around */
.orbit-ring-pulse {
  fill: none;
  stroke: url(#orbitGradient);
  stroke-width: 2.5px;
  stroke-dasharray: 40 939; /* short arc, rest invisible */
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.9))
          drop-shadow(0 0 12px rgba(0, 119, 255, 0.5));
  transform-origin: 200px 200px;
}

/* SVG connector lines from centre to each node */
.orbit-connector {
  stroke: rgba(0, 212, 255, 0.25);
  stroke-width: 0.8px;
  stroke-dasharray: 3 3;
  opacity: 0.2;
  transition: opacity 0.5s;
}

/* ─────────────────────────────────────────────────────────────────
   LOGO GLOW SHELL — the central glowing logo container
───────────────────────────────────────────────────────────────── */
.logo-glow-shell {
  position: relative;
  z-index: 4;
  width: clamp(90px, 15vw, 180px);
  height: clamp(90px, 15vw, 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.23,1,0.32,1);
  will-change: transform;
  flex-shrink: 0;
}

.logo-glow-shell:hover {
  transform: scale(1.06);
}

/* Inner glowing ring around logo */
.logo-inner-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.35);
  box-shadow:
    0 0 16px rgba(0, 212, 255, 0.3),
    inset 0 0 16px rgba(0, 212, 255, 0.08);
  animation: inner-ring-pulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes inner-ring-pulse {
  0%, 100% {
    border-color: rgba(0, 212, 255, 0.35);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.3), inset 0 0 16px rgba(0, 212, 255, 0.08);
  }
  50% {
    border-color: rgba(0, 212, 255, 0.7);
    box-shadow: 0 0 32px rgba(0, 212, 255, 0.6), inset 0 0 24px rgba(0, 212, 255, 0.15),
                0 0 60px rgba(0, 119, 255, 0.3);
  }
}

/* Core pulse radiate effect */
.logo-core-pulse {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 70%);
  animation: core-radiate 3s ease-in-out infinite;
}

@keyframes core-radiate {
  0%, 100% { transform: scale(1);   opacity: 0.5; }
  50%       { transform: scale(1.3); opacity: 1; }
}

/* Logo burst on tap/click */
.logo-glow-shell.logo-burst .logo-inner-ring {
  animation: logo-burst-flash 0.7s ease-out forwards;
}

@keyframes logo-burst-flash {
  0%   { box-shadow: 0 0 0 0 rgba(0,212,255,0.9), 0 0 80px rgba(0,212,255,0.6); border-color: rgba(0,212,255,1); }
  30%  { box-shadow: 0 0 0 30px rgba(0,212,255,0), 0 0 100px rgba(0,212,255,0.8); }
  100% { box-shadow: 0 0 16px rgba(0,212,255,0.3); border-color: rgba(0,212,255,0.35); }
}

/* ─────────────────────────────────────────────────────────────────
   ORBIT NODES CONTAINER
───────────────────────────────────────────────────────────────── */
.orbit-nodes-container {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none; /* clicks pass through to nodes themselves */
}

/* ─────────────────────────────────────────────────────────────────
   INDIVIDUAL ORBIT NODE — the hovering box
───────────────────────────────────────────────────────────────── */
.orbit-node {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: all;

  /* Box styling */
  width: 44px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 13, 26, 0.82);
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  z-index: 6;
  outline: none;
  transition:
    background 0.25s,
    border-color 0.25s,
    box-shadow 0.25s,
    transform 0.3s cubic-bezier(0.23,1,0.32,1);

  /* Ensure boxes stay sharp over SVG */
  will-change: transform, left, top;

  /* Tap highlight off */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Glow ring inside each box (decorative) */
.on-glow-ring {
  position: absolute;
  inset: -3px;
  border-radius: 7px;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

/* Tiny pulsing dot on each node */
.on-dot {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--node-color, #00d4ff);
  box-shadow: 0 0 4px var(--node-color, #00d4ff);
  animation: dot-pulse 2.5s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.4); }
}

/* Label text */
.on-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--node-color, #00d4ff);
  text-transform: uppercase;
  line-height: 1;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 6px var(--node-color, rgba(0,212,255,0.6));
}

/* ── Hover / Active states ── */
.orbit-node:hover,
.orbit-node:focus-visible {
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.7);
  box-shadow:
    0 0 12px rgba(0, 212, 255, 0.4),
    0 0 24px rgba(0, 119, 255, 0.2),
    inset 0 0 8px rgba(0, 212, 255, 0.08);
  transform: translate(-50%, -50%) scale(1.18);
}

.orbit-node:hover .on-glow-ring,
.orbit-node:focus-visible .on-glow-ring {
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.orbit-node.active {
  background: rgba(0, 212, 255, 0.18);
  border-color: var(--node-color, #00d4ff);
  box-shadow:
    0 0 20px rgba(0, 212, 255, 0.6),
    0 0 40px rgba(0, 119, 255, 0.3),
    inset 0 0 12px rgba(0, 212, 255, 0.12);
  transform: translate(-50%, -50%) scale(1.22);
  z-index: 20;
}

.orbit-node.active .on-label {
  text-shadow: 0 0 12px var(--node-color, rgba(0,212,255,0.9));
}

/* Touch active state */
@media (hover: none) {
  .orbit-node:active {
    background: rgba(0, 212, 255, 0.16);
    border-color: rgba(0, 212, 255, 0.7);
    transform: translate(-50%, -50%) scale(1.15);
    transition: transform 0.1s, background 0.1s;
  }
}

/* ─────────────────────────────────────────────────────────────────
   TOOLTIP — expands from node on click/tap
───────────────────────────────────────────────────────────────── */
.orbit-tooltip {
  position: absolute;
  z-index: 30;
  pointer-events: all;

  background: rgba(5, 13, 26, 0.92);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 10px;
  padding: 12px 14px 12px 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(0, 212, 255, 0.1),
    inset 0 1px 0 rgba(0, 212, 255, 0.15);

  /* Hidden by default */
  opacity: 0;
  transform: scale(0.88) translateY(6px);
  pointer-events: none;
  transition:
    opacity 0.3s cubic-bezier(0.23,1,0.32,1),
    transform 0.3s cubic-bezier(0.23,1,0.32,1);
}

.orbit-tooltip.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

/* Tooltip label (the initialism) */
.ot-label {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--cyan, #00d4ff);
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0,212,255,0.5);
  margin-bottom: 6px;
}

/* Divider line */
.ot-divider {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, rgba(0,212,255,0.5), transparent);
  margin-bottom: 8px;
}

/* Description phrase */
.ot-desc {
  display: block;
  font-size: 0.72rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.8);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

/* Close button */
.ot-close {
  position: absolute;
  top: 7px;
  right: 10px;
  font-size: 1rem;
  color: rgba(0, 212, 255, 0.5);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
  padding: 4px; /* larger touch target */
}

.ot-close:hover,
.ot-close:active {
  color: rgba(0, 212, 255, 1);
  transform: scale(1.2);
}

/* ─────────────────────────────────────────────────────────────────
   GESTURE CANVAS — particle / ripple overlay
───────────────────────────────────────────────────────────────── */
.orbit-gesture-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  border-radius: 50%;
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE — MOBILE (< 768px)
───────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .hero-logo-wrap {
    width:  clamp(260px, 85vw, 320px);
    height: clamp(260px, 85vw, 320px);
  }

  .orbit-node {
    width: 36px;
    height: 24px;
  }

  .on-label {
    font-size: 0.56rem;
    letter-spacing: 0.08em;
  }

  .orbit-tooltip {
    width: 200px !important;
  }

  .ot-desc { font-size: 0.68rem; }

  .logo-glow-shell {
    width: clamp(70px, 20vw, 110px);
    height: clamp(70px, 20vw, 110px);
  }
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE — TABLET (768px – 1199px)
───────────────────────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1199px) {
  .hero-logo-wrap {
    width:  clamp(300px, 45vw, 380px);
    height: clamp(300px, 45vw, 380px);
  }

  .orbit-node {
    width: 42px;
    height: 26px;
  }
}

/* ─────────────────────────────────────────────────────────────────
   LARGE TOUCH (≥ 1200px touch screens)
───────────────────────────────────────────────────────────────── */
@media (min-width: 1200px) and (pointer: coarse) {
  .orbit-node {
    width: 52px;
    height: 32px;
    border-radius: 8px;
  }
  .on-label {
    font-size: 0.68rem;
  }
  .ot-close { padding: 8px; }
}

/* ─────────────────────────────────────────────────────────────────
   REDUCED MOTION
───────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .orbit-ring-pulse   { animation: none !important; }
  .logo-inner-ring    { animation: none !important; }
  .logo-core-pulse    { animation: none !important; }
  .on-dot             { animation: none !important; }
  .orbit-tooltip      { transition: opacity 0.15s; transform: none; }
}

/* ─────────────────────────────────────────────────────────────────
   HOVER: NONE — larger tap targets for touch
───────────────────────────────────────────────────────────────── */
@media (hover: none) {
  .orbit-node {
    /* Larger invisible tap area via pseudo-element */
    position: absolute;
  }
  .orbit-node::before {
    content: '';
    position: absolute;
    inset: -10px;
  }

  /* Remove hover stuck state */
  .orbit-node:hover {
    background: rgba(5, 13, 26, 0.82);
    border-color: rgba(0, 212, 255, 0.35);
    box-shadow: none;
    transform: translate(-50%, -50%) scale(1);
  }

  /* Show tooltip close button more prominently on touch */
  .ot-close {
    font-size: 1.2rem;
    color: rgba(0, 212, 255, 0.7);
    padding: 8px;
  }
}
