:root {
  --primary-color: #2563eb;
  --secondary-color: #7c3aed;
  --text-color: #1f2937;
  --text-muted: #6b7280;
  --bg-color: #ffffff;
  --bg-alt: #f9fafb;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --text-color: #f9fafb;
  --text-muted: #9ca3af;
  --bg-color: #111827;
  --bg-alt: #1f2937;
  --border-color: #374151;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  overflow-x: hidden;
}

/* Header */
.site-header {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-family: "Poppins", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 0.5rem 0;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.nav-menu a:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.nav-menu a:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-form {
  display: flex;
  align-items: center;
  background: var(--bg-alt);
  border-radius: 20px;
  padding: 0.5rem 1rem;
}

.search-form input {
  border: none;
  background: none;
  outline: none;
  color: var(--text-color);
}

.search-form button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
}

.theme-toggle {
  border: none;
  background: var(--bg-alt);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
}

.mobile-menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text-color);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="light"] .moon-icon {
  display: none;
}

/* Mobile theme toggle - hidden by default, shown in mobile menu */
.mobile-only {
  display: none;
}

.theme-toggle-mobile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-color);
  font-weight: 500;
  width: 100%;
  transition: all 0.3s ease;
}

.theme-toggle-mobile:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.theme-toggle-mobile svg {
  flex-shrink: 0;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  border: none;
  background: none;
  cursor: pointer;
}

.mobile-menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text-color);
  transition: 0.3s;
}

/* Hero */
.hero {
  padding: 6rem 0;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--bg-color) 100%);
}

.hero-title {
  font-family: "Poppins", sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Global Responsive Image & Element Rules */
img,
video,
iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

section,
.section {
  overflow-x: hidden;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
}

.btn-primary:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.3),
    0 0 0 1px rgba(37, 99, 235, 0.5);
}

.btn-primary:active {
  transform: translateY(-2px) scale(1);
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text-color);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Sections */
section {
  padding: 4rem 0;
}

.section-title {
  font-family: "Poppins", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.service-card {
  padding: 2rem;
  background: var(--bg-alt);
  border-radius: 12px;
  text-align: center;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(37, 99, 235, 0.1) 50%,
    transparent 70%
  );
  transform: rotate(45deg) translateX(-100%);
  transition: transform 0.6s ease;
}

.service-card:hover::before {
  transform: rotate(45deg) translateX(100%);
}

.service-card:hover {
  transform: translateY(-10px) rotateY(5deg) scale(1.03);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15),
    0 0 0 1px rgba(37, 99, 235, 0.1);
}

/* Portfolio Page */
.portfolio-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 5rem 0 3rem;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.portfolio-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></svg>');
  background-size: 50px 50px;
  opacity: 0.3;
}

.portfolio-header {
  position: relative;
  z-index: 1;
}

.portfolio-title {
  font-family: "Poppins", sans-serif;
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  animation: fadeInDown 0.8s ease-out;
}

.portfolio-subtitle {
  font-size: 1.25rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.portfolio-content {
  padding: 4rem 0;
}

/* Category Filters */
.category-filters-wrapper {
  margin-bottom: 3rem;
  overflow-x: hidden;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  background: var(--bg-alt);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 50px;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-color);
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  z-index: 0;
}

.filter-btn:hover::before {
  width: 300px;
  height: 300px;
}

.filter-btn:hover {
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.filter-icon {
  font-size: 0.6rem;
  position: relative;
  z-index: 1;
}

.filter-btn span,
.filter-btn .filter-icon {
  position: relative;
  z-index: 1;
}

/* Projects Count */
.projects-count {
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-alt);
  border-radius: 20px;
  margin-left: 0.5rem;
  font-size: 0.95rem;
}

/* Projects Grid */
.projects-grid-wrapper {
  position: relative;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.project-card {
  background: var(--bg-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 0.6s ease-out forwards;
}

.project-card[data-index="0"] {
  animation-delay: 0.1s;
}
.project-card[data-index="1"] {
  animation-delay: 0.2s;
}
.project-card[data-index="2"] {
  animation-delay: 0.3s;
}
.project-card[data-index="3"] {
  animation-delay: 0.4s;
}
.project-card[data-index="4"] {
  animation-delay: 0.5s;
}
.project-card[data-index="5"] {
  animation-delay: 0.6s;
}

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.15);
  border-color: var(--primary-color);
}

.project-image-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: var(--bg-alt);
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--bg-color) 100%);
  color: var(--text-muted);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(37, 99, 235, 0.9) 0%,
    rgba(124, 58, 237, 0.9) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-card:hover .project-image {
  transform: scale(1.1);
}

.view-project {
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  transform: translateY(10px);
  transition: transform 0.4s ease;
}

.project-card:hover .view-project {
  transform: translateY(0);
}

.project-info {
  padding: 1.75rem;
}

.project-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-color);
  transition: color 0.3s ease;
  line-height: 1.3;
}

