/**
 * El Pulso AI - Design System CSS
 * Dark mode, ADHD accessibility, AI Search Optimized
 */

/* ============================================
   1. CSS VARIABLES
   ============================================ */
:root {
  /* Colors - Dark Theme */
  --color-bg: #000000;
  --color-bg-elevated: #12121A;
  --color-surface: #1A1A24;
  --color-border: #2A2A3A;
  
  /* Text */
  --color-text-primary: #F0F0F5;
  --color-text-secondary: #A0A0B0;
  --color-text-muted: #6B6B7B;
  
  /* Brand */
  --color-brand: #00D9FF;
  --color-brand-hover: #33E0FF;
  --color-brand-glow: rgba(0, 217, 255, 0.15);
  
  /* Status */
  --color-success: #22C55E;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  
  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #00D9FF 0%, #6366F1 50%, #EC4899 100%);
  --gradient-hero: radial-gradient(circle at 50% 0%, rgba(0,217,255,0.15) 0%, transparent 70%);
  
  /* Typography */
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Font Sizes */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.375rem;  /* 22px */
  --text-3xl: 1.75rem;   /* 28px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */
  
  /* Line Heights */
  --leading-tight: 1.1;
  --leading-snug: 1.2;
  --leading-normal: 1.3;
  --leading-relaxed: 1.4;
  --leading-loose: 1.5;
  --leading-body: 1.7;
  
  /* Spacing */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-24: 6rem;     /* 96px */
  
  /* Layout */
  --max-content: 720px;
  --max-layout: 1280px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  
  /* Transitions */
  --transition-fast: 200ms ease-out;
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.0, 0, 0.2, 1);
  
  /* ADHD Focus Mode */
  --focus-mode-opacity: 0.15;
}

/* ============================================
   2. BASE STYLES
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
  background-color: var(--color-brand);
  color: #fff;
}

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

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-surface);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-border);
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: 700;
  line-height: var(--leading-tight);
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
}

p {
  margin-bottom: var(--space-6);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-brand);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #9D00FF;
}

.article-content h1 {
  color: var(--color-brand);
}

/* Headings as links — static neon, hover purple */
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
.article-title a,
.entry-title a,
.card-title a,
.featured-title a,
.post-card-title a {
  color: var(--color-brand);
  transition: color var(--transition-fast);
}

h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
.article-title a:hover,
.entry-title a:hover,
.card-title a:hover,
.featured-title a:hover,
.post-card-title a:hover {
  color: #9D00FF;
}

/* Lead paragraph */
.lead {
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

/* Meta text */
.meta {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Code */
code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

code {
  background: var(--color-surface);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--color-brand-hover);
}

pre {
  background: var(--color-bg-elevated);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--space-6);
  border: 1px solid var(--color-border);
}

/* ============================================
   4. LAYOUT
   ============================================ */
