/* ============================================================
   Components — navbar, buttons, feature list, mascot, city,
   category badges, loading overlay.
   ============================================================ */

/* ---------- Primary button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1.08rem;
  padding: 0.95rem 2.2rem;
  border-radius: var(--radius-pill);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}

.btn--primary {
  color: var(--tw-white);
  background: linear-gradient(135deg, var(--tw-electric) 0%, var(--tw-electric-deep) 100%);
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.35), 0 0 24px rgba(41, 151, 255, 0.4), 0 10px 28px rgba(0, 0, 0, 0.4);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--tw-electric-bright) 0%, var(--tw-electric) 100%);
  opacity: 0;
  z-index: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}

/* Premium "LED bead" sweeping the button perimeter */
.btn--primary::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 255, 255, 0.95) 6deg,
    rgba(125, 211, 252, 0.7) 16deg,
    transparent 32deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: btn-sweep 3s linear infinite;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
}

/* Diagonal shine band that sweeps across the button surface */
.btn__shine {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.btn__shine::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -30%;
  width: 30%;
  height: 220%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.02) 35%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.02) 65%,
    transparent 100%
  );
  transform: rotate(8deg);
  animation: btn-shine-sweep 4.5s ease-in-out infinite;
  animation-delay: 1.2s;
}

.btn__label,
.btn__arrow {
  position: relative;
  z-index: 2;
}

.btn--primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4), 0 0 24px rgba(255, 255, 255, 0.2), 0 0 46px rgba(125, 211, 252, 0.7), 0 16px 40px rgba(0, 0, 0, 0.45);
}

.btn--primary:hover .btn__shine::before {
  animation-duration: 1.1s;
}

.btn--primary:hover::before {
  opacity: 1;
}

.btn__arrow {
  transition: transform var(--dur-fast) var(--ease-out);
}

.btn--primary:hover .btn__arrow {
  transform: translateX(4px);
}

.btn--clicked {
  transform: scale(0.96);
}

/* ---------- Feature list (3 quick facts) ---------- */
.feature-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--tw-ink);
  padding: 0.4rem 0.7rem;
  margin-inline: -0.7rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), background 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.feature-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(226, 240, 255, 0.38) 48%, rgba(255, 255, 255, 0.08) 60%, transparent 78%);
  transform: translateX(-130%);
  transition: transform 0.75s ease;
  pointer-events: none;
}

.feature-item:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(41, 151, 255, 0.07);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(41, 151, 255, 0.22);
}

.feature-item:hover::after {
  transform: translateX(130%);
}

.feature-item__icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--tw-electric-bright);
  background: rgba(41, 151, 255, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.3);
  transition: border-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.feature-item:hover .feature-item__icon {
  border-color: rgba(125, 211, 252, 0.65);
  box-shadow: 0 0 12px rgba(41, 151, 255, 0.45);
}

.feature-item__icon svg {
  width: 14px;
  height: 14px;
}

/* ---------- Mascot — Tru-We, the AI guide ---------- */
.mascot {
  position: relative;
  width: 145px;
  height: 145px;
  flex-shrink: 0;
  animation: mascot-settle-in 0.8s var(--ease-out) both, float 7s ease-in-out 0.8s infinite;
}

.mascot img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 22px rgba(41, 151, 255, 0.45));
}

.mascot::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10%;
  width: 70%;
  aspect-ratio: 3 / 1;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(41, 151, 255, 0.4), transparent 70%);
  filter: blur(5px);
  z-index: -1;
  animation: glow-pulse 6s ease-in-out 0.8s infinite;
  opacity: 0;
  pointer-events: none;
}

.mascot-bubble {
  position: relative;
  padding: 0.7rem 1rem;
  max-width: 240px;
  background: rgba(20, 20, 23, 0.85);
  border: 1px solid var(--tw-line);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--tw-ink-2);
  opacity: 0;
  pointer-events: none;
  animation: bubble-lifecycle 5.2s var(--ease-out) 0.9s 1 forwards;
}

.mascot-bubble strong {
  color: var(--tw-white);
}

/* ---------- Digital globe (index.html hero) — WebGL canvas + CSS-layered glow ---------- */
.city-stage__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.55));
}

