/* ===== RESET & VARIABLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.5);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --nav-height: 80px;
}

/* Dark theme (default) */
[data-theme="dark"] {
  --bg-primary: #050505;
  --bg-secondary: #0a0a0a;
  --surface: #121212;
  --surface-hover: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --border: #27272a;
  --card-bg: rgba(20, 20, 20, 0.6);
  --glass-bg: rgba(10, 10, 10, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --hero-gradient: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.2);
  --border: #e2e8f0;
  --card-bg: rgba(255, 255, 255, 0.8);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.05);
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --hero-gradient: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(3rem, 8vw, 5rem);
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 3rem;
  text-align: center;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  max-width: 65ch;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

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

.text-center {
  text-align: center;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

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

.section-padding {
  padding: 6rem 0;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(var(--bg-primary), 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo img {
  height: 48px;
  width: auto;
  border-radius: 8px;
  /* Optional: adds a slight curve if it's a square logo */
}

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

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  color: var(--text-secondary);
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* Mobile Toggle */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 1001;
}

.bar {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.3s ease;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .btn-primary:hover {
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.2);
}

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

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

.btn-accent {
  background: var(--gradient-primary);
  color: white;
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: var(--nav-height);
  background: var(--hero-gradient);
  overflow: hidden;
}

.hero-bg-accent {
  position: absolute;
  width: 50vw;
  height: 50vw;
  background: var(--accent);
  filter: blur(120px);
  opacity: 0.1;
  border-radius: 50%;
  top: -20%;
  right: -10%;
  z-index: -1;
  animation: float 10s infinite alternate;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(-50px, 50px);
  }
}

.hero-content {
  text-align: center;
  max-width: 900px;
  z-index: 1;
}

.hero-sub {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 2.5rem;
  color: var(--text-secondary);
}

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  display: inline-block;
  padding: 1rem;
  background: rgba(59, 130, 246, 0.1);
  border-radius: var(--radius-md);
}

/* ===== PROJECT CARDS ===== */
.project-card {
  padding: 0;
  overflow: hidden;
}

.project-img-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover .project-img {
  transform: scale(1.05);
}

.project-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
}

.tag-free {
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  color: #000 !important;
  font-weight: 700;
  border: none !important;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.status-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-active {
  background: rgba(16, 185, 129, 0.9);
  color: white;
}

.status-inactive {
  background: rgba(107, 114, 128, 0.9);
  color: white;
}

.status-dead {
  background: rgba(239, 68, 68, 0.9);
  color: white;
}

/* ===== TECH STACK ===== */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
}

.tech-item {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.tech-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-4px);
}

/* ===== FILTER BAR ===== */
.filter-container {
  overflow-x: auto;
  padding-bottom: 1rem;
  margin-bottom: 3rem;
  display: flex;
  justify-content: center;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

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

.filter-bar {
  display: flex;
  gap: 0.75rem;
}

.filter-btn {
  padding: 0.6rem 1.25rem;
  border-radius: 50px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.footer-layout>*:nth-child(1) {
  justify-self: start;
}

.footer-layout>*:nth-child(2) {
  justify-self: center;
}

.footer-layout>*:nth-child(3) {
  justify-self: end;
  text-align: right;
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-copyright p {
  margin: 0;
  font-size: inherit;
  color: inherit;
}

.back-to-top-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1.25rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.back-to-top-btn:hover {
  transform: translateY(-3px);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .footer-layout {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .footer-copyright {
    text-align: center;
  }

  .footer-layout>* {
    justify-self: auto;
    /* Reset grid properties just in case */
    text-align: center;
  }

  .footer-layout>*:nth-child(3) {
    text-align: center;
    /* Reset explicit right align */
  }
}

/* ===== ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 {
  transition-delay: 0.1s;
}

.stagger-2 {
  transition-delay: 0.2s;
}

.stagger-3 {
  transition-delay: 0.3s;
}

/* ===== THEME TOGGLE ===== */
.theme-switch {
  background: var(--surface);
  border: 1px solid var(--border);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition);
}

.theme-switch:hover {
  background: var(--surface-hover);
}


/* Social Buttons */
.social-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: var(--transition);
  font-size: 1.1rem;
}

.social-btn:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 5px 15px rgba(var(--accent-rgb), 0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    background: var(--bg-primary);
    flex-direction: column;
    padding: 2rem;
    align-items: flex-start;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-top: 1px solid var(--border);
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .hamburger {
    display: flex;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Stats Section */
.stats-section {
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem;
  margin-top: 4rem;
}

.stat-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition);
}

.stat-item:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.stat-item:hover::before {
  opacity: 1;
}

.stat-number {
  font-size: 4rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 0.5rem;
  display: block;
}

.stat-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 480px) {
  .stat-number {
    font-size: 3rem;
  }

  .stat-item {
    padding: 2rem 1rem;
  }
}


/* Footer Quick Links */
.footer-center h4 {
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.5rem;
  /* Space between links and dots */
  flex-wrap: wrap;
  /* Wrap on small screens */
}

.footer-nav li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-nav li a:hover {
  color: var(--accent);
  /* Accent hover color */
}

.footer-nav .dot {
  color: var(--text-secondary);
  pointer-events: none;
  /* Dots are not clickable */
}