/* ============================================
   FanFad.com — Global Stylesheet
   The Cultural Acceleration Radar
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --bg-surface: #16162a;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;
  --accent-primary: #ff3c6f;
  --accent-secondary: #7b2ff7;
  --accent-tertiary: #00d4ff;
  --accent-success: #00e676;
  --accent-warning: #ffab00;
  --accent-danger: #ff1744;
  --gradient-hot: linear-gradient(135deg, #ff3c6f, #ff6b35);
  --gradient-cool: linear-gradient(135deg, #7b2ff7, #00d4ff);
  --gradient-fire: linear-gradient(135deg, #ff1744, #ff9100, #ffea00);
  --gradient-brand: linear-gradient(135deg, #ff3c6f, #7b2ff7);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(255,60,111,0.3);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --max-width: 1280px;
  --header-height: 64px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-tertiary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-primary); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
p { color: var(--text-secondary); max-width: 72ch; }
.text-gradient { background: var(--gradient-brand); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.text-hot { background: var(--gradient-hot); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.text-accent { color: var(--accent-primary); }
.label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }

/* --- Layout --- */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header p { margin: 0.75rem auto 0; }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* --- Header / Navigation --- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--header-height);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background var(--transition-base);
}
.site-header.scrolled { background: rgba(10,10,15,0.95); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.5rem; font-weight: 800; }
.logo span:first-child { color: var(--text-primary); }
.logo span:last-child { background: var(--gradient-brand); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo .pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-primary); animation: pulse 2s infinite; margin-left: 2px; }
.nav-main { display: flex; align-items: center; gap: 0.25rem; }
.nav-main a {
  padding: 0.5rem 0.85rem; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500;
  color: var(--text-secondary); transition: all var(--transition-fast); white-space: nowrap;
}
.nav-main a:hover, .nav-main a.active { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.nav-cta {
  padding: 0.5rem 1.25rem; border-radius: var(--radius-xl); font-weight: 600; font-size: 0.85rem;
  background: var(--gradient-brand); color: #fff !important;
  -webkit-text-fill-color: #fff; transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); color: #fff; }
.mobile-toggle { display: none; flex-direction: column; gap: 5px; padding: 0.5rem; }
.mobile-toggle span { display: block; width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all var(--transition-fast); }
.mobile-nav {
  display: none; position: fixed; top: var(--header-height); left: 0; right: 0; bottom: 0;
  background: var(--bg-primary); padding: 1.5rem; z-index: 999; overflow-y: auto;
}
.mobile-nav.open { display: flex; flex-direction: column; gap: 0.5rem; }
.mobile-nav a {
  display: block; padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  font-size: 1.1rem; color: var(--text-secondary);
}
.mobile-nav a:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

@media (max-width: 900px) {
  .nav-main { display: none; }
  .mobile-toggle { display: flex; }
}

/* --- Hero Section --- */
.hero {
  position: relative; padding: 8rem 0 4rem; text-align: center;
  overflow: hidden; min-height: 70vh; display: flex; align-items: center;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(123,47,247,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 30% 80%, rgba(255,60,111,0.1) 0%, transparent 50%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 1rem; border-radius: var(--radius-xl);
  background: rgba(255,60,111,0.1); border: 1px solid rgba(255,60,111,0.2);
  font-size: 0.8rem; font-weight: 600; color: var(--accent-primary); margin-bottom: 1.5rem;
}
.hero-badge .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-primary); animation: pulse 1.5s infinite; }
.hero h1 { margin-bottom: 1rem; }
.hero p { margin: 0 auto 2rem; font-size: 1.15rem; max-width: 640px; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem; border-radius: var(--radius-xl); font-weight: 600; font-size: 0.95rem;
  transition: all var(--transition-fast); white-space: nowrap;
}
.btn-primary { background: var(--gradient-brand); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); color: #fff; }
.btn-secondary { background: rgba(255,255,255,0.08); color: var(--text-primary); border: 1px solid rgba(255,255,255,0.1); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }
.btn-outline { border: 1px solid var(--accent-primary); color: var(--accent-primary); }
.btn-outline:hover { background: rgba(255,60,111,0.1); color: var(--accent-primary); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.25rem; font-size: 1.05rem; }
.btn-icon { padding: 0.6rem; border-radius: 50%; }

/* --- Cards --- */
.card {
  background: var(--bg-card); border-radius: var(--radius-md); padding: 1.5rem;
  border: 1px solid rgba(255,255,255,0.05); transition: all var(--transition-base);
}
.card:hover { background: var(--bg-card-hover); border-color: rgba(255,255,255,0.1); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-highlight { border-color: rgba(255,60,111,0.3); }
.card-highlight:hover { border-color: rgba(255,60,111,0.5); box-shadow: 0 0 30px rgba(255,60,111,0.1); }

/* --- FanFad Index Table --- */
.index-table { width: 100%; border-collapse: collapse; }
.index-table thead { position: sticky; top: var(--header-height); z-index: 10; }
.index-table th {
  padding: 0.75rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
  background: var(--bg-secondary); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.index-table td {
  padding: 0.85rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle; font-size: 0.95rem;
}
.index-table tbody tr { transition: background var(--transition-fast); }
.index-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.index-rank { font-weight: 700; color: var(--text-muted); font-size: 0.85rem; width: 40px; }
.index-entity { display: flex; align-items: center; gap: 0.75rem; }
.index-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gradient-cool); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; }
.index-name { font-weight: 600; }
.index-category { font-size: 0.8rem; color: var(--text-muted); }
.index-score { font-weight: 700; font-family: var(--font-mono); font-size: 1.1rem; }
.index-score.hot { color: var(--accent-primary); }
.index-score.warm { color: var(--accent-warning); }
.index-score.cool { color: var(--accent-tertiary); }
.index-change { font-weight: 600; font-family: var(--font-mono); font-size: 0.85rem; }
.index-change.up { color: var(--accent-success); }
.index-change.down { color: var(--accent-danger); }
.index-bar { width: 100px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.06); overflow: hidden; }
.index-bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }

