/* ============================================================
   HiTechBits — Gamer-Inspired Tech News Stylesheet
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-void:      #030712;
  --bg-deep:      #0a0f1e;
  --bg-card:      #0d1526;
  --bg-card-hover:#111d35;
  --border:       #1a2a4a;
  --border-glow:  #0ea5e9;

  --cyan:         #00e5ff;
  --cyan-dim:     #0ea5e9;
  --green:        #00ff88;
  --purple:       #a855f7;
  --amber:        #f59e0b;
  --red:          #ff2d55;

  --text-primary:   #e2f0ff;
  --text-secondary: #7ca3c8;
  --text-dim:       #3a5a7a;

  --font-display: 'Orbitron', sans-serif;
  --font-ui:      'Rajdhani', sans-serif;
  --font-mono:    'Share Tech Mono', monospace;

  --glow-cyan:    0 0 20px rgba(0, 229, 255, 0.35), 0 0 60px rgba(0, 229, 255, 0.1);
  --glow-green:   0 0 20px rgba(0, 255, 136, 0.35), 0 0 60px rgba(0, 255, 136, 0.1);
  --glow-card:    0 8px 32px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.04);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Grid background */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

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

/* ── Header ─────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 70px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Logo never shrinks */
.logo { flex-shrink: 0; }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  position: relative;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.logo-text span {
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

/* Live ticker */
.ticker-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  height: 30px;
  position: relative;
  max-width: 400px;
}

.ticker-wrap::before,
.ticker-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  z-index: 2;
}
.ticker-wrap::before { left: 0; background: linear-gradient(to right, rgba(3,7,18,0.95), transparent); }
.ticker-wrap::after  { right: 0; background: linear-gradient(to left, rgba(3,7,18,0.95), transparent); }

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

.ticker-item {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  padding: 0 2rem;
  letter-spacing: 0.05em;
}

.ticker-item::before {
  content: '▸ ';
  color: var(--cyan);
}

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

/* Header right */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: var(--glow-green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.header-right { flex-shrink: 0; }

.btn-refresh {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--cyan);
  background: transparent;
  border: 1px solid rgba(0,229,255,0.3);
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.btn-refresh:hover {
  background: rgba(0,229,255,0.1);
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

/* ── Filter Bar ─────────────────────────────────────────────── */
.filter-bar {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 70px;
  z-index: 99;
}

.filter-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 48px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-inner::-webkit-scrollbar { display: none; }

.filter-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 0.5rem;
}

.filter-btn {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  border-radius: 2px;
  text-transform: uppercase;
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--cyan);
  border-color: var(--cyan-dim);
  background: rgba(0,229,255,0.07);
}

.filter-btn.active {
  box-shadow: 0 0 10px rgba(0,229,255,0.15);
}

/* ── Hero Section ───────────────────────────────────────────── */
.hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: auto;
  gap: 1.5rem;
}

/* Featured article */
.card-featured {
  grid-column: 1;
  grid-row: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.card-featured:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow-card), 0 0 40px rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.3);
}

.card-featured .card-image {
  width: 100%;
  height: 360px;
  object-fit: cover;
  display: block;
  filter: brightness(0.7) saturate(1.1);
  transition: filter 0.3s, transform 0.5s;
}

.card-featured:hover .card-image {
  filter: brightness(0.85) saturate(1.2);
  transform: scale(1.02);
}

.card-featured .card-image-wrap {
  overflow: hidden;
  position: relative;
}

.card-featured .card-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3,7,18,0.98) 0%, rgba(3,7,18,0.5) 50%, transparent 100%);
}

.card-featured .no-image {
  height: 360px;
  background: linear-gradient(135deg, #0a1628 0%, #0d1f3c 50%, #0a1628 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 4rem;
  color: rgba(0,229,255,0.1);
  letter-spacing: 0.2em;
}

.card-featured .card-body {
  padding: 1.5rem;
}

/* Sidebar stack */
.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Card Styles ────────────────────────────────────────────── */
.card-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  margin-bottom: 0.75rem;
  border-left: 3px solid currentColor;
  background: rgba(255,255,255,0.04);
}

.card-title {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  transition: color 0.2s;
}

.card-featured:hover .card-title { color: var(--cyan); }

.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.card-meta-dot { color: var(--border); }

/* Compact cards for sidebar */
.card-compact {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.card-compact::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--source-color, var(--cyan));
  transform: scaleY(0);
  transition: transform 0.2s;
  transform-origin: bottom;
}

.card-compact:hover::before { transform: scaleY(1); }

.card-compact:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0,229,255,0.15);
}

