@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #08090d;
  --bg-card: #111318;
  --bg-card-hover: #161a22;
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --secondary: #06b6d4;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --border: #1e2330;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --glow: rgba(124, 58, 237, 0.15);
  --glow-strong: rgba(124, 58, 237, 0.3);
  --radius: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; transition: color .2s; }
a:hover { color: var(--secondary); }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,9,13,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}
.nav-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-weight: 800; font-size: 1.25rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  display: flex; align-items: center; gap: .5rem;
}
.nav-logo svg { width: 28px; height: 28px; }
.nav-links { display: flex; gap: .25rem; }
.nav-links a {
  padding: .5rem 1rem; border-radius: 8px; font-size: .875rem;
  font-weight: 500; color: var(--text-dim); transition: all .2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text); background: rgba(124,58,237,.1);
}
.nav-links a.active { color: var(--primary-light); }
.mobile-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; font-size: 1.5rem; }

/* TICKER */
.ticker {
  background: linear-gradient(90deg, var(--primary), #4f46e5);
  color: white; overflow: hidden; height: 36px;
  display: flex; align-items: center; font-size: .8rem; font-weight: 600;
}
.ticker-label {
  background: rgba(0,0,0,.3); padding: 0 1rem; height: 100%;
  display: flex; align-items: center; white-space: nowrap; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 1px; font-size: .7rem;
}
.ticker-track {
  flex: 1; overflow: hidden; position: relative;
}
.ticker-content {
  display: flex; gap: 3rem; white-space: nowrap;
  animation: tickerScroll 60s linear infinite;
}
.ticker-content span { display: flex; align-items: center; gap: .5rem; }
@keyframes tickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* HERO */
.hero {
  text-align: center; padding: 4rem 1.5rem 2rem;
  background: radial-gradient(ellipse at center top, rgba(124,58,237,.08) 0%, transparent 60%);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900;
  background: linear-gradient(135deg, #fff 30%, var(--primary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: .5rem;
}
.hero p { color: var(--text-dim); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* CONTROLS */
.controls {
  max-width: 1400px; margin: 0 auto; padding: 1rem 1.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
}
.search-box {
  flex: 1; min-width: 250px; position: relative;
}
.search-box input {
  width: 100%; padding: .75rem 1rem .75rem 2.75rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: .9rem;
  transition: border-color .2s;
}
.search-box input:focus { outline: none; border-color: var(--primary); }
.search-box svg {
  position: absolute; left: .875rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-muted);
}
.filter-tabs {
  display: flex; gap: .25rem; flex-wrap: wrap;
}
.filter-tab {
  padding: .5rem 1rem; border-radius: 20px; font-size: .8rem;
  font-weight: 500; cursor: pointer; transition: all .2s;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim);
}
.filter-tab:hover { border-color: var(--primary); color: var(--text); }
.filter-tab.active {
  background: var(--primary); border-color: var(--primary); color: white;
}
.meta-bar {
  max-width: 1400px; margin: 0 auto; padding: 0 1.5rem .5rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; color: var(--text-muted); font-family: var(--mono);
}
.refresh-btn {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  padding: .35rem .75rem; border-radius: 6px; cursor: pointer; font-size: .75rem;
  font-family: var(--mono); transition: all .2s; display: flex; align-items: center; gap: .35rem;
}
.refresh-btn:hover { border-color: var(--primary); color: var(--primary-light); }
.refresh-btn.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* NEWS GRID */
.news-grid {
  max-width: 1400px; margin: 0 auto; padding: 1rem 1.5rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}
.news-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: all .3s;
  cursor: pointer; display: flex; flex-direction: column;
}
.news-card:hover {
  border-color: rgba(124,58,237,.4);
  box-shadow: 0 0 30px var(--glow), 0 8px 32px rgba(0,0,0,.4);
  transform: translateY(-2px);
}
.card-thumb {
  height: 180px; background: linear-gradient(135deg, var(--bg-card), #1a1d27);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 3rem; position: relative; overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-category {
  position: absolute; top: .75rem; left: .75rem;
  padding: .2rem .6rem; border-radius: 6px; font-size: .7rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
}
.cat-research { background: rgba(6,182,212,.2); color: var(--secondary); }
.cat-industry { background: rgba(124,58,237,.2); color: var(--primary-light); }
.cat-startups { background: rgba(16,185,129,.2); color: var(--success); }
.cat-opensource { background: rgba(245,158,11,.2); color: var(--warning); }
.cat-ethics { background: rgba(239,68,68,.2); color: var(--danger); }
.cat-robotics { background: rgba(236,72,153,.2); color: #ec4899; }
.cat-agi { background: rgba(139,92,246,.2); color: #8b5cf6; }
.cat-all { background: rgba(148,163,184,.2); color: var(--text-dim); }
.card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.card-source {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem;
  font-size: .75rem; color: var(--text-muted);
}
.card-source img { width: 16px; height: 16px; border-radius: 3px; }
.card-source .time { margin-left: auto; font-family: var(--mono); font-size: .7rem; }
.card-title {
  font-weight: 700; font-size: 1rem; line-height: 1.4;
  margin-bottom: .5rem; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-summary {
  font-size: .85rem; color: var(--text-dim); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; flex: 1;
}

/* LOAD MORE */
.load-more-wrap {
  text-align: center; padding: 2rem 1.5rem 4rem;
}
.load-more-btn {
  padding: .75rem 2.5rem; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: white; font-weight: 600; font-size: .9rem;
  border: none; cursor: pointer; transition: all .2s;
}
.load-more-btn:hover { transform: scale(1.02); box-shadow: 0 0 20px var(--glow-strong); }
.load-more-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* LOADING */
.loading {
  text-align: center; padding: 4rem; color: var(--text-muted);
}
.loading-spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 1rem;
}

/* COLUMN PAGE */
.column-page {
  max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem 4rem;
}
.column-header {
  text-align: center; margin-bottom: 3rem;
  padding-bottom: 2rem; border-bottom: 1px solid var(--border);
}
.column-header h1 {
  font-size: 2.5rem; font-weight: 900;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.column-date { font-family: var(--mono); color: var(--text-muted); font-size: .85rem; margin-top: .25rem; }
.column-byline { color: var(--text-dim); font-style: italic; margin-top: .5rem; }
.generate-btn {
  margin-top: 1.5rem; padding: .75rem 2rem; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: white; font-weight: 600; border: none; cursor: pointer;
  font-size: .9rem; transition: all .2s;
}
.generate-btn:hover { box-shadow: 0 0 20px var(--glow-strong); }
.generate-btn:disabled { opacity: .5; cursor: wait; }

/* PROGRESS BAR */
.generation-progress {
  margin-top: 1.25rem; width: 100%; max-width: 400px; margin-left: auto; margin-right: auto;
}
.progress-track {
  height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0%; border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--glow-strong);
}
.progress-text {
  font-family: var(--mono); font-size: .75rem; color: var(--text-muted);
  margin-top: .5rem; text-shadow: 0 0 6px rgba(124,58,237,.2);
}

/* INGESTION BADGE & SOURCE GRID */
.ingestion-badge {
  display: inline-block; padding: .5rem 1rem; border-radius: 8px;
  background: rgba(124,58,237,.1); border: 1px solid rgba(124,58,237,.3);
  font-size: .85rem; color: var(--primary-light); margin-bottom: 1rem;
  font-family: var(--mono);
}
.ingestion-badge strong { color: #fff; }
.source-grid {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem;
}
.source-badge {
  padding: .3rem .75rem; border-radius: 20px; font-size: .75rem;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim);
}
.source-badge strong { color: var(--secondary); margin-left: .25rem; }
.source-label { color: var(--text-muted); font-size: .8rem; }
.column-content {
  font-size: 1.05rem; line-height: 1.8;
}
.column-content h2 { font-size: 1.5rem; margin: 2rem 0 1rem; color: var(--primary-light); }
.column-content h3 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; color: var(--secondary); }
.column-content p { margin-bottom: 1.25rem; }
.column-content blockquote {
  border-left: 3px solid var(--primary); padding-left: 1rem;
  color: var(--text-dim); margin: 1.5rem 0; font-style: italic;
}
.column-content ul, .column-content ol { margin: 1rem 0 1.25rem 1.5rem; }
.column-content li { margin-bottom: .5rem; }
.column-content strong { color: #fff; }
.column-sources {
  margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border);
}
.column-sources h3 { margin-bottom: 1rem; color: var(--text-dim); font-size: 1rem; }
.column-sources a {
  display: block; padding: .4rem 0; font-size: .9rem;
  color: var(--primary-light); border-bottom: 1px solid var(--border);
}
.share-buttons {
  display: flex; gap: .75rem; margin-top: 2rem;
}
.share-btn {
  padding: .5rem 1.25rem; border-radius: 8px; font-size: .8rem;
  font-weight: 500; border: 1px solid var(--border); cursor: pointer;
  background: var(--bg-card); color: var(--text-dim); transition: all .2s;
}
.share-btn:hover { border-color: var(--primary); color: var(--text); }
.archive-section {
  margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border);
}
.archive-section h3 { margin-bottom: 1rem; }
.archive-item {
  padding: .75rem; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .2s; display: flex; justify-content: space-between;
}
.archive-item:hover { background: var(--bg-card); }
.archive-item .date { font-family: var(--mono); color: var(--text-muted); font-size: .8rem; }

/* RESEARCH */
.research-grid {
  max-width: 1400px; margin: 0 auto; padding: 1rem 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.paper-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; transition: all .3s;
}
.paper-card:hover {
  border-color: rgba(6,182,212,.4);
  box-shadow: 0 0 20px rgba(6,182,212,.1);
}
.paper-title { font-weight: 700; font-size: 1.05rem; margin-bottom: .5rem; }
.paper-authors { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.paper-abstract {
  font-size: .9rem; color: var(--text-dim); line-height: 1.6;
  overflow: hidden; transition: max-height .3s;
}
.paper-abstract.collapsed { max-height: 3.2em; }
.paper-meta {
  display: flex; gap: 1rem; align-items: center; margin-top: .75rem;
  font-size: .8rem; color: var(--text-muted); font-family: var(--mono);
}
.paper-meta a {
  padding: .3rem .75rem; background: rgba(6,182,212,.1);
  border-radius: 6px; color: var(--secondary); font-weight: 500;
}
.expand-btn {
  background: none; border: none; color: var(--primary-light);
  cursor: pointer; font-size: .8rem; padding: .25rem 0;
}

/* TOOLS */
.tools-grid {
  max-width: 1400px; margin: 0 auto; padding: 1rem 1.5rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; transition: all .3s;
}
.tool-card:hover {
  border-color: rgba(124,58,237,.4);
  box-shadow: 0 0 20px var(--glow);
}
.tool-name { font-weight: 700; font-size: 1.1rem; margin-bottom: .25rem; }
.tool-category {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .5px;
  color: var(--primary-light); font-weight: 600; margin-bottom: .5rem;
}
.tool-desc { font-size: .85rem; color: var(--text-dim); margin-bottom: .75rem; line-height: 1.5; }
.tool-meta { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; }
.tool-pricing {
  padding: .2rem .6rem; border-radius: 6px; font-weight: 600; font-size: .7rem;
}
.pricing-free { background: rgba(16,185,129,.15); color: var(--success); }
.pricing-freemium { background: rgba(245,158,11,.15); color: var(--warning); }
.pricing-paid { background: rgba(124,58,237,.15); color: var(--primary-light); }
.tool-rating { color: var(--warning); }
.tool-link {
  display: inline-block; margin-top: .75rem; font-size: .85rem;
  color: var(--secondary); font-weight: 500;
}

/* TIMELINE */
.timeline-container {
  max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem 4rem;
  position: relative;
}
.timeline-line {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--secondary), var(--primary));
  transform: translateX(-50%);
}
.timeline-item {
  display: flex; margin-bottom: 3rem; position: relative;
}
.timeline-item:nth-child(odd) { flex-direction: row-reverse; }
.timeline-item:nth-child(odd) .timeline-content { text-align: right; margin-right: 2rem; margin-left: 0; }
.timeline-item:nth-child(even) .timeline-content { margin-left: 2rem; }
.timeline-dot {
  position: absolute; left: 50%; top: 1rem; width: 16px; height: 16px;
  background: var(--primary); border: 3px solid var(--bg);
  border-radius: 50%; transform: translateX(-50%); z-index: 2;
  box-shadow: 0 0 10px var(--glow-strong);
}
.timeline-content {
  width: calc(50% - 2rem); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; transition: all .3s;
}
.timeline-content:hover {
  border-color: rgba(124,58,237,.4);
  box-shadow: 0 0 20px var(--glow);
}
.timeline-year {
  font-family: var(--mono); font-size: .8rem; color: var(--primary-light);
  font-weight: 600; margin-bottom: .25rem;
}
.timeline-event { font-weight: 700; font-size: 1.1rem; margin-bottom: .5rem; }
.timeline-desc { font-size: .85rem; color: var(--text-dim); line-height: 1.5; }

/* ABOUT */
.about-page {
  max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem 4rem;
}
.about-page h1 { font-size: 2.5rem; font-weight: 900; margin-bottom: 1.5rem; }
.about-page h2 { font-size: 1.5rem; margin: 2rem 0 1rem; color: var(--primary-light); }
.about-page p { margin-bottom: 1rem; color: var(--text-dim); line-height: 1.7; }

/* FOOTER */
.footer {
  border-top: 1px solid var(--border); padding: 2rem 1.5rem;
  text-align: center; color: var(--text-muted); font-size: .8rem;
}
.footer a { color: var(--text-dim); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; padding: 1rem; }
  .nav-links.open { display: flex; }
  .mobile-toggle { display: block; }
  .news-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .timeline-line { left: 1rem; }
  .timeline-item, .timeline-item:nth-child(odd) { flex-direction: row; }
  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content { text-align: left; margin-left: 2.5rem; margin-right: 0; width: calc(100% - 3rem); }
  .timeline-dot { left: 1rem; }
  .hero h1 { font-size: 1.75rem; }
  .filter-tabs { justify-content: center; }
}