/* --- Score Badge --- */
.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%; font-weight: 800; font-size: 1rem;
  font-family: var(--font-mono);
}
.score-badge.fire { background: rgba(255,23,68,0.15); color: var(--accent-danger); border: 2px solid rgba(255,23,68,0.3); }
.score-badge.hot { background: rgba(255,60,111,0.15); color: var(--accent-primary); border: 2px solid rgba(255,60,111,0.3); }
.score-badge.warm { background: rgba(255,171,0,0.15); color: var(--accent-warning); border: 2px solid rgba(255,171,0,0.3); }
.score-badge.cool { background: rgba(0,212,255,0.15); color: var(--accent-tertiary); border: 2px solid rgba(0,212,255,0.3); }

/* --- Lifecycle Stages --- */
.lifecycle { display: flex; align-items: center; gap: 0; width: 100%; position: relative; padding: 2rem 0; }
.lifecycle-stage {
  flex: 1; text-align: center; position: relative; padding: 1rem 0.5rem;
}
.lifecycle-stage::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 3px;
  background: rgba(255,255,255,0.06); z-index: 0;
}
.lifecycle-dot {
  width: 16px; height: 16px; border-radius: 50%; margin: 0 auto 0.5rem;
  position: relative; z-index: 1; border: 2px solid rgba(255,255,255,0.1);
  background: var(--bg-card);
}
.lifecycle-stage.active .lifecycle-dot { background: var(--accent-primary); border-color: var(--accent-primary); box-shadow: 0 0 12px rgba(255,60,111,0.5); }
.lifecycle-stage.passed .lifecycle-dot { background: var(--accent-secondary); border-color: var(--accent-secondary); }
.lifecycle-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.lifecycle-stage.active .lifecycle-label { color: var(--accent-primary); }

/* --- Heat Bar --- */
.heat-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; }
.heat-bar-fill { height: 100%; border-radius: 4px; background: var(--gradient-hot); animation: heatPulse 2s ease-in-out infinite; }

/* --- Spark Indicators --- */
.spark { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; font-weight: 600; }
.spark-icon { font-size: 0.9rem; }
.spark.high { color: var(--accent-danger); }
.spark.medium { color: var(--accent-warning); }
.spark.low { color: var(--accent-tertiary); }

/* --- Category Tags --- */
.tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.75rem; border-radius: var(--radius-xl);
  font-size: 0.75rem; font-weight: 600;
  background: rgba(123,47,247,0.12); color: var(--accent-secondary);
  border: 1px solid rgba(123,47,247,0.2);
}
.tag-hot { background: rgba(255,60,111,0.12); color: var(--accent-primary); border-color: rgba(255,60,111,0.2); }
.tag-cool { background: rgba(0,212,255,0.12); color: var(--accent-tertiary); border-color: rgba(0,212,255,0.2); }
.tag-success { background: rgba(0,230,118,0.12); color: var(--accent-success); border-color: rgba(0,230,118,0.2); }

/* --- Stats Grid --- */
.stat { text-align: center; }
.stat-value { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 800; font-family: var(--font-mono); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

/* --- Breadcrumbs --- */
.breadcrumbs {
  display: flex; align-items: center; gap: 0.5rem; padding: 1rem 0;
  font-size: 0.85rem; color: var(--text-muted); flex-wrap: wrap;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent-tertiary); }
.breadcrumbs .separator { opacity: 0.4; }
.breadcrumbs .current { color: var(--text-secondary); }