.card-compact .card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.card-compact:hover .card-title { color: var(--cyan); }

.card-compact .card-desc { display: none; }

/* ── Main Grid ──────────────────────────────────────────────── */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  position: relative;
  z-index: 1;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}

.section-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* Article grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.card-article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.card-article::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  transition: border-color 0.25s;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.card-article:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow-card);
}

.card-article:hover::after {
  border-color: rgba(0,229,255,0.2);
}

.card-article .card-image-wrap {
  height: 180px;
  overflow: hidden;
  position: relative;
  background: var(--bg-deep);
}

.card-article .card-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,21,38,0.9) 0%, transparent 60%);
}

.card-article .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.75) saturate(1.1);
  transition: transform 0.5s, filter 0.3s;
}

.card-article:hover .card-image {
  transform: scale(1.06);
  filter: brightness(0.9) saturate(1.2);
}

.card-article .no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: rgba(0,229,255,0.06);
  letter-spacing: 0.3em;
  background: linear-gradient(135deg, #090e1c 0%, #0c1a2e 100%);
}

.card-article .card-body {
  padding: 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-article .card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.card-article:hover .card-title { color: var(--cyan); }

.card-article .card-desc {
  font-size: 0.82rem;
  flex: 1;
  margin-bottom: 0.75rem;
}

/* ── Loader ─────────────────────────────────────────────────── */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  gap: 1.5rem;
}

.loader-ring {
  width: 60px;
  height: 60px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: var(--glow-cyan);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: blink 1.2s ease-in-out infinite;
}

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

/* ── Error State ────────────────────────────────────────────── */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 2rem;
  gap: 1rem;
  text-align: center;
}

.error-code {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--red);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-shadow: 0 0 30px rgba(255,45,85,0.4);
}

.error-msg {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 400px;
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.footer-brand span { color: var(--cyan); }

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}

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

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* ── Animations ─────────────────────────────────────────────── */
.fade-in {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ── Responsive ─────────────────────────────────────────────── */

/* ── Tablet (max 1024px) ────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .sidebar-stack {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .card-compact { flex: 1; min-width: 260px; }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile (max 768px) ─────────────────────────────────────── */
@media (max-width: 768px) {

  /* Header: logo + hamburger-style compact layout */
  .header-inner {
    padding: 0 1rem;
    height: 56px;
    gap: 0.75rem;
  }

  .logo-text { font-size: 1rem; }
  .logo-icon { width: 28px; height: 28px; }

  /* Hide ticker and search on mobile — search moves below header */
  .ticker-wrap  { display: none; }
  .search-wrap  { display: none; }

  .status-dot span { display: none; }  /* hide "LIVE" text, keep dot */

  .btn-refresh {
    font-size: 0.58rem;
    padding: 0.3rem 0.6rem;
  }

  /* Mobile search bar — full width below header */
  .mobile-search {
    display: block;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1rem;
  }

  .mobile-search .search-box {
    width: 100%;
    clip-path: none;
    border-radius: 4px;
    height: 38px;
  }

  /* Filter bars */
  .filter-bar { position: relative; top: auto; }
  .filter-inner {
    padding: 0 1rem;
    height: 40px;
    gap: 0.35rem;
  }
  .filter-btn {
    font-size: 0.68rem;
    padding: 0.2rem 0.6rem;
  }

  /* Topic bar */
  .topic-inner {
    padding: 0 1rem;
    height: 40px;
    gap: 0.3rem;
  }

  /* Hero */
  .hero { padding: 1rem 1rem 0.5rem; }
  .card-featured {
    clip-path: none;
    border-radius: 4px;
  }
  .card-featured .card-image-wrap { height: 200px; }
  .card-featured .card-image      { height: 200px; }
  .card-featured .no-image        { height: 200px; font-size: 2.5rem; }
  .card-featured .card-body       { padding: 1rem; }
  .card-featured .card-title      { font-size: 1.1rem; }

  /* Sidebar stacks vertically on mobile */
  .sidebar-stack {
    flex-direction: column;
    gap: 0.6rem;
  }
  .card-compact { min-width: unset; flex: none; }

  /* Article grid — single column */
  .main-content { padding: 0 1rem 3rem; }
  .articles-grid { grid-template-columns: 1fr; gap: 0.85rem; }

  .card-article {
    clip-path: none;
    border-radius: 4px;
  }
  .card-article .card-image-wrap { height: 160px; }
  .card-article .card-title      { font-size: 0.92rem; }

  /* Section header */
  .section-header { margin: 1.5rem 0 1rem; }
  .section-title  { font-size: 0.68rem; }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
  }
  .footer-links { gap: 1rem; }
  .footer-copy  { font-size: 0.58rem; }

  /* No-results / error states */
  .error-code     { font-size: 2rem; }
  .no-results-code { font-size: 1.8rem; }
}

