/* =======================================================
   CIVICSPIN GLOBAL STYLES — CLEAN VERSION
   Theme: Dark Civic Futurism
   ======================================================= */

/* ---------- Root Theme Vars ---------- */
:root {
  --bg-0: #0a0c10;
  --bg-1: #0f131a;
  --ink: #e8f5ff;
  --muted: #9fb2c6;
  --accent: #a3ff00;
  --accent-2: #25d0ff;
  --card: #121821;
  --card-2: #0f161e;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --radius: 22px;
}

/* ---------- Base Reset ---------- */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(1200px 800px at 20% 0%, #0d131a 0%, var(--bg-0) 45%),
    radial-gradient(600px 600px at 120% 20%, rgba(37, 208, 255, .15) 0%, transparent 60%),
    radial-gradient(800px 800px at -10% 90%, rgba(163, 255, 0, .08) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
}

h1,
h2,
h3,
.brand b {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Overlay + Scanline ---------- */
.grid-overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.scanline::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  height: 1px;
  top: -2%;
  opacity: .25;
  background: linear-gradient(90deg, transparent, rgba(163, 255, 0, .25), transparent);
  animation: sweep 6s linear infinite;
  pointer-events: none;
}

@keyframes sweep {
  0% {
    top: -2%;
  }

  100% {
    top: 102%;
  }
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
  background: linear-gradient(rgba(10, 12, 16, .75), rgba(10, 12, 16, .35));
  border-bottom: 1px solid rgba(163, 255, 0, .15);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.logo {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: conic-gradient(from 200deg, var(--accent), var(--accent-2));
  box-shadow:
    0 0 24px rgba(163, 255, 0, .45) inset,
    0 0 30px rgba(163, 255, 0, .15);
}

.nav a.link {
  color: var(--muted);
  font-weight: 600;
  opacity: .9;
  transition: color .2s ease-in-out;
}

.nav a.link:hover {
  color: var(--ink);
}

.cta {
  margin-left: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(163, 255, 0, .35);
  font-weight: 800;
  color: #0c1610;
  background: linear-gradient(180deg, var(--accent), #7fe000);
  box-shadow: 0 8px 22px rgba(163, 255, 0, .22);
  transition: transform .2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-blue {
  background: linear-gradient(180deg, var(--accent-2), #0ea7da);
  color: #061017;
  border-color: rgba(37, 208, 255, .45);
}

/* ---------- Hero Section ---------- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 20px 48px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 28px;
}

@media(max-width:980px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
}

h1 {
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.05;
  margin: 10px 0 12px;
}

.lead {
  font-size: clamp(16px, 2.1vw, 20px);
  color: var(--muted);
  max-width: 68ch;
}

.hero-panel {
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid rgba(163, 255, 0, .18);
  box-shadow: var(--shadow);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* ---------- Metrics ---------- */
.hero-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(163, 255, 0, .15);
  padding: 12px 14px;
  border-radius: 14px;
  margin-top: 12px;
  background: rgba(5, 10, 10, .45);
}

.hero-metric small {
  color: var(--muted);
}

.metric-value {
  font-weight: 800;
}

/* ---------- Orbit Nodes ---------- */
.orbit {
  position: relative;
  height: 520px;
}

.orbit .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(163, 255, 0, .17);
}

.orbit .ring.r2 {
  inset: 40px;
}

.orbit .ring.r3 {
  inset: 90px;
}

.node {
  position: absolute;
  width: 260px;
  max-width: 38vw;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #121922, #0f151c);
  border: 1px solid rgba(163, 255, 0, .2);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.node:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(163, 255, 0, .38);
  box-shadow: 0 14px 40px rgba(163, 255, 0, .12);
}

.node .tag {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.node h3 {
  margin: 8px 0 6px;
  font-size: 20px;
}

.node p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Grid Cards ---------- */
.grid {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* =======================================================
   CITY BRAIN — ANIMATED NEURAL NETWORK EFFECTS
   ======================================================= */

/* Node base animation — gentle float + shimmer */
.node {
  position: absolute;
  width: 260px;
  max-width: 38vw;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #121922, #0f151c);
  border: 1px solid rgba(163, 255, 0, .2);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  animation: floatNode 12s ease-in-out infinite alternate;
}

/* Randomize floating motion across nodes */
.node:nth-child(3n) {
  animation-duration: 14s;
  animation-delay: 1.8s;
}

.node:nth-child(4n) {
  animation-duration: 16s;
  animation-delay: 3.2s;
}

.node:nth-child(5n) {
  animation-duration: 18s;
  animation-delay: 2.5s;
}

.node:nth-child(6n) {
  animation-duration: 20s;
  animation-delay: 4.2s;
}

/* Neon pulse inside each node */
.node::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(163, 255, 0, 0.05), transparent 70%);
  opacity: 0.6;
  mix-blend-mode: screen;
  animation: nodePulse 5s ease-in-out infinite;
  z-index: 0;
}

/* Subtle glow halo */
.node::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 1px solid rgba(163, 255, 0, 0.25);
  box-shadow: 0 0 20px rgba(163, 255, 0, 0.25);
  opacity: 0.4;
  animation: haloShift 10s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Animation definitions */
@keyframes floatNode {
  0% {
    transform: translate(0px, 0px) rotate(0deg);
  }

  25% {
    transform: translate(8px, -6px) rotate(0.5deg);
  }

  50% {
    transform: translate(-10px, 10px) rotate(-0.5deg);
  }

  75% {
    transform: translate(6px, 4px) rotate(0.3deg);
  }

  100% {
    transform: translate(-8px, -6px) rotate(-0.3deg);
  }
}

@keyframes nodePulse {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.05);
  }
}

@keyframes haloShift {
  0% {
    opacity: 0.3;
    box-shadow: 0 0 14px rgba(163, 255, 0, 0.2);
  }

  50% {
    opacity: 0.7;
    box-shadow: 0 0 28px rgba(37, 208, 255, 0.35);
  }

  100% {
    opacity: 0.4;
    box-shadow: 0 0 18px rgba(163, 255, 0, 0.3);
  }
}


@media(max-width:1100px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width:720px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: linear-gradient(180deg, #121922, #0e141a);
  border: 1px solid rgba(163, 255, 0, .15);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.card h3 {
  margin: 6px 0 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.card p {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.55;
  opacity: 0.95;
  max-width: 60ch;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  color: var(--accent);
}

/* Hover glow border */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 3px solid transparent;
  pointer-events: none;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.card:hover::after {
  border-color: var(--accent);
  box-shadow:
    0 0 12px rgba(163, 255, 0, 0.35),
    0 0 20px rgba(163, 255, 0, 0.15);
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid rgba(163, 255, 0, .15);
  margin-top: 48px;
  background: rgba(5, 8, 10, .6);
}

.foot-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 20px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.tag-pill {
  border: 1px solid rgba(163, 255, 0, .22);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

/* ---------- Glow Cursor ---------- */
.cursor {
  position: fixed;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(163, 255, 0, .12), rgba(37, 208, 255, .10), transparent 70%);
  filter: blur(16px);
  opacity: .8;
  transform: translate(-50%, -50%);
}

/* ---------- Back Button ---------- */
#backBtn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(168, 255, 42, 0.5);
  color: #a8ff2a;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 16px;
  cursor: pointer;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .25s ease;
  box-shadow: 0 0 12px rgba(168, 255, 42, 0.2);
  backdrop-filter: blur(4px);
}

#backBtn i {
  font-size: 1.4rem;
  color: #a8ff2a;
}

#backBtn:hover {
  background: rgba(168, 255, 42, 0.9);
  color: #000;
  border-color: #a8ff2a;
  box-shadow: 0 0 20px rgba(168, 255, 42, 0.6);
}

#backBtn:hover i {
  color: #000;
}

