:root {
  --primary-glow: #38bdf8;
  --secondary-glow: #6366f1;
}

html { scroll-behavior: auto; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #030614; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; border: 1px solid rgba(56, 189, 248, 0.2); }
::-webkit-scrollbar-thumb:hover { background: #2563eb; }

/* Cinematic grain over the whole page */
.film-grain {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.035'/%3E%3C/svg%3E");
}


.logo-on-dark { filter: invert(1) brightness(1.1); }


.cyber-grid {
  background-size: 50px 50px;
  background-image:
    linear-gradient(to right, rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
}

.glass-panel {
  background: linear-gradient(135deg, rgba(12, 22, 59, 0.72) 0%, rgba(6, 11, 32, 0.85) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(147, 197, 253, 0.14);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card {
  background: linear-gradient(145deg, rgba(16, 28, 77, 0.45) 0%, rgba(5, 9, 28, 0.75) 100%);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  transition: transform 0.18s ease-out, border-color 0.35s, box-shadow 0.35s;
  transform: perspective(1000px);
  transform-style: preserve-3d;
}
.glass-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 14px 40px -10px rgba(37, 99, 235, 0.4), inset 0 0 20px rgba(56, 189, 248, 0.12);
}

.glow-text-cyan { text-shadow: 0 0 24px rgba(56, 189, 248, 0.55); }

/* Envoy hub: name tag under each orbiting satellite node, positioned by
   script.js every frame via camera projection — left/top 0 so JS's
   translate() fully controls placement, no CSS layout fighting it */
.hub-node-label {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  letter-spacing: .02em; padding: 2px 8px; border-radius: 999px;
  background: rgba(3, 6, 20, 0.75); border: 1px solid rgba(147, 197, 253, 0.25);
  backdrop-filter: blur(4px); transition: opacity .2s;
}

/* scroll reveal: sections/cards settle into place as they enter view.
   --rd is an optional per-element stagger delay (e.g. style="--rd:180ms");
   elements that don't set it default to 0ms, so this is safe to share
   across every page without affecting ones that never use --rd. */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--rd, 0ms); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- mobile ---------- */
h1, h2, h3 { overflow-wrap: break-word; }

/* hero copy spans the full width on phones, so the desktop scrim (strong only
   at the left-centre) leaves the right half of every line over the 3D scene */
@media (max-width: 640px) {
  .hero-scrim {
    background: linear-gradient(to bottom, rgba(3,6,20,.82) 0%, rgba(3,6,20,.7) 60%, rgba(3,6,20,.35) 100%) !important;
  }
  #scene-canvas { opacity: .4; }
  .glass-panel, .glass-card { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .hub-node-label { font-size: 10px; padding: 1px 6px; }
}

/* touch screens have no hover: don't leave cards stuck in their hover/tilt state after a tap */
@media (hover: none) {
  .glass-card:hover { border-color: rgba(99, 102, 241, 0.2); box-shadow: none; }
}