/* Soft ambient atmosphere ring, breathing gently behind the sphere */
.globe-halo {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(41, 151, 255, 0.42) 0%, rgba(41, 151, 255, 0.14) 55%, transparent 78%);
  filter: blur(6px);
  pointer-events: none;
  animation: globe-halo-breathe 8s ease-in-out infinite;
}

/* Category-synced glow bump — brightens once per active category, five times per cycle */
.globe-active-glow {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(41, 151, 255, 0.34) 45%, transparent 74%);
  opacity: 0;
  pointer-events: none;
  animation: globe-active-glow-sequence 10s ease-in-out infinite;
}

.city__data-particle {
  fill: var(--tw-electric-bright);
  opacity: 0;
  filter: drop-shadow(0 0 4px var(--tw-electric-bright)) drop-shadow(0 0 8px rgba(41, 151, 255, 0.9));
}

.city-stage__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.city-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--tw-electric-bright);
  box-shadow: 0 0 6px 1px var(--tw-electric-glow);
  opacity: 0;
  animation: particle-rise 7s ease-in infinite;
  animation-delay: var(--pdelay, 0s);
  left: var(--px, 50%);
}

/* ---------- Badge connector lines ---------- */
.badge-link {
  stroke: var(--tw-electric-bright);
  stroke-width: 0.35;
  stroke-linecap: round;
  stroke-dasharray: 1.4 3.2;
  opacity: 0.4;
  animation: badge-link-pulse 4s ease-in-out infinite, link-sequence-pulse 10s ease-in-out infinite;
  animation-delay: var(--ld, 0s), var(--seq, 0s);
  animation-fill-mode: backwards;
  transition: stroke-width var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out),
    filter var(--dur-fast) var(--ease-out);
}

/* Small glowing node marking where each connector meets the globe */
.badge-link-node {
  fill: var(--tw-white);
  opacity: 0.45;
  filter: drop-shadow(0 0 2px rgba(125, 211, 252, 0.6));
  transform-box: fill-box;
  transform-origin: center;
  animation: node-sequence-pulse 10s ease-in-out infinite;
  animation-delay: var(--seq, 0s);
  animation-fill-mode: backwards;
}