/* =======================================================
   CITY BRAIN NETWORK — 12 Randomized Nodes
   ======================================================= */
.brain-network {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  filter: drop-shadow(0 0 6px rgba(163, 255, 0, 0.25));
}

.brain-network svg {
  width: 100%;
  height: 100%;
}

.brain-node {
  fill: var(--accent);
  opacity: 0.28;
  animation: brainPulse 4.5s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(163, 255, 0, 0.4));
}

.brain-node:nth-child(3n) {
  animation-delay: 1.2s;
}

.brain-node:nth-child(4n) {
  animation-delay: 2.4s;
}

.brain-node:nth-child(5n) {
  animation-delay: 3.6s;
}

.brain-link {
  stroke: var(--accent-2);
  stroke-opacity: 0.18;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 5 12;
  animation: brainFlow 6s linear infinite;
  filter: drop-shadow(0 0 8px rgba(37, 208, 255, 0.25));
}

.brain-link:nth-child(4n) {
  animation-duration: 4.8s;
}

.brain-link:nth-child(5n) {
  animation-duration: 7.2s;
}

@keyframes brainPulse {

  0%,
  100% {
    r: 3;
    opacity: 0.25;
  }

  40% {
    r: 6;
    opacity: 0.9;
  }
}

@keyframes brainFlow {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -180;
  }
}

