/* ========================================
   PRO INDIE DEV — Custom CSS
   Award-quality animations & prose styling
   ======================================== */

/* ---- Grain overlay ---- */
#grain {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}

/* ---- Blob animation ---- */
@keyframes blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -50px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(20px, 40px) scale(1.02); }
}

.animate-blob {
  animation: blob 25s ease-in-out infinite;
}

/* ---- Navbar states ---- */
#navbar.scrolled {
  background: rgba(250, 250, 248, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

:is(.dark) #navbar.scrolled {
  background: rgba(12, 12, 12, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- Prose styling ---- */
.prose-custom {
  font-size: 1.125rem;
  line-height: 1.8;
  color: rgba(12, 12, 12, 0.8);
}

:is(.dark) .prose-custom {
  color: rgba(255, 255, 255, 0.8);
}

.prose-custom h1,
.prose-custom h2,
.prose-custom h3,
.prose-custom h4,
.prose-custom h5,
.prose-custom h6 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 2.5em;
  margin-bottom: 0.8em;
  letter-spacing: -0.02em;
}

:is(.dark) .prose-custom h1,
:is(.dark) .prose-custom h2,
:is(.dark) .prose-custom h3,
:is(.dark) .prose-custom h4,
:is(.dark) .prose-custom h5,
:is(.dark) .prose-custom h6 {
  color: white;
}

.prose-custom h2 { font-size: 1.75rem; }
.prose-custom h3 { font-size: 1.375rem; }
.prose-custom h4 { font-size: 1.125rem; }

.prose-custom p {
  margin-bottom: 1.5em;
}

.prose-custom a {
  color: rgb(136, 57, 239);
  text-decoration: underline;
  text-decoration-color: rgba(136, 57, 239, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.prose-custom a:hover {
  text-decoration-color: rgb(136, 57, 239);
}

.prose-custom strong {
  font-weight: 700;
}

:is(.dark) .prose-custom strong {
  color: white;
}

.prose-custom blockquote {
  border-left: 3px solid rgb(136, 57, 239);
  padding-left: 1.5em;
  margin: 2em 0;
  font-style: italic;
  opacity: 0.8;
}

.prose-custom code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  padding: 0.2em 0.4em;
  border-radius: 0.375rem;
  background: rgba(0, 0, 0, 0.05);
}

:is(.dark) .prose-custom code {
  background: rgba(255, 255, 255, 0.08);
}

.prose-custom pre {
  margin: 2em 0;
  padding: 1.5em;
  border-radius: 1rem;
  overflow-x: auto;
  background: #1a1a2e !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.prose-custom pre code {
  padding: 0;
  background: none;
  font-size: 0.875rem;
  line-height: 1.7;
}

.prose-custom ul,
.prose-custom ol {
  margin: 1.5em 0;
  padding-left: 1.5em;
}

.prose-custom li {
  margin-bottom: 0.5em;
}

.prose-custom ul li::marker {
  color: rgb(136, 57, 239);
}

.prose-custom ol li::marker {
  color: rgba(136, 57, 239, 0.7);
  font-weight: 600;
}

.prose-custom img {
  border-radius: 1rem;
  margin: 2em 0;
  max-width: 100%;
}

.prose-custom hr {
  border: none;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
  margin: 3em 0;
}

:is(.dark) .prose-custom hr {
  background: rgba(255, 255, 255, 0.08);
}

.prose-custom table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 0.95em;
}

.prose-custom th,
.prose-custom td {
  padding: 0.75em 1em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-align: left;
}

:is(.dark) .prose-custom th,
:is(.dark) .prose-custom td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.prose-custom th {
  font-weight: 600;
}

:is(.dark) .prose-custom th {
  color: white;
}

/* ---- Smooth transitions ---- */
* {
  scroll-behavior: smooth;
}

/* ---- Selection ---- */
::selection {
  background: rgba(136, 57, 239, 0.2);
  color: rgb(136, 57, 239);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(136, 57, 239, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(136, 57, 239, 0.4);
}

/* ---- Project cards ---- */
.project-card {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.5s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 80px -20px rgba(136, 57, 239, 0.12),
              0 0 0 1px rgba(136, 57, 239, 0.06);
}

:is(.dark) .project-card:hover {
  box-shadow: 0 20px 80px -20px rgba(136, 57, 239, 0.2),
              0 0 0 1px rgba(136, 57, 239, 0.1);
}

/* ---- Waveform animation ---- */
@keyframes waveform {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

/* ---- Page load transition ---- */
body {
  animation: pageIn 0.5s ease;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin-slow { animation: spinSlow 12s linear infinite; }

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
