:root {
  --brand: #10b981;
  --brand-light: #34d399;
  --brand-dark: #059669;
  --brand-glow: rgba(16, 185, 129, 0.15);
  --brand-glow-strong: rgba(16, 185, 129, 0.25);
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --card-hover-bg: #f9fafb;
  --nav-hover: rgba(255, 255, 255, 0.06);
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --sidebar-width: 240px;
  --bg-main: #f3f4f6;
  --bg-sidebar: #0f172a;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-main);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.15); }

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255,255,255,0.06);
  z-index: 40;
}

.main-content {
  flex: 1;
  min-height: 100vh;
  background: var(--bg-main);
}

.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.glass-card-static {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}

.brand-text {
  color: var(--brand);
}

.brand-border {
  border-color: rgba(16, 185, 129, 0.3);
}

.brand-bg {
  background: rgba(16, 185, 129, 0.1);
}

.brand-glow {
  box-shadow: 0 0 20px var(--brand-glow);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 10px;
  color: #94a3b8;
  transition: all 0.25s ease;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.nav-link:hover {
  background: var(--nav-hover);
  color: #f1f5f9;
}

.nav-link.active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--brand);
  font-weight: 600;
}

.nav-link .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  opacity: 0.7;
}

.nav-link.active .nav-icon {
  opacity: 1;
}

.nav-link .nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-link.active .nav-dot {
  opacity: 1;
}

/* ---- Article Card (2-column with image) ---- */
.article-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}

.article-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.article-card .card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.article-card .card-body {
  padding: 16px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.article-card:hover h3 {
  color: var(--brand-dark);
}

.article-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: auto;
}

.article-card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ---- Tag Badge ---- */
.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 500;
  background: rgba(16, 185, 129, 0.08);
  color: var(--brand-dark);
  border: 1px solid rgba(16, 185, 129, 0.15);
  transition: all 0.2s;
}

.tag-badge:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

/* ---- Product Card (1-column with image) ---- */
.product-card {
  display: flex;
  gap: 20px;
  padding: 20px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  align-items: flex-start;
}

.product-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.product-card .product-img {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f3f4f6;
}

.product-card .product-info {
  flex: 1;
  min-width: 0;
}

.product-card .product-info h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.product-card .product-info .product-sub {
  font-size: 12px;
  color: var(--brand-dark);
  margin-bottom: 8px;
}

.product-card .product-info p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.product-card .tech-tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: #f3f4f6;
  color: var(--text-secondary);
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}

.product-card .tech-tag:hover {
  background: rgba(16,185,129,0.08);
  color: var(--brand-dark);
  border-color: rgba(16,185,129,0.2);
}

/* ---- Resource Card (compact, supports up to 6-column grid) ---- */
.resource-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: all 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  gap: 6px;
  min-width: 0;
}

.resource-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.resource-card .resource-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: rgba(16,185,129,0.08);
  color: var(--brand-dark);
  flex-shrink: 0;
}

.resource-card .resource-info {
  width: 100%;
  overflow: hidden;
}

.resource-card .resource-info h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1px;
  transition: color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-card:hover .resource-info h4 {
  color: var(--brand-dark);
}

.resource-card .resource-info p {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.resource-cat-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-left: 4px;
}

/* ---- Stat Card ---- */
.stat-card {
  padding: 20px 16px;
  border-radius: 12px;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---- Timeline ---- */
.timeline-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 28px;
  border-left: 2px solid #e5e7eb;
  transition: border-color 0.3s;
}

.timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline-item:hover {
  border-left-color: rgba(16, 185, 129, 0.3);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--bg-main);
  transition: all 0.3s;
  z-index: 1;
}

.timeline-item:hover::before {
  transform: scale(1.3);
  box-shadow: 0 0 12px var(--brand-glow);
}

.timeline-item .timeline-year {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.timeline-item .timeline-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  transition: color 0.2s;
}

