/* ===== CSS Variables & Reset ===== */
:root {
  --bg-primary: #0b0b1a;
  --bg-secondary: #10102a;
  --bg-card: #161638;
  --bg-card-hover: #1c1c45;
  --accent-primary: #7c3aed;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #7c3aed, #06b6d4);
  --text-primary: #e8eaf0;
  --text-secondary: #9ca3b8;
  --text-muted: #6b7280;
  --border-color: #2a2a55;
  --border-light: #1e1e48;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 40px rgba(124, 58, 237, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --max-width: 1200px;
  --header-height: 72px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.3;
  color: var(--text-primary);
}

/* ===== Utility Classes ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Header & Navigation ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(11, 11, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-height);
  transition: background 0.3s ease;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
}

.logo span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  text-decoration: none;
}

.nav a:hover,
.nav a.active {
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.1);
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero Section ===== */
.hero {
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 60%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--accent-primary);
  margin-bottom: 24px;
  font-weight: 500;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero h1 .gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.8;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--accent-gradient);
  color: #fff;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(124, 58, 237, 0.45);
  color: #fff;
}

/* ===== Article Cards Grid ===== */
.section {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-color);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

.article-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .article-card-image img {
  transform: scale(1.05);
}

.article-card-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 12px;
  background: rgba(11, 11, 26, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.article-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.article-card-body h3 a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.article-card-body h3 a:hover {
  color: var(--accent-secondary);
}

.article-card-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  flex: 1;
}

.article-card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: gap 0.3s ease;
}

.read-more:hover {
  gap: 10px;
  color: var(--accent-primary);
}

.read-more svg {
  width: 16px;
  height: 16px;
}

/* ===== Article Page ===== */
.article-page {
  padding: 120px 0 60px;
}

.article-container {
  max-width: 800px;
  margin: 0 auto;
}

.article-hero-image {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 36px;
  border: 1px solid var(--border-light);
}

.article-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-tag {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.article-container h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.article-meta-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  line-height: 1.8;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border-light);
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-top: 20px;
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 28px 0 12px;
}

.article-content p {
  margin-bottom: 18px;
  color: var(--text-primary);
  line-height: 1.85;
}

.article-content ul,
.article-content ol {
  margin-bottom: 18px;
  padding-left: 24px;
}

.article-content ul {
  list-style: disc;
}

.article-content ol {
  list-style: decimal;
}

.article-content li {
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.75;
}

.article-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-content a {
  color: var(--accent-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-content a:hover {
  color: var(--accent-primary);
}

.article-content blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  background: var(--bg-card);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 16px;
  transition: border-color 0.3s ease;
}

.resource-card:hover {
  border-color: var(--border-color);
}

.resource-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--accent-secondary);
}

.resource-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ===== Comparison Table ===== */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
}

.comparison-table th,
.comparison-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.comparison-table th {
  background: var(--bg-card);
  color: var(--accent-secondary);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.comparison-table tr:hover td {
  background: rgba(22, 22, 56, 0.5);
}

.comparison-table td {
  color: var(--text-secondary);
}

/* Table responsive wrapper */
.table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

/* ===== Back to Articles ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 28px;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: var(--accent-primary);
}

.back-link svg {
  width: 18px;
  height: 18px;
}

/* ===== CTA Section ===== */
.cta-section {
  margin-top: 48px;
  padding: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-align: center;
}

.cta-section h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.cta-section p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ===== About Page ===== */
.page-hero {
  padding: 140px 0 40px;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.page-hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.page-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 36px 0 16px;
}

.page-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 28px 0 12px;
}

.page-content p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--text-primary);
}

.page-content ul,
.page-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.page-content ul {
  list-style: disc;
}

.page-content ol {
  list-style: decimal;
}

.page-content li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--text-primary);
}

.page-content a {
  color: var(--accent-secondary);
}

/* ===== Contact Info ===== */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 24px 0;
  text-align: center;
}

.contact-card .icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: rgba(124, 58, 237, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-card .icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent-primary);
}

.contact-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.contact-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.contact-card .email {
  color: var(--accent-secondary);
  font-size: 1.1rem;
  font-weight: 600;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border-light);
  padding: 48px 0 32px;
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 12px;
  line-height: 1.7;
  max-width: 320px;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 4px 0;
  transition: color 0.3s ease;
}

.footer-col a:hover {
  color: var(--accent-secondary);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 24px 0;
  margin-top: 36px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== Cookie Banner ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-banner p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 600px;
}

.cookie-banner a {
  color: var(--accent-secondary);
  text-decoration: underline;
}

.cookie-btn {
  padding: 10px 28px;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.cookie-btn:hover {
  opacity: 0.9;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 100px 32px 32px;
    gap: 4px;
    transition: right 0.3s ease;
    border-left: 1px solid var(--border-light);
    z-index: 999;
  }

  .nav.active {
    right: 0;
  }

  .nav a {
    font-size: 1.05rem;
    padding: 12px 16px;
    width: 100%;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .section {
    padding: 40px 0;
  }

  .article-card-body {
    padding: 18px;
  }

  .article-card-footer {
    padding: 14px 18px;
  }

  .cookie-banner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .container {
    padding: 0 16px;
  }

  .article-container h1 {
    font-size: 1.5rem;
  }
}

/* ===== Overlay ===== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===== Scroll to Top ===== */
.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
}

.scroll-top svg {
  width: 20px;
  height: 20px;
}

/* ===== Featured Article (first card larger) ===== */
.articles-grid .article-card:first-child {
  grid-column: 1 / -1;
}

.articles-grid .article-card:first-child .article-card-image {
  aspect-ratio: 21/9;
}

@media (max-width: 768px) {
  .articles-grid .article-card:first-child {
    grid-column: 1;
  }

  .articles-grid .article-card:first-child .article-card-image {
    aspect-ratio: 16/10;
  }
}

/* ===== Related Articles ===== */
.related-articles {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border-light);
}

.related-articles h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.related-card {
  display: flex;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
}

.related-card:hover {
  border-color: var(--border-color);
  background: var(--bg-card-hover);
}

.related-card-image {
  width: 120px;
  min-height: 100px;
  flex-shrink: 0;
}

.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card-body {
  padding: 16px 16px 16px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.related-card-body h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
}
