/* ==========================================================================
   PolicyPath — coverpathlog.org
   Shared design tokens + ambient animation system
   ========================================================================== */

:root {
  --bg: #0A0612;
  --bg-soft: #0D0817;
  --card: #130D24;
  --card-hi: #180F2C;
  --header: #040208;
  --rose: #C026D3;
  --rose-dim: #8B1FA0;
  --violet: #A78BFA;
  --violet-dim: #6D48C9;
  --amber: #FBBF24;
  --text: #F8FAFC;
  --text-soft: #94A3B8;
  --border: rgba(167, 139, 250, 0.16);
  --border-hi: rgba(192, 38, 212, 0.35);
  --font-display: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

h1,
h2,
h3,
h4,
.font-display {
  font-family: var(--font-display);
}

.font-mono {
  font-family: var(--font-mono);
}

::selection {
  background: var(--rose);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--violet-dim);
  border-radius: 8px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Logo mark (pure CSS, no SVG / image) ---------- */
.logo-mark {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, var(--rose) 0%, var(--violet-dim) 100%);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 4px 14px rgba(192, 38, 212, 0.35);
}

.logo-mark::before {
  content: "";
  position: absolute;
  width: 150%;
  height: 2px;
  background: rgba(255, 255, 255, 0.55);
  top: 62%;
  left: -25%;
  transform: rotate(-32deg);
}

.logo-mark .node-a,
.logo-mark .node-b {
  position: absolute;
  border-radius: 999px;
}

.logo-mark .node-a {
  width: 7px;
  height: 7px;
  background: var(--amber);
  top: 7px;
  left: 8px;
  box-shadow: 0 0 6px 2px rgba(251, 191, 36, 0.7);
}

.logo-mark .node-b {
  width: 7px;
  height: 7px;
  background: #fff;
  bottom: 8px;
  right: 7px;
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.55);
}

.logo-word {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.logo-word .accent {
  color: var(--rose);
}

/* ---------- Ambient background systems ---------- */

/* Aurora gradient drift */
.bg-aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: auroraDrift 26s ease-in-out infinite;
}

.bg-aurora span:nth-child(1) {
  width: 42vw;
  height: 42vw;
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(192, 38, 212, 0.55), transparent 70%);
  animation-delay: 0s;
}

.bg-aurora span:nth-child(2) {
  width: 38vw;
  height: 38vw;
  top: 20%;
  right: -10%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.5), transparent 70%);
  animation-delay: -8s;
}

.bg-aurora span:nth-child(3) {
  width: 32vw;
  height: 32vw;
  bottom: -14%;
  left: 25%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.18), transparent 70%);
  animation-delay: -16s;
}

@keyframes auroraDrift {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(4%, 6%) scale(1.08);
  }

  66% {
    transform: translate(-5%, -3%) scale(0.96);
  }
}

/* Floating particles */
.bg-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-particles i {
  position: absolute;
  border-radius: 999px;
  background: var(--violet);
  opacity: 0.5;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(10%) translateX(0);
    opacity: 0;
  }

  10% {
    opacity: 0.6;
  }

  90% {
    opacity: 0.35;
  }

  100% {
    transform: translateY(-110%) translateX(20px);
    opacity: 0;
  }
}

/* Animated grid */
.bg-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 40%, transparent 90%);
  animation: gridPulse 10s ease-in-out infinite;
}

@keyframes gridPulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 0.9;
  }
}

/* Path / route lines */
.path-line {
  stroke: url(#pathGradient);
  stroke-dasharray: 8 10;
  animation: dashFlow 6s linear infinite;
}

@keyframes dashFlow {
  to {
    stroke-dashoffset: -180;
  }
}

.risk-node {
  animation: nodePulse 2.6s ease-in-out infinite;
}

@keyframes nodePulse {

  0%,
  100% {
    opacity: 0.55;
    r: 4;
  }

  50% {
    opacity: 1;
    r: 6;
  }
}

/* Glowing border */
.glow-border {
  position: relative;
}

.glow-border::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, var(--rose), transparent 40%, var(--violet) 70%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.55;
  animation: borderSweep 8s linear infinite;
  pointer-events: none;
}