.container {
  width: 100%;
  max-width: var(--max-layout);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

/* ============================================
   5. COMPONENTS
   ============================================ */

/* --- Header / Navigation --- */
.site-header {
  position: relative;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-branding {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
}

.site-branding a {
  color: inherit;
}

/* --- Hero Logo Section --- */
.hero-logo-section {
  padding: var(--space-4) 0 0;
  text-align: center;
  background: transparent;
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-brand);
  text-align: center;
  margin-top: var(--space-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- Main Navigation --- */
.main-navigation {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.main-navigation a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.main-navigation a:hover {
  color: var(--color-text-primary);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  padding: var(--space-24) 0 var(--space-16);
  background: var(--gradient-hero);
  text-align: center;
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto var(--space-6);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .lead {
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--color-brand);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--color-brand);
  border: 1px solid var(--color-brand);
}

.btn-secondary:hover {
  background: var(--color-brand);
  color: #fff;
}

.btn-pill {
  border-radius: var(--radius-pill);
}

/* --- Cards --- */
.card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.card:hover {
  border-color: var(--color-brand);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

.card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-content {
  padding: var(--space-6);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
  line-height: var(--leading-normal);
}

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

.card-title a:hover {
  color: var(--color-brand-hover);
}

.card-excerpt {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: 0;
}

/* --- Tags --- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.tag:hover {
  background: var(--color-brand);
  color: #fff;
}

/* --- Article --- */
.article-header {
  padding: var(--space-16) 0 var(--space-8);
  text-align: center;
}

.article-title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.article-content {
  padding-bottom: var(--space-16);
}

.article-content h2 {
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.article-content h3 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.article-content ul,
.article-content ol {
  margin-bottom: var(--space-6);
  padding-left: var(--space-6);
}

.article-content li {
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

.article-content blockquote {
  margin: var(--space-8) 0;
  padding: var(--space-6) var(--space-8);
  border-left: 4px solid var(--color-brand);
  background: var(--color-bg-elevated);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
}

.article-content blockquote p {
  margin-bottom: 0;
  color: var(--color-text-primary);
}

/* --- Reading Progress Bar --- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-brand);
  z-index: 1001;
  transition: width 0.1s linear;
}

/* ============================================
   6. ADHD ACCESSIBILITY
   ============================================ */

/* Focus Mode Toggle */
.focus-mode-toggle {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  transition: all var(--transition-fast);
}

.focus-mode-toggle:hover {
  transform: scale(1.1);
}

/* Focus Mode Active */
body.focus-mode .site-header,
body.focus-mode .site-footer,
body.focus-mode .sidebar,
body.focus-mode .related-posts,
body.focus-mode .comments-area {
  opacity: var(--focus-mode-opacity);
  pointer-events: none;
  transition: opacity var(--transition-base);
}

body.focus-mode .content {
  max-width: 680px;
}

/* Visual Anchors for ADHD */
.anchor-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: var(--space-2);
  color: var(--color-brand);
}

.section-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-12) 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* TLDR Box */
.tldr-box {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-brand);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
}

.tldr-box h4 {
  font-size: var(--text-lg);
  color: var(--color-brand);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tldr-box ul {
  margin-bottom: 0;
  padding-left: var(--space-6);
}

.tldr-box li {
  margin-bottom: var(--space-2);
}

/* Key Takeaways */
.takeaways {
  background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(139,92,246,0.1) 100%);
  border-left: 4px solid var(--color-brand);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-6);
  margin: var(--space-8) 0;
}

.takeaways h4 {
  color: var(--color-brand-hover);
  margin-bottom: var(--space-4);
}

/* ============================================
   7. GRID SYSTEM
   ============================================ */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   8. UTILITIES
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

/* ============================================
   9. RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --text-5xl: 2.25rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --text-lg: 1rem;
  }
  
  .hero {
    padding: var(--space-16) 0 var(--space-12);
  }
  
  .article-header {
    padding: var(--space-12) 0 var(--space-6);
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .main-navigation {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-4);
  }
  
  .card-content {
    padding: var(--space-4);
  }
}

/* ============================================
   10. ANIMATIONS
   ============================================ */

/* --- Posts Grid Layout --- */
.posts-section {
  padding: var(--space-16) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.posts-grid,
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
  margin: 0 auto;
}

/* Post card image centering */
.post-image,
.featured-image {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.post-image img,
.featured-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

/* Article hero image centering */
.article-hero-image {
  margin: var(--space-8) auto;
  max-width: 100%;
  text-align: center;
}

.article-hero-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  display: inline-block;
}

/* Hero content centering */
.hero-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  padding: 0 var(--space-4);
}

/* Post card title centering fix */
.post-card-title {
  text-align: left;
}

/* Featured section */
.featured-section {
  padding: var(--space-16) 0;
}

/* Placeholder section */
.placeholder-section {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

/* Pagination centering */
.pagination,
.nav-links {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-12);
}

/* Related articles grid */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

/* Post navigation */
.post-navigation {
  margin-top: var(--space-16);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.nav-links {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
}

.nav-prev,
.nav-next {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  flex: 1;
  max-width: 48%;
}

.nav-next {
  text-align: right;
  margin-left: auto;
}

.nav-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.nav-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Back to home button */
.back-to-home {
  margin-bottom: var(--space-6);
}

.btn-back-home {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.btn-back-home:hover {
  color: var(--color-brand);
}

/* Article tags */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-8);
}

.tags-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-right: var(--space-2);
}