.n1 {
  top: 20px;
  left: 5%;
}

.n2 {
  top: 60px;
  right: 8%;
}

.n3 {
  top: 200px;
  left: -2%;
}

.n4 {
  top: 340px;
  left: 12%;
}

.n5 {
  bottom: 30px;
  right: 14%;
}

.n6 {
  top: 280px;
  right: 0;
}

.n7 {
  top: 150px;
  right: 20%;
}

.n8 {
  bottom: 90px;
  left: 6%;
}

.n9 {
  bottom: 20px;
  right: 4%;
}

.n10 {
  top: 400px;
  left: 45%;
}

.n11 {
  top: 50px;
  left: 40%;
}

.n12 {
  bottom: 80px;
  left: 25%;
}

/* =======================================================
   CITY BRAIN: ADVANCED NEURAL MOTION + DEPTH FIELDS
   ======================================================= */

.node {
  position: absolute;
  width: 260px;
  max-width: 38vw;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #121922, #0f151c);
  border: 1px solid rgba(163, 255, 0, .25);
  box-shadow: 0 0 24px rgba(163, 255, 0, .15);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  animation: nodeFloat 8s ease-in-out infinite alternate;
  transform-style: preserve-3d;
  perspective: 800px;
}

/* give each node its own rhythm */
.node:nth-child(2n) {
  animation: nodeFloat2 7s ease-in-out infinite alternate-reverse;
}

.node:nth-child(3n) {
  animation: nodeFloat3 9s ease-in-out infinite alternate;
}

.node:nth-child(4n) {
  animation: nodeFloat4 11s ease-in-out infinite alternate-reverse;
}

/* shimmering data layer */
.node::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 60% 40%, rgba(37, 208, 255, 0.12), transparent 70%);
  mix-blend-mode: screen;
  opacity: 0.8;
  animation: shimmer 4s ease-in-out infinite alternate;
  z-index: 0;
}

/* faint depth glow */
.node::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(163, 255, 0, 0.25);
  box-shadow: 0 0 25px rgba(163, 255, 0, 0.25);
  opacity: 0.4;
  animation: haloBreath 6s ease-in-out infinite alternate;
}

/* movement + depth illusion */
@keyframes nodeFloat {
  0% {
    transform: translate3d(-10px, -10px, -40px) rotateY(-2deg) rotateX(1deg) scale(0.96);
  }

  25% {
    transform: translate3d(20px, -15px, 20px) rotateY(1deg) rotateX(-1deg) scale(1.02);
  }

  50% {
    transform: translate3d(-30px, 20px, 60px) rotateY(-2deg) rotateX(2deg) scale(1.08);
  }

  75% {
    transform: translate3d(25px, 15px, -30px) rotateY(2deg) rotateX(-1deg) scale(0.95);
  }

  100% {
    transform: translate3d(-5px, -10px, 0px) rotateY(-1deg) rotateX(1deg) scale(1.03);
  }
}