@keyframes borderSweep {
  to {
    filter: hue-rotate(30deg);
  }
}

/* Soft glowing orb decoration */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  animation: orbFloat 12s ease-in-out infinite;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translateY(0) translateX(0);
  }

  50% {
    transform: translateY(-18px) translateX(10px);
  }
}

/* Card base */
.pp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.pp-card:hover {
  border-color: var(--border-hi);
}

/* Nav link underline */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--rose), var(--violet));
  transition: width 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Mobile nav panel */
#mobile-nav {
  transition: max-height 0.3s ease, opacity 0.25s ease;
}

/* Range input styling */
input[type="range"] {
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--violet));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--rose);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(192, 38, 212, 0.6);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--rose);
  cursor: pointer;
}

/* Accordion */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.accordion-item.open .accordion-content {
  max-height: 600px;
}

.accordion-item.open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-chevron {
  transition: transform 0.25s ease;
}

/* Coverage meter bar */
.meter-track {
  background: rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill {
  background: linear-gradient(90deg, var(--rose), var(--amber));
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* Toast */
#toast {
  transition: transform 0.35s ease, opacity 0.35s ease;
}

/* Fade utility (used for popup, no scroll-triggered reveals) */
.fade-in {
  animation: fadeIn 0.4s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}



/* =========================================================
   POLICY PATH — ANIMATED COVERAGE CONSOLE
   ========================================================= */

.pp-hero {
  isolation: isolate;
}

/* Main console */
.coverage-console {
  position: relative;
  width: min(560px, 100%);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ambient glow */
.console-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  pointer-events: none;
}

.console-glow-a {
  width: 280px;
  height: 280px;
  background: rgba(192, 38, 211, .18);
  animation: consoleGlowA 7s ease-in-out infinite alternate;
}

.console-glow-b {
  width: 210px;
  height: 210px;
  background: rgba(251, 191, 36, .10);
  animation: consoleGlowB 9s ease-in-out infinite alternate;
}

@keyframes consoleGlowA {
  0% {
    transform: translate(-50px, -20px) scale(.85);
  }

  100% {
    transform: translate(60px, 35px) scale(1.15);
  }
}

@keyframes consoleGlowB {
  0% {
    transform: translate(50px, 40px) scale(1);
  }

  100% {
    transform: translate(-50px, -30px) scale(.7);
  }
}


/* =========================================================
   ORBIT RINGS
   ========================================================= */

.orbit {
  position: absolute;
  border: 1px solid rgba(167, 139, 250, .16);
  border-radius: 50%;
  pointer-events: none;
}

.orbit::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 18px 5px rgba(167, 139, 250, .55);
  top: -3px;
  left: 50%;
}

.orbit-outer {
  width: 480px;
  height: 480px;
  animation: orbitRotate 25s linear infinite;
}

.orbit-middle {
  width: 390px;
  height: 390px;
  border-color: rgba(192, 38, 211, .18);
  animation: orbitRotateReverse 18s linear infinite;
}

.orbit-middle::after {
  background: #c026d3;
  box-shadow: 0 0 18px 5px rgba(192, 38, 211, .5);
  top: auto;
  bottom: -3px;
}

.orbit-inner {
  width: 300px;
  height: 300px;
  border-style: dashed;
  border-color: rgba(251, 191, 36, .13);
  animation: orbitRotate 14s linear infinite;
}

@keyframes orbitRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes orbitRotateReverse {
  from {
    transform: rotate(360deg);
  }

  to {
    transform: rotate(0deg);
  }
}


/* =========================================================
   NETWORK
   ========================================================= */

.coverage-network {
  position: relative;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center,
      rgba(139, 92, 246, .10),
      rgba(10, 6, 18, .38) 48%,
      rgba(10, 6, 18, .05) 72%);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow:
    inset 0 0 80px rgba(139, 92, 246, .06),
    0 30px 100px rgba(0, 0, 0, .35);
  backdrop-filter: blur(12px);
}

