/* ============================================
   Nootropics Blog - Dark Theme Stylesheet
   ============================================ */

:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #111117;
  --bg-card: #1a1a24;
  --bg-card-hover: #22222e;
  --bg-nav: rgba(13, 13, 13, 0.85);
  --text-primary: #e8e8ed;
  --text-secondary: #9a9aad;
  --text-muted: #6a6a7a;
  --accent: #00d4ff;
  --accent-secondary: #7b61ff;
  --gradient: linear-gradient(135deg, #00d4ff, #7b61ff);
  --border: #2a2a3a;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1100px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, monospace;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 1px 1px, rgba(0, 212, 255, 0.045) 1px, transparent 0);
  background-size: 40px 40px;
  color: var(--text-primary);
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
}

/* ---- Background Orbs ---- */

.bg-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.bg-orb-1 {
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.07) 0%, transparent 60%);
  top: -450px;
  right: -300px;
  filter: blur(60px);
  animation: orbDrift 14s ease-in-out infinite;
}

.bg-orb-2 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(123, 97, 255, 0.08) 0%, transparent 60%);
  bottom: -200px;
  left: -250px;
  filter: blur(60px);
  animation: orbDrift 18s ease-in-out infinite reverse;
}

.bg-orb-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.05) 0%, transparent 60%);
  top: 45%;
  right: 8%;
  filter: blur(60px);
  animation: orbDrift 11s ease-in-out infinite;
  animation-delay: -5s;
}

nav, header, main, footer, article {
  position: relative;
  z-index: 1;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-secondary);
}

img {
  max-width: 100%;
  display: block;
}

/* ---- Typography ---- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.8rem; font-weight: 600; }
h3 { font-size: 1.35rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

/* ---- Navigation ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  font-style: italic;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
  transition: filter 0.3s;
}

.nav-logo:hover {
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5));
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 6px 0;
  transition: all 0.3s;
  border-radius: 2px;
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* ---- Keyframes ---- */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.3)); }
  50%      { filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.6)); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

@keyframes brainPulse {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50%      { opacity: 0.25; transform: scale(1.03); }
}

@keyframes neuronFire {
  0%   { stroke-dashoffset: 200; opacity: 0; }
  20%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes cardShimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}

@keyframes orbDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -30px) scale(1.05); }
  66%       { transform: translate(-25px, 35px) scale(0.97); }
}

@keyframes pillPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0); }
  50%       { box-shadow: 0 0 20px 4px rgba(0, 212, 255, 0.15); }
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%       { transform: translateY(8px); opacity: 1; }
}

/* ---- Scroll Reveal ---- */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Hero ---- */

.hero {
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.hero-pill {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.06);
  margin-bottom: 2rem;
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both,
             pillPulse 3s ease-in-out 1s infinite;
  position: relative;
  z-index: 1;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 2.5rem;
  margin-bottom: 0;
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
  position: relative;
  z-index: 1;
}

.hero-stat {
  text-align: center;
  padding: 0 2.5rem;
}

.hero-stat:not(:last-child) {
  border-right: 1px solid var(--border);
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-top: 0.4rem;
}


.hero-brain {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  opacity: 0.15;
  animation: brainPulse 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.hero-brain .neuron-path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: neuronFire 3s ease-out infinite;
}

.hero-brain .neuron-path:nth-child(2) { animation-delay: 0.5s; }
.hero-brain .neuron-path:nth-child(3) { animation-delay: 1s; }
.hero-brain .neuron-path:nth-child(4) { animation-delay: 1.5s; }
.hero-brain .neuron-path:nth-child(5) { animation-delay: 2s; }
.hero-brain .neuron-path:nth-child(6) { animation-delay: 2.5s; }

