/* CSS Variables - Matching the original design system */
:root {
  --background: #ffffff;
  --foreground: #374151;
  --card: #f8fafc;
  --card-foreground: #374151;
  --popover: #ffffff;
  --popover-foreground: #374151;
  --primary: #374151;
  --primary-foreground: #ffffff;
  --secondary: #6366f1;
  --secondary-foreground: #ffffff;
  --muted: #f8fafc;
  --muted-foreground: #1f2937;
  --accent: #6366f1;
  --accent-foreground: #ffffff;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --border: #d1d5db;
  --input: #f8fafc;
  --ring: rgba(99, 102, 241, 0.5);
  --radius: 0.5rem;
}

/* Dark mode variables */
.dark {
  --background: #0a0a0a;
  --foreground: #fafafa;
  --card: #1a1a1a;
  --card-foreground: #fafafa;
  --popover: #0a0a0a;
  --popover-foreground: #fafafa;
  --primary: #fafafa;
  --primary-foreground: #1a1a1a;
  --secondary: #6366f1;
  --secondary-foreground: #ffffff;
  --muted: #262626;
  --muted-foreground: #a3a3a3;
  --accent: #6366f1;
  --accent-foreground: #ffffff;
  --destructive: #7f1d1d;
  --destructive-foreground: #fecaca;
  --border: #262626;
  --input: #262626;
  --ring: rgba(99, 102, 241, 0.5);
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: space-between;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--foreground);
  text-transform: uppercase;
  line-height: 1;
}

.nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--foreground);
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.mobile-menu-btn:hover {
  color: var(--accent);
  background-color: rgba(99, 102, 241, 0.1);
  border-color: var(--accent);
  transform: scale(1.05);
}

.mobile-menu-btn:active {
  transform: scale(0.95);
}

.menu-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 4rem;
  left: 0;
  right: 0;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 40;
  animation: slideDown 0.3s ease-out;
}

.mobile-nav.active {
  display: block;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  gap: 0.75rem;
}

.mobile-nav-link {
  display: block;
  padding: 1rem 1.25rem;
  color: var(--foreground);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 1rem;
  text-align: center;
  border: 1px solid transparent;
}