/* Network SVG */
.network-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.network-lines line {
  stroke: url(#networkLine);
  stroke-width: 1;
  opacity: .3;
  stroke-dasharray: 5 8;
  animation: networkDash 4s linear infinite;
}

.network-lines circle {
  fill: none;
  stroke: rgba(167, 139, 250, .14);
  stroke-width: 1;
  stroke-dasharray: 3 10;
  animation: networkCircle 10s linear infinite;
}

@keyframes networkDash {
  to {
    stroke-dashoffset: -100;
  }
}

@keyframes networkCircle {
  to {
    transform: rotate(360deg);
    transform-origin: center;
  }
}


/* =========================================================
   CORE
   ========================================================= */

.network-core {
  position: absolute;
  width: 150px;
  height: 150px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle,
      rgba(139, 92, 246, .25),
      rgba(10, 6, 18, .95) 65%);
  border: 1px solid rgba(167, 139, 250, .35);
  box-shadow:
    0 0 50px rgba(139, 92, 246, .18),
    inset 0 0 30px rgba(192, 38, 211, .12);
  z-index: 5;
}

.core-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(251, 191, 36, .22);
  border-top-color: #fbbf24;
  animation: coreSpin 5s linear infinite;
}

.core-ring::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  top: -4px;
  left: 50%;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 15px 4px rgba(251, 191, 36, .65);
}

@keyframes coreSpin {
  to {
    transform: rotate(360deg);
  }
}

.core-content {
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
}

.core-label {
  display: block;
  font-size: 8px;
  letter-spacing: .18em;
  color: #94a3b8;
  margin-bottom: 3px;
}

.core-content strong {
  display: block;
  font-family: "Manrope", sans-serif;
  font-size: 44px;
  line-height: 1;
  background: linear-gradient(135deg, #fbbf24, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.core-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 7px;
  letter-spacing: .12em;
  color: #a7f3d0;
}

.core-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: statusBlink 1.8s ease-in-out infinite;
}

@keyframes statusBlink {
  50% {
    opacity: .3;
  }
}


/* =========================================================
   COVERAGE NODES
   ========================================================= */

.coverage-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px 9px 9px;
  min-width: 130px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(8, 5, 16, .72);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, .25);
  z-index: 4;
  animation: nodeFloat 4s ease-in-out infinite;
}

.node-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, .13);
  border: 1px solid rgba(167, 139, 250, .2);
  color: #c4b5fd;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 500;
}

.node-info span {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 7px;
  letter-spacing: .12em;
  color: #64748b;
}

.node-info strong {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #f8fafc;
}

.node-pulse {
  position: absolute;
  width: 5px;
  height: 5px;
  right: 8px;
  top: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: statusBlink 1.5s ease-in-out infinite;
}


/* Positions */

.node-life {
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
}

.node-health {
  top: 78px;
  right: -28px;
  animation-delay: -.8s;
}

.node-umbrella {
  right: -28px;
  bottom: 65px;
  animation-delay: -1.7s;
}

.node-claims {
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: -2.5s;
}

.node-auto {
  bottom: 65px;
  left: -30px;
  animation-delay: -1.2s;
}

.node-property {
  top: 78px;
  left: -28px;
  animation-delay: -3s;
}

@keyframes nodeFloat {

  0%,
  100% {
    margin-top: 0;
  }

  50% {
    margin-top: -8px;
  }
}


/* =========================================================
   FLOATING DATA PANELS
   ========================================================= */

.floating-data-panel {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border-radius: 10px;
  background: rgba(5, 3, 10, .82);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(15px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, .3);
  z-index: 8;
  font-family: "IBM Plex Mono", monospace;
}

.panel-top {
  top: 15%;
  right: -10px;
  animation: panelFloat 5s ease-in-out infinite;
}

.data-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8px;
  letter-spacing: .1em;
  color: #a7f3d0;
}

.data-live i {
  width: 5px;
  height: 5px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 8px #34d399;
}

