/* ============================================================
   LLM ThreatIntel — Production Stylesheet
   Dark purple luxury theme with neural network accents
   ============================================================ */

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

:root {
  --bg: #0c0a12;
  --bg2: #13111c;
  --bg3: #181525;
  --bg3h: #1e1a30;
  --bg4: #221e35;
  --bgc: #0e0c16;
  --bd: #2a2540;
  --bds: #1f1b30;
  --bdg: rgba(139,92,246,.25);
  --t1: #e8e4f0;
  --t2: #9b93b0;
  --t3: #5e5575;
  --a: #a78bfa;
  --ab: #c4b5fd;
  --ad: rgba(167,139,250,.15);
  --as: #8b5cf6;
  --r: #f87171;
  --rb: rgba(248,113,113,.1);
  --am: #fbbf24;
  --ab2: rgba(251,191,36,.1);
  --g: #34d399;
  --gb: rgba(52,211,153,.1);
  --w: rgba(255,255,255,.88);
  --fd: 'Outfit', system-ui, sans-serif;
  --fm: 'DM Mono', 'Fira Code', monospace;
  --mw: 1240px;
  --rd: 10px;
  --rs: 6px;
  --tr: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

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


a { color: var(--a); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--ab); }

/* Neural network canvas */
#neural-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--bds);
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(12,10,18,.85);
}

.header-inner {
  max-width: var(--mw);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--w);
  letter-spacing: -0.03em;
  cursor: pointer;
  text-decoration: none;
}
.site-logo:hover { color: var(--w); text-decoration: none; }

.logo-mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--as), #6366f1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 500;
  color: white;
  box-shadow: 0 2px 12px rgba(139,92,246,.3);
}

.logo-accent { color: var(--a); }

.site-nav { display: flex; gap: 0.15rem; }
.site-nav a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--t2);
  padding: 0.45rem 0.9rem;
  border-radius: var(--rs);
  transition: all var(--tr);
  cursor: pointer;
  text-decoration: none;
}
.site-nav a:hover { color: var(--t1); background: var(--ad); text-decoration: none; }
.site-nav a.active { color: var(--a); background: var(--ad); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--bd);
  color: var(--t2);
  padding: 0.4rem 0.6rem;
  border-radius: var(--rs);
  cursor: pointer;
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--bd);
    flex-direction: column;
    padding: 0.75rem;
  }
  .site-nav.open { display: flex; }
}

/* Main content */
.main-content {
  max-width: var(--mw);
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 2;
}

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.85rem 1.5rem;
  background: rgba(19,17,28,.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--bds);
  border-radius: var(--rd);
  margin-bottom: 2rem;
  font-family: var(--fm);
  font-size: 0.72rem;
  color: var(--t2);
  overflow-x: auto;
  white-space: nowrap;
}
.status-item { display: flex; align-items: center; gap: 0.5rem; }
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--g);
  box-shadow: 0 0 8px var(--g);
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.status-label { color: var(--t3); text-transform: uppercase; letter-spacing: 0.06em; }
.status-value { color: var(--t1); font-weight: 500; }

/* Stat tiles */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 768px) { .stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; } }

@media (max-width: 480px) {
  .stat-card { padding: 1rem 0.8rem; }
  .stat-value { font-size: 1.6rem; }
  .stat-label { font-size: 0.62rem; }
}

.stat-card {
  background: rgba(24,21,37,.85);
  backdrop-filter: blur(4px);
  border: 1px solid var(--bds);
  border-radius: var(--rd);
  padding: 1.4rem 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--tr);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--as), transparent);
  opacity: 0;
  transition: opacity var(--tr);
}
.stat-card:hover {
  background: var(--bg3h);
  border-color: var(--bdg);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139,92,246,.08);
}
.stat-card:hover::before { opacity: 1; }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ab), var(--as));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.45rem;
}
.stat-label {
  font-family: var(--fm);
  font-size: 0.68rem;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Page titles */
.page-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--w);
  margin-bottom: 0.4rem;
  letter-spacing: -0.03em;
}
.title-accent { color: var(--a); font-weight: 700; margin-right: 0.15rem; }
.page-subtitle { color: var(--t2); font-size: 0.92rem; margin-bottom: 2rem; font-weight: 300; }

/* Filter bar */
.filter-bar { display: flex; gap: 0.4rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.filter-btn {
  font-family: var(--fd);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--bds);
  background: transparent;
  color: var(--t3);
  cursor: pointer;
  transition: all var(--tr);
}
.filter-btn:hover,
.filter-btn.active {
  color: var(--a);
  border-color: var(--bdg);
  background: var(--ad);
}

