/* ====================================================
   DevOps Radar — Stylesheet
   Design: Dark Industrial / Command Center Aesthetic
   ==================================================== */

/* ── CSS Variables ── */
:root {
  --bg-base:       #070910;
  --bg-surface:    #0d1117;
  --bg-card:       #111827;
  --bg-card-hover: #1a2436;
  --bg-elevated:   #1f2937;

  --border:        rgba(255,255,255,0.07);
  --border-hover:  rgba(255,255,255,0.15);

  --primary:       #f59e0b;      /* Amber */
  --primary-dim:   rgba(245,158,11,0.15);
  --accent:        #06b6d4;      /* Cyan */
  --accent-dim:    rgba(6,182,212,0.12);
  --success:       #10b981;
  --danger:        #ef4444;

  --text-1:        #f9fafb;
  --text-2:        #d1d5db;
  --text-3:        #9ca3af;
  --text-4:        #4b5563;

  --font-display:  'Syne', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --font-mono:     'Space Mono', monospace;

  --radius:        10px;
  --radius-lg:     16px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:     0 8px 48px rgba(0,0,0,0.6);

  --header-h:      64px;
  --status-h:      36px;
}

/* Light theme overrides */
body.light-theme {
  --bg-base:       #f0f4f8;
  --bg-surface:    #ffffff;
  --bg-card:       #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-elevated:   #eef2f7;
  --border:        rgba(0,0,0,0.08);
  --border-hover:  rgba(0,0,0,0.18);
  --text-1:        #0f172a;
  --text-2:        #334155;
  --text-3:        #64748b;
  --text-4:        #94a3b8;
  --shadow:        0 2px 16px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.12);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--status-h) + 16px);
}

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

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ── Background Effects ── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
}
.bg-glow {
  position: fixed; top: -300px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse, rgba(245,158,11,.08) 0%, transparent 70%);
}
body > * { position: relative; z-index: 1; }