.mobile-nav-link:hover {
  background-color: var(--muted);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.mobile-nav-link:active {
  transform: translateY(0);
  background-color: rgba(99, 102, 241, 0.1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .nav {
    display: flex;
  }
  
  .mobile-menu-btn {
    display: none;
  }
}

/* Hero Section */
.hero {
  padding: 5rem 1rem;
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-accent {
  color: var(--accent);
}

.hero-description {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-image {
  position: relative;
}

.hero-img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@media (min-width: 640px) {
  .hero-buttons {
    flex-direction: row;
  }
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .hero-title {
    font-size: 3.75rem;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  outline: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--accent-foreground);
  padding: 0.75rem 1.5rem;
  height: 2.5rem;
}

.btn-primary:hover {
  background-color: rgba(99, 102, 241, 0.9);
  transform: scale(1.05);
}

.btn-outline {
  background-color: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  height: 2.5rem;
}

.btn-outline:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
  transform: scale(1.05);
}

.btn-icon {
  width: 1rem;
  height: 1rem;
}

/* Section styles */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

.section-description {
  color: var(--muted-foreground);
  max-width: 32rem;
  margin: 0 auto;
}

/* Services Section */
.services {
  padding: 5rem 1rem;
  background-color: var(--muted);
}

.services-grid {
  display: grid;
  gap: 2rem;
}

.service-card {
  background-color: var(--card);
  color: var(--card-foreground);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.service-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.service-icon {
  width: 3rem;
  height: 3rem;
  background-color: rgba(99, 102, 241, 0.1);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.service-icon .icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
}

.service-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.service-description {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.6;
}

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

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

/* Projects Section */
.projects {
  padding: 5rem 1rem;
}

.projects-grid {
  display: grid;
  gap: 2rem;
}

.project-card {
  background-color: var(--card);
  color: var(--card-foreground);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.project-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

.project-image {
  position: relative;
  overflow: hidden;
}

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

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

.project-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background-color: var(--accent);
  color: var(--accent-foreground);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.project-card:hover .project-title {
  color: var(--accent);
}

.project-description {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-technologies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tech-badge {
  background-color: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.project-result {
  background-color: var(--muted);
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-icon {
  width: 1rem;
  height: 1rem;
  color: var(--accent);
}

.project-source {
  background-color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  border-left: 3px solid var(--accent);
}

.source-icon {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--muted-foreground);
}

.source-text {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-style: italic;
}

.result-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
}

.project-btn {
  width: 100%;
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.project-btn:hover {
  background-color: rgba(99, 102, 241, 0.9);
}

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

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

/* About Section */
.about {
  padding: 5rem 1rem;
  background-color: var(--muted);
}

.about-content {
  max-width: 64rem;
  margin: 0 auto;
}

.about-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.about-description {
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-badge {
  background-color: rgba(99, 102, 241, 0.2);
  color: var(--foreground);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.skill-badge:hover {
  background-color: rgba(99, 102, 241, 0.3);
}

.about-features {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.feature {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.feature-icon {
  width: 3rem;
  height: 3rem;
  background-color: rgba(99, 102, 241, 0.1);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-icon .icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
}

.feature-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.feature-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Contact Section */
.contact {
  padding: 5rem 1rem;
}

.contact-content {
  max-width: 32rem;
  margin: 0 auto;
  text-align: center;
}

.contact-card {
  background-color: var(--card);
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  margin-top: 2rem;
}

.contact-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  max-width: 28rem;
  margin: 0 auto;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contact-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
}

.contact-text {
  color: var(--muted-foreground);
}

/* Footer */
.footer {
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  background-color: var(--muted);
  text-align: center;
}

.footer-text {
  color: var(--muted-foreground);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Comprehensive Mobile Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  /* Header mobile adjustments */
  .header-content {
    height: 3.5rem;
    padding: 0 0.5rem;
  }
  
  .logo-text {
    font-size: 1.125rem;
  }
  
  /* Mobile menu button improvements */
  .mobile-menu-btn {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--background);
    border: 2px solid var(--border);
  }
  
  /* Mobile navigation improvements */
  .mobile-nav {
    top: 3.5rem;
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.15);
    border-bottom: 2px solid var(--accent);
  }
  
  .mobile-nav-links {
    padding: 2rem 1rem;
    gap: 1rem;
  }
  
  .mobile-nav-link {
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  }
  
  .mobile-nav-link:hover {
    background: var(--accent);
    color: var(--accent-foreground);
    border-color: var(--accent);
    box-shadow: 0 4px 8px 0 rgba(99, 102, 241, 0.2);
  }
  
  /* Hero section mobile */
  .hero {
    padding: 2rem 0;
  }
  
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .hero-title {
    font-size: 2.25rem;
    line-height: 1.2;
  }
  
  .hero-description {
    font-size: 1.125rem;
    margin-bottom: 2rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  
  .hero-buttons .btn {
    width: 100%;
    max-width: 280px;
  }
  
  .hero-image {
    order: -1;
  }
  
  .hero-img {
    max-width: 100%;
    height: auto;
  }
  
  /* Services section mobile */
  .services {
    padding: 3rem 0;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .service-card {
    padding: 1.5rem;
  }
  
  /* Projects section mobile */
  .projects {
    padding: 3rem 0;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .project-card {
    max-width: 100%;
  }
  
  .project-image {
    height: 200px;
  }
  
  .project-content {
    padding: 1.5rem;
  }
  
  .project-title {
    font-size: 1.25rem;
  }
  
  .project-description {
    font-size: 0.9rem;
  }
  
  .tech-stack {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .tech-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  
  /* About section mobile */
  .about {
    padding: 3rem 0;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .about-content {
    text-align: center;
  }
  
  .about-image {
    order: -1;
  }
  
  .about-img {
    max-width: 100%;
    height: auto;
  }
  
  /* Contact section mobile */
  .contact {
    padding: 3rem 0;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .contact-form {
    padding: 1.5rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  .form-input,
  .form-textarea {
    padding: 0.75rem;
    font-size: 1rem;
  }
  
  .contact-info {
    text-align: center;
  }
  
  /* Section titles mobile */
  .section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }
  
  .section-description {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
  
  /* Header adjustments for very small screens */
  .header-content {
    height: 3rem;
    padding: 0 0.25rem;
  }
  
  .logo-text {
    font-size: 1rem;
  }
  
  .mobile-menu-btn {
    width: 2.25rem;
    height: 2.25rem;
  }
  
  .menu-icon {
    width: 1.25rem;
    height: 1.25rem;
  }
  
  /* Mobile navigation for very small screens */
  .mobile-nav {
    top: 3rem;
  }
  
  .mobile-nav-links {
    padding: 1.5rem 0.75rem;
    gap: 0.75rem;
  }
  
  .mobile-nav-link {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }
  
  .hero {
    padding: 1.5rem 0;
  }
  
  .hero-title {
    font-size: 1.875rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .services, .projects, .about, .contact {
    padding: 2rem 0;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .project-content {
    padding: 1rem;
  }
  
  .service-card {
    padding: 1rem;
  }
  
  .contact-form {
    padding: 1rem;
  }
}

/* Animation utilities */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Focus styles for accessibility */
.btn:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .header,
  .hero-buttons,
  .project-btn {
    display: none;
  }
  
  .hero,
  .services,
  .projects,
  .about,
  .contact {
    padding: 1rem 0;
  }
}