@keyframes nodeFloat2 {
  0% {
    transform: translate3d(10px, -20px, 60px) rotateY(2deg) rotateX(-1deg) scale(1.05);
  }

  50% {
    transform: translate3d(-30px, 10px, -40px) rotateY(-2deg) rotateX(2deg) scale(0.94);
  }

  100% {
    transform: translate3d(25px, 15px, 30px) rotateY(1deg) rotateX(1deg) scale(1.02);
  }
}

@keyframes nodeFloat3 {
  0% {
    transform: translate3d(-15px, 10px, 20px) rotateY(-1deg) scale(0.97);
  }

  40% {
    transform: translate3d(35px, -25px, -60px) rotateY(2deg) rotateX(-1deg) scale(1.1);
  }

  80% {
    transform: translate3d(-25px, 20px, 50px) rotateY(-2deg) rotateX(2deg) scale(0.9);
  }

  100% {
    transform: translate3d(0, 0, 0) rotate(0);
  }
}

@keyframes nodeFloat4 {
  0% {
    transform: translate3d(0px, -10px, -50px) rotateY(-2deg) scale(1);
  }

  33% {
    transform: translate3d(15px, 20px, 70px) rotateY(2deg) scale(1.08);
  }

  66% {
    transform: translate3d(-20px, -15px, -30px) rotateY(-3deg) scale(0.94);
  }

  100% {
    transform: translate3d(10px, 5px, 10px) rotateY(1deg) scale(1.03);
  }
}

/* shimmer + glow */
@keyframes shimmer {
  0% {
    opacity: .4;
    transform: translate(0, 0);
  }

  50% {
    opacity: .9;
    transform: translate(-8px, 8px);
  }

  100% {
    opacity: .6;
    transform: translate(6px, -6px);
  }
}

@keyframes haloBreath {
  0% {
    opacity: 0.2;
    box-shadow: 0 0 16px rgba(163, 255, 0, 0.2);
  }

  50% {
    opacity: 0.8;
    box-shadow: 0 0 40px rgba(37, 208, 255, 0.4);
  }

  100% {
    opacity: 0.3;
    box-shadow: 0 0 24px rgba(163, 255, 0, 0.25);
  }
}

/* floating neural sparks between nodes */
.brain-link {
  stroke: var(--accent-2);
  stroke-opacity: 0.25;
  stroke-width: 1.6;
  stroke-dasharray: 3 8;
  animation: sparkFlow 2.5s linear infinite;
  filter: drop-shadow(0 0 6px rgba(37, 208, 255, 0.45));
}

@keyframes sparkFlow {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -60;
  }
}

/* occasional burst highlight — subtle electric spike */
.node:hover {
  border-color: rgba(163, 255, 0, 0.5);
  box-shadow: 0 0 40px rgba(163, 255, 0, 0.4), 0 0 80px rgba(37, 208, 255, 0.25);
  transform: scale(1.08) translateZ(30px);
  transition: transform .4s cubic-bezier(.17, .67, .83, .67);
}

/* =======================================================
   ADVANCED NEURAL LAYER SYSTEM
   Nodes drift through Z-depth, fade in/out, swap layers
   ======================================================= */

@keyframes neuralDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
    z-index: 10;
  }

  15% {
    transform: translate3d(-10px, 20px, -80px) scale(0.9);
    opacity: 0.6;
    z-index: 5;
  }

  35% {
    transform: translate3d(20px, -10px, 120px) scale(1.15);
    opacity: 1;
    z-index: 30;
  }

  55% {
    transform: translate3d(-25px, 10px, -60px) scale(0.8);
    opacity: 0.5;
    z-index: 3;
  }

  75% {
    transform: translate3d(15px, -15px, 100px) scale(1.2);
    opacity: 0.9;
    z-index: 25;
  }

  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
    z-index: 10;
  }
}

.node {
  position: absolute;
  width: 260px;
  max-width: 38vw;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #121922, #0f151c);
  border: 1px solid rgba(163, 255, 0, 0.25);
  box-shadow: 0 0 24px rgba(163, 255, 0, 0.15);
  transform-style: preserve-3d;
  animation: neuralDrift 12s ease-in-out infinite;
  backface-visibility: hidden;
  transition: opacity 1s ease, transform 0.6s ease;
}

