/* ═══════════════════════════════════════════════════════════════════
   DIGITAL AI COLLECTIVE — Main Stylesheet
   Design: Dark Editorial / Neural Dispatch Aesthetic
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500&family=Syne+Mono&family=Playfair+Display:ital,wght@1,700&display=swap');

/* ─── CSS Variables ─────────────────────────────────────────────── */
:root {
  --bg-deep:      #07070F;
  --bg-card:      #0D0D1A;
  --bg-card-hover:#111122;
  --bg-nav:       rgba(7, 7, 15, 0.96);
  --border:       rgba(0, 245, 200, 0.1);
  --border-hover: rgba(0, 245, 200, 0.3);
  --accent:       #00F5C8;
  --accent-dim:   rgba(0, 245, 200, 0.15);
  --accent-glow:  rgba(0, 245, 200, 0.4);
  --orange:       #FF6B35;
  --orange-dim:   rgba(255, 107, 53, 0.15);
  --purple:       #7B61FF;
  --purple-dim:   rgba(123, 97, 255, 0.15);
  --green:        #2EFF8A;
  --green-dim:    rgba(46, 255, 138, 0.12);
  --yellow:       #FFD740;
  --yellow-dim:   rgba(255, 215, 64, 0.12);
  --text-primary: #E4E4F0;
  --text-muted:   #6B6B88;
  --text-dim:     #3A3A55;
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'Syne Mono', monospace;
  --radius:       6px;
  --radius-lg:    12px;
  --transition:   0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card:  0 4px 24px rgba(0,0,0,0.4), 0 0 0 1px var(--border);
  --shadow-glow:  0 0 30px rgba(0, 245, 200, 0.12);
}

/* ─── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background grid texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,245,200,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,200,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ─── Ticker Bar ─────────────────────────────────────────────────── */
.ticker-bar {
  position: relative;
  z-index: 200;
  background: var(--accent);
  color: #000;
  height: 32px;
  display: flex;
  align-items: center;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.ticker-label {
  flex-shrink: 0;
  padding: 0 14px;
  background: #000;
  color: var(--accent);
  height: 100%;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
}
.ticker-label .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}
.ticker-track {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
}
.ticker-inner {
  display: inline-block;
  animation: ticker-scroll 60s linear infinite;
}
.ticker-inner:hover { animation-play-state: paused; }
.ticker-item {
  display: inline-block;
  padding: 0 24px;
}
.ticker-item::before {
  content: '//';
  margin-right: 10px;
  opacity: 0.5;
}
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── Navigation ─────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 0;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 32px;
  flex-shrink: 0;
}
.nav-logo .logo-mark {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #000;
  font-weight: 800;
}
.nav-logo .logo-sub {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: block;
  line-height: 1;
  margin-top: 2px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}
.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--border);
}
.nav-link.active {
  font-weight: 600;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.btn-refresh {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-refresh:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.btn-refresh.loading .refresh-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.update-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.update-badge .live-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 5px;
  animation: pulse 2s ease-in-out infinite;
  vertical-align: middle;
}

/* ─── Layout Container ───────────────────────────────────────────── */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ─── Hero Section ───────────────────────────────────────────────── */
.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}
.hero-overline {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-overline::before {
  content: '';
  display: block;
  width: 24px; height: 2px;
  background: var(--accent);
}
.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 58px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 20px;
}
.hero-headline .italic-word {
  font-style: italic;
  color: var(--accent);
}
.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.7;
  margin-bottom: 28px;
}
.hero-stats {
  display: flex;
  gap: 32px;
}
.stat {
  display: flex;
  flex-direction: column;
}
.stat-number {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}
.hero-featured {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}
.hero-featured:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}
.hero-featured-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: linear-gradient(135deg, #0D1A2E, #1A0D2E);
}
.hero-featured-body { padding: 20px; }
.hero-featured-source {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.hero-featured-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}
.hero-featured-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ─── Section Styles ────────────────────────────────────────────── */
.section { margin-bottom: 64px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.section-header::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 48px;
  height: 2px;
  background: var(--section-accent, var(--accent));
}
.section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--section-accent, var(--accent));
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title .section-icon { font-size: 16px; }
.section-num {
  font-family: var(--font-mono);
  font-size: 56px;
  font-weight: 800;
  color: var(--text-dim);
  position: absolute;
  right: 100px;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.section-viewall {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius);
  transition: var(--transition);
  z-index: 1;
}
.section-viewall:hover {
  color: var(--section-accent, var(--accent));
  border-color: var(--section-accent, var(--accent));
  background: var(--section-accent-dim, var(--accent-dim));
}

