/* Global Reset & Core Styles */
* {margin:0;padding:0;box-sizing:border-box}
html {scroll-behavior:smooth}

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background:
    radial-gradient(circle at 0 0, rgba(56,189,248,0.18), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(244,63,94,0.16), transparent 55%),
    radial-gradient(circle at 120% -20%, rgba(180,83,9,0.2), transparent 60%),
    linear-gradient(135deg, #020617 0%, #020617 35%, #020617 100%);
  color: #f9fafb;
  min-height: 100vh;
  /* overflow: hidden; Removed to allow scrolling on longer pages like index/blog */
}

/* Background Noise */
.bg-noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url('/bg.png');
  background-size: cover; background-position: center;
  opacity: .22;
  mix-blend-mode: soft-light;
}

/* Typography */
.font-serif { font-family: 'DM Serif Display', serif; }
.font-sans { font-family: 'Space Grotesk', system-ui, sans-serif; }

/* Layout Containers */
.shell {
  position: relative; z-index: 1;
  max-width: 1160px; margin: 0 auto;
  padding: 32px 20px 28px;
  min-height: 100vh;
  display: flex; flex-direction: column;
  gap: 16px;
}

/* Header / Brand */
.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.brand-mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 999px;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  background-image: url('https://www.natalcodex.com/mandala.webp.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 14px rgba(34,197,94,0.25));
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 66%, transparent 100%);
  mask-image: radial-gradient(circle at 50% 50%, #000 66%, transparent 100%);
  will-change: transform;
  animation: nc-logo-spin 18s linear infinite;
}
.brand-logo::before {
  content: '';
  position: absolute;
  inset: -45%;
  background: conic-gradient(from 140deg, rgba(34,197,94,0.65), rgba(34,211,238,0.55), rgba(168,85,247,0.55), rgba(34,197,94,0.65));
  filter: blur(14px);
  opacity: 0.22;
}
.brand-logo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(2,6,23,0) 0%, rgba(2,6,23,0.2) 70%, rgba(2,6,23,0.55) 100%);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: 'DM Serif Display', serif; font-size: 22px; letter-spacing: .14em; text-transform: uppercase; color: #f9fafb; }
.brand-sub { font-size: 11px; color: #9ca3af; letter-spacing: .18em; text-transform: uppercase; }

@keyframes nc-logo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-logo { animation: none; }
}

/* Buttons */
.nav-btn {
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid rgba(56,189,248,0.3);
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(8px);
  color: #e5e7eb; font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}
.nav-btn:hover {
  border-color: #38bdf8;
  background: rgba(56,189,248,0.15);
  color: #fff;
  box-shadow: 0 0 12px rgba(56,189,248,0.4);
  transform: translateY(-1px);
}

.primary-btn {
  padding: 12px 28px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.1);
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all .3s ease;
  background: linear-gradient(135deg, #22c55e 0%, #0ea5e9 50%, #8b5cf6 100%);
  background-size: 200% 200%;
  animation: gradient-move 4s ease infinite;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  box-shadow: 0 0 20px rgba(14,165,233,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  text-decoration: none; display: inline-block;
}
.primary-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 30px rgba(139,92,246,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
  background-position: 100% 50%;
}
@keyframes gradient-move {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Glass Panels */
.glass-panel {
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,0.45);
  background: radial-gradient(circle at 0 0, rgba(56,189,248,0.08), transparent 55%),
              radial-gradient(circle at 100% 100%, rgba(168,85,247,0.12), transparent 60%),
              rgba(15,23,42,0.92);
  box-shadow: 0 18px 40px rgba(15,23,42,0.95);
  padding: 24px;
}

/* Form Elements */
.field-input, .field-select, .field-textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.7);
  background: rgba(15,23,42,0.96);
  color: #f9fafb; font-size: 14px;
  transition: all .22s ease;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  outline: none; border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34,197,94,0.65);
  background: rgba(15,23,42,1);
}

/* Blog/Content Specific */
.content-wrapper {
  max-width: 800px; margin: 0 auto; width: 100%;
}
.article-title {
  font-family: 'DM Serif Display', serif;
  font-size: 32px; margin-bottom: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #e0f2fe 0%, #ffffff 50%, #d8b4fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 26px rgba(255,255,255,0.18);
}
.article-meta {
  font-size: 13px; color: #9ca3af; margin-bottom: 24px;
  display: flex; gap: 12px; align-items: center;
}
.article-body {
  font-size: 16px; line-height: 1.8; color: #d1d5db;
}
.article-body p { margin-bottom: 1.5em; }
.article-body h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 24px; color: #f9fafb;
  margin-top: 40px; margin-bottom: 16px;
}
.article-body h3 {
  font-size: 18px; color: #e5e7eb; font-weight: 600;
  margin-top: 24px; margin-bottom: 12px;
}
.article-body ul, .article-body ol {
  margin-bottom: 1.5em; padding-left: 20px;
}
.article-body li { margin-bottom: 8px; }

