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

/* ================================================
   PETA KUASA RAKYAT — Premium Design System v2
   Palette: Midnight Navy × Electric Indigo × Luminous Amber
   ================================================ */

:root {
  /* Core Backgrounds */
  --bg-base: #05071a;
  --bg-surface: #0b0f2a;
  --bg-card: #0f1535;
  --bg-glass: rgba(15, 21, 53, 0.7);
  --bg-glass-light: rgba(99, 102, 241, 0.06);

  /* Brand Colors — Electric & Luminous */
  --indigo:      #6366f1;
  --indigo-light: #818cf8;
  --indigo-glow: rgba(99, 102, 241, 0.35);
  --amber:       #f59e0b;
  --amber-light: #fbbf24;
  --amber-glow:  rgba(245, 158, 11, 0.3);
  --crimson:     #ef4444;
  --emerald:     #10b981;

  /* Accent aliases */
  --accent-primary:   var(--indigo);
  --accent-hover:     var(--indigo-light);
  --accent-secondary: var(--amber);
  --accent-danger:    var(--crimson);

  /* Typography */
  --text-primary:   #f0f4ff;
  --text-secondary: #a5b4fc;
  --text-muted:     #4c5a8a;

  /* Borders & Shadows */
  --border-subtle: rgba(99, 102, 241, 0.15);
  --border-glow:   rgba(99, 102, 241, 0.4);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.6);
  --shadow-glow-indigo: 0 0 30px rgba(99, 102, 241, 0.25);
  --shadow-glow-amber:  0 0 30px rgba(245, 158, 11, 0.2);

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
}

/* Light mode override */
[data-theme="light"] {
  --bg-base: #f0f2ff;
  --bg-surface: #ffffff;
  --bg-card: #f5f7ff;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --bg-glass-light: rgba(99, 102, 241, 0.04);

  --indigo:       #4f46e5;
  --indigo-light: #6366f1;
  --indigo-glow:  rgba(79, 70, 229, 0.2);
  --amber:        #d97706;
  --amber-light:  #f59e0b;
  --amber-glow:   rgba(217, 119, 6, 0.2);

  --accent-primary:   var(--indigo);
  --accent-hover:     var(--indigo-light);
  --accent-secondary: var(--amber);

  --text-primary:   #0f0c2d;
  --text-secondary: #3730a3;
  --text-muted:     #7c7cad;

  --border-subtle: rgba(79, 70, 229, 0.15);
  --border-glow:   rgba(79, 70, 229, 0.35);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 20px rgba(79, 70, 229, 0.1);
  --shadow-lg:  0 12px 40px rgba(79, 70, 229, 0.15);
  --shadow-glow-indigo: 0 0 30px rgba(79, 70, 229, 0.15);
  --shadow-glow-amber:  0 0 30px rgba(217, 119, 6, 0.12);
}

/* ================================================
   RESET & BASE
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  /* Subtle noise texture for depth */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99,102,241,0.12) 0%, transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

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

p { margin-bottom: 1.4rem; }

/* ================================================
   LAYOUT
   ================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 5rem 0; }
.pt-nav { padding-top: calc(72px + 4rem); }

/* ================================================
   NAVBAR — Glassmorphism Premium
   ================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 72px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.02em;
}

.logo svg { width: 32px; height: 32px; }

.logo span {
  background: linear-gradient(135deg, var(--indigo-light), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-glass-light);
}

.nav-links a.active {
  color: var(--indigo-light);
  background: rgba(99, 102, 241, 0.12);
}

.theme-toggle {
  background: var(--bg-glass-light);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.theme-toggle:hover {
  border-color: var(--border-glow);
  color: var(--indigo-light);
  box-shadow: var(--shadow-glow-indigo);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  gap: 0.5rem;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--indigo), #7c3aed);
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
  filter: brightness(1.1);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  border-color: var(--border-glow);
  background: var(--bg-glass-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-indigo);
}

.btn-amber {
  background: linear-gradient(135deg, var(--amber), #ea580c);
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}
.btn-amber:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
}

/* ================================================
   HERO SECTION
   ================================================ */
.hero {
  text-align: center;
  padding: 10rem 0 7rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 65%);
  z-index: 0;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245,158,11,0.08) 0%, transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--indigo-light);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  max-width: 950px;
  margin-inline: auto;
  background: linear-gradient(160deg, #ffffff 30%, var(--indigo-light) 65%, var(--amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 3rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ================================================
   CARDS
   ================================================ */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
  display: block;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 30px rgba(99,102,241,0.1);
  color: var(--text-primary);
}

.card:hover::before { opacity: 1; }

.card-icon {
  width: 52px;
  height: 52px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--indigo-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

/* ================================================
   SECTION HEADERS
   ================================================ */
.section-header { text-align: center; margin-bottom: 4rem; }

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.75;
}

/* ================================================
   ARTICLE STYLES
   ================================================ */
.article-header {
  max-width: 820px;
  margin: 0 auto 4rem;
  text-align: center;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 1rem;
}

.article-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--indigo-light);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-content {
  max-width: 820px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.article-content h2 {
  font-size: 1.75rem;
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.article-content h3 {
  font-size: 1.3rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--indigo-light);
}

.article-content p {
  color: var(--text-secondary);
  line-height: 1.85;
}

.article-content ul, .article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.article-content li { margin-bottom: 0.6rem; line-height: 1.75; }

.article-content blockquote {
  border-left: 3px solid var(--indigo);
  padding: 1.25rem 1.75rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(99,102,241,0.02));
  margin: 2.5rem 0;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font-style: italic;
  color: var(--text-primary);
  font-size: 1.15rem;
  line-height: 1.7;
  box-shadow: inset 0 0 40px rgba(99,102,241,0.03);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.article-content th {
  background: rgba(99, 102, 241, 0.12);
  color: var(--indigo-light);
  font-weight: 700;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border-subtle);
  text-align: left;
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.article-content td {
  padding: 0.875rem 1rem;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.article-content tr:hover td {
  background: rgba(99,102,241,0.04);
}

/* ================================================
   CALLOUT BOXES
   ================================================ */
.callout {
  background: linear-gradient(135deg, rgba(99,102,241,0.07), rgba(99,102,241,0.02));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.callout::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--indigo), var(--amber));
}

.callout-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--indigo-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ================================================
   FOOTER
   ================================================ */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 5rem 0 2.5rem;
  margin-top: 5rem;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 1rem;
  max-width: 360px;
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-title {
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.625rem; }
.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--indigo-light); }

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ================================================
   MERMAID DIAGRAM
   ================================================ */
.mermaid-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin: 2.5rem 0;
  overflow-x: auto;
}

/* ================================================
   UTILITIES
   ================================================ */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

/* Highlight text */
.text-gradient {
  background: linear-gradient(135deg, var(--indigo-light), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
    gap: 0.25rem;
  }
  .nav-links.active { display: flex; }
  .mobile-menu-btn { display: block; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero { padding: 8rem 0 5rem; }

  .hero h1 { font-size: 2.4rem; }
}