/* Post cards */
.posts-grid { display: flex; flex-direction: column; gap: 0.85rem; }
.post-card {
  background: var(--bg3);
  border: 1px solid var(--bds);
  border-radius: var(--rd);
  padding: 1.5rem 1.75rem;
  transition: all var(--tr);
  cursor: pointer;
}
.post-card:hover {
  background: var(--bg3h);
  border-color: var(--bdg);
  transform: translateX(4px);
  box-shadow: -4px 0 0 0 var(--as), 0 4px 20px rgba(0,0,0,.15);
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  font-size: 0.72rem;
}
.post-date { color: var(--t3); font-family: var(--fm); }
.post-tag {
  padding: 0.12rem 0.55rem;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.6rem;
}
.tag-supply-chain { background: var(--rb); color: var(--r); }
.tag-malicious-tool { background: var(--ab2); color: var(--am); }
.tag-nation-state { background: var(--ad); color: var(--a); }
.tag-shadow-ai { background: var(--gb); color: var(--g); }
.tag-llmjacking { background: var(--rb); color: var(--r); }
.tag-malware { background: var(--ab2); color: var(--am); }
.tag-apt { background: var(--ad); color: var(--ab); }
.tlp-clear { background: rgba(255,255,255,.06); color: var(--t3); font-weight: 500; }

.post-title {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 0.45rem;
  line-height: 1.45;
}
.post-card:hover .post-title { color: var(--ab); }
.post-excerpt { color: var(--t2); font-size: 0.88rem; line-height: 1.65; font-weight: 300; }

/* Tables */
.actor-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--bds);
  border-radius: var(--rd);
  margin-bottom: 2rem;
}
.actor-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; min-width: 900px; }
.actor-table th {
  font-family: var(--fm);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--a);
  text-align: left;
  padding: 0.8rem 1rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--bd);
}
.actor-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--bds);
  vertical-align: top;
}
.actor-table tr:hover td { background: var(--bg3h); }
.actor-name { font-weight: 600; color: var(--t1); }
.actor-aliases { font-size: 0.76rem; color: var(--t3); margin-top: 0.15rem; }
.actor-status {
  font-family: var(--fm);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  display: inline-block;
}
.status-active { background: var(--gb); color: var(--g); }
.ttp-tag {
  font-family: var(--fm);
  font-size: 0.66rem;
  background: var(--bg4);
  border: 1px solid var(--bds);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  color: var(--t2);
  display: inline-block;
  margin: 0.1rem;
}
.mitre-badge {
  font-family: var(--fm);
  font-size: 0.66rem;
  background: var(--ad);
  color: var(--a);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(139,92,246,.15);
  display: inline-block;
  margin: 0.1rem;
}

/* IOC Feed cards */
.feed-card {
  background: var(--bg3);
  border: 1px solid var(--bds);
  border-radius: var(--rd);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.feed-card h3 { font-size: 1rem; font-weight: 600; color: var(--ab); margin-bottom: 0.4rem; }
.feed-description { color: var(--t2); font-size: 0.85rem; margin-bottom: 1rem; font-weight: 300; }
.feed-output {
  background: var(--bgc);
  border: 1px solid var(--bds);
  border-radius: var(--rs);
  padding: 1.1rem 1.25rem;
  font-family: var(--fm);
  font-size: 0.78rem;
  color: var(--t1);
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.9;
}
.feed-actions { display: flex; gap: 0.5rem; margin-top: 0.85rem; }

.btn {
  font-family: var(--fd);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.45rem 1.1rem;
  border-radius: var(--rs);
  border: 1px solid var(--bd);
  background: var(--bg2);
  color: var(--t2);
  cursor: pointer;
  transition: all var(--tr);
}
.btn:hover {
  color: var(--a);
  border-color: var(--bdg);
  background: var(--ad);
  box-shadow: 0 2px 8px rgba(139,92,246,.1);
}
.btn.copied { color: var(--g) !important; border-color: rgba(52,211,153,.4) !important; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,4,10,.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--rd);
  padding: 2rem;
  max-width: 720px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 40px rgba(139,92,246,.08);
}
.modal h2 { font-size: 1.2rem; font-weight: 700; color: var(--w); margin-bottom: 1.25rem; }
.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--t3);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  transition: color var(--tr);
}
.modal-close:hover { color: var(--a); }

