/* style.css — FTC Archive Design Tokens & Component Styles */

/* ═══════════════════════ DESIGN TOKENS ═══════════════════════ */
:root {
  --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.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.125rem, 0.95rem + 0.85vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1rem    + 1.5vw,  2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  --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;

  --font-display: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;

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

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --content-narrow: 640px; --content-default: 960px; --content-wide: 1200px;
}

/* ═══════════════════════ LIGHT MODE ═══════════════════════ */
:root, [data-theme="light"] {
  --color-bg:               #f6f6f6;
  --color-surface:          #ffffff;
  --color-surface-2:        #f1f3f4;
  --color-surface-offset:   #e8ecf0;
  --color-surface-offset-2: #dce2eb;
  --color-surface-dynamic:  #d0d8e4;
  --color-divider:          #dce2eb;
  --color-border:           #bfc9da;
  --color-text:             #1a1a2e;
  --color-text-muted:       #5a6577;
  --color-text-faint:       #9bacc0;
  --color-text-inverse:     #ffffff;
  --color-primary:          #26539c;
  --color-primary-hover:    #1d4080;
  --color-primary-active:   #162f5e;
  --color-primary-highlight: #e0e8f4;
  --color-primary-light:    #9bacc0;
  --color-accent-red:       #b95360;
  --color-accent-red-highlight: #f4e0e3;
  --shadow-sm: 0 1px 2px rgba(26,26,46,0.06);
  --shadow-md: 0 4px 12px rgba(26,26,46,0.08);
  --shadow-lg: 0 12px 32px rgba(26,26,46,0.12);
}

/* ═══════════════════════ DARK MODE ═══════════════════════ */
[data-theme="dark"] {
  --color-bg:               #0d1b2a;
  --color-surface:          #132238;
  --color-surface-2:        #1a2d47;
  --color-surface-offset:   #1e3452;
  --color-surface-offset-2: #243b5c;
  --color-surface-dynamic:  #2a4468;
  --color-divider:          #1e3452;
  --color-border:           #2a4468;
  --color-text:             #e0e6ed;
  --color-text-muted:       #9bacc0;
  --color-text-faint:       #5a6f8a;
  --color-text-inverse:     #0d1b2a;
  --color-primary:          #5b8fd4;
  --color-primary-hover:    #7aa5e0;
  --color-primary-active:   #3d73b8;
  --color-primary-highlight: #1e3452;
  --color-primary-light:    #5a6f8a;
  --color-accent-red:       #d4717e;
  --color-accent-red-highlight: #2a1e22;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px 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: #0d1b2a; --color-surface: #132238;
    --color-surface-2: #1a2d47; --color-surface-offset: #1e3452;
    --color-text: #e0e6ed; --color-text-muted: #9bacc0;
    --color-text-faint: #5a6f8a; --color-text-inverse: #0d1b2a;
    --color-primary: #5b8fd4; --color-primary-hover: #7aa5e0;
    --color-divider: #1e3452; --color-border: #2a4468;
    --color-primary-highlight: #1e3452;
  }
}

/* ═══════════════════════ LAYOUT ═══════════════════════ */
.container { max-width: var(--content-wide); margin: 0 auto; padding: 0 var(--space-6); }
.container-narrow { max-width: var(--content-default); margin: 0 auto; padding: 0 var(--space-6); }

/* ═══════════════════════ HEADER / NAV ═══════════════════════ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,246,246,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
  transition: box-shadow 0.3s cubic-bezier(0.16,1,0.3,1);
}
[data-theme="dark"] .site-header { background: rgba(13,27,42,0.92); }
.site-header.scrolled { box-shadow: var(--shadow-sm); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  max-width: var(--content-wide); margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.logo svg { width: 32px; height: 32px; }
.logo-icon { height: 22px; width: auto; object-fit: contain; }
[data-theme="dark"] .logo-icon { filter: invert(1); }
.logo-text {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-sm); letter-spacing: 0.06em; text-transform: uppercase;
}

.nav-links {
  display: flex; align-items: center; gap: var(--space-1);
  list-style: none;
}
.nav-links a {
  display: block; padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs); font-weight: 500;
  color: var(--color-text-muted); border-radius: var(--radius-md);
  transition: all var(--transition-interactive);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--color-text); background: var(--color-surface-2);
}
.nav-links a.active { color: var(--color-primary); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: var(--space-2); }
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-md);
  color: var(--color-text-muted); transition: all var(--transition-interactive);
}
.theme-toggle:hover { background: var(--color-surface-2); color: var(--color-text); }

.mobile-menu-btn {
  display: none; width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border-radius: var(--radius-md); color: var(--color-text-muted);
}

/* ═══════════════════════ PAGES ═══════════════════════ */
.page { display: none; }
.page.active { display: block; }

