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

:root {
  --bg: #09090b;
  --bg-card: #111113;
  --bg-card-alt: #18181b;
  --bg-surface: #1c1c1f;
  --primary: #4f46e5;
  --primary-hover: #6366f1;
  --primary-dim: rgba(79, 70, 229, 0.15);
  --accent: #10b981;
  --accent-dim: rgba(16, 185, 129, 0.15);
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-subtle: #71717a;
  --border: #27272a;
  --border-hover: #4f46e5;
  --signal-high: #f43f5e;
  --signal-high-bg: rgba(244, 63, 94, 0.12);
  --signal-medium: #f59e0b;
  --signal-medium-bg: rgba(245, 158, 11, 0.12);
  --signal-low: #71717a;
  --signal-low-bg: rgba(113, 113, 122, 0.12);
  --font-head: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Instrument Sans', system-ui, sans-serif;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.hidden { display: none !important; }

/* ─── Header ─────────────────────────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(9,9,11,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
header .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }

.logo { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-head); font-weight: 700; font-size: 1rem; }
.logo-icon { width: 28px; height: 28px; border-radius: 6px; }
.logo-name { color: var(--text); }

nav { display: flex; align-items: center; gap: 1.5rem; }
nav a { color: var(--text-muted); font-size: 0.875rem; font-weight: 500; transition: color 0.2s; }
nav a:hover { color: var(--text); }
nav a.nav-active { color: var(--text); }

.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1.25rem; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all 0.2s; border: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--text); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn svg { flex-shrink: 0; }

.mobile-menu-btn { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.mobile-menu-btn span { display: block; width: 22px; height: 2px; background: var(--text-muted); border-radius: 2px; transition: all 0.2s; }

.mobile-nav { display: none; flex-direction: column; gap: 0; background: var(--bg-card); border-top: 1px solid var(--border); }
.mobile-nav a { padding: 0.875rem 1.5rem; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; border-bottom: 1px solid var(--border); transition: color 0.2s; }
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover, .mobile-nav a.nav-active { color: var(--text); }

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  padding: 4rem 0 3rem;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(79,70,229,0.18) 0%, transparent 70%);
  border-bottom: 1px solid var(--border);
}
.hero-badge { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--accent-dim); border: 1px solid rgba(16,185,129,0.3); color: var(--accent); border-radius: 99px; padding: 0.3rem 0.85rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 1.25rem; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.85); } }

.hero h1 { font-family: var(--font-head); font-size: clamp(2.5rem, 5vw, 3.75rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.1rem; color: var(--text-muted); max-width: 560px; margin-bottom: 1.5rem; }
.hero-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.last-updated { font-size: 0.8rem; color: var(--text-subtle); }

/* ─── Page Body ──────────────────────────────────────────────────────────────── */
.page-body { padding: 3rem 0 5rem; }

/* ─── Brief Section ──────────────────────────────────────────────────────────── */
.brief-section { margin-bottom: 3rem; }
.section-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap; }
.section-title { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.section-icon { font-size: 1.1rem; }
.brief-date { font-size: 0.8rem; color: var(--text-muted); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.25rem 0.6rem; }

.brief-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }

.brief-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.brief-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 3px 0 0 3px;
}
.brief-card:hover { border-color: var(--border-hover); box-shadow: 0 0 0 1px rgba(79,70,229,0.3), var(--shadow-md); }

.brief-card-top { display: flex; align-items: center; gap: 0.6rem; }
.rank-badge { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-dim); border: 1px solid rgba(79,70,229,0.4); color: var(--primary); font-size: 0.78rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-1 { background: rgba(79,70,229,0.25); border-color: rgba(79,70,229,0.7); }

.brief-card-title { font-weight: 600; font-size: 0.9rem; line-height: 1.4; }
.brief-card-title a { color: var(--text); transition: color 0.2s; }
.brief-card-title a:hover { color: var(--primary-hover); }

