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

:root {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --primary: 217.2 91.2% 59.8%;
  --primary-light: 217.2 91.2% 70%;
  --secondary: 217.2 32.6% 17.5%;
  --muted: 215 20.2% 65.1%;
  --radius: 0.75rem;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --max-width: 1200px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #581c87 50%, #1e40af 100%);
  color: hsl(var(--foreground));
  min-height: 100vh;
  line-height: 1.5;
  padding-top: 70px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ====== Typography ====== */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

/* ====== Layout Components ====== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.section-subtitle {
  text-align: center;
  font-size: 1.25rem;
  color: hsl(var(--muted));
  max-width: 800px;
  margin: 0 auto 3rem;
}

/* ====== Glassmorphism Effect ====== */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 2rem;
  overflow: hidden;
  transition: var(--transition);
}

/* ====== Gradient Text ====== */
.gradient-text {
  background: linear-gradient(90deg, #8b5cf6, #ec4899, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 300%;
  animation: gradient-shift 5s ease infinite;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ====== Navigation ====== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: white;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  background: linear-gradient(to right, #a855f7, #ec4899);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: var(--transition);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.nav-link:hover {
  color: #c084fc;
}

.nav-link.active {
  color: #c084fc;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #a855f7, #ec4899);
}

/* Mobile Navigation */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: white;
  transition: var(--transition);
}

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.8rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  min-width: 44px;
  min-height: 44px;
}

.btn-primary {
  background: linear-gradient(to right, #9333ea, #db2777);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(to right, #8b5cf6, #ec4899);
}

.btn-outline {
  border: 2px solid #c084fc;
  color: #c084fc;
  background: transparent;
}

.btn-outline:hover {
  background: #c084fc;
  color: white;
}

.btn-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ====== Home Page Components ====== */
.hero {
  padding: 3rem 0 5rem;
  text-align: center;
}

.hero h1 {
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  color: hsl(var(--muted));
  max-width: 800px;
  margin: 0 auto 2rem;
}

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

.service-card {
  padding: 2rem;
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-5px);
}

.service-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  color: #c084fc;
}

.service-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: white;
}

.service-description {
  color: hsl(var(--muted));
}

/* Portfolio Components */
.portfolio-header {
  padding: 3rem 0 2rem;
  text-align: center;
}

.portfolio-item {
  margin-bottom: 4rem;
  scroll-margin-top: 6rem;
}

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

.portfolio-image {
  height: 300px;
  border-radius: calc(var(--radius) - 0.5rem);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

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

.portfolio-img:hover {
  transform: scale(1.02);
}

.feature-list {
  color: hsl(var(--muted));
  list-style-type: none;
}

.feature-list li {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.feature-list li::before {
  content: "•";
  color: #c084fc;
  position: absolute;
  left: 0;
}

/* Contact Page Components */
.contact-header {
  padding: 3rem 0 2rem;
  text-align: center;
}

.contact-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-info {
  flex: 1;
}

.contact-form-container {
  flex: 1;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: #c084fc;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

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

.business-hours {
  margin-top: 2.5rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 1rem;
  color: white;
}

.form-control {
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  width: 100%;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: rgba(192, 132, 252, 0.5);
  box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.25);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

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

.testimonial-card {
  padding: 2rem;
  border-radius: var(--radius);
}

.testimonial-card blockquote {
  font-style: italic;
  margin-bottom: 1.5rem;
  position: relative;
}

.testimonial-card blockquote::before {
  content: '"';
  font-size: 3rem;
  color: rgba(192, 132, 252, 0.2);
  position: absolute;
  left: -1rem;
  top: -1rem;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
}

.testimonial-author strong {
  color: white;
}

.testimonial-author span {
  color: hsl(var(--muted));
  font-size: 0.9rem;
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.pricing-card {
  padding: 2rem;
  border-radius: var(--radius);
  position: relative;
}

.pricing-card.featured {
  border: 1px solid rgba(192, 132, 252, 0.5);
  overflow: visible;
}

.popular-badge {
  position: absolute;
  top: -0.75rem;
  right: 1.5rem;
  background: linear-gradient(to right, #9333ea, #db2777);
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.price {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 1rem 0;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pricing-features {
  list-style: none;
  margin: 2rem 0;
  color: hsl(var(--muted));
}

.pricing-features li {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
}

.pricing-features li::before {
  content: "✓";
  color: #c084fc;
  position: absolute;
  left: 0;
}

/* CTA Section */
.cta-container {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  color: white;
}

.contact-info-item svg {
  width: 1.5rem;
  height: 1.5rem;
  color: #c084fc;
}

.benefits-tags {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.benefit-tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.9rem;
}

/* Footer */
footer {
  padding: 3rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 2rem;
}

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

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

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

/* ====== Scrollbar ====== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #7c3aed, #db2777);
}

/* ====== Responsive Styles ====== */
@media (max-width: 992px) {
  .section {
    padding: 4rem 0;
  }
  
  .hero {
    padding: 2rem 0 3rem;
  }
  
  .contact-info,
  .contact-form-container {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 3rem 0;
  }
  
  .services-grid, .pricing-grid, .testimonials-grid {
    grid-template-columns: 1fr;
  }
  
  .service-card, .pricing-card, .testimonial-card {
    width: 100%;
    margin-bottom: 1.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .section-subtitle {
    font-size: 1.1rem;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 0;
    gap: 0;
    transform: translateY(-150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    padding: 1.2rem;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  .portfolio-images {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .nav-container {
    padding: 0 1rem;
  }
  
  .hero {
    padding: 1.5rem 0 2rem;
  }
  
  .btn-group {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .contact-content {
    flex-direction: column;
  }
}

/* ====== Accessibility Improvements ====== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .gradient-text {
    animation: none;
  }
}

/* ====== Print Styles ====== */
@media print {
  nav, footer {
    display: none;
  }
  
  body {
    padding-top: 0;
    background: white !important;
    color: black !important;
  }
  
  .glass {
    background: white !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
  }
  
  .btn {
    display: none !important;
  }
}

/* ====== Fallbacks ====== */
@supports not (backdrop-filter: blur(10px)) {
  .glass {
    background: rgba(15, 23, 42, 0.95);
  }
  
  nav {
    background: rgba(15, 23, 42, 0.95);
  }
}

/* ====== Chrome-specific fixes ====== */
@media screen and (-webkit-min-device-pixel-ratio:0) {
  .pricing-card, 
  .service-card,
  .testimonial-card {
    transform: translateZ(0);
    backface-visibility: hidden;
  }
}