/* ═══════════════════════ HERO ═══════════════════════ */
.hero {
  padding: clamp(var(--space-10), 6vw, var(--space-20)) var(--space-6) clamp(var(--space-4), 3vw, var(--space-8));
  text-align: center; position: relative; overflow: hidden;
}
.hero-tagline {
  font-family: var(--font-serif); font-size: var(--text-2xl);
  font-weight: 400; line-height: 1.2; color: var(--color-text);
  margin-bottom: var(--space-4); max-width: 720px; margin-inline: auto;
}
.hero-sub {
  font-size: var(--text-sm); color: var(--color-text-muted);
  max-width: 520px; margin-inline: auto; margin-bottom: var(--space-8);
}

.hero-counters {
  display: flex; justify-content: center; gap: var(--space-10);
  flex-wrap: wrap; margin-bottom: var(--space-10);
}
.counter-item { text-align: center; }
.counter-value {
  font-family: var(--font-display); font-size: var(--text-xl);
  font-weight: 700; color: var(--color-primary);
  font-variant-numeric: tabular-nums lining-nums;
}
.counter-label {
  font-size: var(--text-xs); color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-top: var(--space-1);
}

/* Timeline sparkline */
.sparkline-container {
  max-width: 600px; margin: 0 auto var(--space-4);
  height: 60px; position: relative;
}
.sparkline-container canvas { width: 100% !important; height: 100% !important; }

/* ═══════════════════════ HOME SECTIONS ═══════════════════════ */
.home-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-8); margin-bottom: var(--space-12);
}

.section-heading {
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: 700; margin-bottom: var(--space-4);
}
.section-overline {
  font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--color-primary); margin-bottom: var(--space-2);
}

/* This Week Widget */
.this-week-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);
}
.this-week-list { list-style: none; }
.this-week-item {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}
.this-week-item:last-child { border-bottom: none; }
.this-week-item a {
  font-size: var(--text-sm); color: var(--color-text);
  transition: color var(--transition-interactive);
}
.this-week-item a:hover { color: var(--color-primary); }
.this-week-meta {
  font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-1);
}

/* Editorial Preview */
.editorial-preview {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.editorial-preview-title {
  font-family: var(--font-serif); font-size: var(--text-lg);
  font-weight: 600; margin-bottom: var(--space-3);
  cursor: pointer; transition: color var(--transition-interactive);
}
.editorial-preview-title:hover { color: var(--color-primary); }
.editorial-preview-text {
  font-family: var(--font-serif); font-size: var(--text-sm);
  line-height: 1.7; color: var(--color-text-muted);
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical;
  overflow: hidden;
}
.editorial-preview-date {
  font-size: var(--text-xs); color: var(--color-text-faint);
  margin-bottom: var(--space-2);
}
.editorial-preview-gif {
  margin: calc(-1 * var(--space-6)); margin-bottom: var(--space-4);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden; background: var(--color-surface-2);
}
.editorial-preview-gif img {
  width: 100%; display: block;
  max-height: 360px; object-fit: contain;
}

/* Collections grid */
.collections-shortcuts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3); margin-bottom: var(--space-12);
}
.collection-shortcut {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5);
  cursor: pointer; transition: all var(--transition-interactive);
  text-align: center;
}
.collection-shortcut:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md); transform: translateY(-1px);
}
.collection-shortcut-name {
  font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-1);
}
.collection-shortcut-count {
  font-size: var(--text-xs); color: var(--color-text-faint);
}

/* ═══════════════════════ EXPLORE ═══════════════════════ */
.explore-header {
  padding: var(--space-8) 0 var(--space-6);
}
.search-bar {
  position: relative; max-width: 640px; margin-bottom: var(--space-6);
}
.search-input {
  width: 100%; padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); font-size: var(--text-sm);
  transition: border-color var(--transition-interactive);
}
.search-input:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(38,83,156,0.12);
}
.search-icon {
  position: absolute; left: var(--space-3); top: 50%;
  transform: translateY(-50%); color: var(--color-text-faint);
}
.search-count {
  font-size: var(--text-xs); color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}

/* Filters */
.filters-row {
  display: flex; gap: var(--space-4); align-items: flex-start;
  flex-wrap: wrap; margin-bottom: var(--space-6);
}
.filter-group label {
  display: block; font-size: var(--text-xs); font-weight: 500;
  color: var(--color-text-muted); margin-bottom: var(--space-1);
}
.filter-select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); font-size: var(--text-xs);
  color: var(--color-text);
}