.project-card:hover .project-title {
  color: var(--primary-color);
}

.project-excerpt {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.project-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* No Projects */
.no-projects {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-alt);
  border-radius: 16px;
  margin: 2rem 0;
}

.no-projects svg {
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.no-projects h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.no-projects p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

/* Pagination */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
}

textarea.form-control {
  resize: vertical;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Footer */
.site-footer {
  background: var(--bg-alt);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h3,
.footer-col h4 {
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-col a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination-link {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-color);
}

.pagination-link.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Responsive */
/* ===================================
   RESPONSIVE DESIGN - Mobile & Tablet
   =================================== */

/* Tablet Styles (768px - 1024px) */
@media (max-width: 1024px) {
  .container {
    padding: 0 30px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .portfolio-title {
    font-size: 2.5rem;
  }

  .portfolio-subtitle {
    font-size: 1.1rem;
  }
}

/* Mobile Styles (max-width: 768px) */
@media (max-width: 768px) {
  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .container {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Hide logo text on mobile, keep only icon/initial */
  .logo span {
    display: none;
  }

  .logo::before {
    content: "N";
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
  }

  /* Hide desktop theme toggle on mobile */
  .nav-actions {
    display: none !important;
  }

  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex !important;
  }

  /* Show mobile-only items in menu */
  .mobile-only {
    display: block !important;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }

  /* Navigation */
  .nav-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: var(--bg-color);
    border-left: 1px solid var(--border-color);
    padding: 5rem 2rem 2rem;
    flex-direction: column;
    gap: 0;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow-y: auto;
  }

  .nav-menu.active {
    display: flex;
    transform: translateX(0);
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu a {
    display: block;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
  }

  .nav-menu a::after {
    display: none;
  }

  .nav-menu a:hover {
    background: var(--bg-alt);
    transform: translateX(5px);
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* Overlay for mobile menu */
  body.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  /* Container */
  .container {
    padding: 0 16px;
    max-width: 100%;
  }

  /* Prevent all images from overflowing */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Typography */
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.5;
  }

  .section-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Hero Section */
  .hero {
    padding: 3rem 0;
    overflow-x: hidden;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 1rem;
  }

  /* Projects Grid - Single Column on Mobile */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
  }

  .project-card {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
  }

  .project-image-wrapper {
    height: 220px;
  }

  .project-image {
    height: 100%;
    width: 100%;
    object-fit: cover;
  }

  .project-info {
    padding: 1.25rem;
    width: 100%;
  }

  .project-title {
    font-size: 1.2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Portfolio Hero */
  .portfolio-hero {
    padding: 3.5rem 0 2.5rem;
  }

  .portfolio-title {
    font-size: 2rem;
  }

  .portfolio-subtitle {
    font-size: 1rem;
  }

  /* Category Filters */
  .category-filters-wrapper {
    margin-bottom: 2rem;
  }

  .category-filters {
    gap: 0.5rem;
    padding: 1rem;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0.5rem;
  }

  .category-filters::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Forms */
  .form-group {
    margin-bottom: 1.25rem;
    width: 100%;
  }

  .form-control {
    padding: 0.85rem;
    font-size: 1rem;
    width: 100%;
    max-width: 100%;
  }

  textarea.form-control {
    min-height: 120px;
    resize: vertical;
  }

  label {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    display: block;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1rem;
  }

  /* Footer */
  .site-footer {
    padding: 3rem 0 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }

  .footer-links {
    justify-content: center;
  }

  .footer-social {
    justify-content: center;
    gap: 1.5rem;
  }

  .footer-social a {
    width: 44px;
    height: 44px;
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .testimonial-card {
    padding: 1.5rem;
  }

  /* Project Detail */
  .project-detail-header {
    padding: 2rem 0;
  }

  .project-detail-title {
    font-size: 2rem;
  }

  .project-meta {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .project-gallery {
    gap: 1rem;
  }

  /* About Page */
  .about-content {
    padding: 2rem 0;
  }

  /* Contact Page */
  .contact-section {
    padding: 2rem 0;
  }

  .contact-info-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-info-item {
    padding: 1.5rem;
  }

  /* Pagination */
  .pagination {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .pagination a {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    min-width: 44px;
  }

  /* Sections */
  section {
    padding: 3rem 0;
  }

  /* CTA Section */
  .cta-section {
    padding: 2.5rem 1.25rem;
    border-radius: 12px;
    margin: 0 16px;
    max-width: calc(100% - 32px);
  }

  .cta-section h2 {
    font-size: 1.75rem;
    word-wrap: break-word;
  }

  .cta-section p {
    font-size: 1rem;
  }

  /* Error Pages */
  .error-page {
    padding: 3rem 0;
  }

  .error-page h1 {
    font-size: 6rem;
  }

  .error-page h2 {
    font-size: 1.75rem;
  }

  /* Search Form in Header */
  .search-form {
    display: none; /* Hide on mobile to save space */
  }

  /* Improve touch targets */
  a,
  button,
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
    max-width: 100%;
  }

  .logo {
    font-size: 1.2rem;
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero-title {
    font-size: 1.65rem;
    line-height: 1.2;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .project-image {
    height: 180px;
    width: 100%;
  }

  .project-info {
    padding: 1rem;
    width: 100%;
  }

  .project-info h3 {
    font-size: 1.05rem;
  }

  .btn {
    padding: 0.8rem 1.25rem;
    font-size: 0.9rem;
    width: 100%;
  }

  .category-filters {
    gap: 0.5rem;
    justify-content: flex-start;
  }

  .filter-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    text-align: center;
  }

  .service-card {
    padding: 1.5rem;
  }

  .service-card h3 {
    font-size: 1.15rem;
  }

  .cta-section {
    padding: 2rem 1rem;
    margin: 0 12px;
    border-radius: 12px;
    max-width: calc(100% - 24px);
  }

  .cta-section h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .cta-section p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .error-page h1 {
    font-size: 4.5rem;
  }

  .error-page h2 {
    font-size: 1.5rem;
  }

  .pagination a {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    min-width: 40px;
  }

  .testimonial-card {
    padding: 1.25rem;
  }

  .contact-info-item {
    padding: 1.25rem;
  }

  .footer-social a {
    width: 40px;
    height: 40px;
  }
}

/* Extra Small Mobile (max-width: 375px) - iPhone SE, Small Devices */
@media (max-width: 375px) {
  .container {
    padding: 0 10px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 0.85rem;
  }

  .section-title {
    font-size: 1.35rem;
  }

  .nav-menu {
    width: 260px;
    max-width: 90vw;
    padding: 4.5rem 1.5rem 2rem;
  }

  .mobile-menu-toggle {
    padding: 0.5rem;
  }

  .project-image {
    height: 160px;
  }

  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  .filter-btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
  }

  .cta-section {
    padding: 1.75rem 0.85rem;
    margin: 0 10px;
  }

  .cta-section h2 {
    font-size: 1.35rem;
  }

  .cta-section p {
    font-size: 0.85rem;
  }
}

/* Utilities */
.text-center {
  text-align: center;
}

.content-text {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
}

.content-text h2 {
  margin: 2rem 0 1rem;
  font-family: "Poppins", sans-serif;
}

.content-text p {
  margin-bottom: 1rem;
}

/* Category Filters */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.testimonial-card {
  padding: 2rem;
  background: var(--bg-alt);
  border-radius: 12px;
}

.testimonial-card blockquote {
  font-style: italic;
}

.testimonial-card footer {
  margin-top: 1rem;
  font-style: normal;
}

.testimonial-card footer strong {
  display: block;
}

.testimonial-card footer span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* CTA Section */
.cta-section {
  text-align: center;
  padding: 5rem 0;
  background: var(--bg-alt);
  border-radius: 12px;
}

.cta-section h2 {
  font-family: "Poppins", sans-serif;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* Error Pages */
.error-page {
  text-align: center;
  padding: 5rem 0;
}

.error-page h1 {
  font-size: 8rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.error-page h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* ============================================
   3D ANIMATIONS & SMOOTH TRANSITIONS
   ============================================ */

/* Scroll-triggered animation */
.animate-in {
  animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Floating animation for hero elements */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.hero-title {
  animation: float 6s ease-in-out infinite;
}

/* Smooth page transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body {
  animation: fadeIn 0.3s ease-in;
}

/* Gradient animation for buttons */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.btn-primary {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

/* Pulse animation for important elements */
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
}

/* Smooth card reveal */
.project-card,
.service-card {
  opacity: 0;
  transform: translateY(30px);
}

.project-card.animate-in,
.service-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* 3D Flip effect for category filters */
.filter-btn {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.filter-btn:hover {
  transform: rotateY(10deg) scale(1.05);
}

.filter-btn.active {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

/* Smooth image loading */
img {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

img.loaded,
img[src] {
  opacity: 1;
}

/* Hover glow effect */
.project-card::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(37, 99, 235, 0.1) 0%,
    transparent 70%
  );
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.6s ease;
  pointer-events: none;
  z-index: 0;
}

.project-card:hover::after {
  transform: translate(-50%, -50%) scale(1.5);
}

/* Stagger animation for lists */
.nav-menu li,
.category-filters .filter-btn {
  animation: slideInDown 0.5s ease-out backwards;
}

.nav-menu li:nth-child(1) {
  animation-delay: 0.1s;
}
.nav-menu li:nth-child(2) {
  animation-delay: 0.2s;
}
.nav-menu li:nth-child(3) {
  animation-delay: 0.3s;
}
.nav-menu li:nth-child(4) {
  animation-delay: 0.4s;
}
.nav-menu li:nth-child(5) {
  animation-delay: 0.5s;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