/* Responsive */
@media (max-width: 640px) {
  .shell { padding: 18px 14px 22px; }
  .top-nav { flex-direction: column; align-items: flex-start; gap: 12px; }
  .article-title { font-size: 26px; }
}

/* Blog Index & Cards */
.blog-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.blog-card {
  display: block; text-decoration: none;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 16px; padding: 24px;
  transition: all .25s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56,189,248,0.5);
  background: rgba(15,23,42,0.8);
  box-shadow: 0 12px 32px rgba(15,23,42,0.5);
}
.blog-card-meta { display: flex; gap: 10px; margin-bottom: 12px; font-size: 12px; align-items: center; flex-wrap: wrap; }
.blog-tag {
  background: rgba(56,189,248,0.1); color: #38bdf8;
  padding: 4px 10px; border-radius: 99px;
  border: 1px solid rgba(56,189,248,0.2);
}
.blog-date { color: #9ca3af; }
.blog-card-title {
  font-family: 'DM Serif Display', serif;
  font-size: 20px; color: #f9fafb; margin-bottom: 10px; line-height: 1.4;
}
.blog-card-desc { font-size: 14px; color: #9ca3af; line-height: 1.6; margin-bottom: 16px; }
.blog-card-read {
  font-size: 13px; font-weight: 600; color: #38bdf8;
  display: inline-flex; align-items: center; gap: 4px;
}

/* Categories */
.categories { margin-bottom: 40px; }
.categories-title { font-size: 12px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px; }
.categories-list { display: flex; flex-wrap: wrap; gap: 8px; }
.category-btn {
  background: rgba(15,23,42,0.6); border: 1px solid rgba(148,163,184,0.2);
  color: #d1d5db; padding: 6px 14px; border-radius: 99px;
  font-size: 13px; cursor: pointer; transition: all .2s;
}
.category-btn:hover, .category-btn.active {
  background: rgba(56,189,248,0.15); border-color: #38bdf8; color: #38bdf8;
}

/* CTA Section */
.cta-section {
  text-align: center; margin: 60px 0 40px; padding: 40px 32px;
  background: radial-gradient(circle at 50% 0, rgba(56,189,248,0.1), transparent 70%), rgba(15,23,42,0.8);
  border: 1px solid rgba(148,163,184,0.3); border-radius: 20px;
}
.cta-title { font-family: 'DM Serif Display', serif; font-size: 24px; color: #f9fafb; margin-bottom: 12px; }
.cta-desc { color: #9ca3af; margin-bottom: 24px; font-size: 15px; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: #6b7280; }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-text { font-size: 16px; }

/* Site Footer */
.site-footer {
  text-align: center; padding: 40px 0; color: #6b7280; font-size: 13px;
  border-top: 1px solid rgba(148,163,184,0.15); margin-top: 60px;
}
.site-footer a { color: #38bdf8; text-decoration: none; }

/* Article Components */
.highlight-box {
  background: rgba(56,189,248,0.1); border-left: 4px solid #38bdf8;
  padding: 20px 24px; margin: 24px 0; border-radius: 0 8px 8px 0;
  color: #e5e7eb;
}

.comparison-table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px; }
.comparison-table th, .comparison-table td { padding: 14px 12px; border: 1px solid rgba(148,163,184,0.2); text-align: left; color: #d1d5db; }
.comparison-table th { background: rgba(56,189,248,0.15); color: #38bdf8; font-weight: 600; }
.comparison-table tr:nth-child(even) { background: rgba(15,23,42,0.3); }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0; }
.tag {
  padding: 6px 12px; background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.25); border-radius: 20px;
  font-size: 12px; color: #38bdf8;
}

.author-box {
  display: flex; align-items: center; gap: 16px; padding: 24px;
  background: rgba(15,23,42,0.6); border: 1px solid rgba(148,163,184,0.2);
  border-radius: 12px; margin: 48px 0;
}
.author-avatar {
  width: 50px; height: 50px; border-radius: 50%;
  background: conic-gradient(from 140deg, #22c55e, #22d3ee, #a855f7, #22c55e);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; font-weight: bold;
}
.author-info h4 { color: #f9fafb; margin-bottom: 4px; font-size: 16px; }
.author-info p { font-size: 13px; color: #9ca3af; margin: 0; }

.related-articles { margin: 48px 0; }
.related-articles h3 { color: #f9fafb; margin-bottom: 20px; font-size: 18px; font-family: 'DM Serif Display', serif; }
.related-link {
  display: block; padding: 16px;
  background: rgba(15,23,42,0.6); border: 1px solid rgba(148,163,184,0.2);
  border-radius: 8px; color: #d1d5db; text-decoration: none;
  margin-bottom: 12px; transition: all 0.2s;
}
.related-link:hover {
  border-color: #38bdf8; background: rgba(56,189,248,0.1); color: #f9fafb;
}