.tag-facets {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  margin-bottom: var(--space-6); max-height: 120px; overflow-y: auto;
}
.tag-chip {
  display: inline-flex; align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs); font-weight: 500;
  border-radius: var(--radius-full); cursor: pointer;
  background: var(--color-surface-2); color: var(--color-text-muted);
  border: 1px solid transparent;
  transition: all var(--transition-interactive);
}
.tag-chip:hover { border-color: var(--color-primary); color: var(--color-text); }
.tag-chip.active {
  background: var(--color-primary); color: var(--color-text-inverse);
  border-color: var(--color-primary);
}
.tag-chip-count {
  margin-left: var(--space-1); opacity: 0.6;
}

/* Post results */
.results-grid {
  display: grid; gap: var(--space-3);
}
.post-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5);
  transition: all var(--transition-interactive);
}
.post-card:hover { border-color: var(--color-primary-light); box-shadow: var(--shadow-sm); }
.post-card-title {
  font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-1);
}
.post-card-title a {
  color: var(--color-text);
  transition: color var(--transition-interactive);
}
.post-card-title a:hover { color: var(--color-primary); }
.post-card-meta {
  font-size: var(--text-xs); color: var(--color-text-faint);
  display: flex; gap: var(--space-3); flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.post-card-snippet {
  font-size: var(--text-xs); color: var(--color-text-muted);
  line-height: 1.5; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-tags {
  display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2);
}
.post-card-tags .mini-tag {
  font-size: 0.65rem; padding: 1px 6px;
  border-radius: var(--radius-full); background: var(--color-surface-2);
  color: var(--color-text-faint);
}

.load-more-btn {
  display: block; margin: var(--space-6) auto;
  padding: var(--space-2) var(--space-8);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500;
  color: var(--color-text-muted); background: var(--color-surface);
  transition: all var(--transition-interactive);
}
.load-more-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ═══════════════════════ EDITORIALS ═══════════════════════ */
.editorial-grid { display: grid; gap: var(--space-4); }
.editorial-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: all var(--transition-interactive);
}
.editorial-card-header { cursor: pointer; }
.editorial-card-title {
  font-family: var(--font-serif); font-size: var(--text-base);
  font-weight: 600; margin-bottom: var(--space-2);
  transition: color var(--transition-interactive);
}
.editorial-card-header:hover .editorial-card-title { color: var(--color-primary); }
.editorial-card-date {
  font-size: var(--text-xs); color: var(--color-text-faint);
}
.editorial-card-stats {
  font-size: var(--text-xs); color: var(--color-text-faint);
  display: flex; gap: var(--space-4);
}
.editorial-card-body {
  font-family: var(--font-serif); font-size: var(--text-sm);
  line-height: 1.75; color: var(--color-text-muted);
  margin-top: var(--space-4); padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
  display: none; max-width: 65ch;
}
.editorial-card.expanded .editorial-card-body { display: block; }
.editorial-card-expand {
  font-size: var(--text-xs); color: var(--color-primary);
  margin-top: var(--space-2); cursor: pointer; display: inline-block;
}
.editorial-card-gif {
  margin: calc(-1 * var(--space-6)); margin-bottom: var(--space-4);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden; background: var(--color-surface-2);
}
.editorial-card-gif img {
  width: 100%; height: auto; display: block;
  object-fit: contain; max-height: 480px;
}

/* ═══════════════════════ COLLECTIONS ═══════════════════════ */
.collections-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
.collection-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: all var(--transition-interactive);
}
.collection-card:hover { box-shadow: var(--shadow-md); }
.collection-card-header {
  padding: var(--space-5) var(--space-6);
  background: var(--color-primary); color: var(--color-text-inverse);
  cursor: pointer;
}
.collection-card-name {
  font-size: var(--text-lg); font-weight: 700;
}
.collection-card-count {
  font-size: var(--text-xs); opacity: 0.8; margin-top: var(--space-1);
}
.collection-card-timeline {
  padding: var(--space-3) var(--space-6); height: 48px;
  background: var(--color-surface-2);
}
.collection-card-posts {
  padding: var(--space-4) var(--space-6);
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16,1,0.3,1);
}
.collection-card.expanded { grid-column: 1 / -1; }
.collection-card.expanded .collection-card-posts { max-height: 600px; overflow-y: auto; }
.collection-post-item {
  padding: var(--space-2) 0; border-bottom: 1px solid var(--color-divider);
}
.collection-post-item:last-child { border-bottom: none; }
.collection-post-item a {
  font-size: var(--text-xs); color: var(--color-text);
  transition: color var(--transition-interactive);
}
.collection-post-item a:hover { color: var(--color-primary); }
.collection-post-date { font-size: 0.65rem; color: var(--color-text-faint); margin-left: var(--space-2); }