/* randomize timing for each node so motion never repeats */
.node:nth-child(2n) {
  animation-duration: 10s;
  animation-delay: 1.5s;
}

.node:nth-child(3n) {
  animation-duration: 13s;
  animation-delay: 3s;
}

.node:nth-child(4n) {
  animation-duration: 15s;
  animation-delay: 2s;
}

.node:nth-child(5n) {
  animation-duration: 11s;
  animation-delay: 4s;
}

/* subtle light pulse through each card */
.node::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 60% 40%, rgba(37, 208, 255, 0.08), transparent 60%);
  mix-blend-mode: screen;
  animation: lightFlicker 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes lightFlicker {

  0%,
  100% {
    opacity: 0.2;
    transform: scale(1);
  }

  25% {
    opacity: 0.6;
    transform: scale(1.03);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.05);
  }

  75% {
    opacity: 0.4;
    transform: scale(0.98);
  }
}

/* when a node comes forward, give it glow priority */
.node[style*="z-index: 25"],
.node[style*="z-index: 30"] {
  box-shadow: 0 0 40px rgba(163, 255, 0, 0.4), 0 0 80px rgba(37, 208, 255, 0.25);
}

/* optional flickering neural sparks behind everything */
@keyframes neuralSpark {

  0%,
  100% {
    opacity: 0.1;
    transform: translateY(0) scale(1);
  }

  50% {
    opacity: 0.5;
    transform: translateY(-10px) scale(1.2);
  }
}

.brain-network::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(37, 208, 255, 0.1), transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(163, 255, 0, 0.08), transparent 60%);
  animation: neuralSpark 8s ease-in-out infinite alternate;
  filter: blur(80px);
  opacity: 0.4;
  z-index: 0;
}

/* =======================================================
   NEURAL TELEPORTATION FIELD
   Nodes vanish into the deep layer, reappear randomly
   ======================================================= */

.node {
  position: absolute;
  width: 260px;
  max-width: 38vw;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #121922, #0f151c);
  border: 1px solid rgba(163, 255, 0, 0.25);
  box-shadow: 0 0 24px rgba(163, 255, 0, 0.15);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: opacity 1s ease, transform 1.5s cubic-bezier(0.4, 0.0, 0.2, 1);
  animation: neuralTeleport 18s ease-in-out infinite;
  perspective: 1000px;
}

/* Randomize timing for each node so pattern is never the same */
.node:nth-child(2n) {
  animation-delay: 2s;
  animation-duration: 22s;
}

.node:nth-child(3n) {
  animation-delay: 4s;
  animation-duration: 25s;
}

.node:nth-child(4n) {
  animation-delay: 6s;
  animation-duration: 20s;
}

.node:nth-child(5n) {
  animation-delay: 8s;
  animation-duration: 24s;
}

/* The main animation — fading, moving, teleporting */
@keyframes neuralTeleport {
  0% {
    opacity: 1;
    transform: translate3d(0px, 0px, 0px) scale(1);
    z-index: 20;
  }

  25% {
    opacity: 0.7;
    transform: translate3d(30px, -20px, 80px) scale(1.1) rotateY(2deg);
  }

  45% {
    opacity: 0.4;
    transform: translate3d(-60px, 40px, -150px) scale(0.7) rotateY(-4deg);
    z-index: 2;
  }

  50% {
    opacity: 0;
    transform: translate3d(0, 0, -400px) scale(0.2);
    filter: blur(10px);
  }

  55% {
    /* reappear in new random zone */
    opacity: 0;
    transform: translate3d(calc(200px - 400px * var(--randX)),
        calc(200px - 400px * var(--randY)),
        400px) scale(0.5);
  }

  65% {
    opacity: 0.4;
    transform: translate3d(20px, -30px, 150px) scale(0.8) rotateY(1deg);
  }

  85% {
    opacity: 1;
    transform: translate3d(-15px, 10px, 0px) scale(1);
    z-index: 20;
  }

  100% {
    opacity: 1;
    transform: translate3d(0px, 0px, 0px) scale(1);
  }
}

