/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --secondary-color: #64748b;
  --accent-color: #f59e0b;
  --background-color: #ffffff;
  --surface-color: #f8fafc;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --transition: all 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background-color);
  overflow-x: hidden;
}

/* Header styles */
header {
  background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: white;
}

nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: var(--transition);
  position: relative;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

nav a.active {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 3px 0;
  transition: var(--transition);
}

/* Main content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  min-height: calc(100vh - 200px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2.25rem;
  font-weight: 600;
}

h3 {
  font-size: 1.875rem;
  font-weight: 600;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 1.125rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

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

.btn-primary:hover {
  background-color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
  background-color: #e2e8f0;
  transform: translateY(-2px);
}

/* Cards */
.card {
  background-color: white;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

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

/* Hero section enhancements */
.hero {
  text-align: center;
  padding: 6rem 2rem;
  background: linear-gradient(135deg, var(--surface-color), #e0f2fe);
  border-radius: 1rem;
  margin-bottom: 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23000" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.5rem;
  margin-bottom: 3rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-secondary);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Features section */
.features {
  margin: 4rem 0;
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

/* Stats section */
.stats-section {
  padding: 4rem 2rem;
  background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
  color: white;
  border-radius: 1rem;
  margin: 4rem 0;
}

.stats-section h2 {
  color: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

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

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: white;
}

.stat-label {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.8);
}

/* CTA section */
.cta-section {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface-color);
  border-radius: 1rem;
  margin: 4rem 0;
}

.cta-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.cta-content p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Team section */
.team-section {
  margin: 4rem 0;
}

.team-avatar {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
}

.team-role {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Timeline section */
.timeline-section {
  margin: 4rem 0;
}

.timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: var(--border-color);
}

.timeline-item {
  display: flex;
  margin-bottom: 3rem;
  position: relative;
}

.timeline-item:nth-child(odd) {
  flex-direction: row-reverse;
}

.timeline-item:nth-child(odd) .timeline-content {
  text-align: right;
  margin-right: 2rem;
}

.timeline-item:nth-child(even) .timeline-content {
  margin-left: 2rem;
}

.timeline-date {
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  font-weight: 600;
  min-width: 100px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.timeline-content {
  flex: 1;
  background: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.timeline-content h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Contact form styles */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: var(--transition);
  background-color: var(--background-color);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

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

/* Portfolio grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.portfolio-item {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.portfolio-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.portfolio-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.portfolio-content {
  padding: 1.5rem;
}

.portfolio-content h3 {
  margin-bottom: 0.5rem;
}

.portfolio-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

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

.portfolio-links {
  display: flex;
  gap: 1rem;
}

.portfolio-links a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
  transition: var(--transition);
}

.portfolio-links a:hover {
  color: var(--accent-color);
}

/* Blog styles */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.blog-post {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.blog-post:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.blog-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
}

.blog-content {
  padding: 1.5rem;
}

.blog-meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.blog-content h3 {
  margin-bottom: 0.5rem;
}

.blog-content h3 a {
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.blog-content h3 a:hover {
  color: var(--primary-color);
}

.blog-excerpt {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.read-more {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.read-more:hover {
  color: var(--accent-color);
}

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

.service-card {
  background: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  text-align: center;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.service-card h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.service-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.service-features {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.service-features li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.service-features li:last-child {
  border-bottom: none;
}

.service-features li::before {
  content: '✓';
  color: var(--primary-color);
  margin-right: 0.5rem;
  font-weight: bold;
}

/* Pricing section */
.pricing-section {
  margin: 4rem 0;
}

.price {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 1rem 0;
}

.price::before {
  content: '$';
  font-size: 1.5rem;
  vertical-align: top;
}

/* Portfolio filters */
.portfolio-filters {
  margin: 2rem 0;
}

.filter-btn {
  margin: 0.25rem;
}

.filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Process section */
.process-section {
  margin: 4rem 0;
  padding: 3rem 0;
  background: var(--surface-color);
  border-radius: 1rem;
}

/* Dark theme support */
[data-theme="dark"] {
  --primary-color: #3b82f6;
  --secondary-color: #94a3b8;
  --accent-color: #fbbf24;
  --background-color: #0f172a;
  --surface-color: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --border-color: #334155;
}

[data-theme="dark"] .hero {
  background: linear-gradient(135deg, var(--surface-color), #1e40af);
}

[data-theme="dark"] .stats-section {
  background: linear-gradient(135deg, var(--primary-color), #1e40af);
}

[data-theme="dark"] .card,
[data-theme="dark"] .contact-form,
[data-theme="dark"] .portfolio-item,
[data-theme="dark"] .blog-post,
[data-theme="dark"] .service-card {
  background-color: var(--surface-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .timeline-content {
  background-color: var(--surface-color);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background-color: #334155;
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  border-color: var(--primary-color);
}

/* Error/404 page styles */
.error-page {
  text-align: center;
  padding: 4rem 2rem;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  line-height: 1;
}

.error-message {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
}

/* Additional responsive design for new elements */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 1rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.125rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .cta-section {
    padding: 2rem 1rem;
  }
  
  .cta-content h2 {
    font-size: 2rem;
  }
  
  .error-code {
    font-size: 4rem;
  }
  
  .process-section {
    padding: 2rem 1rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .price {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
footer {
  background-color: #1e293b;
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

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

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: white;
  margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
  color: #94a3b8;
  text-decoration: none;
  margin-bottom: 0.5rem;
  display: block;
}

.footer-section a:hover {
  color: white;
  transition: var(--transition);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #334155;
  color: #94a3b8;
}

/* Social links */
.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  transition: var(--transition);
}

.social-links a:hover {
  transform: translateY(-2px) scale(1.1);
  background-color: var(--accent-color);
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 2rem; }

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

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

/* Responsive design */
@media (max-width: 768px) {
  .header-container {
    padding: 0 1rem;
  }
  
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
  }
  
  nav.active {
    display: flex;
  }
  
  nav a {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }
  
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }
  
  main {
    padding: 2rem 1rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero {
    padding: 2rem 1rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .footer-container {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  .card {
    padding: 1.5rem;
  }
}
