:root {
  --neon-red: #ff003c;
  --neon-amber: #ff9d00;
  --deep-bg: #030303;
  --panel-bg: rgba(10, 10, 10, 0.8);
  --grid-color: rgba(255, 255, 255, 0.03);

  /* Layer Management Variables */
  --z-background: 0;
  --z-content: 10;
  --z-nav: 50;
  --z-modal: 100;
}

body {
  background-color: var(--deep-bg);
  background-image: linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 30px 30px;
  color: #e0e0e0;
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
}

.font-display {
  font-family: "Orbitron", sans-serif;
}
.font-mono {
  font-family: "JetBrains Mono", monospace;
}

/* --- STABILITY OVERRIDES --- 
   These enforce layout even if Tailwind CDN is slow or glitchy on resize 
*/

/* Enforce Navigation Layering */
nav {
  z-index: var(--z-nav) !important;
}

/* Enforce Content Layering */
main,
header,
footer {
  position: relative;
  z-index: var(--z-content);
}

/* Fix for "Disappearing Menu" on Resize */
/* This mimics Tailwind's md:flex behavior natively in CSS */
@media (min-width: 768px) {
  .md\:flex {
    display: flex !important;
  }
  .md\:block {
    display: block !important;
  }
}

/* --- UI COMPONENTS --- */

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #000;
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-red);
}

/* Animations */
@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 0, 60, 0.1);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 0, 60, 0.3);
  }
}

@keyframes scanline {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100vh);
  }
}

/* Scanlines - Fixed to sit in background */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-background);
}

.scanlines::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.06),
      rgba(0, 255, 0, 0.02),
      rgba(0, 0, 255, 0.06)
    );
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

.scan-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0.3;
  animation: scanline 8s linear infinite;
  pointer-events: none;
  z-index: var(--z-background);
}

/* Clock Components */
.clock-container {
  filter: drop-shadow(0 0 30px rgba(255, 0, 60, 0.2));
  transition: all 0.5s ease;
}

.clock-hand {
  transition: transform 2.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: 150px 150px;
}

/* UI Elements */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

.neon-text {
  text-shadow: 0 0 10px var(--neon-red);
}

/* Timeline */
.timeline-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, #ff003c, transparent);
  z-index: 0;
}

.timeline-node {
  position: relative;
  z-index: 10;
}

/* Modal Z-Index Override */
#donate-modal,
#admin-terminal {
  z-index: var(--z-modal) !important;
}

/* Widget Mode Overrides */
body.widget-mode {
  background: transparent;
  overflow: hidden;
}
body.widget-mode nav,
body.widget-mode .content-section,
body.widget-mode footer {
  display: none !important;
}
body.widget-mode .hero-section {
  min-height: 100vh;
  padding: 10px;
}
body.widget-mode .clock-container {
  width: 180px;
  height: 180px;
}
body.widget-mode h1 {
  font-size: 1.5rem !important;
  margin-top: 1rem;
}
body.widget-mode p {
  font-size: 0.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prose strong {
  color: white;
}
