/* ============================================================
   BestOfKPOP.com — Main Stylesheet
   Mobile-First Design System | Zero Frameworks
   ============================================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Brand Colors */
  --color-primary: #8B5CF6;
  --color-primary-hover: #7C3AED;
  --color-primary-light: #A78BFA;
  --color-secondary: #EC4899;
  --color-secondary-hover: #DB2777;
  --color-accent: #06B6D4;
  --color-accent-hover: #0891B2;
  --color-gold: #F59E0B;
  --color-gold-hover: #D97706;

  /* Gradient Palette */
  --gradient-hero: linear-gradient(135deg, #1a0533 0%, #2d1b69 25%, #6d28d9 50%, #ec4899 75%, #f97316 100%);
  --gradient-card: linear-gradient(135deg, rgba(139,92,246,0.1) 0%, rgba(236,72,153,0.1) 100%);
  --gradient-accent: linear-gradient(135deg, #8B5CF6, #EC4899);
  --gradient-gold: linear-gradient(135deg, #F59E0B, #EF4444);
  --gradient-cyan: linear-gradient(135deg, #06B6D4, #8B5CF6);
  --gradient-surface: linear-gradient(180deg, rgba(139,92,246,0.03) 0%, transparent 100%);

  /* Background Colors */
  --bg-primary: #FAFAFA;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #F5F3FF;
  --bg-elevated: #FFFFFF;
  --bg-overlay: rgba(0,0,0,0.5);
  --bg-glass: rgba(255,255,255,0.7);

  /* Text Colors */
  --text-primary: #1A1A2E;
  --text-secondary: #4A4A68;
  --text-tertiary: #8888A4;
  --text-inverse: #FFFFFF;
  --text-link: #7C3AED;
  --text-link-hover: #6D28D9;

  /* Border Colors */
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --border-focus: #8B5CF6;

  /* Fluid Typography */
  --text-xs:   clamp(0.7rem,  0.65rem + 0.25vw, 0.8rem);
  --text-sm:   clamp(0.8rem,  0.75rem + 0.3vw,  0.9rem);
  --text-base: clamp(0.95rem, 0.9rem  + 0.3vw,  1.1rem);
  --text-lg:   clamp(1.1rem,  1rem    + 0.5vw,  1.35rem);
  --text-xl:   clamp(1.3rem,  1.1rem  + 0.8vw,  1.75rem);
  --text-2xl:  clamp(1.6rem,  1.3rem  + 1.2vw,  2.4rem);
  --text-3xl:  clamp(2rem,    1.5rem  + 2vw,    3.2rem);
  --text-4xl:  clamp(2.5rem,  1.8rem  + 3vw,    4.5rem);

  /* Spacing Scale */
  --space-xs:  clamp(0.25rem, 0.2rem  + 0.2vw,  0.5rem);
  --space-sm:  clamp(0.5rem,  0.4rem  + 0.4vw,  0.75rem);
  --space-md:  clamp(0.75rem, 0.6rem  + 0.6vw,  1.25rem);
  --space-lg:  clamp(1rem,    0.8rem  + 1vw,    2rem);
  --space-xl:  clamp(1.5rem,  1rem    + 2vw,    3rem);
  --space-2xl: clamp(2rem,    1.5rem  + 2.5vw,  4.5rem);
  --space-3xl: clamp(3rem,    2rem    + 3.5vw,  6rem);

  /* Content Widths */
  --content-width:  min(90vw, 1200px);
  --content-narrow: min(90vw, 720px);
  --content-wide:   min(95vw, 1400px);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  --shadow-glow: 0 0 20px rgba(139,92,246,0.3);
  --shadow-glow-pink: 0 0 20px rgba(236,72,153,0.3);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 500;
  --z-modal: 1000;
  --z-toast: 1500;
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0A0A0F;
    --bg-surface: #141420;
    --bg-surface-hover: #1E1E30;
    --bg-elevated: #1A1A2E;
    --bg-overlay: rgba(0,0,0,0.7);
    --bg-glass: rgba(20,20,32,0.8);

    --text-primary: #E8E6E3;
    --text-secondary: #A8A8C0;
    --text-tertiary: #6B6B88;
    --text-link: #A78BFA;
    --text-link-hover: #C4B5FD;

    --border: #2A2A40;
    --border-light: #1E1E30;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.6);

    --gradient-card: linear-gradient(135deg, rgba(139,92,246,0.15) 0%, rgba(236,72,153,0.15) 100%);
    --gradient-surface: linear-gradient(180deg, rgba(139,92,246,0.06) 0%, transparent 100%);
  }
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

a:hover {
  color: var(--text-link-hover);
}

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-primary);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

/* --- Touch Targets (WCAG 2.2) --- */
a, button, [role="button"], summary, input, select, textarea {
  min-height: 44px;
}

button, [role="button"] {
  min-width: 44px;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

/* --- Focus Indicators --- */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Skip Navigation --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: var(--z-toast);
  padding: 12px 24px;
  background: var(--gradient-accent);
  color: #fff;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

/* --- Layout Containers --- */
.container {
  width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-narrow {
  width: var(--content-narrow);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-wide {
  width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* --- Section Spacing --- */
.section {
  padding: var(--space-2xl) 0;
}

.section-lg {
  padding: var(--space-3xl) 0;
}

/* --- Site Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-sm) 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo:hover { color: var(--text-primary); }

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 900;
}

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

/* --- Mobile Navigation --- */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: calc(var(--z-modal) + 1);
  padding: 0;
}

.hamburger {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  position: relative;
  transition: background var(--transition-fast);
}

.hamburger::before, .hamburger::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  left: 0;
  transition: transform var(--transition-base);
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

.nav-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.nav-toggle[aria-expanded="true"] .hamburger::before { transform: rotate(45deg); top: 0; }
.nav-toggle[aria-expanded="true"] .hamburger::after { transform: rotate(-45deg); top: 0; }

.main-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(80vw, 320px);
  height: 100dvh;
  background: var(--bg-surface);
  transition: right 0.3s ease;
  z-index: var(--z-modal);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 80px var(--space-lg) var(--space-lg);
  box-shadow: -5px 0 30px rgba(0,0,0,0.15);
}

.nav-open .main-nav { right: 0; }
.nav-open .nav-overlay { display: block; }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: calc(var(--z-modal) - 1);
}

.main-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.main-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: var(--text-lg);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--bg-surface-hover);
  color: var(--color-primary);
}

.nav-icon {
  font-size: 1.2em;
  width: 28px;
  text-align: center;
}

/* Desktop Navigation */
@media (min-width: 900px) {
  .nav-toggle, .nav-overlay { display: none !important; }
  .main-nav {
    position: static;
    width: auto;
    height: auto;
    background: none;
    padding: 0;
    box-shadow: none;
    overflow: visible;
  }
  .main-nav ul {
    flex-direction: row;
    gap: var(--space-xs);
  }
  .main-nav a {
    font-size: var(--text-sm);
    padding: 8px 14px;
    font-weight: 600;
  }
}

/* --- Site Footer --- */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: var(--space-2xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-section h3 {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}

.footer-section a {
  display: block;
  color: var(--text-secondary);
  padding: 6px 0;
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

@media (min-width: 600px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* --- Hero Section --- */
.hero {
  position: relative;
  background: var(--gradient-hero);
  color: white;
  padding: var(--space-2xl) 0 var(--space-3xl);
  overflow: hidden;
  min-height: 50vh;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(139,92,246,0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(236,72,153,0.3) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(6,182,212,0.2) 0%, transparent 50%);
  animation: heroShimmer 8s ease-in-out infinite alternate;
}

@keyframes heroShimmer {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 2;
  width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.hero h1 {
  font-size: var(--text-4xl);
  color: white;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero p {
  font-size: var(--text-lg);
  opacity: 0.9;
  max-width: 600px;
  margin-bottom: var(--space-lg);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-lg);
  border: 1px solid rgba(255,255,255,0.2);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all var(--transition-base);
  text-decoration: none;
  min-height: 44px;
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(139,92,246,0.4);
  color: white;
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* --- Cards --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-link:hover { color: inherit; }

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 600px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

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

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

/* --- Pillar Cards --- */
.pillar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.pillar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-accent);
  transform: scaleX(0);
  transition: transform var(--transition-base);
  transform-origin: left;
}

.pillar-card .pillar-icon {
  font-size: 2.5em;
  margin-bottom: var(--space-md);
  display: block;
}

.pillar-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.pillar-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

/* --- Ranking Item --- */
.ranking-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.rank-number {
  font-size: var(--text-2xl);
  font-weight: 900;
  min-width: 48px;
  text-align: center;
  line-height: 1;
}

.rank-1 .rank-number { background: var(--gradient-gold); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rank-2 .rank-number { color: #94A3B8; }
.rank-3 .rank-number { color: #CD7F32; }

.ranking-info h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.ranking-info p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 0;
}

.ranking-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Score Badge */
.score-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: var(--text-lg);
  color: white;
  flex-shrink: 0;
}

.score-high { background: var(--gradient-accent); box-shadow: var(--shadow-glow); }
.score-mid { background: var(--gradient-cyan); }
.score-low { background: linear-gradient(135deg, #64748B, #475569); }

/* --- Tag / Badge --- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
}

.tag-primary {
  background: rgba(139,92,246,0.1);
  color: var(--color-primary);
}

.tag-secondary {
  background: rgba(236,72,153,0.1);
  color: var(--color-secondary);
}

.tag-accent {
  background: rgba(6,182,212,0.1);
  color: var(--color-accent);
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: var(--space-md) 0;
  font-size: var(--text-sm);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.breadcrumbs li + li::before {
  content: '\203A';
  color: var(--text-tertiary);
  font-size: 1.2em;
}

.breadcrumbs a {
  color: var(--text-secondary);
  font-weight: 500;
}

.breadcrumbs a:hover { color: var(--color-primary); }

.breadcrumbs [aria-current="page"] {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Key Takeaways (AEO) --- */
.key-takeaways {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
}

.key-takeaways h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.key-takeaways p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- FAQ Section --- */
.faq {
  padding: var(--space-xl) 0;
}

.faq h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-lg);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  padding: var(--space-md) 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--text-base);
  color: var(--text-primary);
  min-height: 44px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.5em;
  color: var(--color-primary);
  transition: transform var(--transition-base);
  flex-shrink: 0;
  line-height: 1;
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-answer {
  padding: 0 0 var(--space-md);
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: var(--text-base);
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-btn {
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  white-space: nowrap;
  transition: all var(--transition-fast);
  cursor: pointer;
  min-height: 44px;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--color-primary);
  background: rgba(139,92,246,0.1);
  color: var(--color-primary);
}

/* --- Scroll Strip --- */
.scroll-strip {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-sm) 0;
  scrollbar-width: none;
}

.scroll-strip::-webkit-scrollbar { display: none; }

.scroll-strip > * {
  scroll-snap-align: start;
  flex-shrink: 0;
  width: min(80vw, 300px);
}

/* --- Trending Strip --- */
.trending-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  min-width: min(75vw, 280px);
  transition: all var(--transition-base);
}

.trending-card .trending-rank {
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trending-card h3 {
  font-size: var(--text-lg);
  margin: var(--space-xs) 0;
}

.trending-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* --- Calendar Styles --- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calendar-header {
  background: var(--bg-elevated);
  padding: var(--space-sm);
  text-align: center;
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.calendar-day {
  background: var(--bg-surface);
  padding: var(--space-sm);
  min-height: 60px;
  font-size: var(--text-xs);
}

.calendar-day-number {
  font-weight: 600;
  margin-bottom: 4px;
}

.calendar-event {
  background: rgba(139,92,246,0.1);
  color: var(--color-primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 600;
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 12px 20px;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 44px;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content { display: none; padding: var(--space-lg) 0; }
.tab-content.active { display: block; }

/* --- Newsletter Signup --- */
.newsletter {
  background: var(--gradient-hero);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.newsletter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.newsletter-content {
  position: relative;
  z-index: 2;
}

.newsletter h2 {
  color: white;
  margin-bottom: var(--space-sm);
}

.newsletter p {
  opacity: 0.9;
  margin-bottom: var(--space-lg);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 440px;
  margin: 0 auto;
}

.newsletter-form input[type="email"] {
  padding: 14px 20px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: var(--text-base);
  backdrop-filter: blur(10px);
  min-height: 44px;
}

.newsletter-form input[type="email"]::placeholder { color: rgba(255,255,255,0.6); }

.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: white;
  background: rgba(255,255,255,0.2);
}

@media (min-width: 600px) {
  .newsletter-form {
    flex-direction: row;
  }
  .newsletter-form input[type="email"] { flex: 1; }
}

/* --- Table of Contents --- */
.toc {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
}

.toc h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-md);
}

.toc ol {
  list-style: decimal;
  padding-left: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.toc a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: block;
  padding: 4px 0;
}

.toc a:hover { color: var(--color-primary); }

@media (min-width: 900px) {
  .toc-sticky {
    position: sticky;
    top: 80px;
  }
}

/* --- Author Bio (E-E-A-T) --- */
.author-bio {
  display: flex;
  gap: var(--space-md);
  align-items: start;
  padding: var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: var(--space-lg) 0;
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: var(--text-lg);
}

.author-info h3 { font-size: var(--text-base); margin-bottom: 2px; }
.author-info .author-role { font-size: var(--text-sm); color: var(--text-tertiary); margin-bottom: var(--space-xs); }
.author-info p { font-size: var(--text-sm); color: var(--text-secondary); }

/* --- Cross-Pillar Links --- */
.related-pillars {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-xl);
}

.related-pillars h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-lg);
}

/* --- Countdown / Timeline --- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.timeline-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: var(--space-md);
  position: relative;
}

.timeline-date {
  text-align: center;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-primary);
}

.timeline-date .day { font-size: var(--text-2xl); display: block; }
.timeline-date .month { font-size: var(--text-xs); text-transform: uppercase; }

.timeline-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

/* --- Voting / Progress Bar --- */
.vote-bar {
  margin: var(--space-sm) 0;
}

.vote-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.vote-bar-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

.vote-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  margin-bottom: 4px;
}

/* --- Scroll Reveal Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* --- Device-Specific Interactions --- */
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
  .card:hover::before { opacity: 1; }
  .pillar-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-xl); }
  .pillar-card:hover::before { transform: scaleX(1); }
  .ranking-item:hover { border-color: var(--color-primary); box-shadow: var(--shadow-glow); }
  .trending-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
  a:hover { color: var(--text-link-hover); }
}