/* subtle glow flicker while teleporting */
.node::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(163, 255, 0, 0.08), transparent 70%);
  mix-blend-mode: screen;
  animation: pulseNode 3s ease-in-out infinite;
}

@keyframes pulseNode {

  0%,
  100% {
    opacity: 0.2;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.06);
  }
}

/* flickering data plasma in the background */
.brain-network::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(37, 208, 255, 0.12), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(163, 255, 0, 0.1), transparent 60%);
  animation: plasmaWave 12s ease-in-out infinite alternate;
  filter: blur(90px);
  opacity: 0.4;
  z-index: 0;
}

@keyframes plasmaWave {
  0% {
    transform: scale(1);
    opacity: 0.3;
  }

  50% {
    transform: scale(1.3) rotate(10deg);
    opacity: 0.6;
  }

  100% {
    transform: scale(1);
    opacity: 0.35;
  }
}

/* =======================================================
   FAST FADE TELEPORT + ELECTRIC CONNECTION FLASH
   ======================================================= */

/* make teleports quicker */
.node {
  animation: neuralTeleportFast 12s ease-in-out infinite;
}

@keyframes neuralTeleportFast {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    z-index: 20;
  }

  15% {
    opacity: 0.8;
    transform: translate3d(25px, -20px, 80px) scale(1.05);
  }

  35% {
    opacity: 0.4;
    transform: translate3d(-40px, 20px, -150px) scale(0.7);
    z-index: 2;
  }

  40% {
    opacity: 0;
    transform: translate3d(0, 0, -400px) scale(0.3);
    filter: blur(8px);
  }

  50% {
    opacity: 0;
    transform: translate3d(calc(300px - 600px * var(--randX)),
        calc(300px - 600px * var(--randY)),
        300px) scale(0.4);
  }

  60% {
    opacity: 0.7;
    transform: translate3d(20px, -10px, 120px) scale(0.9);
  }

  80% {
    opacity: 1;
    transform: translate3d(-10px, 5px, 0) scale(1);
    z-index: 25;
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* global field flash triggered by neural rhythm */
.neural-flash {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(163, 255, 255, 0.25), transparent 70%);
  opacity: 0;
  mix-blend-mode: screen;
  filter: blur(40px);
  z-index: 9999;
  animation: flashPulse 6s ease-in-out infinite;
}

@keyframes flashPulse {

  0%,
  100% {
    opacity: 0;
  }

  45% {
    opacity: 0;
  }

  50% {
    opacity: 0.9;
  }

  55% {
    opacity: 0.2;
  }

  60% {
    opacity: 0.6;
  }

  65% {
    opacity: 0;
  }
}

/* optional: fast traveling arcs (electric sweep) */
.neural-arc {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(75deg,
      rgba(37, 208, 255, 0.15) 0%,
      rgba(37, 208, 255, 0.15) 2%,
      transparent 2%,
      transparent 6%);
  mix-blend-mode: screen;
  opacity: 0.05;
  filter: blur(6px);
  animation: arcSweep 4s linear infinite;
  z-index: 9000;
}

@keyframes arcSweep {
  from {
    transform: translateX(-100%) rotate(5deg);
    opacity: 0.05;
  }

  40% {
    opacity: 0.3;
  }

  to {
    transform: translateX(100%) rotate(5deg);
    opacity: 0.05;
  }
}

/* --------------------------------------------
   Fix: Keep population counter visible + stable
   -------------------------------------------- */
.pop-section {
  position: relative;
  z-index: 20000;
  /* above neural layers */
  text-align: center;
  margin-top: 40px;
  font-family: 'Space Grotesk', sans-serif;
}

.pop-total,
.pop-today {
  position: relative;
  z-index: 20000;
}

#nycTotal,
#nycToday {
  display: inline-block;
  color: #a3ff00;
  text-shadow:
    0 0 8px rgba(163, 255, 0, 0.4),
    0 0 18px rgba(163, 255, 0, 0.25);
}