/* Section color themes */
.section-llm     { --section-accent: var(--purple); --section-accent-dim: var(--purple-dim); }
.section-auto    { --section-accent: var(--orange); --section-accent-dim: var(--orange-dim); }
.section-imaging { --section-accent: var(--green);  --section-accent-dim: var(--green-dim); }
.section-research{ --section-accent: var(--yellow); --section-accent-dim: var(--yellow-dim); }

/* ─── News Grid Layouts ──────────────────────────────────────────── */
.news-grid-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
}
.news-grid-equal {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.news-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.news-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ─── Card Styles ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: var(--transition);
  background: linear-gradient(135deg, var(--accent-dim) 0%, transparent 100%);
  pointer-events: none;
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px var(--border-hover), var(--shadow-glow);
}
.card:hover::after { opacity: 1; }

.card-featured {
  grid-row: span 2;
}
.card-featured .card-body { padding: 24px; }
.card-featured .card-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
}

.card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: linear-gradient(135deg, #0F1A2A 0%, #1A0F2A 100%);
  flex-shrink: 0;
}
.card-featured .card-img { height: 220px; }

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-source {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--section-accent, var(--accent));
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.card-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tag {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: lowercase;
}
.card-link-arrow {
  font-size: 14px;
  color: var(--text-dim);
  transition: var(--transition);
}
.card:hover .card-link-arrow {
  color: var(--section-accent, var(--accent));
  transform: translate(2px, -2px);
}

/* ─── List Card (compact) ────────────────────────────────────────── */
.news-list { display: flex; flex-direction: column; gap: 1px; }
.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 8px;
}
.list-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateX(3px);
}
.list-card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
  width: 20px;
  text-align: right;
  padding-top: 2px;
}
.list-card-body { flex: 1; }
.list-card-source {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--section-accent, var(--accent));
  margin-bottom: 4px;
}
.list-card-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.list-card-time {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ─── Skeleton Loading ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, #111128 50%, var(--bg-card) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.skeleton-card {
  height: 240px;
  border-radius: var(--radius-lg);
}
.skeleton-title { height: 18px; margin-bottom: 8px; }
.skeleton-line  { height: 12px; margin-bottom: 6px; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }

/* ─── Error/Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty-state .empty-icon { font-size: 32px; margin-bottom: 12px; }
.empty-state p { font-size: 13px; font-family: var(--font-mono); }

/* ─── Bottom Bar / Footer ────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 24px;
  margin-top: 64px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-muted);
}
.footer-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-source-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-align: right;
  line-height: 1.8;
}
.footer-meta strong { color: var(--accent); }

/* ─── Auto-refresh Status Bar ────────────────────────────────────── */
.refresh-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  height: 3px;
  background: var(--border);
  overflow: hidden;
}
.refresh-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  width: 0%;
  transition: width 1s linear;
}

/* ─── Toast Notification ─────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(0,245,200,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-icon { font-size: 14px; }

/* ─── Scroll Animations ──────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ─── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .news-grid-equal { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-featured { display: none; }
}
@media (max-width: 860px) {
  .news-grid-main  { grid-template-columns: 1fr 1fr; }
  .news-grid-equal { grid-template-columns: repeat(2, 1fr); }
  .news-grid-3     { grid-template-columns: repeat(2, 1fr); }
  .card-featured   { grid-row: span 1; }
  .section-num     { display: none; }
}
@media (max-width: 600px) {
  .nav-links { display: none; }
  .news-grid-main,
  .news-grid-equal,
  .news-grid-3,
  .news-grid-2    { grid-template-columns: 1fr; }
  .hero-stats      { gap: 16px; }
  .footer-inner    { flex-direction: column; align-items: flex-start; }
}
