/* NetPulse — Network Articles Hub */

:root {
  --bg: #f4f6f9;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --text: #1a1f2e;
  --text-muted: #5c6578;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 48px rgba(15, 23, 42, 0.12);
  --gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --radius: 12px;
  --radius-lg: 20px;
  --header-h: 72px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0f1219;
  --bg-card: #1a1f2e;
  --bg-elevated: #222838;
  --text: #e8ecf4;
  --text-muted: #94a3b8;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.12);
  --border: #2d3548;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

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

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
}

.logo-icon { width: 32px; height: 32px; color: var(--accent); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover { color: var(--text); }

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: all var(--transition);
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 20px; height: 20px; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-badge svg { width: 16px; height: 16px; }

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 480px;
  margin-bottom: 1.75rem;
}

.hero-search {
  position: relative;
  max-width: 440px;
  margin-bottom: 2rem;
}

.hero-search svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

.hero-search input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.hero-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
}

.stat-num {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
}

.hero-visual > img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
}

.hero-card {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow);
  animation: float 4s ease-in-out infinite;
}

.hero-card svg { width: 28px; height: 28px; color: var(--accent); flex-shrink: 0; }
.hero-card strong { display: block; font-size: 0.9rem; }
.hero-card span { font-size: 0.75rem; color: var(--text-muted); }

.hero-card-1 { bottom: -1rem; left: -1.5rem; }
.hero-card-2 { top: 1rem; right: -1rem; animation-delay: -2s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Topics */
.topics {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.topics h2 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-weight: 600;
}

.topic-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.topic-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.topic-btn svg { width: 16px; height: 16px; }

.topic-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.topic-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Articles */
.articles {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}

.articles-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.articles-header h2 { font-size: 1.75rem; }
.articles-count { color: var(--text-muted); font-size: 0.9rem; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  opacity: 0;
  transform: translateY(20px);
}

.article-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.article-card.hidden { display: none; }

.article-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
}

.article-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .article-img-wrap img { transform: scale(1.05); }

.article-topic-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: color-mix(in srgb, var(--bg-card) 90%, transparent);
  backdrop-filter: blur(8px);
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: capitalize;
}

.article-topic-badge svg { width: 12px; height: 12px; }

.article-body { padding: 1.25rem; }

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.article-excerpt {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Featured strip */
.featured-strip {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.strip-card {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.strip-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 280px;
}

.strip-content {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.strip-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  width: fit-content;
  margin-bottom: 1rem;
}

.strip-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.strip-content p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.read-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  transition: background var(--transition), transform var(--transition);
}

.read-btn:hover {
  background: var(--accent-hover);
  transform: translateX(4px);
}

/* About */
.about {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about h2 { font-size: 1.75rem; margin-bottom: 1rem; }
.about p { color: var(--text-muted); margin-bottom: 1.5rem; }

.about-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
}

.about-features svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.about-img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.footer-inner { max-width: 600px; margin: 0 auto; }

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.footer-brand .logo-icon { width: 28px; height: 28px; }

.site-footer p { color: var(--text-muted); font-size: 0.9rem; }
.footer-copy { margin-top: 1rem; font-size: 0.8rem !important; }

/* Modal */
.article-modal {
  border: none;
  padding: 0;
  max-width: 720px;
  width: calc(100% - 2rem);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.article-modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-inner { position: relative; }

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.modal-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-body { padding: 2rem; }

.modal-topic {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  text-transform: capitalize;
  margin-bottom: 0.75rem;
}

.modal-body h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-content {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.modal-content p { margin-bottom: 1rem; }
.modal-content h4 { color: var(--text); margin: 1.5rem 0 0.5rem; font-size: 1.05rem; }

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-card-1 { left: 0.5rem; }
  .hero-card-2 { right: 0.5rem; }
  .about-grid { grid-template-columns: 1fr; }
  .strip-card { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

@media (max-width: 480px) {
  .hero { padding-top: 2rem; }
  .topic-filters { gap: 0.4rem; }
  .topic-btn { padding: 0.45rem 0.85rem; font-size: 0.82rem; }
  .articles-grid { grid-template-columns: 1fr; }
}