/* --- FAQ --- */
.faq-item { border-bottom: 1px solid rgba(255,255,255,0.06); }
.faq-question {
  width: 100%; text-align: left; padding: 1.25rem 0; font-size: 1.05rem; font-weight: 600;
  color: var(--text-primary); display: flex; justify-content: space-between; align-items: center;
  gap: 1rem;
}
.faq-question::after { content: '+'; font-size: 1.5rem; color: var(--text-muted); transition: transform var(--transition-fast); flex-shrink: 0; }
.faq-item.open .faq-question::after { content: '-'; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height var(--transition-slow); }
.faq-answer-inner { padding: 0 0 1.25rem; color: var(--text-secondary); line-height: 1.7; }

/* --- Pricing --- */
.pricing-card { text-align: center; padding: 2.5rem 2rem; }
.pricing-card.featured { border-color: rgba(255,60,111,0.4); position: relative; }
.pricing-card.featured::before {
  content: 'Most Popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  padding: 0.25rem 1rem; border-radius: var(--radius-xl);
  background: var(--gradient-brand); color: #fff; font-size: 0.75rem; font-weight: 700;
}
.pricing-price { font-size: 2.5rem; font-weight: 800; margin: 1rem 0; }
.pricing-price span { font-size: 1rem; color: var(--text-muted); font-weight: 400; }
.pricing-features { text-align: left; margin: 1.5rem 0; display: flex; flex-direction: column; gap: 0.65rem; }
.pricing-features li { display: flex; align-items: flex-start; gap: 0.5rem; color: var(--text-secondary); font-size: 0.95rem; }
.pricing-features li::before { content: '✓'; color: var(--accent-success); font-weight: 700; flex-shrink: 0; }

/* --- Footer --- */
.site-footer {
  background: var(--bg-secondary); border-top: 1px solid rgba(255,255,255,0.06);
  padding: 4rem 0 2rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 3rem; margin-bottom: 3rem; }
.footer-brand p { margin-top: 0.75rem; font-size: 0.9rem; }
.footer-col h4 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-primary); margin-bottom: 1rem; }
.footer-col a { display: block; padding: 0.3rem 0; color: var(--text-muted); font-size: 0.9rem; }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.06); font-size: 0.85rem; color: var(--text-muted); flex-wrap: wrap; gap: 1rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text-primary); }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* --- Heatmap placeholder --- */
.heatmap-container {
  width: 100%; aspect-ratio: 2/1; background: var(--bg-card); border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.05); position: relative; overflow: hidden;
}
.heatmap-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 25% 40%, rgba(255,60,111,0.25) 0%, transparent 30%),
    radial-gradient(circle at 70% 35%, rgba(123,47,247,0.2) 0%, transparent 25%),
    radial-gradient(circle at 50% 60%, rgba(0,212,255,0.15) 0%, transparent 20%),
    radial-gradient(circle at 80% 70%, rgba(255,171,0,0.15) 0%, transparent 20%),
    radial-gradient(circle at 15% 75%, rgba(0,230,118,0.1) 0%, transparent 20%);
}

/* --- Chart placeholder --- */
.chart-container { width: 100%; aspect-ratio: 16/9; background: var(--bg-card); border-radius: var(--radius-md); border: 1px solid rgba(255,255,255,0.05); position: relative; overflow: hidden; min-height: 200px; }
.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 100%; padding: 1.5rem; }
.chart-bar { flex: 1; border-radius: 3px 3px 0 0; transition: height 1s ease; min-width: 4px; }

/* --- Animations --- */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}
@keyframes heatPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes countUp {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(255,60,111,0.3); }
  50% { box-shadow: 0 0 20px rgba(255,60,111,0.5); }
}
.animate-in { animation: fadeInUp 0.6s ease forwards; opacity: 0; }
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* --- Skip to content (A11y) --- */
.skip-link {
  position: absolute; top: -100%; left: 1rem; padding: 0.75rem 1.5rem;
  background: var(--accent-primary); color: #fff; border-radius: var(--radius-sm);
  font-weight: 600; z-index: 9999;
}
.skip-link:focus { top: 1rem; }

/* --- Utility --- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.pt-header { padding-top: var(--header-height); }

/* --- Compare page --- */
.compare-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2rem; align-items: start; }
.compare-vs { font-size: 2rem; font-weight: 800; color: var(--text-muted); padding-top: 2rem; }
@media (max-width: 768px) {
  .compare-grid { grid-template-columns: 1fr; }
  .compare-vs { text-align: center; padding: 0; }
}

/* --- Methodology page --- */
.score-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.score-component { padding: 1.25rem; }
.score-component .score-weight { font-size: 1.5rem; font-weight: 800; font-family: var(--font-mono); }

/* --- Responsive overrides --- */
@media (max-width: 768px) {
  .section { padding: 3rem 0; }
  .hero { padding: 6rem 0 3rem; min-height: 60vh; }
  .hero-actions { flex-direction: column; align-items: center; }
  .index-table { font-size: 0.85rem; }
  .index-table th, .index-table td { padding: 0.6rem 0.5rem; }
}

/* --- Print styles --- */
@media print {
  .site-header, .site-footer, .mobile-toggle, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; background: #fff; }
}
