/* ==========================================================================
   BRAIN FRIED — ADHD-OPTIMIZED PUBLICATION & BLOG SYSTEM
   Theme Tokens, Glassmorphism, Fluid Typography & Accessible UI
   Light & Airy Default with Obsidian / Warm Cream / Tokyo Neon modes
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&family=Lexend:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800;900&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* Default Theme: Periwinkle Mist & Indigo Slate */
  --bg-primary: #f2f5fc;       /* Airy Periwinkle Mist */
  --bg-secondary: #e6ecf8;     /* Soft Periwinkle Surface */
  --bg-card: #ffffff;          /* Floating Crisp White */
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(242, 245, 252, 0.88);
  --bg-badge: rgba(99, 102, 241, 0.08);

  --text-primary: #0f172a;       /* Deep Slate Headings */
  --text-secondary: #334155;     /* Crisp Slate Body */
  --text-muted: #64748b;         /* Cool Slate Meta */
  --text-inverse: #ffffff;

  --accent-primary: #6366f1;     /* Radiant Periwinkle Indigo */
  --accent-secondary: #8b5cf6;   /* Vibrant Lavender Violet */
  --accent-cyan: #0284c7;        /* Sky Periwinkle */
  --accent-emerald: #059669;     /* Fresh Mint */
  --accent-purple: #7c3aed;      /* Radiant Violet */
  --accent-orange: #f43f5e;      /* Dopamine Rose Accent */

  --border-subtle: #dbe3f3;
  --border-active: rgba(99, 102, 241, 0.45);
  --border-glow: 0 4px 20px rgba(99, 102, 241, 0.16);

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(99, 102, 241, 0.03);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(99, 102, 241, 0.04);
  --shadow-lg: 0 20px 35px -8px rgba(15, 23, 42, 0.08), 0 10px 15px -5px rgba(99, 102, 241, 0.05);
  --shadow-neon: 0 0 22px rgba(99, 102, 241, 0.22);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-full: 9999px;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-readable: 'Lexend', sans-serif;
  --font-hyperlegible: 'Atkinson Hyperlegible', sans-serif;
  --font-mono: 'Space Mono', monospace;

  --content-max-width: 1280px;
  --reader-max-width: 720px;
  --header-height: 72px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Dyslexia / Hyperlegible Font Mode */
body.font-lexend {
  font-family: var(--font-readable), sans-serif;
}
body.font-hyperlegible {
  font-family: var(--font-hyperlegible), sans-serif;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-normal);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.brand-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.3)); }
  100% { transform: scale(1.05); filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.35)); }
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
  margin-left: 0.25rem;
}

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

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-badge);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--border-active);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ==========================================================================
   HERO BANNER & SPOTLIGHT
   ========================================================================== */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  position: relative;
  overflow: hidden;
}

.hero-glow-bg {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 450px;
  background: radial-gradient(circle, rgba(199, 210, 254, 0.45) 0%, rgba(224, 231, 255, 0.35) 40%, rgba(243, 232, 255, 0.25) 70%, transparent 80%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent-primary);
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(8px);
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
}

.gradient-text {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 2rem;
}

/* Fast Search & ADHD Quick Tools Toolbar */
.hero-search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 0.4rem 0.6rem 0.4rem 1.25rem;
  box-shadow: var(--shadow-md);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  transition: all var(--transition-normal);
}

.hero-search-bar:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.kbd-shortcut {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

/* Category Filters Bar */
.category-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 3rem;
}

.category-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: var(--shadow-sm);
}

.category-pill:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-active);
  transform: translateY(-1px);
}

.category-pill.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

/* ==========================================================================
   FEATURED SPOTLIGHT & ARTICLE CARDS GRID
   ========================================================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.section-title {
  font-size: 1.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-smooth);
  position: relative;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
}

.post-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-active);
  box-shadow: var(--shadow-lg), var(--border-glow);
}

.post-card-banner {
  height: 180px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #e0e7ff 0%, #fae8ff 50%, #ffedd5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card-emoji-icon {
  font-size: 4.5rem;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.12));
  transition: transform var(--transition-smooth);
}

.post-card:hover .post-card-emoji-icon {
  transform: scale(1.12) rotate(-4deg);
}

.post-card-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.post-card-readtime {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.post-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-category {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.post-card-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.post-card:hover .post-card-title {
  color: var(--accent-primary);
}

.post-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

/* Dopamine Sparknotes Bullet in Card */
.post-card-sparknote {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border-left: 3px solid var(--accent-primary);
  padding: 0.65rem 0.85rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.82rem;
  color: #3730a3;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.post-card-cta {
  font-weight: 700;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: transform var(--transition-fast);
}

.post-card:hover .post-card-cta {
  transform: translateX(4px);
}

/* ==========================================================================
   INTERACTIVE AMBIENT SOUNDSCAPE & FOCUS BAR
   ========================================================================== */
.focus-audio-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.75rem;
  margin: 3rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.audio-bar-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.audio-bar-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.audio-bar-text h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.audio-bar-text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.sound-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.sound-toggle-btn:hover {
  background: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-active);
}

.sound-toggle-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(124, 58, 237, 0.15));
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.2);
}

.audio-volume-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.audio-volume-slider {
  -webkit-appearance: none;
  width: 90px;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  outline: none;
}

.audio-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: 3.5rem 0 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-brand h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 400px;
}

.footer-links h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 840px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .focus-audio-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
