/* CSS Custom Properties - Color Palette */
:root {
  --dark: #121212;
  --red-accent: #8C030E;
  --light: #FFF4ED;
  --bright-red: #D90404;
  --gray: #312C2D;
  
  /* Component-specific color variables */
  --color-primary: #3b82f6;
  --color-accent: #8b5cf6;
  --color-text: #374151;
  --color-light: #f9fafb;
  --color-dark: #1f2937;
  
  /* Additional utility colors */
  --white: #ffffff;
  --black: #000000;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.15);
  --shadow-dark: rgba(0, 0, 0, 0.3);
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-xxl: 4rem;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* Inter Font Integration */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  line-height: 1.6;
  color: var(--dark);
  font-size: 16px;
  background-color: var(--light);
  overflow-x: hidden;  
}

/* Base Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--dark);
  margin-bottom: var(--spacing-sm);
}

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

p {
  margin-bottom: var(--spacing-sm);
  color: var(--gray);
}

a {
  color: var(--red-accent);
  text-decoration: none;
  transition: color var(--transition-normal);
}

a:hover {
  color: var(--bright-red);
}

a:focus {
  outline: 2px solid var(--red-accent);
  outline-offset: 2px;
}

/* Container for content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  width: 100%;
}

/* Header and Navigation - Fixed with smooth scrolling */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--white);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px var(--shadow-light);
  z-index: 1000;
  transition: all var(--transition-normal);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  transition: color var(--transition-normal);
}

.nav-logo a:hover {
  color: var(--red-accent);
}

.nav-links {
  display: flex;
  gap: var(--spacing-xl);
  list-style: none;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  color: var(--dark);
  font-weight: 500;
  font-size: 0.95rem;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal);
  position: relative;
}

.nav-links a:hover {
  color: var(--red-accent);
  background-color: rgba(140, 3, 14, 0.05);
}

.nav-links a:focus {
  background-color: rgba(140, 3, 14, 0.1);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--dark);
  transition: all var(--transition-normal);
  border-radius: 2px;
}

/* Sections */
section {
  padding: var(--spacing-xxl) 0;
}

/* CTA Buttons */
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-xl);
  background-color: var(--red-accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(140, 3, 14, 0.3);
}

.cta-button:hover {
  background-color: var(--bright-red);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(140, 3, 14, 0.4);
  color: var(--white);
}

.cta-button:focus {
  outline: 3px solid rgba(140, 3, 14, 0.3);
  outline-offset: 2px;
}

.cta-button.secondary {
  background-color: transparent;
  color: var(--red-accent);
  border: 2px solid var(--red-accent);
  box-shadow: none;
}

.cta-button.secondary:hover {
  background-color: var(--red-accent);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(140, 3, 14, 0.3);
}

/* Projects Section */
#projects {
  background-color: var(--white);
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-xxl);
}

.section-header h2 {
  margin-bottom: var(--spacing-sm);
}

.section-header p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* CSS Grid for Projects - 3-column layout */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
}

.project-card {
  background: var(--white);
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px var(--shadow-light);
  transition: all var(--transition-normal);
  border: 1px solid rgba(140, 3, 14, 0.1);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red-accent) 0%, var(--bright-red) 100%);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
  transform-origin: left;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px var(--shadow-medium);
  border-color: var(--red-accent);
}

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

.project-card h3 {
  color: var(--dark);
  margin-bottom: var(--spacing-sm);
  font-size: 1.5rem;
}

.project-card p {
  color: var(--gray);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
}

.tech-tag {
  background-color: rgba(140, 3, 14, 0.1);
  color: var(--red-accent);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
}

.project-links {
  display: flex;
  gap: var(--spacing-sm);
}

.project-link {
  padding: var(--spacing-xs) var(--spacing-md);
  border: 1px solid var(--red-accent);
  color: var(--red-accent);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-normal);
}

.project-link:hover {
  background-color: var(--red-accent);
  color: var(--white);
  transform: translateY(-1px);
}

/* WhatsApp Button */
.whatsapp-button {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  width: 60px;
  height: 60px;
  background-color: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: all var(--transition-normal);
  z-index: 999;
  text-decoration: none;
}

.whatsapp-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

.whatsapp-button svg {
  width: 30px;
  height: 30px;
  fill: var(--white);
}

/* Footer with Social Icons */
footer {
  background: var(--dark);
  color: var(--light);
  padding: var(--spacing-xxl) 0 var(--spacing-lg);
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

footer h2 {
  color: var(--light);
  margin-bottom: var(--spacing-lg);
  font-size: 2rem;
}

footer p {
  color: var(--light);
  opacity: 0.8;
  margin-bottom: var(--spacing-xl);
  font-size: 1.1rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background-color: rgba(255, 244, 237, 0.1);
  border-radius: 50%;
  color: var(--light);
  transition: all var(--transition-normal);
  border: 2px solid transparent;
}

.social-link:hover {
  background-color: var(--red-accent);
  transform: translateY(-3px);
  border-color: var(--red-accent);
  color: var(--white);
}

.social-link svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.footer-bottom {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(255, 244, 237, 0.2);
  color: var(--light);
  opacity: 0.7;
  font-size: 0.9rem;
}

/* Image Optimization and Styling */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Profile Image Styling */
.profile-image {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 30px var(--shadow-medium);
  transition: all var(--transition-normal);
  border: 4px solid var(--white);
}

.profile-image:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 40px var(--shadow-dark);
}