/* ── Small phones (max 480px) ───────────────────────────────── */
@media (max-width: 480px) {
  .header-inner { height: 52px; }
  .logo-text    { font-size: 0.9rem; }

  .filter-btn   { font-size: 0.62rem; padding: 0.18rem 0.5rem; }
  .filter-label { display: none; } /* hide "Source ▸" label to save space */

  .topic-label  { display: none; } /* hide "Topic ▸" label to save space */
  .topic-btn    { font-size: 0.58rem; padding: 0.18rem 0.6rem; }

  .card-featured .card-image-wrap { height: 170px; }
  .card-featured .card-title      { font-size: 1rem; }
  .card-featured .card-desc       { font-size: 0.82rem; }

  .articles-grid { gap: 0.7rem; }
  .card-article .card-image-wrap  { height: 140px; }
}

/* ── Search ─────────────────────────────────────────────────── */

.search-wrap {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(13, 21, 38, 0.9);
  border: 1px solid var(--border);
  padding: 0 0.75rem;
  height: 36px;
  gap: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.search-box:focus-within {
  border-color: var(--cyan-dim);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.12);
}

.search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color 0.2s;
}

.search-box:focus-within .search-icon {
  color: var(--cyan);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}

/* Hide the native browser clear button on search inputs */
.search-input::-webkit-search-cancel-button { display: none; }

.search-clear {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.2s;
  flex-shrink: 0;
}

.search-clear:hover { color: var(--cyan); }

/* Active search state — dims the ticker */
body.searching .ticker-wrap { opacity: 0.3; pointer-events: none; }

/* Keyword highlight in article titles/descriptions */
.highlight {
  background: rgba(0, 229, 255, 0.18);
  color: var(--cyan);
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 700;
}

/* No results state */
.no-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5rem 2rem;
  gap: 1rem;
  text-align: center;
}

.no-results-code {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-dim);
  letter-spacing: 0.15em;
}

.no-results-msg {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.no-results-query {
  font-family: var(--font-mono);
  color: var(--cyan);
}

/* Search result count badge in section header */
.search-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  letter-spacing: 0.08em;
  display: none;
}

.search-badge.visible { display: inline-block; }

@media (max-width: 768px) {
  .search-wrap { max-width: 100%; }
}

/* ── Topic Bar ──────────────────────────────────────────────── */

.topic-bar {
  background: var(--bg-void);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 118px; /* below header (70px) + filter bar (48px) */
  z-index: 98;
}

.topic-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0,229,255,0.12), transparent);
  pointer-events: none;
}

.topic-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 42px;
  overflow-x: auto;
  scrollbar-width: none;
}

.topic-inner::-webkit-scrollbar { display: none; }

.topic-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 0.25rem;
  flex-shrink: 0;
}

.topic-btn {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.07);
  padding: 0.22rem 0.8rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  line-height: 1.8;
}

.topic-icon {
  font-size: 0.72rem;
  line-height: 1;
}

.topic-btn:hover {
  color: var(--text-secondary);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
}

/* Active states — one rule per topic to avoid color-mix() */
.topic-btn.active {
  color: #030712;
  border-color: transparent;
  font-weight: 700;
}

.topic-btn[data-topic="cybersecurity"].active { background: #ff2d55; box-shadow: 0 0 14px rgba(255,45,85,0.45); }
.topic-btn[data-topic="ai"].active            { background: #a855f7; box-shadow: 0 0 14px rgba(168,85,247,0.45); }
.topic-btn[data-topic="hardware"].active      { background: #f59e0b; box-shadow: 0 0 14px rgba(245,158,11,0.45); }
.topic-btn[data-topic="software"].active      { background: #00d46a; box-shadow: 0 0 14px rgba(0,212,106,0.45); }
.topic-btn[data-topic="gaming"].active        { background: #ef4444; box-shadow: 0 0 14px rgba(239,68,68,0.45); }
.topic-btn[data-topic="space"].active         { background: #00e5ff; box-shadow: 0 0 14px rgba(0,229,255,0.45); }
.topic-btn[data-topic="crypto"].active        { background: #8b5cf6; box-shadow: 0 0 14px rgba(139,92,246,0.45); }

@media (max-width: 768px) {
  .topic-inner { padding: 0 1rem; }
}