/* ═══════════════════════ TRENDS ═══════════════════════ */
.trends-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}
.chart-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);
}
.chart-card-full { grid-column: 1 / -1; }
.chart-title {
  font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-4);
}
.chart-container { position: relative; height: 300px; }
.chart-container canvas { width: 100% !important; height: 100% !important; }

/* ═══════════════════════ NEWSLETTERS ═══════════════════════ */
.newsletter-table-wrap {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.newsletter-table {
  font-size: var(--text-xs); width: 100%;
}
.newsletter-table th {
  text-align: left; padding: var(--space-3) var(--space-4);
  font-weight: 600; color: var(--color-text-muted);
  background: var(--color-surface-2); border-bottom: 1px solid var(--color-divider);
  white-space: nowrap; cursor: pointer;
  transition: color var(--transition-interactive);
}
.newsletter-table th:hover { color: var(--color-primary); }
.newsletter-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  font-variant-numeric: tabular-nums lining-nums;
  vertical-align: middle;
}
.newsletter-table tr:last-child td { border-bottom: none; }
.newsletter-table tr:hover td { background: var(--color-surface-2); }
.newsletter-subject {
  font-weight: 500; color: var(--color-text);
  max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.newsletter-subject a { transition: color var(--transition-interactive); }
.newsletter-subject a:hover { color: var(--color-primary); }
.sparkline-cell { width: 80px; }
.sparkline-cell canvas { display: inline-block; vertical-align: middle; }

/* ═══════════════════════ LOADING STATE ═══════════════════════ */
.loading-overlay {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: var(--space-20) 0; gap: var(--space-4);
}
.loading-spinner {
  width: 32px; height: 32px; border: 3px solid var(--color-divider);
  border-top-color: var(--color-primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: var(--text-sm); color: var(--color-text-muted);
}

/* ═══════════════════════ PAGINATION ═══════════════════════ */
.pagination {
  display: flex; justify-content: center; gap: var(--space-2);
  margin-top: var(--space-6);
}
.pagination button {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs); border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text-muted); transition: all var(--transition-interactive);
}
.pagination button:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination button.active {
  background: var(--color-primary); color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

/* ═══════════════════════ FOOTER ═══════════════════════ */
.site-footer {
  padding: var(--space-8) var(--space-6);
  border-top: 1px solid var(--color-divider);
  text-align: center; margin-top: var(--space-16);
}
.site-footer p {
  font-size: var(--text-xs); color: var(--color-text-faint);
  margin: 0 auto;
}
.site-footer a {
  color: var(--color-text-faint);
  transition: color var(--transition-interactive);
}
.site-footer a:hover { color: var(--color-primary); }
.footer-brand { margin-bottom: var(--space-2) !important; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-1); }
.footer-sep { margin: 0 var(--space-1); opacity: 0.5; }

/* ═══════════════════════ EMPTY / NO RESULTS ═══════════════════════ */
.empty-state {
  text-align: center; padding: var(--space-12) 0;
  color: var(--color-text-muted);
}
.empty-state p { margin: 0 auto; font-size: var(--text-sm); }

/* ═══════════════════════ RESPONSIVE ═══════════════════════ */
@media (max-width: 768px) {
  .home-grid { grid-template-columns: 1fr; }
  .collections-shortcuts { grid-template-columns: repeat(2, 1fr); }
  .collections-grid { grid-template-columns: 1fr; }
  .trends-grid { grid-template-columns: 1fr; }
  .hero-counters { gap: var(--space-6); }
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-surface); border-bottom: 1px solid var(--color-divider);
    padding: var(--space-4) var(--space-6);
    box-shadow: var(--shadow-md); z-index: 99;
  }
  .newsletter-table { font-size: 0.7rem; }
  .filters-row { flex-direction: column; }
}

@media (max-width: 480px) {
  .collections-shortcuts { grid-template-columns: 1fr; }
  .hero-counters { flex-direction: column; gap: var(--space-4); }
}

/* Scroll animation */
.fade-in {
  opacity: 0; transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1);
}
.fade-in.visible { opacity: 1; }

/* Sort indicator */
.sort-asc::after { content: ' ↑'; }
.sort-desc::after { content: ' ↓'; }

/* Page section padding */
.page-section {
  padding: clamp(var(--space-8), 6vw, var(--space-16)) 0;
}