/* Reading time */
.reading-time {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Post author in card */
.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.post-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.author-name {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* Post category tag */
.post-category {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface);
  color: var(--color-brand);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-category:hover {
  background: var(--color-brand);
  color: #fff;
}

/* Post date */
.post-date {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Hide date on homepage/blog card listings */
.home .post-card .post-date,
.blog .post-card .post-date,
.archive .post-card .post-date {
  display: none;
}

/* Keep date visible inside single article */
.single .article-meta-top .post-date,
.single .article-author-bar .post-date {
  display: inline-flex;
  align-items: center;
}

/* Compact post card for related */
.post-card-compact .post-card-content {
  padding: var(--space-4);
}

.post-card-compact .post-card-title {
  font-size: var(--text-lg);
}

/* Responsive grids */
@media (max-width: 768px) {
  .posts-grid,
  .featured-grid {
    grid-template-columns: 1fr;
  }
  
  .related-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-links {
    flex-direction: column;
  }
  
  .nav-prev,
  .nav-next {
    max-width: 100%;
  }
  
  .nav-next {
    text-align: left;
    margin-left: 0;
  }
}

/* ============================================
   11. ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
}

.animate-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

.site-footer { display: none !important; }

.footer-container { display: none !important; }
.site-footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-24);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-16) var(--space-4);
}

.footer-brand {
  max-width: 400px;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-logo .logo-ai {
  color: var(--color-brand);
}

.footer-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-top: var(--space-3);
}

.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.footer-social a {
  font-size: var(--text-lg);
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.footer-social a:hover {
  opacity: 1;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-8);
  margin-top: var(--space-12);
}

.footer-nav-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.footer-nav-list {
  list-style: none;
  padding-left: 0;
}

.footer-nav-list li {
  margin-bottom: var(--space-2);
}

.footer-nav-list a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-nav-list a:hover {
  color: var(--color-brand);
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-copyright,
.footer-team {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

.ai-badge {
  cursor: help;
}

/* Responsive Footer */
@media (min-width: 768px) {
  .footer-container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
  
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ============================================
   ARTICLE STYLES
   ============================================ */

.article-layout {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-4) var(--space-16);
}

.article-header {
  margin-bottom: var(--space-12);
}

.article-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.article-title {
  font-family: var(--font-heading);
  font-size: var(--text-hero-h1);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-brand);
  margin-bottom: var(--space-6);
  transition: color var(--transition-fast);
}

.article-title:hover {
  color: #9D00FF;
}

.article-lead {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-6);
  font-style: italic;
}

.article-author-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-6);
}

.article-author-bar .author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.author-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}

.article-author-bar .author-name {
  font-weight: 500;
  color: var(--color-text);
}

.article-author-bar .reading-time {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.article-hero-image {
  margin: 0 0 var(--space-8);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.article-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Article Content Typography */
.article-content h2 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--color-text);
  margin: var(--space-12) 0 var(--space-4);
  padding-top: var(--space-4);
  border-top: 2px solid var(--color-brand);
}

.article-content h3 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  margin: var(--space-8) 0 var(--space-3);
}

.article-content h4 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: var(--space-6) 0 var(--space-2);
}

.article-content p {
  font-size: var(--text-lg);
  line-height: 1.8;
  margin-bottom: var(--space-5);
  color: var(--color-text);
}

.article-content ul,
.article-content ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-5);
}

.article-content li {
  margin-bottom: var(--space-2);
  line-height: 1.7;
}

.article-content a {
  color: var(--color-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-content a:hover {
  color: var(--color-brand-hover);
}

.article-content blockquote {
  border-left: 4px solid var(--color-brand);
  padding-left: var(--space-5);
  margin: var(--space-8) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--color-brand);
}

.article-content pre {
  background: var(--color-bg-elevated);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--space-5);
}

.article-content pre code {
  background: none;
  padding: 0;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: var(--space-6) 0;
}

/* Article Tags */
.article-tags {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.tags-label {
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-right: var(--space-2);
}

/* Post Navigation */
.post-navigation {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-4);
}

.nav-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .nav-links {
    grid-template-columns: 1fr 1fr;
  }
}