/* optional: reintroduce smooth pulse */
#nycTotal.glow-pulse {
  animation: pulsePop 3s ease-in-out infinite;
}

@keyframes pulsePop {

  0%,
  100% {
    text-shadow: 0 0 12px rgba(163, 255, 0, 0.3), 0 0 25px rgba(163, 255, 0, 0.2);
  }

  50% {
    text-shadow: 0 0 24px rgba(163, 255, 0, 0.6), 0 0 48px rgba(163, 255, 0, 0.3);
  }
}

/* =======================================================
   READABILITY & IMPACT — FONT SIZE BOOST
   ======================================================= */

/* Hero text */
h1 {
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.05;
}

.lead,
.city-brain {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.6;
  max-width: 68ch;
}

/* Buttons stay proportionate */
.btn {
  font-size: 17px;
  padding: 12px 18px;
  border-radius: 16px;
}

/* Reflex loop + metrics */
#reflex-timer {
  font-size: 18px;
  font-weight: 600;
}

/* Population counter */
.pop-total {
  font-size: clamp(42px, 6.5vw, 90px);
  font-weight: 800;
  color: #a3ff00;
  text-shadow: 0 0 20px rgba(163, 255, 0, 0.35);
}

.pop-today {
  font-size: clamp(24px, 3.5vw, 40px);
  color: #25d0ff;
  font-weight: 600;
}

/* Node & card headings */
.node h3,
.card h3 {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--ink);
}

/* Node & card body text */
.node p,
.card p {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* Section labels like DATA MIRROR, GUIDES, etc. */
.tag,
.chip {
  font-size: 13px;
  letter-spacing: 0.1em;
  font-weight: 800;
}

/* mimic hover effect when JS adds .auto-hover */
.node.auto-hover,
.card.auto-hover {
  border-color: rgba(163, 255, 0, 0.6);
  box-shadow:
    0 0 14px rgba(163, 255, 0, 0.45),
    0 0 30px rgba(37, 208, 255, 0.25);
  transform: translateY(-4px) scale(1.02);
  transition: all 0.3s ease;
}

/* ==========================================================
   NODE FIRING EFFECT — orbit deck only
   ========================================================== */
.node.firing {
  border-color: rgba(163, 255, 0, 0.7);
  box-shadow:
    0 0 18px rgba(163, 255, 0, 0.6),
    0 0 32px rgba(37, 208, 255, 0.4),
    0 0 80px rgba(163, 255, 0, 0.15);
  transform: translateY(-6px) scale(1.05);
  transition: all 0.25s ease;
  z-index: 999;
}

.node.firing::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center,
      rgba(163, 255, 0, 0.35),
      rgba(37, 208, 255, 0.15),
      transparent 70%);
  mix-blend-mode: screen;
  opacity: 0.8;
  filter: blur(8px);
  animation: flicker 0.6s ease-in-out forwards;
}

@keyframes flicker {
  0% {
    opacity: 0.2;
  }

  30% {
    opacity: 0.8;
  }

  60% {
    opacity: 0.3;
  }

  100% {
    opacity: 0;
  }
}

/* ==========================================================
   REFLEX LOOP — Neural Flash + Typography Boost
   ========================================================== */
/* ==========================================================
   HERO — Highlight "City Brain" & Enhance Reflex Loop
   ========================================================== */

/* Highlight phrase inside the paragraph */
.city-brain b {
  color: var(--accent);
  /* your lime green #a3ff00 */
  font-weight: 800;
  text-shadow:
    0 0 6px rgba(163, 255, 0, 0.4),
    0 0 12px rgba(163, 255, 0, 0.2);
}

/* Also make the phrase “The City Brain” stand out as a unit */
.city-brain {
  font-size: 20px;
  /* slightly larger for visual presence */
  line-height: 1.6;
  color: var(--ink);
  font-weight: 400;
}

/* Reflex Loop header */
.eyebrow,
.reflex-label {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 14px;
  /* slightly larger than before */
  text-shadow: 0 0 8px rgba(163, 255, 0, 0.3);
}

