/* Color System - WCAG AAA Compliant based on Logo SVG */
:root {
  /* Primary Colors - Extracted from Logo (#f75f5f) */
  --primary-50: #fef2f2;
  --primary-100: #fee2e2;
  --primary-200: #fecaca;
  --primary-300: #fca5a5;
  --primary-400: #f87171;
  --primary-500: #f75f5f;
  --primary-600: #e64545;
  --primary-700: #cc3232;
  --primary-800: #b82828;
  --primary-900: #991b1b;

  /* Neutral Colors - Based on Logo Gray (#333333) */
  --neutral-50: #f9fafb;
  --neutral-100: #f3f4f6;
  --neutral-200: #e5e7eb;
  --neutral-300: #d1d5db;
  --neutral-400: #9ca3af;
  --neutral-500: #6b7280;
  --neutral-600: #4b5563;
  --neutral-700: #374151;
  --neutral-800: #333333;
  --neutral-900: #1f2937;

  /* Text Colors - Direct from Logo */
  --text-primary: #333333;
  --text-secondary: #4d4d4d;
  --text-muted: #6b7280;

  /* Accent Colors */
  --accent-500: #cc3232;
  --accent-600: #b82828;
  --accent-700: #991b1b;

  /* Semantic Colors */
  --success-500: #10b981;
  --warning-500: #f59e0b;
  --error-500: #ef4444;

  /* Logo-specific Opacities */
  --logo-opacity-1: 0.6;
  --logo-opacity-2: 0.75;
  --logo-opacity-3: 1.0;

  /* Brand Gradients based on Logo */
  --gradient-primary: linear-gradient(135deg, #f75f5f 0%, #e64545 100%);
  --gradient-secondary: linear-gradient(135deg, #f75f5f 0%, #cc3232 50%, #b82828 100%);
  --gradient-hero: linear-gradient(135deg, #333333 0%, #6b7280 100%);
  --gradient-neutral: linear-gradient(135deg, #333333 0%, #6b7280 100%);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*::before,
*::after {
  box-sizing: inherit;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--neutral-800);
  background-color: var(--neutral-50);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 0.5em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 600;
}

h4 {
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
}

p {
  margin-bottom: 1em;
  color: var(--text-secondary);
}

a {
  color: var(--primary-500);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover,
a:focus {
  color: var(--primary-600);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid var(--accent-600);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip Link - Accessibility */
.skip-link {
  position: absolute;
  top: -50px;
  left: 6px;
  background: var(--primary-600);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 6px;
}

/* Header Styles */
header {
  background: var(--neutral-800);
  padding: 1rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(51, 51, 51, 0.95);
  border-bottom: 1px solid var(--neutral-700);
  transition: all 0.3s ease;
}

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

.logo {
  display: flex;
  align-items: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  transition: transform 0.3s ease;
  gap: 0.75rem;
}

.logo:hover {
  transform: scale(1.05);
}

.logo-triangles {
  width: 24px;
  height: 27px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--neutral-100);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--primary-300);
  background: rgba(247, 95, 95, 0.1);
  text-decoration: none;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-500);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-links a:hover::after,
.nav-links a:focus::after {
  width: 80%;
}

/* Mobile Menu Button */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--neutral-100);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.3s ease;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
  background: rgba(247, 95, 95, 0.1);
  outline: 2px solid var(--accent-600);
  outline-offset: 2px;
}

/* Hero Section */
.hero {
  background: var(--gradient-hero);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding: 6rem 2rem 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="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  background-size: 100px 100px;
  animation: float 20s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(247, 95, 95, 0.05) 0%, transparent 70%);
  animation: rotate 30s linear infinite;
}

.hero-content {
  max-width: 800px;
  z-index: 1;
  position: relative;
}

.hero-logo {
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease;
}

.hero-logo img {
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  transition: transform 0.3s ease;
}

.hero-logo img:hover {
  transform: scale(1.05);
}

.hero h1 {
  color: white;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero .tagline {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  margin-bottom: 2rem;
  opacity: 0.95;
  animation: fadeInUp 1s ease 0.2s both;
  color: var(--primary-100);
}

.hero-description {
  margin-bottom: 2rem;
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  opacity: 0.9;
  animation: fadeInUp 1s ease 0.3s both;
  color: white !important;
}

.cta-button {
  display: inline-block;
  padding: 1rem 2rem;
  background: white;
  color: var(--primary-600);
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  animation: fadeInUp 1s ease 0.4s both;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}

.cta-button::before {
  display: none;
}

.cta-button:hover,
.cta-button:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(247, 95, 95, 0.3);
  text-decoration: none;
  color: var(--neutral-900);
}

.cta-button:focus {
  outline: 3px solid var(--accent-600);
  outline-offset: 2px;
}

.cta-button span {
  position: relative;
  z-index: 1;
}

/* Services Section */
.services {
  padding: 5rem 2rem;
  background: var(--neutral-50);
  position: relative;
}

.services::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
}

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

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  color: var(--text-primary);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

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

.service-card {
  background: white;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(247, 95, 95, 0.15);
  border-color: var(--primary-200);
}

.service-card:focus-within {
  outline: 3px solid var(--accent-600);
  outline-offset: -3px;
}

.service-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
  transition: transform 0.3s ease, background 0.3s ease;
  color: var(--primary-600);
  animation: bounce 2s ease-in-out infinite;
  animation-delay: calc(var(--card-index) * 0.1s);
}

.service-icon i {
  font-size: 1.5rem;
}

.service-card h3 {
  color: var(--primary-700);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.service-card p {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Expertise Section */
.expertise {
  padding: 5rem 2rem;
  background: white;
}

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

.tech-item {
  text-align: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, var(--neutral-50) 0%, var(--neutral-100) 100%);
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid var(--neutral-200);
  position: relative;
  overflow: hidden;
}

.tech-item::before {
  content: '';
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: var(--gradient-accent);
  transition: all 0.6s ease;
  border-radius: 50%;
}

.tech-item:hover::before {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.1;
}

.tech-item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(247, 95, 95, 0.25);
  border-color: var(--primary-300);
}

.tech-item h4 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.tech-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

/* Footer */
footer {
  background: var(--neutral-800);
  color: var(--neutral-100);
  padding: 3rem 2rem 2rem;
  text-align: center;
  border-top: 1px solid var(--neutral-700);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

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

.footer-content p {
  color: var(--neutral-300);
  margin-bottom: 2rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--neutral-300);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--primary-300);
  background: rgba(247, 95, 95, 0.1);
  text-decoration: none;
}

.footer-links a:focus-visible {
  outline: 2px solid var(--accent-600);
  outline-offset: 2px;
}

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

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-10px) translateX(5px);
  }
  50% {
    transform: translateY(5px) translateX(-5px);
  }
  75% {
    transform: translateY(-5px) translateX(10px);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.focus-within-ring:focus-within {
  outline: 2px solid var(--accent-600);
  outline-offset: 2px;
  border-radius: 4px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --neutral-50: #ffffff;
    --neutral-800: #000000;
    --neutral-900: #000000;
    --primary-500: #cc0000;
    --primary-600: #990000;
    --text-primary: #000000;
    --text-secondary: #333333;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero::before,
  .hero::after {
    animation: none;
  }
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--neutral-800);
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    border-top: 1px solid var(--neutral-700);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero .tagline {
    font-size: 1.2rem;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .service-card {
    padding: 2rem 1.5rem;
  }
  
  .tech-item {
    padding: 1.5rem 1rem;
  }
  
  .hero {
    padding: 4rem 1rem 2rem;
  }
}