@media (hover: none) {
  .card:active { transform: scale(0.98); }
  .pillar-card:active { transform: scale(0.97); }
  .ranking-item:active { background: var(--bg-surface-hover); }
  .trending-card:active { transform: scale(0.98); }
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xl) 0;
}

.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.pagination a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination .active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

/* --- Glossary --- */
.glossary-term {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}

.glossary-term dt {
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.glossary-term dd {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Search Overlay --- */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: var(--z-modal);
  align-items: start;
  justify-content: center;
  padding: 10vh var(--space-md) var(--space-md);
}

.search-overlay.active { display: flex; }

.search-box {
  width: min(90vw, 600px);
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-xl);
}

.search-input {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-lg);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 44px;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* --- Article Content --- */
.article-content {
  max-width: var(--content-narrow);
  margin: 0 auto;
}

.article-content h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  padding-top: var(--space-lg);
}

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

.article-content p {
  margin-bottom: var(--space-md);
  line-height: 1.8;
}

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

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

.article-content ul li { list-style: disc; }
.article-content ol li { list-style: decimal; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

/* --- Comparison Table --- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  font-size: var(--text-sm);
}

.comparison-table th, .comparison-table td {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  text-align: left;
}

.comparison-table th {
  background: var(--bg-elevated);
  font-weight: 700;
  white-space: nowrap;
}

.comparison-table tr:hover td { background: var(--bg-surface-hover); }

/* Responsive table wrapper */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-lg) 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* --- Methodology Section --- */
.methodology {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
}

