:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --accent: #f59e0b;
  --accent-green: #10b981;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-w: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

.header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-badge {
  background: var(--primary);
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-main);
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: 4.5rem 1.5rem;
  text-align: center;
  border-bottom: 4px solid var(--primary);
}

.hero-inner {
  max-width: 820px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  background: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.3);
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.15rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
}

.search-wrapper {
  max-width: 580px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1rem;
  outline: none;
  backdrop-filter: blur(8px);
  transition: all 0.3s;
}

.search-input::placeholder {
  color: #94a3b8;
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.22);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.1rem;
}

/* Categories Pills */
.categories-bar {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 1.25rem 0 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.category-pill {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
}

.category-pill:hover,
.category-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Section Title */
.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title a {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Grid & Cards */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 2rem;
  margin-bottom: 3.5rem;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-img-wrap {
  position: relative;
  height: 190px;
  background: linear-gradient(135deg, #1e293b, #334155);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 3.2rem;
}

.card-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(15, 23, 42, 0.85);
  color: #60a5fa;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.card-title a {
  color: var(--secondary);
}

.card-title a:hover {
  color: var(--primary);
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Featured Banner */
.featured-banner {
  background: linear-gradient(to right, #1e3a8a, #2563eb);
  color: #fff;
  border-radius: var(--radius);
  padding: 2.75rem;
  margin-bottom: 3.5rem;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2rem;
  align-items: center;
  box-shadow: var(--shadow-lg);
}

.featured-content h2 {
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.featured-content p {
  color: #dbeafe;
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: #fff;
  color: var(--primary);
}

.btn-primary:hover {
  background: #f1f5f9;
  color: var(--primary-hover);
}

.btn-accent {
  background: var(--primary);
  color: #fff;
}

.btn-accent:hover {
  background: var(--primary-hover);
}

/* Single Article */
.article-container {
  max-width: 840px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.breadcrumbs {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.article-header {
  margin-bottom: 2.5rem;
}

.article-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.25;
  margin: 1rem 0;
  letter-spacing: -0.02em;
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.article-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: #334155;
  margin-top: 2rem;
}

.article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
}

.article-content h3 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--secondary);
  margin: 2rem 0 0.75rem;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content code {
  background: #f1f5f9;
  color: #dc2626;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: monospace;
}

.callout {
  background: #f0fdf4;
  border-left: 4px solid var(--accent-green);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 2rem 0;
}

.callout-warning {
  background: #fffbeb;
  border-left-color: var(--accent);
}

.callout-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Newsletter Box */
.newsletter-section {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 3.5rem 2rem;
  text-align: center;
  margin: 4rem 0 2rem;
  box-shadow: var(--shadow);
}

.newsletter-box {
  max-width: 580px;
  margin: 0 auto;
}

.newsletter-box h3 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 0.75rem;
}

.newsletter-box p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
}

.newsletter-form input {
  flex-grow: 1;
  padding: 0.9rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  outline: none;
  font-size: 1rem;
}

.newsletter-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

/* Footer */
.footer {
  background: var(--secondary);
  color: #94a3b8;
  padding: 4.5rem 1.5rem 2rem;
  border-top: 1px solid #1e293b;
  margin-top: 5rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-col h4 {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.75rem;
}

.footer-col a {
  color: #94a3b8;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  border-top: 1px solid #1e293b;
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: var(--primary);
  z-index: 1000;
  width: 0%;
  transition: width 0.1s ease;
}

@media (max-width: 900px) {
  .featured-banner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .hero h1 {
    font-size: 2rem;
  }
  .mobile-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .nav-links.show {
    display: flex;
  }
  .newsletter-form {
    flex-direction: column;
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}