/* ── Layout ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7,9,16,.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
body.light-theme .site-header {
  background: rgba(240,244,248,.92);
}

.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-1); font-family: var(--font-display);
  font-weight: 800; font-size: 1.3rem;
  white-space: nowrap;
}
.logo-icon { font-size: 1.6rem; }
.logo-accent { color: var(--primary); }

.main-nav {
  display: flex; gap: 4px; margin-left: 16px;
}
.nav-link {
  color: var(--text-3); font-size: .875rem;
  padding: 6px 14px; border-radius: 6px;
  transition: all .2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-1);
  background: var(--bg-elevated);
}

.header-actions {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
}

.search-wrapper {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 14px;
  transition: border-color .2s;
}
.search-wrapper:focus-within { border-color: var(--primary); }
.search-wrapper i { color: var(--text-4); font-size: .85rem; }
.search-wrapper input {
  background: none; border: none; outline: none;
  color: var(--text-1); font-family: var(--font-body);
  font-size: .875rem; width: 180px;
}
.search-wrapper input::placeholder { color: var(--text-4); }

.btn-icon {
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-3); border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s;
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }

.btn-github {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-2); font-size: .875rem; font-weight: 500;
  padding: 6px 14px; border-radius: 8px;
  transition: all .2s; white-space: nowrap;
}
.btn-github:hover { border-color: var(--primary); color: var(--primary); }

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-2); border-radius: 2px;
  transition: all .3s;
}

/* Status Bar */
.status-bar {
  background: var(--primary-dim); border-top: 1px solid rgba(245,158,11,.2);
  height: var(--status-h); display: flex; align-items: center;
}
.status-inner {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: .72rem; color: var(--text-3);
}
.status-sep { color: var(--text-4); }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
}
.status-dot.pulse {
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); }
  50% { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #000;
  font-family: var(--font-display); font-weight: 700; font-size: .9rem;
  padding: 12px 24px; border-radius: var(--radius);
  transition: all .2s;
}
.btn-primary:hover { background: #fbbf24; color: #000; transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text-2);
  font-family: var(--font-display); font-weight: 600; font-size: .9rem;
  padding: 12px 24px; border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all .2s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ── Hero ── */
.hero {
  padding: 96px 0 80px;
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 680px; }
.hero-badge {
  display: inline-block;
  background: var(--primary-dim); border: 1px solid rgba(245,158,11,.3);
  color: var(--primary); font-family: var(--font-mono); font-size: .78rem;
  padding: 6px 14px; border-radius: 99px; margin-bottom: 28px;
  letter-spacing: .05em;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800; line-height: 1.05;
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  color: var(--text-3); font-size: 1.1rem; line-height: 1.7;
  margin-bottom: 36px; max-width: 560px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ── Sections ── */
.section { padding: 80px 0; }
.section-dark {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-header { margin-bottom: 48px; }
.section-label {
  display: inline-block;
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--primary); letter-spacing: .1em;
  text-transform: uppercase; margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800; color: var(--text-1);
}

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 48px;
}
.kpi-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; align-items: flex-start; gap: 16px;
  transition: border-color .2s;
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity .3s;
}
.kpi-card:hover::before { opacity: 1; }
.kpi-card:hover { border-color: var(--border-hover); }
.kpi-primary { border-color: rgba(245,158,11,.3); }
.kpi-primary::before { opacity: 1; background: linear-gradient(90deg, transparent, var(--primary), transparent); }
.kpi-icon { font-size: 1.8rem; }
.kpi-body { flex: 1; }
.kpi-value {
  display: block;
  font-family: var(--font-mono); font-size: 1.8rem;
  font-weight: 700; color: var(--text-1); line-height: 1;
}
.kpi-label {
  display: block; font-size: .8rem; color: var(--text-3); margin-top: 4px;
}
.kpi-trend {
  position: absolute; top: 16px; right: 16px;
  font-family: var(--font-mono); font-size: .65rem;
  color: var(--text-4); background: var(--bg-elevated);
  padding: 3px 8px; border-radius: 99px;
}
.kpi-trend.up { color: var(--success); background: rgba(16,185,129,.1); }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px; margin-bottom: 48px;
}
.stat-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: border-color .2s;
}
.stat-block:hover { border-color: var(--border-hover); }
.stat-block-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.stat-block-header h3 {
  font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  color: var(--text-1);
}
.stat-year {
  font-family: var(--font-mono); font-size: .7rem;
  color: var(--text-4); background: var(--bg-elevated);
  padding: 3px 8px; border-radius: 99px;
}
.stat-items { display: flex; flex-direction: column; gap: 14px; }
.stat-item { display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: .8rem; color: var(--text-3); }
.stat-bar-wrap { display: flex; align-items: center; gap: 10px; }
.stat-bar {
  flex: 1; height: 6px;
  background: var(--bg-elevated); border-radius: 99px;
  position: relative; overflow: hidden;
}
.stat-bar::after {
  content: ''; position: absolute; inset-block: 0; left: 0;
  width: var(--pct); background: var(--accent);
  border-radius: 99px;
  animation: bar-fill .8s ease both;
}
.stat-bar.highlight::after { background: var(--primary); }
.stat-bar.low::after { background: var(--danger); }
@keyframes bar-fill {
  from { width: 0 }
  to { width: var(--pct) }
}
.stat-pct {
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--text-2); width: 36px; text-align: right;
}
.stat-source {
  font-size: .7rem; color: var(--text-4); margin-top: 14px;
  font-family: var(--font-mono);
}

/* ── Trend Tags ── */
.trend-section { }
.trend-title {
  font-family: var(--font-display); font-size: 1.1rem;
  font-weight: 700; margin-bottom: 16px;
}
.trend-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.trend-tag {
  display: inline-block;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-3); font-size: .82rem;
  padding: 6px 14px; border-radius: 99px;
  cursor: default; transition: all .2s;
}
.trend-tag:hover { border-color: var(--accent); color: var(--accent); }
.trend-tag.hot {
  background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3);
  color: var(--primary);
}
.trend-tag.hot::before { content: '🔥 '; }

/* ── Filter Bar ── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px;
}
.filter-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-3); font-family: var(--font-body); font-size: .82rem;
  padding: 7px 15px; border-radius: 99px; cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover { border-color: var(--border-hover); color: var(--text-2); }
.filter-btn.active {
  background: var(--primary); border-color: var(--primary);
  color: #000; font-weight: 600;
}

/* ── Feed Grid ── */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px; margin-bottom: 32px;
}

/* Article Card */
.article-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: all .25s; cursor: pointer;
  text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
}
.article-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.article-card:hover::before { transform: scaleX(1); }
.article-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: inherit;
}

