/* Animation Keyframes */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1.25rem);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 1.25rem rgba(56, 189, 248, 0.3);
  }
  50% {
    box-shadow: 0 0 2rem rgba(56, 189, 248, 0.6);
  }
}

@keyframes particle-float {
  0% {
    transform: translateY(100vh) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-10vh) translateX(calc(var(--x-drift, 0) * 6.25rem)) scale(1);
    opacity: 0;
  }
}

/* Glow Effect */
.glow-effect {
  animation: glow 3s ease-in-out infinite;
}

/* Parallax Background */
.parallax-bg {
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* Particle Container */
.particle-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 0.25rem;
  height: 0.25rem;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.8), rgba(14, 165, 233, 0.2));
  border-radius: 50%;
  animation: particle-float linear infinite;
  --x-drift: calc((var(--random) - 0.5) * 2);
}

.particle:nth-child(odd) {
  --random: 0.3;
}

.particle:nth-child(even) {
  --random: 0.7;
}

/* Burger Menu Animation */
#burger.active span:nth-child(1) {
  transform: rotate(45deg) translate(0.4rem, 0.4rem);
}

#burger.active span:nth-child(2) {
  opacity: 0;
}

#burger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(0.4rem, -0.4rem);
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Prose Styling for Markdown Content */
.prose {
  color: #e2e8f0;
  max-width: 100%;
}

.prose h2 {
  color: #bae6fd;
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.3;
  background: linear-gradient(to right, #bae6fd, #e2e8f0);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.prose h3 {
  color: #7dd3fc;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.6em;
  margin-bottom: 0.8em;
  line-height: 1.4;
}

.prose h4 {
  color: #38bdf8;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  line-height: 1.4;
}

.prose p {
  margin-top: 0;
  margin-bottom: 1.25em;
  line-height: 1.75;
  color: #cbd5e1;
  font-size: 1.0625rem;
}

.prose a {
  color: #38bdf8;
  text-decoration: underline;
  text-decoration-color: rgba(56, 189, 248, 0.3);
  text-underline-offset: 0.125rem;
  transition: all 0.3s ease;
  font-weight: 500;
}

.prose a:hover {
  color: #7dd3fc;
  text-decoration-color: rgba(125, 211, 252, 0.6);
}

.prose strong {
  color: #f1f5f9;
  font-weight: 600;
}

.prose ul, .prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.625em;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  line-height: 1.75;
  color: #cbd5e1;
}

.prose li::marker {
  color: #38bdf8;
}

.prose blockquote {
  font-style: italic;
  border-left: 0.25rem solid #38bdf8;
  padding-left: 1.5em;
  margin: 1.5em 0;
  color: #94a3b8;
  background: rgba(56, 189, 248, 0.05);
  padding-top: 1em;
  padding-bottom: 1em;
  border-radius: 0 0.5rem 0.5rem 0;
}

.prose table {
  width: 100%;
  max-width: 100%;
  margin-top: 2em;
  margin-bottom: 2em;
  border-collapse: collapse;
  font-size: 0.9375rem;
  overflow-x: auto;
  display: block;
}

.prose thead {
  border-bottom: 0.125rem solid rgba(56, 189, 248, 0.3);
}

.prose thead th {
  color: #7dd3fc;
  font-weight: 600;
  padding: 0.875rem 1rem;
  text-align: left;
  background: rgba(56, 189, 248, 0.1);
}

.prose tbody tr {
  border-bottom: 0.0625rem solid rgba(56, 189, 248, 0.1);
  transition: background-color 0.2s ease;
}

.prose tbody tr:hover {
  background: rgba(56, 189, 248, 0.05);
}

.prose tbody td {
  padding: 0.875rem 1rem;
  color: #cbd5e1;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 2em auto;
  display: block;
  box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.3);
  border: 0.0625rem solid rgba(56, 189, 248, 0.2);
}

.prose code {
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: monospace;
}

.prose pre {
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  padding: 1.25em;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5em 0;
  border: 0.0625rem solid rgba(56, 189, 248, 0.2);
}

.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.875rem;
}

/* Table Responsive Wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* Responsive Typography */
@media (max-width: 768px) {
  .prose {
    font-size: 0.9375rem;
  }
  
  .prose h2 {
    font-size: 1.5rem;
    margin-top: 1.5em;
  }
  
  .prose h3 {
    font-size: 1.25rem;
    margin-top: 1.25em;
  }
  
  .prose h4 {
    font-size: 1.125rem;
  }
  
  .prose table {
    font-size: 0.875rem;
  }
  
  .prose thead th,
  .prose tbody td {
    padding: 0.625rem 0.75rem;
  }
}

/* Ensure Dark Text Never Appears on Dark Background */
.prose {
  background: transparent;
}

/* Link Back to Home Styling */
.prose p:first-of-type a:first-child {
  font-weight: 600;
  color: #38bdf8;
  text-decoration: none;
  border-bottom: 0.125rem solid rgba(56, 189, 248, 0.3);
  transition: all 0.3s ease;
}

.prose p:first-of-type a:first-child:hover {
  color: #7dd3fc;
  border-bottom-color: rgba(125, 211, 252, 0.6);
  transform: translateX(0.125rem);
}