.nav-prev,
.nav-next {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  text-decoration: none;
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.nav-prev:hover,
.nav-next:hover {
  border-color: var(--color-brand);
  background: rgba(99, 102, 241, 0.05);
}

.nav-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.nav-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

/* Related Articles */
.related-articles {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-4);
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card-compact {
  min-height: 0;
}

/* ============================================
   BACK TO HOME BUTTON (Circular Arrow)
   ============================================ */
.back-to-home {
	margin-bottom: var(--space-4);
}

.btn-back-home {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	color: var(--color-text-secondary);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 50%;
	transition: all var(--transition-fast);
	text-decoration: none;
	box-shadow: 0 4px 16px rgba(0,0,0,0.3);
	cursor: pointer;
}

.btn-back-home:hover {
	color: #fff;
	background: var(--color-brand);
	border-color: var(--color-brand);
	box-shadow: 0 0 24px var(--color-brand-glow);
	transform: scale(1.08);
	text-decoration: none;
}

.btn-back-home svg {
	width: 20px;
	height: 20px;
	stroke-width: 2.5px;
}

/* ============================================
   HERO CTA
   ============================================ */
.hero-cta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-4);
	margin-top: var(--space-8);
}

@media (max-width: 480px) {
	.hero-cta {
		flex-direction: column;
		align-items: center;
	}
	.hero-cta .btn {
		width: 100%;
		max-width: 280px;
	}
}

/* ============================================
   FLOATING BACK-TO-TOP BUTTON + SCROLL PROGRESS RING
   ============================================ */
.btn-top {
	position: fixed;
	bottom: var(--space-6);
	right: var(--space-6);
	z-index: 9999;
	width: 48px;
	height: 48px;
	padding: 0;
	background: var(--color-surface);
	border: none;
	border-radius: 50%;
	color: var(--color-text-primary);
	cursor: pointer;
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: transform 400ms ease, box-shadow 400ms ease;
	box-shadow: 0 4px 24px rgba(0,0,0,0.4);
	display: flex;
	align-items: center;
	justify-content: center;
}

.btn-top:hover {
	transform: scale(1.12);
	box-shadow: 0 0 40px var(--color-brand-glow);
}

/* Progress ring */
.btn-top-ring {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
	pointer-events: none;
}

.btn-top-track,
.btn-top-progress {
	fill: none;
	stroke-width: 2.5px;
}

.btn-top-track {
	stroke: var(--color-border);
}

.btn-top-progress {
	stroke: var(--color-brand);
	stroke-linecap: round;
	stroke-dasharray: 138.23;
	stroke-dashoffset: 138.23;
	transition: stroke-dashoffset 100ms linear;
}

/* Arrow icon */
.btn-top-arrow {
	position: relative;
	z-index: 1;
	stroke-width: 2.5px;
}

.btn-top:hover .btn-top-arrow {
	stroke: #fff;
}

@media (max-width: 768px) {
	.btn-top {
		width: 44px;
		height: 44px;
		bottom: var(--space-4);
		right: var(--space-4);
	}
	.btn-top-arrow {
		width: 20px;
		height: 20px;
	}
}

/* ============================================
   HERO CTA BUTTONS (Pill / Round)
   ============================================ */
.btn-hero {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 200px;
	padding: var(--space-3) var(--space-6);
	font-family: var(--font-body);
	font-size: var(--text-base);
	font-weight: 500;
	border-radius: var(--radius-pill);
	border: none;
	cursor: pointer;
	transition: all var(--transition-fast);
	text-align: center;
	white-space: nowrap;
}

.btn-hero-primary {
	background: var(--color-brand);
	color: #fff;
}

.btn-hero-primary:hover {
	filter: brightness(1.1);
	transform: scale(1.02);
	color: #fff;
	box-shadow: 0 0 24px var(--color-brand-glow);
}

.btn-hero-secondary {
	background: transparent;
	color: var(--color-brand);
	border: 1px solid var(--color-brand);
}

.btn-hero-secondary:hover {
	background: var(--color-brand);
	color: #fff;
	box-shadow: 0 0 24px var(--color-brand-glow);
}