/* Reflex timer animation (kept from previous step, but slightly stronger) */
#reflex-timer {
  display: inline-block;
  font-size: 24px;
  /* increased from 22px */
  font-weight: 800;
  color: var(--accent);
  animation: reflexFlash 3.5s ease-in-out infinite;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 8px rgba(163, 255, 0, 0.3),
    0 0 16px rgba(37, 208, 255, 0.15);
}

#reflex-timer {
  display: inline-block;
  font-size: 22px;
  font-weight: 700;
  color: #a3ff00;
  text-shadow: 0 0 8px rgba(163, 255, 0, 0.25);
  animation: reflexFlash 3.5s ease-in-out infinite;
  letter-spacing: 0.02em;
}

@keyframes reflexFlash {

  0%,
  100% {
    color: #ffffff;
    text-shadow:
      0 0 6px rgba(255, 255, 255, 0.4),
      0 0 12px rgba(255, 255, 255, 0.2);
  }

  40% {
    color: #a3ff00;
    text-shadow:
      0 0 12px rgba(163, 255, 0, 0.7),
      0 0 24px rgba(163, 255, 0, 0.4),
      0 0 48px rgba(163, 255, 0, 0.25);
  }

  60% {
    color: #25d0ff;
    text-shadow:
      0 0 10px rgba(37, 208, 255, 0.7),
      0 0 22px rgba(37, 208, 255, 0.4);
  }
}

/* Optional: make the label itself stronger */
.chip {
  font-size: 13px;
  letter-spacing: 0.15em;
  color: #a3ff00;
  text-shadow: 0 0 8px rgba(163, 255, 0, 0.3);
}

/* ==========================================================
   THE CITY BRAIN — Neural Glow + Green Pulse
   ========================================================== */

.city-brain strong {
  position: relative;
  display: inline-block;
  background: linear-gradient(90deg,
      #a3ff00,
      #25d0ff,
      #a3ff00);
  background-size: 300% 100%;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brainPulse 4s ease-in-out infinite;
  text-shadow:
    0 0 8px rgba(163, 255, 0, 0.4),
    0 0 16px rgba(37, 208, 255, 0.2);
}

@keyframes brainPulse {
  0% {
    background-position: 0% 50%;
    filter: brightness(1);
  }

  50% {
    background-position: 100% 50%;
    filter: brightness(1.4);
  }

  100% {
    background-position: 0% 50%;
    filter: brightness(1);
  }
}

/* ==========================================================
   REFLEX LOOP — Neural Path Animation
   ========================================================== */
.reflex-line {
  position: relative;
  margin-top: 8px;
  padding-top: 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #e8f5ff;
  line-height: 1.6;
}

.reflex-line .metric {
  display: inline-block;
  margin-right: 14px;
}

.reflex-line .metric b {
  font-weight: 800;
  color: #a3ff00;
}

.reflex-line .metric.think b {
  color: #25d0ff;
}

.reflex-line .metric.respond b {
  color: #ffeb00;
}

.reflex-path {
  position: relative;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, rgba(163, 255, 0, 0.15), rgba(37, 208, 255, 0.1));
  border-radius: 2px;
  overflow: hidden;
  margin: 6px 0 4px;
}

.pulse {
  position: absolute;
  top: 0;
  left: -10%;
  width: 10%;
  height: 100%;
  background: linear-gradient(90deg, rgba(163, 255, 0, 0), rgba(163, 255, 0, 0.9), rgba(163, 255, 0, 0));
  border-radius: 2px;
  filter: blur(2px);
  animation: reflexPulse 3s cubic-bezier(0.6, 0.01, 0.5, 1) infinite;
}

@keyframes reflexPulse {
  0% {
    left: -10%;
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  50% {
    left: 100%;
    opacity: 1;
  }

  80% {
    opacity: 0.7;
  }

  100% {
    left: 120%;
    opacity: 0;
  }
}

.reflex-line .total {
  display: block;
  font-size: 14px;
  color: #9fb2c6;
  margin-top: 2px;
}