.brief-card-meta { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.brief-card-reason { font-size: 0.72rem; color: var(--text-subtle); margin-top: 0.15rem; }

/* ─── Filter Bar ─────────────────────────────────────────────────────────────── */
.filter-bar { margin-bottom: 2rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.filter-chips { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 99px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--text); }
.chip-active { background: var(--primary-dim); border-color: rgba(79,70,229,0.5); color: var(--text); }

/* ─── Feed Sections ──────────────────────────────────────────────────────────── */
.feed-section { margin-bottom: 2.5rem; }
.feed-section-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.feed-section-header:hover { background: var(--bg-card-alt); }
.feed-section-header.collapsed { border-radius: var(--radius); }

.feed-section-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.cat-dot-news { background: #06b6d4; }
.cat-dot-releases { background: #a78bfa; }
.cat-dot-research { background: #f59e0b; }
.cat-dot-signals { background: #f43f5e; }
.cat-dot-openai { background: #10b981; }
.cat-dot-google { background: #3b82f6; }
.cat-dot-anthropic { background: #f97316; }
.cat-dot-chinese-ai { background: #ec4899; }

.feed-section-count { font-size: 0.75rem; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 99px; padding: 0.15rem 0.55rem; }
.feed-section-chevron { color: var(--text-muted); transition: transform 0.2s; flex-shrink: 0; }
.feed-section-chevron.rotated { transform: rotate(-90deg); }

.feed-section-body {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1px; background: var(--border); }
.article-card {
  background: var(--bg-card);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.2s, box-shadow 0.2s;
}
.article-card:hover { background: var(--bg-card-alt); box-shadow: inset 0 0 0 1px rgba(79,70,229,0.25); }

.article-card-title { font-weight: 600; font-size: 0.875rem; line-height: 1.4; }
.article-card-title a { color: var(--text); transition: color 0.2s; }
.article-card-title a:hover { color: var(--primary-hover); }

.article-card-snippet { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.article-card-meta { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.25rem; }

/* ─── Pills / Badges ─────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  white-space: nowrap;
}
.pill-source { background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border); }
.pill-age { background: transparent; color: var(--text-subtle); }
.pill-cat { background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border); }

.pill-signal { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; padding: 0.15rem 0.5rem; border-radius: 99px; text-transform: uppercase; }
.pill-signal-high { background: var(--signal-high-bg); color: var(--signal-high); border: 1px solid rgba(244,63,94,0.3); }
.pill-signal-medium { background: var(--signal-medium-bg); color: var(--signal-medium); border: 1px solid rgba(245,158,11,0.3); }
.pill-signal-low { background: var(--signal-low-bg); color: var(--signal-low); border: 1px solid rgba(113,113,122,0.3); }

/* ─── Skeletons ──────────────────────────────────────────────────────────────── */
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton-bg { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-surface) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }

.skeleton-brief { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-surface) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.skeleton-section { height: 200px; border-radius: var(--radius); margin-bottom: 1.5rem; background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-surface) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }

/* ─── Error State ────────────────────────────────────────────────────────────── */
.error-state { text-align: center; padding: 4rem 2rem; }
.error-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.error-state h3 { font-family: var(--font-head); font-size: 1.25rem; margin-bottom: 0.5rem; }
.error-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ─── Empty Category ─────────────────────────────────────────────────────────── */
.empty-cat { padding: 2rem; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 2rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-brand .logo { margin-bottom: 0.75rem; }
.footer-tagline { color: var(--text-muted); font-size: 0.875rem; }
.footer-col h4 { font-family: var(--font-head); font-size: 0.8rem; font-weight: 700; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.9rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.footer-col ul a { font-size: 0.875rem; color: var(--text-muted); transition: color 0.2s; }
.footer-col ul a:hover { color: var(--text); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 1.5rem; border-top: 1px solid var(--border); gap: 1rem; flex-wrap: wrap; }
.footer-bottom p { font-size: 0.8rem; color: var(--text-subtle); }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .brief-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .mobile-nav.open { display: flex; }

  .hero { padding: 3rem 0 2rem; }
  .hero h1 { font-size: 2.25rem; }
  .hero-subtitle { font-size: 0.95rem; }

  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-brand { grid-column: auto; }

  .article-grid { grid-template-columns: 1fr; }
  .filter-chips { gap: 0.35rem; }
  .chip { padding: 0.3rem 0.7rem; font-size: 0.75rem; }
}