.data-time {
  color: #64748b;
  font-size: 8px;
}

.panel-bottom {
  bottom: 19%;
  right: -25px;
  min-width: 220px;
  animation: panelFloat 6s ease-in-out infinite reverse;
}

.alert-icon {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, .12);
  color: #fbbf24;
  font-weight: 700;
  font-size: 12px;
}

.panel-bottom span:not(.signal-dot) {
  display: block;
  color: #64748b;
  font-size: 7px;
  letter-spacing: .12em;
}

.panel-bottom strong {
  display: block;
  color: #e2e8f0;
  font-size: 9px;
  margin-top: 2px;
}

.signal-dot {
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 10px #fbbf24;
}

@keyframes panelFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}


/* =========================================================
   BOTTOM METRICS
   ========================================================= */

.console-metrics {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 5px;
  background: rgba(5, 3, 10, .85);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  backdrop-filter: blur(15px);
  z-index: 10;
  box-shadow: 0 15px 40px rgba(0, 0, 0, .35);
}

.console-metrics div {
  min-width: 95px;
  padding: 7px 12px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.console-metrics div:last-child {
  border-right: 0;
}

.console-metrics span {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 7px;
  letter-spacing: .12em;
  color: #64748b;
}

.console-metrics strong {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #f8fafc;
}


/* =========================================================
   ROUTE ANIMATION
   ========================================================= */

.hero-route {
  stroke-dasharray: 10 18;
  animation: routeMove 6s linear infinite;
}

.hero-route-2 {
  animation-duration: 10s;
}

@keyframes routeMove {
  to {
    stroke-dashoffset: -280;
  }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 1023px) {

  .coverage-console {
    width: min(500px, 100%);
    margin-top: 30px;
  }

  .coverage-network {
    width: 390px;
    height: 390px;
  }

  .orbit-outer {
    width: 440px;
    height: 440px;
  }

  .orbit-middle {
    width: 360px;
    height: 360px;
  }

  .orbit-inner {
    width: 280px;
    height: 280px;
  }

  .panel-top {
    right: 0;
  }

  .panel-bottom {
    right: -5px;
  }

}


@media (max-width: 640px) {

  .coverage-console {
    width: 360px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
  }

  .coverage-network {
    width: 300px;
    height: 300px;
  }

  .orbit-outer {
    width: 340px;
    height: 340px;
  }

  .orbit-middle {
    width: 285px;
    height: 285px;
  }

  .orbit-inner {
    width: 220px;
    height: 220px;
  }

  .network-core {
    width: 105px;
    height: 105px;
  }

  .core-content strong {
    font-size: 30px;
  }

  .core-label {
    font-size: 6px;
  }

  .core-status {
    font-size: 5px;
  }

  .coverage-node {
    min-width: 92px;
    padding: 6px;
    gap: 6px;
  }

  .node-icon {
    width: 23px;
    height: 23px;
    font-size: 8px;
  }

  .node-info span {
    font-size: 5px;
  }

  .node-info strong {
    font-size: 8px;
  }

  .node-life {
    top: 4px;
  }

  .node-health {
    right: -5px;
    top: 50px;
  }

  .node-umbrella {
    right: -5px;
    bottom: 48px;
  }

  .node-claims {
    bottom: 4px;
  }

  .node-auto {
    left: -5px;
    bottom: 48px;
  }

  .node-property {
    left: -5px;
    top: 50px;
  }

  .panel-top {
    top: 0;
    right: 5px;
    transform: scale(.85);
    transform-origin: right top;
  }

  .panel-bottom {
    bottom: 5px;
    right: 0;
    transform: scale(.8);
    transform-origin: right bottom;
  }

  .console-metrics {
    bottom: -8px;
    width: max-content;
  }

  .console-metrics div {
    min-width: 72px;
    padding: 6px 7px;
  }

  .console-metrics span {
    font-size: 5px;
  }

  .console-metrics strong {
    font-size: 8px;
  }

}


/* Hide Scrollbar */
html,
body {
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}