/* Blog cards */
.blog-card {
  background: var(--bg3);
  border: 1px solid var(--bds);
  border-radius: var(--rd);
  padding: 1.75rem;
  margin-bottom: 1rem;
  transition: all var(--tr);
}
.blog-card:hover { border-color: var(--bdg); background: var(--bg3h); }
.blog-date { font-family: var(--fm); font-size: 0.72rem; color: var(--t3); margin-bottom: 0.5rem; }
.blog-title { font-size: 1.1rem; font-weight: 600; color: var(--t1); margin-bottom: 0.6rem; line-height: 1.45; }
.blog-excerpt { color: var(--t2); font-size: 0.88rem; line-height: 1.7; font-weight: 300; }
.blog-tags { display: flex; gap: 0.4rem; margin-top: 0.75rem; flex-wrap: wrap; }
.blog-tag {
  font-family: var(--fm);
  font-size: 0.65rem;
  color: var(--t3);
  background: var(--bg4);
  border: 1px solid var(--bds);
  padding: 0.1rem 0.5rem;
  border-radius: 12px;
}

/* Post content (single post view) */
.post-content {
  background: var(--bg3);
  border: 1px solid var(--bds);
  border-radius: var(--rd);
  padding: 2.5rem;
  max-width: 860px;
}
.post-content h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; color: var(--t1); }
.post-content h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ab);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--bds);
}
.post-content h3 { font-size: 1rem; font-weight: 600; color: var(--t1); margin-top: 1.5rem; margin-bottom: 0.5rem; }
.post-content p { margin-bottom: 1rem; color: var(--t1); }
.post-content ul, .post-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.4rem; color: var(--t1); }
.post-content code {
  font-family: var(--fm);
  font-size: 0.85em;
  background: var(--bgc);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: var(--a);
  border: 1px solid var(--bds);
}
.post-content pre {
  background: var(--bgc);
  border: 1px solid var(--bds);
  border-radius: var(--rs);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  position: relative;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--t1);
  line-height: 1.6;
}
.post-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; font-size: 0.88rem; }
.post-content th {
  font-family: var(--fm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--t3);
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 2px solid var(--bd);
  background: var(--bg2);
}
.post-content td { padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--bds); color: var(--t1); font-size: 0.85rem; }
.post-content tr:hover td { background: var(--bg3h); }
.post-content blockquote {
  border-left: 3px solid var(--a);
  padding: 0.75rem 1.25rem;
  margin: 1rem 0;
  background: var(--ad);
  color: var(--t2);
  border-radius: 0 var(--rs) var(--rs) 0;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg2);
  border: 1px solid var(--bd);
  color: var(--t3);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-family: var(--fm);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--tr);
}
.copy-btn:hover { color: var(--a); border-color: var(--bdg); }

/* Page sections */
.page-section { display: none; }
.page-section.active { display: block; animation: fadeUp 0.35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--fm);
  font-size: 0.8rem;
  color: var(--t3);
  margin-bottom: 1.5rem;
  cursor: pointer;
}
.back-link:hover { color: var(--a); text-decoration: none; }

/* Search */
.search-input {
  width: 100%;
  max-width: 500px;
  font-family: var(--fm);
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--bds);
  border-radius: var(--rs);
  color: var(--t1);
  outline: none;
  transition: border-color var(--tr);
  margin-bottom: 1.5rem;
}
.search-input::placeholder { color: var(--t3); }
.search-input:focus { border-color: var(--bdg); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--bds);
  padding: 2.5rem 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--t3);
  margin-top: 4rem;
  position: relative;
  z-index: 2;
}
.footer-brand { color: var(--a); font-weight: 600; }
.footer-links { margin-top: 0.5rem; }
.footer-links span { margin: 0 0.4rem; opacity: 0.4; }

/* About */
.about-content { max-width: 760px; }
.about-content p { color: var(--t2); line-height: 1.85; margin-bottom: 1.1rem; font-weight: 300; }
.about-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ab);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--bds);
}
.source-list { list-style: none; padding: 0; }
.source-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bds);
  font-size: 0.88rem;
  font-weight: 300;
}
.source-list li:last-child { border-bottom: none; }

/* Loading */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--t3);
  font-family: var(--fm);
  font-size: 0.85rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--t3); }

/* Responsive */
@media (max-width: 768px) {
  html { font-size: 14px; }
  .main-content { padding: 1rem; }
  .status-bar { gap: 1rem; padding: 0.7rem 1rem; }
  .page-title { font-size: 1.35rem; }
  .header-inner { padding: 0 1rem; }
  .post-content { padding: 1.5rem; }
}
