/* ============================================
   QUANTONOMIST — Quantum Sector News
   Theme: Dark Matter + Quantum Neon
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-deep: #08081a;
  --bg-card: #0d0d28;
  --bg-card-hover: #12123a;
  --bg-surface: #15153a;
  --border-subtle: rgba(120, 100, 255, 0.12);
  --border-glow: rgba(100, 180, 255, 0.3);
  --text-primary: #e8e6f0;
  --text-secondary: #9895b4;
  --text-muted: #5c5a78;
  --accent-cyan: #00e5ff;
  --accent-purple: #b388ff;
  --accent-pink: #ff4081;
  --accent-green: #69f0ae;
  --accent-gold: #ffd740;
  --accent-red: #ff5252;
  --font-heading: 'Georgia', 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 1px rgba(100, 180, 255, 0.1);
  --shadow-glow: 0 0 20px rgba(0, 229, 255, 0.15), 0 0 60px rgba(179, 136, 255, 0.08);
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* --- 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;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-purple);
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Quantum Particle Canvas --- */
#quantum-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  font-size: 28px;
  animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px var(--accent-cyan)); }
  50% { filter: drop-shadow(0 0 12px var(--accent-purple)); }
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: rgba(179, 136, 255, 0.1);
}

.market-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-green);
  background: rgba(105, 240, 174, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(105, 240, 174, 0.2);
}

/* --- Ticker Bar --- */
.ticker-bar {
  position: relative;
  z-index: 90;
  background: rgba(13, 13, 40, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  height: 40px;
}

.ticker-track {
  display: flex;
  gap: 0;
  animation: ticker-scroll 60s linear infinite;
  white-space: nowrap;
  height: 100%;
  align-items: center;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  border-right: 1px solid var(--border-subtle);
  height: 100%;
}

.ticker-symbol {
  font-weight: 700;
  color: var(--text-primary);
}

.ticker-price {
  color: var(--text-secondary);
}

.ticker-change.up { color: var(--accent-green); }
.ticker-change.down { color: var(--accent-red); }

/* --- Main Content --- */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Hero Section --- */
.hero {
  padding: 60px 0 48px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-purple), transparent);
  opacity: 0.5;
}

.hero-content {
  max-width: 780px;
}

.hero-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-pink);
  background: rgba(255, 64, 129, 0.12);
  padding: 4px 12px;
  border-radius: 3px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 64, 129, 0.2);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-shadow: 0 0 40px rgba(0, 229, 255, 0.1);
}

.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 650px;
}

.hero-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.hero-cta {
  display: inline-block;
  padding: 12px 28px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(179, 136, 255, 0.15));
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 15px;
  transition: all var(--transition-base);
}

.hero-cta:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(179, 136, 255, 0.25));
  box-shadow: var(--shadow-glow);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

/* --- Section Headers --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
  padding-top: 48px;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--text-primary);
}

.live-dot {
  font-size: 12px;
  color: var(--accent-red);
  animation: blink 1.5s ease-in-out infinite;
  margin-left: 8px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.section-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 4px;
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
}

.filter-btn.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(179, 136, 255, 0.1));
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* --- News Grid --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-purple), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.news-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.news-card:hover::before {
  opacity: 1;
}

.news-card .card-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 12px;
}

.cat-computing { color: var(--accent-cyan); background: rgba(0, 229, 255, 0.1); }
.cat-security { color: var(--accent-red); background: rgba(255, 82, 82, 0.1); }
.cat-markets { color: var(--accent-gold); background: rgba(255, 215, 64, 0.1); }
.cat-research { color: var(--accent-green); background: rgba(105, 240, 174, 0.1); }

.news-card .card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.news-card .card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card .card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.news-card .card-source {
  font-weight: 600;
  color: var(--accent-purple);
}

/* --- Skeleton Loading --- */
.skeleton {
  pointer-events: none;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--bg-surface) 25%, rgba(179, 136, 255, 0.1) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
  margin-bottom: 12px;
}

.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Load More --- */
.load-more-wrap {
  text-align: center;
  padding: 40px 0;
}

.load-more {
  padding: 12px 36px;
  background: transparent;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  color: var(--accent-cyan);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.load-more:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.1);
  box-shadow: var(--shadow-glow);
}

.load-more:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Markets Grid --- */
.markets-section {
  border-top: 1px solid var(--border-subtle);
}

.markets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.market-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-base);
}

.market-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card);
}

.market-card .stock-symbol {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.market-card .stock-name {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.market-card .stock-price {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.market-card .stock-change {
  font-family: var(--font-mono);
  font-size: 14px;
  margin-top: 4px;
}

.stock-up { color: var(--accent-green); }
.stock-down { color: var(--accent-red); }

.market-card .stock-sparkline {
  margin-top: 12px;
  height: 40px;
  opacity: 0.6;
}

.market-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding-bottom: 24px;
}

/* --- Research Grid --- */
.research-section {
  border-top: 1px solid var(--border-subtle);
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  padding-bottom: 48px;
}

.research-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
}

.research-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card);
}

.research-card .research-institution {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent-green);
  margin-bottom: 8px;
}

.research-card .research-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.research-card .research-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}


/* --- Footer --- */
.site-footer {
  position: relative;
  z-index: 1;
  background: rgba(13, 13, 40, 0.95);
  border-top: 1px solid var(--border-subtle);
  padding: 60px 24px 32px;
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 12px;
}

.footer-links h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
}

.footer-links a {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-bottom p {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .header-inner {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-desc {
    font-size: 16px;
  }

  .news-grid,
  .research-grid {
    grid-template-columns: 1fr;
  }

  .markets-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

}

@media (max-width: 480px) {
  .markets-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 24px;
  }
}