.timeline-item:hover .timeline-title {
  color: var(--brand-dark);
}

.timeline-item .timeline-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---- Section Title ---- */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(16,185,129,0.3), transparent);
}

/* ---- Banner ---- */
.banner-slide {
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 32px;
  transition: opacity 0.3s ease;
}

.banner-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  border: 1px solid var(--card-border);
  border-radius: 14px;
}

.banner-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: radial-gradient(ellipse at 30% 50%, rgba(16,185,129,0.08) 0%, transparent 60%);
}

.banner-slide .banner-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.banner-slide h2 {
  font-size: 24px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.banner-slide p {
  font-size: 14px;
  color: #94a3b8;
}

/* ---- Dots ---- */
.dots-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  cursor: pointer;
  transition: all 0.35s ease;
}

.dot:hover {
  background: #9ca3af;
}

.dot.active {
  background: var(--brand);
  width: 28px;
  border-radius: 4px;
  box-shadow: 0 0 8px var(--brand-glow);
}

/* ---- Keyframes ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px var(--brand-glow); }
  50% { box-shadow: 0 0 28px var(--brand-glow-strong); }
}

@keyframes skeleton-pulse {
  0% { opacity: 0.06; }
  50% { opacity: 0.15; }
  100% { opacity: 0.06; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ---- Animation Classes ---- */
.animate-fade-in-up {
  animation: fadeInUp 0.45s ease forwards;
}

.animate-fade-in {
  animation: fadeIn 0.35s ease forwards;
}

.animate-fade-out {
  animation: fadeOut 0.15s ease forwards;
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

.animate-slide-in-right {
  animation: slideInRight 0.4s ease forwards;
}

.animate-scale-in {
  animation: scaleIn 0.35s ease forwards;
}

.stagger-1 { animation-delay: 0.04s; }
.stagger-2 { animation-delay: 0.08s; }
.stagger-3 { animation-delay: 0.12s; }
.stagger-4 { animation-delay: 0.16s; }
.stagger-5 { animation-delay: 0.2s; }
.stagger-6 { animation-delay: 0.24s; }
.stagger-7 { animation-delay: 0.28s; }
.stagger-8 { animation-delay: 0.32s; }
.stagger-9 { animation-delay: 0.36s; }
.stagger-10 { animation-delay: 0.4s; }

.skeleton {
  background: #e5e7eb;
  border-radius: 8px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---- Avatar (sidebar, dark theme) ---- */
.avatar-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark), #6366f1);
}

.avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-sidebar);
}

/* ---- Social Link (sidebar, dark theme) ---- */
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: #64748b;
  font-size: 14px;
  transition: all 0.25s ease;
  text-decoration: none;
}

.social-link:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--brand);
  transform: translateY(-1px);
}

/* ---- Footer ---- */
.footer-area {
  border-top: 1px solid #e5e7eb;
  padding: 20px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* ---- Page Transition ---- */
.content-page {
  animation: fadeIn 0.3s ease forwards;
}

.content-page-leaving {
  animation: fadeOut 0.12s ease forwards;
}

#page-loading {
  min-height: 60vh;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 260px;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 50;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 30px rgba(0,0,0,0.4);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 45;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .mobile-menu-btn {
    display: flex !important;
  }

  .main-content {
    min-height: auto;
  }

  .stat-card .stat-value {
    font-size: 22px;
  }

  .banner-slide {
    min-height: 140px;
    padding: 24px 16px;
  }

  .banner-slide h2 {
    font-size: 18px;
  }

  .product-card {
    flex-direction: column;
  }

  .product-card .product-img {
    width: 100%;
    height: 160px;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none !important;
  }

  .sidebar-overlay {
    display: none !important;
  }
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.9);
  border: 1px solid #e5e7eb;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 18px;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
}

.mobile-menu-btn:hover {
  background: #ffffff;
  color: #374151;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  padding: 16px 14px 6px;
  opacity: 0.6;
}