/* --- GLOBAL STYLES --- */
body {
  position: relative;
  font-family: sans-serif;
  background-color: #000;
  color: #fff;
}

.background-grid {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  background-image: linear-gradient(to right, rgba(107, 114, 128, 0.1) 1px, transparent 1px), linear-gradient(to bottom, rgba(107, 114, 128, 0.1) 1px, transparent 1px);
  z-index: 0;
}


/* --- KEYFRAME ANIMATIONS --- */

/* General Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes flash {
  0%, 100% {
    opacity: 1;
    filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 5px #0ff) drop-shadow(0 0 10px #0ff);
  }
  50% {
    opacity: 0.6;
    filter: drop-shadow(0 0 5px #fff) drop-shadow(0 0 15px #0ff) drop-shadow(0 0 25px #0ff);
  }
}

@keyframes background-pan {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes lightning-strike {
  0%, 100% {
      text-shadow: none;
  }
  50% {
      text-shadow: 0 0 15px #fff, 0 0 25px #fff, 0 0 40px #fff;
  }
  49%, 51% {
       text-shadow: 0 0 5px #fff, 0 0 10px #fff;
  }
}
@keyframes lightning-strike-light {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 15px #4b5563, 0 0 25px #4b5563; }
  49%, 51% { text-shadow: 0 0 5px #4b5563, 0 0 10px #4b5563; }
}

/* Header Logo Animations */
@keyframes icon-glow {
  0%, 100% {
    filter: drop-shadow(0 0 1.5px #0ff);
  }
  50% {
    filter: drop-shadow(0 0 4px #0ff);
  }
}
@keyframes light-icon-glow {
  0%, 100% {
    filter: drop-shadow(0 0 1.5px #164e63);
  }
  50% {
    filter: drop-shadow(0 0 4px #164e63);
  }
}

/* Loader Animations */
@keyframes draw-square {
  to { stroke-dashoffset: 0; }
}

@keyframes bright-flash {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 15px #fff, 0 0 25px #fff, 0 0 40px #0ff; }
}

@keyframes text-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes classic-reveal {
    0% {
        opacity: 0;
        filter: blur(10px);
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

/* Page Transition Animation */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- ANIMATION UTILITY CLASSES --- */

/* General */
.animate-flash {
  animation: flash 1.5s infinite;
}
.animate-fadeIn {
  animation: fadeIn 1s ease-out forwards;
}
.animate-background-pan {
  background-size: 200% 200%;
  animation: background-pan 15s ease infinite;
}
.animate-lightning-strike {
  animation: lightning-strike 2.5s ease-in-out infinite;
}

/* Header */
.animate-icon-glow {
  animation: icon-glow 2.5s ease-in-out infinite;
}

/* Loader */
.animate-loader-square {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: draw-square 1.2s ease-out forwards 0.2s;
}
.animate-loader-T {
  opacity: 0;
  animation: text-reveal 0.6s ease-out forwards 1.2s;
}
.animate-loader-flash-container {
   animation: bright-flash 0.6s ease-out 1.4s;
}
.animate-classic-reveal {
    animation: classic-reveal 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards 1.6s;
    opacity: 0;
}

/* Page Transition */
.animate-spin-slow {
  animation: spin-slow 1.5s linear infinite;
}

/* --- TYPOGRAPHY FOR BLOG --- */
.prose {
  color: #d1d5db; /* gray-300 */
  max-width: 65ch;
  line-height: 1.75;
}
.prose h2 {
  color: #ffffff; /* white */
  font-size: 1.875rem; /* text-3xl */
  line-height: 2.25rem;
  margin-top: 2em;
  margin-bottom: 1em;
  font-weight: 700;
}
.prose h3 {
    color: #ffffff; /* white */
    font-size: 1.5rem; /* text-2xl */
    line-height: 2rem;
    margin-top: 1.6em;
    margin-bottom: 0.8em;
    font-weight: 600;
}
.prose p {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}
.prose a {
  color: #22d3ee; /* cyan-400 */
  text-decoration: none;
  transition: color 0.2s;
}
.prose a:hover {
  color: #67e8f9; /* cyan-300 */
}
.prose strong {
  color: #ffffff; /* white */
  font-weight: 600;
}

/* --- LIGHT MODE STYLES --- */
html.light-mode {
  color-scheme: light;
}

html.light-mode body {
  background-color: #f9fafb; /* gray-50 */
  color: #1f2937; /* gray-800 */
}

html.light-mode .background-grid {
  background-image: linear-gradient(to right, rgba(229, 231, 235, 1) 1px, transparent 1px), linear-gradient(to bottom, rgba(229, 231, 235, 1) 1px, transparent 1px);
}

html.light-mode header, html.light-mode #mobile-menu {
  background-color: rgba(255, 255, 255, 0.8);
}

html.light-mode .text-white { color: #11182b; }
html.light-mode .fill-white { fill: #11182b; }
html.light-mode .text-gray-300 { color: #4b5563; }
html.light-mode .text-gray-400 { color: #4b5563; }
html.light-mode .text-gray-500 { color: #6b7280; }

html.light-mode nav a, html.light-mode #mobile-menu nav a { color: #374151; }
html.light-mode nav a:hover, html.light-mode #mobile-menu nav a:hover { color: #155e75; }

html.light-mode #mobile-menu-button,
html.light-mode .theme-switcher-button {
  color: #1f2937;
}

html.light-mode .bg-black { background-color: #f9fafb; }
html.light-mode footer { background-color: #f3f4f6; }
html.light-mode .bg-gray-900\/50 {
  background-color: #ffffff;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}
html.light-mode .border-gray-800\/50, html.light-mode .border-gray-800 { border-color: #e5e7eb; }

/* Hero */
html.light-mode .animate-lightning-strike { animation-name: lightning-strike-light; }
html.light-mode .absolute.inset-0.bg-black\/60 { background-color: rgba(249, 250, 251, 0.5); }

/* --- Light Mode Accent Color Overrides --- */
html.light-mode .text-cyan-400,
html.light-mode .hover\:text-cyan-400:hover {
  color: #164e63; /* cyan-900 */
}
html.light-mode .stroke-cyan-400 {
  stroke: #164e63; /* cyan-900 */
}
html.light-mode .fill-cyan-400 {
  fill: #164e63; /* cyan-900 */
}
html.light-mode .bg-cyan-400 {
  background-color: #164e63; /* cyan-900 */
}
html.light-mode .bg-cyan-500 {
  background-color: #155e75; /* cyan-800 */
}
html.light-mode .hover\:bg-cyan-400:hover {
  background-color: #164e63; /* cyan-900 */
}
html.light-mode .border-cyan-500 {
  border-color: #155e75; /* cyan-800 */
}
html.light-mode nav a.text-cyan-400,
html.light-mode #mobile-menu nav a.text-cyan-400 {
  color: #155e75; /* cyan-800 */
  font-weight: 600;
}
html.light-mode .animate-icon-glow {
  animation-name: light-icon-glow;
}