.hero h1 {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #00d4ff, #7b61ff, #00d4ff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both,
             gradientShift 6s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.hero p {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  color: var(--text-secondary);
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
  position: relative;
  z-index: 1;
}

/* ---- Tags / Categories ---- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 3rem;
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag:hover,
.tag.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.08);
  transform: scale(1.05);
}

.tag:active {
  transform: scale(0.95);
}

/* ---- Vendor Bar ---- */

.vendor-bar {
  position: relative;
  z-index: 90;
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.55rem 1.5rem;
  margin-top: 64px;
}

.vendor-bar-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  white-space: nowrap;
}

.vendor-bar-link {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s;
}

.vendor-bar-link:hover {
  color: var(--accent);
}

.vendor-bar-arrow {
  font-size: 0.7rem;
  opacity: 0.5;
}

/* ---- Article Cards ---- */

.articles {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background: rgba(26, 26, 36, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card.featured {
  grid-column: span 2;
  padding: 2.5rem;
  background: rgba(26, 26, 36, 0.7);
  border-color: rgba(0, 212, 255, 0.12);
}

.card.featured h3 { font-size: 1.6rem; }
.card.featured p  { font-size: 1rem; }

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  transition: none;
  pointer-events: none;
}

.card:hover::after {
  animation: cardShimmer 0.8s ease-out;
}

.card:hover {
  background: rgba(34, 34, 46, 0.8);
  border-color: rgba(0, 212, 255, 0.25);
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(0, 212, 255, 0.1),
              0 0 60px rgba(0, 212, 255, 0.06);
}

.card:hover::before {
  opacity: 1;
}

.card-tag {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-bottom: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  width: fit-content;
}

/* Category accent colours */
.card[data-category="science"]    .card-tag { color: #00d4ff; background: rgba(0,212,255,0.08);   border: 1px solid rgba(0,212,255,0.2); }
.card[data-category="productivity"] .card-tag { color: #7b61ff; background: rgba(123,97,255,0.08); border: 1px solid rgba(123,97,255,0.2); }
.card[data-category="nootropics"] .card-tag { color: #00ffb3; background: rgba(0,255,179,0.07);  border: 1px solid rgba(0,255,179,0.18); }
.card[data-category="guides"]     .card-tag { color: #ffd166; background: rgba(255,209,102,0.08); border: 1px solid rgba(255,209,102,0.2); }
.card-tag:not([class~="card-tag"]) { color: var(--accent); }

.card h3 {
  margin-bottom: 0.75rem;
}

.card h3 a {
  color: var(--text-primary);
}

.card h3 a:hover {
  color: var(--accent);
}

.card p {
  font-size: 0.9rem;
  flex: 1;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ---- Page Content (About, Posts) ---- */

.page-content {
  max-width: 740px;
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem;
}

.page-content h1 {
  margin-bottom: 0.5rem;
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page-content .subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.page-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.page-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.page-content ul,
.page-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.page-content li {
  margin-bottom: 0.4rem;
}

.page-content p a,
.page-content li a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 212, 255, 0.4);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.page-content p a:hover,
.page-content li a:hover {
  color: var(--accent-secondary);
  text-decoration-color: var(--accent-secondary);
}

.page-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.page-content code {
  font-family: var(--font-mono);
  background: var(--bg-card);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.disclaimer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid #ff6b6b;
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.disclaimer strong {
  color: #ff6b6b;
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

/* ---- Footer ---- */

.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  margin-bottom: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Related Posts ---- */

.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-posts h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  margin-top: 0;
}

.related-posts ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.related-posts li::before {
  content: '→ ';
  color: var(--accent);
  font-size: 0.85rem;
}

.related-posts a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s;
}

.related-posts a:hover {
  color: var(--accent);
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .articles { grid-template-columns: repeat(2, 1fr); }
  .card.featured { grid-column: span 2; }
}

@media (max-width: 768px) {
  h1 { font-size: 2.1rem; }
  .hero h1 { font-size: 2.4rem; }
  .hero-stat { padding: 0 1.25rem; }
  .hero-stat-value { font-size: 1.6rem; }
  .articles { grid-template-columns: 1fr; }
  .card.featured { grid-column: span 1; }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .articles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .hero h1 { font-size: 1.85rem; }
  .card { padding: 1.5rem; }
}