.methodology h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
}

.methodology p { line-height: 1.8; }

/* --- Page Hero Image --- */
.hero-image {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: var(--space-lg) auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

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

.hero-image figcaption {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-align: center;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-surface);
}

/* --- Inline Illustration --- */
.illustration {
  margin: var(--space-xl) auto;
  text-align: center;
  max-width: 100%;
}

.illustration svg {
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.illustration figcaption {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}

/* --- Sources & Citations --- */
.sources {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
}

.sources h2,
.sources h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-primary);
}

.sources ul {
  padding-left: var(--space-lg);
}

.sources li {
  list-style: disc;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-xs);
}

.sources li a {
  color: var(--text-link);
}

.sources li a:hover {
  color: var(--text-link-hover);
}

.sources .sources-updated {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.sources cite {
  font-style: normal;
  font-weight: 600;
}

/* --- Data Attribution Banner --- */
.data-attribution {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-md);
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.data-attribution strong {
  color: var(--text-primary);
}

/* --- Ranking Card Image Placeholder --- */
.ranking-item .group-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--text-sm);
  color: white;
}

/* --- Print Styles --- */
@media print {
  .site-header, .site-footer, .nav-toggle, .nav-overlay,
  .newsletter, .filter-bar, .btn, .search-overlay { display: none !important; }

  body { font-size: 12pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
  .hero { background: #f0f0f0 !important; color: #000; }
  .hero h1 { color: #000; text-shadow: none; }
  .card { border: 1px solid #ddd; box-shadow: none; }
}