/* ═══════════════════════ FUNDING PULSE ═══════════════════════ */
.chart-subtitle {
  font-size: var(--text-xs); color: var(--color-text-faint);
  margin-top: calc(-1 * var(--space-2)); margin-bottom: var(--space-4);
}

.funding-kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4); margin-bottom: var(--space-8);
}
.funding-kpi-item {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-5) var(--space-6);
}
.funding-kpi-value {
  font-family: var(--font-display); font-size: var(--text-xl);
  font-weight: 700; line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
}
.funding-kpi-value.blue { color: var(--color-primary); }
.funding-kpi-value.green { color: #4a9c6f; }
.funding-kpi-value.red { color: var(--color-accent-red); }
.funding-kpi-label {
  font-size: var(--text-xs); font-weight: 500; color: var(--color-text-faint);
  text-transform: uppercase; letter-spacing: 0.05em; margin-top: var(--space-1);
}
.funding-kpi-delta {
  font-size: var(--text-xs); font-weight: 600; margin-top: var(--space-1);
}
.funding-kpi-delta.up { color: #4a9c6f; }
.funding-kpi-delta.down { color: var(--color-accent-red); }

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

/* Drill-down panel */
.funding-drilldown {
  background: var(--color-surface); border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg); padding: var(--space-6);
  margin-top: var(--space-6); box-shadow: var(--shadow-md);
  animation: slideDown 0.3s cubic-bezier(0.16,1,0.3,1);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.funding-drilldown-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-4);
}
.funding-drilldown-header h3 {
  font-family: var(--font-display); font-size: var(--text-sm);
  font-weight: 600; color: var(--color-primary);
}
.funding-drilldown-close {
  width: 32px; height: 32px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--color-text-muted);
  background: var(--color-surface-2); border: none; cursor: pointer;
  transition: all var(--transition-interactive);
}
.funding-drilldown-close:hover { background: var(--color-surface-offset); color: var(--color-text); }
.funding-drilldown-posts {
  max-height: 400px; overflow-y: auto;
}
.funding-drilldown-posts .post-card { margin-bottom: var(--space-2); }

/* Deal timeline */
.funding-timeline {
  display: grid; gap: var(--space-3); margin-top: var(--space-4);
}
.funding-timeline-item {
  display: flex; gap: var(--space-4); align-items: flex-start;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-interactive);
}
.funding-timeline-item:hover { border-color: var(--color-primary-light); box-shadow: var(--shadow-sm); }
.funding-timeline-date {
  font-size: var(--text-xs); color: var(--color-text-faint);
  white-space: nowrap; min-width: 80px; padding-top: 2px;
}
.funding-timeline-content { flex: 1; min-width: 0; }
.funding-timeline-title {
  font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-1);
}
.funding-timeline-title a {
  color: var(--color-text);
  transition: color var(--transition-interactive);
}
.funding-timeline-title a:hover { color: var(--color-primary); }
.funding-timeline-meta {
  font-size: var(--text-xs); color: var(--color-text-faint);
  display: flex; gap: var(--space-3); flex-wrap: wrap;
}
.funding-timeline-tags {
  display: flex; gap: var(--space-1); margin-top: var(--space-2);
}
.funding-timeline-tags .mini-tag {
  font-size: 0.65rem; padding: 1px 6px;
  border-radius: var(--radius-full); background: var(--color-surface-2);
  color: var(--color-text-faint);
}
.deal-type-badge {
  font-size: 0.6rem; font-weight: 600; padding: 2px 8px;
  border-radius: var(--radius-full); text-transform: uppercase;
  letter-spacing: 0.05em; white-space: nowrap;
}
.deal-type-badge.funding { background: #26539c22; color: #26539c; }
.deal-type-badge.financings { background: #4a9c6f22; color: #4a9c6f; }
.deal-type-badge.ma { background: #b9536022; color: #b95360; }
.deal-type-badge.ipo { background: #d4a01722; color: #d4a017; }
[data-theme="dark"] .deal-type-badge.funding { background: #26539c44; color: #5b8fd4; }
[data-theme="dark"] .deal-type-badge.financings { background: #4a9c6f44; color: #6fc494; }
[data-theme="dark"] .deal-type-badge.ma { background: #b9536044; color: #d4717e; }
[data-theme="dark"] .deal-type-badge.ipo { background: #d4a01744; color: #e8c040; }

@media (max-width: 768px) {
  .funding-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .funding-two-col { grid-template-columns: 1fr; }
  .funding-timeline-item { flex-direction: column; gap: var(--space-1); }
  .funding-timeline-date { min-width: auto; }
}
