/* ===== DESIGN TOKENS ===== */
:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Fonts */
  --font-display: 'Clash Display', 'Arial Black', sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', sans-serif;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* ===== LIGHT MODE (default) ===== */
:root, [data-theme="light"] {
  --color-bg: #faf9f7;
  --color-surface: #ffffff;
  --color-surface-2: #f5f3f0;
  --color-border: #e2dfda;
  --color-divider: #ebe8e4;

  --color-text: #1a1714;
  --color-text-muted: #6b6560;
  --color-text-faint: #a8a29e;

  --color-flame: #d94a1a;
  --color-flame-inner: #f59e0b;
  --color-flame-bg: #fef3ec;

  --color-tag-bg: #fde8db;
  --color-tag-text: #9a3412;

  --shadow-sm: 0 1px 2px rgba(26, 23, 20, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 23, 20, 0.08);
  --shadow-lg: 0 12px 32px rgba(26, 23, 20, 0.1);
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --color-bg: #141210;
  --color-surface: #1c1a17;
  --color-surface-2: #242220;
  --color-border: #333130;
  --color-divider: #2a2826;

  --color-text: #e8e5e1;
  --color-text-muted: #8a8580;
  --color-text-faint: #5c5855;

  --color-flame: #ef6c3a;
  --color-flame-inner: #fbbf24;
  --color-flame-bg: #2a1c14;

  --color-tag-bg: #3d2215;
  --color-tag-text: #f4a261;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #141210;
    --color-surface: #1c1a17;
    --color-surface-2: #242220;
    --color-border: #333130;
    --color-divider: #2a2826;
    --color-text: #e8e5e1;
    --color-text-muted: #8a8580;
    --color-text-faint: #5c5855;
    --color-flame: #ef6c3a;
    --color-flame-inner: #fbbf24;
    --color-flame-bg: #2a1c14;
    --color-tag-bg: #3d2215;
    --color-tag-text: #f4a261;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  }
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
}

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

.logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.logo-icon {
  flex-shrink: 0;
  width: auto;
  height: 52px;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-tagline {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
  display: none;
}

@media (min-width: 640px) {
  .nav-tagline { display: block; }
}

.theme-toggle {
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

/* ===== HERO ===== */
.hero {
  padding: clamp(var(--space-16), 8vw, var(--space-24)) var(--space-6);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-flame {
  position: absolute;
  right: -20px;
  top: -40px;
  opacity: 0.4;
  pointer-events: none;
}

@media (min-width: 768px) {
  .hero-flame { opacity: 0.2; right: 40px; top: -60px; }
  .hero-flame svg { width: 200px; height: 260px; }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: var(--space-6);
  max-width: 16ch;
}

.hero-sub {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-bottom: var(--space-10);
  line-height: 1.7;
}
.hero-sub strong {
  color: var(--color-text);
  font-weight: 600;
}

.hero-stats {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  color: var(--color-flame);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface-2);
  padding: var(--space-4) var(--space-6);
}

.filter-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.filter-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.year-pills {
  display: flex;
  gap: var(--space-2);
}

.pill {
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.pill:hover {
  color: var(--color-text);
  border-color: var(--color-text-faint);
}
.pill.active {
  background: var(--color-flame);
  color: #fff;
  border-color: var(--color-flame);
}

/* ===== TIMELINE ===== */
.timeline-section {
  padding: var(--space-12) var(--space-6);
}

.timeline-container {
  max-width: var(--content-default);
  margin: 0 auto;
  position: relative;
}

/* Vertical line */
.timeline-container::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-divider);
}

@media (min-width: 768px) {
  .timeline-container::before {
    left: 40px;
  }
}

/* Year divider */
.timeline-year {
  position: relative;
  padding-left: 60px;
  margin-bottom: var(--space-8);
  margin-top: var(--space-10);
}

.timeline-year:first-child {
  margin-top: 0;
}

@media (min-width: 768px) {
  .timeline-year { padding-left: 90px; }
}

.timeline-year::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-flame);
  border: 3px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-flame);
}

@media (min-width: 768px) {
  .timeline-year::before { left: 32px; }
}

.timeline-year h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--color-flame);
  letter-spacing: -0.02em;
}

/* Entry card */
.timeline-entry {
  position: relative;
  padding-left: 60px;
  margin-bottom: var(--space-8);
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.4s ease forwards;
}

@media (min-width: 768px) {
  .timeline-entry { padding-left: 90px; }
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 24px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2.5px solid var(--color-flame);
}

@media (min-width: 768px) {
  .timeline-entry::before { left: 35px; }
}

.entry-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}

.entry-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.entry-date {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.entry-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
  line-height: 1.25;
}

.entry-body {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.entry-quote {
  border-left: 3px solid var(--color-flame);
  padding-left: var(--space-4);
  margin: var(--space-4) 0;
  font-style: italic;
  color: var(--color-text);
  font-size: var(--text-base);
  line-height: 1.65;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.tag {
  font-size: var(--text-xs);
  padding: 2px var(--space-3);
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  border-radius: var(--radius-full);
  font-weight: 500;
}

.entry-sources {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
}

.source-link {
  font-size: var(--text-xs);
  color: var(--color-flame);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-flame-bg);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.source-link:hover {
  text-decoration: underline;
}
.source-link::before {
  content: '→';
  font-size: 0.7em;
}

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

/* Stagger the animation */
.timeline-entry:nth-child(1) { animation-delay: 0ms; }
.timeline-entry:nth-child(2) { animation-delay: 60ms; }
.timeline-entry:nth-child(3) { animation-delay: 120ms; }
.timeline-entry:nth-child(4) { animation-delay: 180ms; }
.timeline-entry:nth-child(5) { animation-delay: 240ms; }
.timeline-entry:nth-child(6) { animation-delay: 300ms; }
.timeline-entry:nth-child(7) { animation-delay: 360ms; }
.timeline-entry:nth-child(8) { animation-delay: 420ms; }
.timeline-entry:nth-child(9) { animation-delay: 480ms; }
.timeline-entry:nth-child(10) { animation-delay: 540ms; }

/* ===== METHODOLOGY ===== */
.methodology {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-6);
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-divider);
}

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

.methodology h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-8);
}

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

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

.method-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.method-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  color: var(--color-flame);
  opacity: 0.3;
  line-height: 1;
  display: block;
  margin-bottom: var(--space-3);
}

.method-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}

.method-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ===== FOOTER ===== */
.site-footer {
  padding: var(--space-10) var(--space-6);
  border-top: 1px solid var(--color-divider);
}

.footer-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  text-align: center;
}

.footer-disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.footer-attr a {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
}
.footer-attr a:hover {
  color: var(--color-text-muted);
  text-decoration: underline;
}

/* ===== NO RESULTS ===== */
.no-results {
  text-align: center;
  padding: var(--space-16) 0;
  color: var(--color-text-muted);
  font-size: var(--text-base);
}
