:root {
  /* Colors */
  --bg-dark: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-hover: #334155;
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.3);
  --secondary: #818cf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --border-hover: #475569;
  
  /* Code Colors */
  --code-bg: #020617;
  --code-keyword: #c678dd;
  --code-string: #98c379;
  --code-function: #61afef;
  --code-number: #d19a66;
  
  /* Spacing */
  --container-width: 1200px;
  --header-height: 70px;
  
  /* Effects */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px var(--primary-glow);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

ul {
  list-style: none;
}

/* Background Effects */
.bg-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.15), transparent 50%);
  z-index: -2;
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

/* Layout */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-main);
}

.logo img {
  transition: transform 0.3s ease;
}

.logo:hover img {
  transform: rotate(10deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-badge {
  height: 20px;
  transition: transform 0.2s ease;
}

.nav-badge:hover {
  transform: translateY(-1px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-primary {
  background: var(--primary);
  color: #0f172a;
}

.btn-primary:hover {
  background: #7dd3fc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

/* Hero Section */
.hero {
  padding: 160px 0 100px;
  text-align: center;
}

.badge-wrapper {
  margin-bottom: 24px;
  animation: fadeDown 0.8s ease-out;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
}

.hero-title {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  animation: fadeUp 0.8s ease-out 0.1s backwards;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
  animation: fadeUp 0.8s ease-out 0.2s backwards;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  animation: fadeUp 0.8s ease-out 0.3s backwards;
}

.hero-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-top: 40px;
  flex-wrap: wrap;
  animation: fadeUp 0.8s ease-out 0.4s backwards;
}

.stat-item {
  transition: transform 0.2s ease;
}

.stat-item:hover {
  transform: translateY(-2px);
}

.stat-item img {
  height: 20px;
  display: block;
}

/* Blog Carousel */
.blog-carousel {
  padding: 80px 0;
  background: rgba(15, 23, 42, 0.3);
  border-bottom: 1px solid var(--border);
}


.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

@media (max-width: 768px) {
  .carousel-wrapper {
    position: relative;
    display: block;
  }
}

.carousel-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 24px;
  transition: transform 0.5s ease;
  will-change: transform;
}

@media (min-width: 640px) {
  .carousel-items {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .carousel-items {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-card {
  min-width: 300px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.carousel-track .blog-card {
  flex: 0 0 320px; /* fixed width for sliding */
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.blog-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card .post-image img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}

.blog-card .blog-excerpt {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card .blog-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.blog-card .blog-date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.carousel-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.carousel-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--primary);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}

/* Skeleton Loading */
.skeleton {
  pointer-events: none;
  cursor: default;
}

.skeleton-title,
.skeleton-text {
  background: linear-gradient(90deg, var(--border) 25%, var(--border-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-title {
  height: 24px;
  width: 80%;
  margin-bottom: 16px;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text:last-child {
  width: 60%;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Features Section */
.features {
  padding: 80px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.5);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

.feature-card {
  text-align: center;
  padding: 24px;
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 16px;
  display: inline-block;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 15px;
}

/* Projects Section */
.projects {
  padding: 100px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 18px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 32px;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.project-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.project-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-meta h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  color: var(--text-muted);
  font-weight: 500;
}

.project-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
  flex-grow: 1;
}

.project-links {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.link-item {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.link-item:hover {
  text-decoration: underline;
}

.badges {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.projects-cta {
  display: flex;
  justify-content: center;
  margin-top: 60px;
}

/* Code Preview */
.code-preview {
  background: var(--code-bg);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-top: auto;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.code-preview pre {
  padding: 12px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-main);
}

/* Syntax Highlighting */
.k { color: var(--code-keyword); }
.s { color: var(--code-string); }
.f { color: var(--code-function); }
.n { color: var(--code-number); }

/* Footer */
.footer {
  padding: 60px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-dark);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-muted);
}

.footer-brand img {
  opacity: 0.7;
}

.footer-links {
  display: flex;
  gap: 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Animations */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 36px;
  }
  
  .hero-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }

  .blog-card {
    min-width: 100%;
  }

  .carousel-btn {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    box-shadow: var(--shadow-lg);
    z-index: 20;
  }

  .carousel-prev {
    left: 8px;
  }

  .carousel-next {
    right: 8px;
  }

  .carousel-container {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .carousel-container::-webkit-scrollbar {
    display: none;
  }

  .carousel-track {
    display: flex;
    gap: 16px;
    padding: 0 16px;
  }

  .carousel-track .blog-card {
    flex: 0 0 calc(100% - 32px);
    scroll-snap-align: center;
  }

  .blog-carousel {
    padding: 60px 0;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 12px;
  }
  .carousel-dot {
    min-width: 24px;
    min-height: 24px;
    padding: 4px;
  }
}