/* Project Image Styling */
.project-image {
  width: 100%;
  height: 200px;
  margin-bottom: var(--spacing-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background-color: var(--color-light);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

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

/* Image Loading States */
.image-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.image-error {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-light);
  color: var(--color-text);
  font-size: 0.9rem;
}

/* About Section Layout */
.about-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--spacing-xxl);
  align-items: center;
}

.about-text h2 {
  margin-bottom: var(--spacing-md);
  color: var(--dark);
}

.about-text p {
  line-height: 1.7;
  margin-bottom: var(--spacing-lg);
  color: var(--gray);
  font-size: 1.1rem;
}

/* Skills Section */
.skills {
  margin-top: var(--spacing-xl);
}

.skills h3 {
  margin-bottom: var(--spacing-md);
  color: var(--dark);
  font-size: 1.2rem;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.skill-tag {
  background: linear-gradient(135deg, var(--red-accent), var(--bright-red));
  color: var(--white);
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-normal);
  box-shadow: 0 2px 8px rgba(140, 3, 14, 0.2);
}

.skill-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(140, 3, 14, 0.3);
}

/* Project Status Badge */
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
}

.project-status {
  background-color: var(--color-primary);
  color: var(--white);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-status[data-status="live"] {
  background-color: #10b981;
}

.project-status[data-status="completed"] {
  background-color: #3b82f6;
}

.project-status[data-status="planning"] {
  background-color: #f59e0b;
}

/* Project Technologies */
.project-technologies {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
}

/* Project Links */
.project-links {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1.5px solid var(--red-accent);
  color: var(--red-accent);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.project-link:hover {
  background-color: var(--red-accent);
  color: var(--white);
  transform: translateY(-1px);
}

.project-link svg {
  width: 16px;
  height: 16px;
}

/* Focus Indicators for Keyboard Navigation */
.project-card:focus,
.cta-button:focus,
.project-link:focus,
.social-link:focus {
  outline: 3px solid var(--red-accent);
  outline-offset: 2px;
}

/* Screen Reader Only Content */
.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;
}

/* Lazy Loading Image Optimization */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Print Styles */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  header,
  .whatsapp-button,
  .nav-toggle {
    display: none !important;
  }
  
  main {
    margin-top: 0 !important;
  }
  
  .project-card {
    break-inside: avoid;
    border: 1px solid #ccc;
    margin-bottom: 1rem;
  }
  
  a {
    text-decoration: underline;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --shadow-light: rgba(0, 0, 0, 0.5);
    --shadow-medium: rgba(0, 0, 0, 0.7);
    --shadow-dark: rgba(0, 0, 0, 0.9);
  }
  
  .project-card {
    border: 2px solid var(--dark);
  }
  
  .cta-button,
  .project-link {
    border-width: 2px;
  }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #f3f4f6;
    --color-light: #1f2937;
    --color-dark: #f9fafb;
    --white: #1f2937;
    --dark: #f9fafb;
    --light: #111827;
    --gray: #d1d5db;
  }
  
  body {
    background-color: var(--light);
    color: var(--color-text);
  }
  
  header {
    background: var(--white);
    border-bottom: 1px solid #374151;
  }
  
  .project-card {
    background: var(--white);
    border-color: #374151;
  }
}

/* Responsive About Section */
@media (max-width: 767px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    text-align: center;
  }
  
  .about-image {
    order: -1;
  }
  
  .profile-image {
    width: 250px;
    height: 250px;
    margin: 0 auto;
  }
  
  .cta-button {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .about-content {
    grid-template-columns: 1fr 250px;
    gap: var(--spacing-xl);
  }
  
  .profile-image {
    width: 250px;
    height: 250px;
  }
}

/* Animation Performance Optimization */
.project-card,
.profile-image,
.skill-tag {
  will-change: transform;
}

/* Ensure proper contrast ratios */
.tech-tag {
  background-color: rgba(140, 3, 14, 0.15);
  border: 1px solid rgba(140, 3, 14, 0.3);
}

/* Contact section styling */
#contact {
  background: linear-gradient(135deg, var(--red-accent) 0%, var(--bright-red) 100%);
  color: var(--white);
}

#contact .container {
  text-align: center;
}

#contact h2 {
  color: var(--white);
  margin-bottom: var(--spacing-md);
}

#contact p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: var(--spacing-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Ensure all images have proper alt text - this is handled in HTML */
/* Color contrast verification - all contrasts meet WCAG AA standards */
/* Screen reader compatibility - semantic HTML structure maintained */