@media (max-width: 680px) {
	.btn-hero {
		min-width: 160px;
		padding: var(--space-3) var(--space-4);
		font-size: var(--text-sm);
	}
}

@media (max-width: 480px) {
	.hero-cta {
		flex-direction: column;
		align-items: center;
	}
	.btn-hero {
		width: 100%;
		max-width: 280px;
		min-width: unset;
	}
}

/* ============================================
   INTERNAL ARTICLE LINKS (Perelinkovka)
   ============================================ */
a.internal-link {
	color: var(--color-brand);
	text-decoration: none;
	border-bottom: 1px solid var(--color-brand);
	transition: all var(--transition-fast);
	padding-bottom: 1px;
}

a.internal-link:hover {
	color: var(--color-brand-hover);
	border-bottom-color: var(--color-brand-hover);
	box-shadow: 0 0 12px var(--color-brand-glow);
	background: var(--color-brand-glow);
	border-radius: 2px;
}

/* ============================================
   FOCUS MODE
   ============================================ */
body.focus-mode .site-header,
body.focus-mode .site-footer,
body.focus-mode .widget-area,
body.focus-mode .comments-area,
body.focus-mode .post-navigation,
body.focus-mode .related-posts,
body.focus-mode .search-overlay,
body.focus-mode .header-actions .search-toggle {
	display: none !important;
}

body.focus-mode .site-main {
	max-width: 680px;
	margin: 0 auto;
	padding-top: 2rem;
}

body.focus-mode #floating-nav {
	background: rgba(0,0,0,0.85);
	backdrop-filter: blur(12px);
}

/* Focus mode toggle button */
.focus-toggle {
	position: fixed;
	bottom: var(--space-6);
	left: var(--space-6);
	z-index: 999;
	width: 48px;
	height: 48px;
	border-radius: var(--radius-full);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	color: var(--color-text-secondary);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--transition-fast);
	box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.focus-toggle:hover {
	border-color: var(--color-brand);
	color: var(--color-brand);
	box-shadow: 0 0 16px var(--color-brand-glow);
}

body.focus-mode .focus-toggle {
	background: var(--color-brand);
	color: #000;
	border-color: var(--color-brand);
}

@media (max-width: 768px) {
	.focus-toggle {
		width: 44px;
		height: 44px;
		bottom: var(--space-4);
		left: var(--space-4);
	}
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.reading-progress {
	position: fixed;
	top: 0;
	left: 0;
	width: 0%;
	height: 3px;
	background: linear-gradient(90deg, var(--color-brand) 0%, var(--color-brand-hover) 100%);
	z-index: 10001;
	transition: width 0.1s linear;
	box-shadow: 0 0 8px var(--color-brand-glow);
}

/* ============================================
   FLOATING NAVIGATION (Always Visible)
   ============================================ */
#floating-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9999;
	background: rgba(10,10,15,0.95);
	backdrop-filter: blur(12px);
	border-top: 1px solid var(--color-border);
	padding: var(--space-3) 0;
	transform: translateY(0);
	transition: transform var(--transition-fast);
}

body.focus-mode #floating-nav {
	background: rgba(0,0,0,0.9);
}

.floating-nav-inner {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 0 var(--space-5);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
}

.floating-nav-title {
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--color-text-primary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 300px;
}

.floating-nav-actions {
	display: flex;
	align-items: center;
	gap: var(--space-3);
}

.floating-nav-btn {
	padding: var(--space-2) var(--space-3);
	font-size: var(--text-xs);
	font-weight: 500;
	border-radius: var(--radius-md);
	border: 1px solid var(--color-border);
	background: var(--color-surface);
	color: var(--color-text-secondary);
	cursor: pointer;
	transition: all var(--transition-fast);
	white-space: nowrap;
}

.floating-nav-btn:hover {
	border-color: var(--color-brand);
	color: var(--color-brand);
}

.floating-nav-btn svg {
	width: 16px;
	height: 16px;
	vertical-align: middle;
	margin-right: 4px;
}

@media (max-width: 680px) {
	.floating-nav-title {
		display: none;
	}
	.floating-nav-inner {
		justify-content: center;
	}
}