/* Traveling energy pulse — hidden until the matching node is hovered/focused */
.badge-link-energy {
  fill: none;
  stroke: var(--tw-white);
  stroke-width: 0.55;
  stroke-linecap: round;
  stroke-dasharray: 2.6 9;
  opacity: 0;
  filter: drop-shadow(0 0 2px rgba(125, 211, 252, 0.9));
  animation: badge-energy-flow 1.1s linear infinite;
  animation-play-state: paused;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.city-stage:has(.category-badge--infrastructure:hover) .badge-link--infrastructure,
.city-stage:has(.category-badge--infrastructure:focus-visible) .badge-link--infrastructure {
  opacity: 0.95;
  stroke-width: 0.6;
  filter: drop-shadow(0 0 3px rgba(125, 211, 252, 0.85));
}
.city-stage:has(.category-badge--infrastructure:hover) .badge-link-energy--infrastructure,
.city-stage:has(.category-badge--infrastructure:focus-visible) .badge-link-energy--infrastructure {
  opacity: 0.9;
  animation-play-state: running;
}

.city-stage:has(.category-badge--cybersecurity:hover) .badge-link--cybersecurity,
.city-stage:has(.category-badge--cybersecurity:focus-visible) .badge-link--cybersecurity {
  opacity: 0.95;
  stroke-width: 0.6;
  filter: drop-shadow(0 0 3px rgba(125, 211, 252, 0.85));
}
.city-stage:has(.category-badge--cybersecurity:hover) .badge-link-energy--cybersecurity,
.city-stage:has(.category-badge--cybersecurity:focus-visible) .badge-link-energy--cybersecurity {
  opacity: 0.9;
  animation-play-state: running;
}

.city-stage:has(.category-badge--operations:hover) .badge-link--operations,
.city-stage:has(.category-badge--operations:focus-visible) .badge-link--operations {
  opacity: 0.95;
  stroke-width: 0.6;
  filter: drop-shadow(0 0 3px rgba(125, 211, 252, 0.85));
}
.city-stage:has(.category-badge--operations:hover) .badge-link-energy--operations,
.city-stage:has(.category-badge--operations:focus-visible) .badge-link-energy--operations {
  opacity: 0.9;
  animation-play-state: running;
}

.city-stage:has(.category-badge--licensing:hover) .badge-link--licensing,
.city-stage:has(.category-badge--licensing:focus-visible) .badge-link--licensing {
  opacity: 0.95;
  stroke-width: 0.6;
  filter: drop-shadow(0 0 3px rgba(125, 211, 252, 0.85));
}
.city-stage:has(.category-badge--licensing:hover) .badge-link-energy--licensing,
.city-stage:has(.category-badge--licensing:focus-visible) .badge-link-energy--licensing {
  opacity: 0.9;
  animation-play-state: running;
}

.city-stage:has(.category-badge--automation:hover) .badge-link--automation,
.city-stage:has(.category-badge--automation:focus-visible) .badge-link--automation {
  opacity: 0.95;
  stroke-width: 0.6;
  filter: drop-shadow(0 0 3px rgba(125, 211, 252, 0.85));
}
.city-stage:has(.category-badge--automation:hover) .badge-link-energy--automation,
.city-stage:has(.category-badge--automation:focus-visible) .badge-link-energy--automation {
  opacity: 0.9;
  animation-play-state: running;
}

/* ---------- Category badges ---------- */
.category-badge__icon {
  position: relative;
  width: 63px;
  height: 63px;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
  background: linear-gradient(160deg, rgba(56, 170, 255, 0.26) 0%, rgba(14, 22, 32, 0.92) 55%, rgba(6, 9, 13, 0.95) 100%);
  border: 1px solid rgba(125, 211, 252, 0.42);
  color: var(--tw-electric-bright);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 3px 8px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(125, 211, 252, 0.1),
    0 0 22px rgba(41, 151, 255, 0.25);
  animation: icon-sequence-pulse 10s ease-in-out infinite;
  animation-delay: var(--seq, 0s);
  animation-fill-mode: backwards;
  transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.category-badge__icon::before {
  content: "";
  position: absolute;
  inset: -15%;
  background: linear-gradient(115deg, transparent 32%, rgba(230, 242, 255, 0.7) 48%, rgba(255, 255, 255, 0.15) 58%, transparent 74%);
  transform: translateX(-140%);
  transition: transform 0.8s ease;
  pointer-events: none;
}

/* Faint accent glow behind the icon while its sequential turn is active —
   secondary to the icon/label's own lift-and-brighten, timed with --seq */
.category-badge::after {
  content: "";
  position: absolute;
  top: -4%;
  left: 50%;
  width: 70%;
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), rgba(41, 151, 255, 0.2) 45%, transparent 72%);
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  z-index: -1;
  animation: badge-halo-sequence-pulse 10s ease-in-out infinite;
  animation-delay: var(--seq, 0s);
  animation-fill-mode: backwards;
}

.category-badge__icon svg {
  width: 27px;
  height: 27px;
  position: relative;
}

.category-badge:hover .category-badge__icon,
.category-badge:focus-visible .category-badge__icon {
  animation-play-state: paused;
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--tw-electric-pale);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 16px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.4),
    0 0 44px rgba(41, 151, 255, 0.6);
  transform: translateY(-4px) scale(1.045);
}

.category-badge:hover .category-badge__icon::before,
.category-badge:focus-visible .category-badge__icon::before {
  transform: translateX(140%);
}

.category-badge:hover .category-badge__label,
.category-badge:focus-visible .category-badge__label {
  color: var(--tw-white);
}

.category-badge:hover .category-badge__desc,
.category-badge:focus-visible .category-badge__desc {
  max-height: 2.6rem;
  margin-top: 0.3rem;
  opacity: 1;
}

/* ---------- Loading overlay ---------- */
.loader-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(125, 211, 252, 0.2);
  border-top-color: var(--tw-electric-bright);
  animation: loader-spin 0.9s linear infinite;
}