.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.card-source {
  font-family: var(--font-mono); font-size: .7rem;
  color: var(--primary); background: var(--primary-dim);
  padding: 3px 10px; border-radius: 99px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 180px;
}
.card-category {
  font-size: .7rem; color: var(--text-4);
  background: var(--bg-elevated); padding: 3px 8px; border-radius: 99px;
  white-space: nowrap;
}
.card-title {
  font-family: var(--font-display); font-size: 1rem;
  font-weight: 700; color: var(--text-1); line-height: 1.4;
}
.card-summary {
  font-size: .84rem; color: var(--text-3); line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--border);
}
.card-date {
  font-family: var(--font-mono); font-size: .68rem; color: var(--text-4);
}
.card-link-icon { color: var(--accent); font-size: .8rem; }

/* Skeleton */
.skeleton-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; height: 220px;
  animation: skeleton-pulse 1.5s ease infinite;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.feed-empty {
  text-align: center; padding: 64px 24px; color: var(--text-3);
}
.feed-empty span { font-size: 3rem; margin-bottom: 16px; display: block; }

.load-more-wrap { text-align: center; margin-top: 16px; }
.btn-load-more {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-2); font-family: var(--font-body); font-size: .875rem;
  padding: 10px 28px; border-radius: var(--radius); cursor: pointer;
  transition: all .2s;
}
.btn-load-more:hover { border-color: var(--primary); color: var(--primary); }
.btn-load-more:disabled { opacity: .4; cursor: not-allowed; }

/* ── Tools Grid ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.tool-category {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.tool-cat-title {
  font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.tool-list { display: flex; flex-direction: column; gap: 4px; }
.tool-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 8px;
  color: var(--text-2); font-size: .875rem;
  transition: all .2s; border: 1px solid transparent;
}
.tool-item:hover {
  background: var(--bg-elevated); border-color: var(--border);
  color: var(--text-1);
}
.tool-name { font-weight: 500; }
.tool-badge {
  font-family: var(--font-mono); font-size: .65rem;
  color: var(--text-4); background: var(--bg-elevated);
  padding: 2px 8px; border-radius: 99px; white-space: nowrap;
}
.tool-badge.popular {
  color: var(--primary); background: var(--primary-dim);
}

/* ── Resources Grid ── */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.resource-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; gap: 16px;
  transition: border-color .2s;
}
.resource-card:hover { border-color: var(--border-hover); }
.resource-icon { font-size: 2rem; flex-shrink: 0; }
.resource-body h4 {
  font-family: var(--font-display); font-size: .95rem;
  font-weight: 700; margin-bottom: 12px;
}
.resource-body li { margin-bottom: 8px; }
.resource-body a {
  font-size: .84rem; color: var(--text-3); transition: color .2s;
}
.resource-body a:hover { color: var(--primary); }

/* ── Footer ── */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 64px 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 48px;
}
.footer-brand .logo-icon { font-size: 1.8rem; }
.footer-brand .logo-text {
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
  display: block; margin-bottom: 12px;
}
.footer-brand p {
  font-size: .875rem; color: var(--text-3); line-height: 1.6; margin-bottom: 20px;
}
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  color: var(--text-4); font-size: 1.2rem; transition: color .2s;
}
.footer-social a:hover { color: var(--primary); }
.footer-links h4 {
  font-family: var(--font-display); font-weight: 700;
  font-size: .875rem; color: var(--text-1); margin-bottom: 16px;
}
.footer-links li { margin-bottom: 10px; }
.footer-links a { font-size: .84rem; color: var(--text-4); transition: color .2s; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border); padding: 20px 0;
  display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap;
}
.footer-bottom p { font-size: .78rem; color: var(--text-4); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--bg-surface);
    border-bottom: 1px solid var(--border); padding: 12px 24px; gap: 4px;
  }
  .main-nav.open { display: flex; }
  .hamburger { display: flex; }
  .search-wrapper input { width: 120px; }
  .btn-github span { display: none; }

  .hero { padding: 60px 0 48px; }
  .hero-title { font-size: 2.4rem; }
  .section { padding: 56px 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .feed-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .resources-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .header-actions .search-wrapper { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .hero-actions { flex-direction: column; }
  .btn-primary, .btn-secondary { justify-content: center; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Animations ── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fade-in-up .4s ease both; }

/* ── Toast Notification ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-1); font-size: .875rem;
  padding: 12px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 999;
  animation: fade-in-up .3s ease;
}
