/* Modern CSS with Variables - Mobile background bug fixed (robust approach) */
:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --primary-light: #ff6b7a;
  --dark: #1d1e20;
  --darker: #121212;
  --light: #f8f9fa;
  --gray: #6c757d;
  --dark-gray: #343a40;
  --light-gray: #adb5bd;
  --accent: #4361ee;
  --accent-dark: #3a56d4;
  --success: #4cc9f0;
  --border-radius: 12px;
  --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.4);
}

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

html, body {
  height: 100%;
}

/* Robust background: use a fixed pseudo-element so mobile browsers don't break gradient rendering */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--darker); /* fallback color */
  color: var(--light);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative; /* not required for fixed ::before but harmless */
}

/* Body background layer (fixed, robust across devices) */
body::before {
  content: "";
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  background: linear-gradient(135deg, var(--darker) 0%, #1a1a1a 100%);
  background-repeat: no-repeat;
  background-size: cover;
  z-index: -9999; /* always behind everything */
  pointer-events: none;
  will-change: transform;
}

/* Respect user's reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Layout container */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Styles */
header {
  background-color: rgba(29, 30, 32, 0.95);
  backdrop-filter: blur(10px);
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(230, 57, 70, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

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

.logo-group {
  display: flex;
  flex-direction: column;
}

.logo {
  color: var(--primary);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  letter-spacing: -0.5px;
  background: linear-gradient(45deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: shine 3s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

.logo-text {
  color: var(--light-gray);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 1px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  z-index: 1000;
}

.menu-toggle span {
  width: 28px;
  height: 3px;
  background-color: var(--light);
  margin: 3px 0;
  transition: var(--transition);
  border-radius: 2px;
}

nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

nav a {
  color: var(--light);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1rem;
  position: relative;
  transition: var(--transition);
  border-radius: var(--border-radius);
  text-decoration: none;
}

nav a:hover,
nav a.active {
  color: var(--primary);
  background-color: rgba(230, 57, 70, 0.1);
}

/* About Section */
#about {
  padding: 5rem 0;
  position: relative;
}

#about::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.1) 0%, transparent 70%);
  z-index: -1;
}

.about-content {
  display: flex;
  gap: 4rem;
  align-items: center;
  position: relative;
}

.text-block {
  flex: 1;
  animation: fadeInUp 0.8s ease-out;
}

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

.highlight {
  color: var(--primary);
  position: relative;
  display: inline-block;
}

.highlight::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary);
  border-radius: 3px;
}

h2 {
  font-size: 2.8rem;
  margin-bottom: 2rem;
  line-height: 1.2;
  font-weight: 800;
}

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

.detail-item {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  padding: 1.5rem;
  background-color: rgba(29, 30, 32, 0.7);
  border-radius: var(--border-radius);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: rgba(230, 57, 70, 0.2);
}

.detail-item i {
  font-size: 1.8rem;
  color: var(--primary);
  margin-top: 0.3rem;
  background: rgba(230, 57, 70, 0.1);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.detail-item h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.detail-item p {
  color: var(--light-gray);
  font-size: 1rem;
}

.main-text {
  margin: 2.5rem 0;
  color: var(--light);
  font-size: 1.1rem;
  line-height: 1.8;
}

.cta-buttons {
  display: flex;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.btn {
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: var(--transition);
  display: inline-block;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, var(--primary-dark), var(--primary));
  z-index: -1;
  transition: var(--transition);
  opacity: 0;
}

.btn:hover::before {
  opacity: 1;
}

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

.btn.primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.btn.secondary {
  border: 2px solid var(--primary);
  color: var(--primary);
  background-color: transparent;
}

.btn.secondary:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.image-block {
  position: relative;
  flex: 0 0 380px;
  animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.profile-img {
  width: 100%;
  border-radius: calc(var(--border-radius) * 2);
  border: 4px solid var(--primary);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.profile-img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}

.tech-stack {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.tech-stack span {
  background-color: rgba(29, 30, 32, 0.8);
  padding: 0.7rem 1.3rem;
  border-radius: 30px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
}

.tech-stack span:hover {
  transform: translateY(-3px);
  background-color: rgba(230, 57, 70, 0.15);
  border-color: rgba(230, 57, 70, 0.3);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.tech-stack i {
  color: var(--primary);
  font-size: 1.1rem;
}

/* Services Section */
#services {
  padding: 5rem 0;
  position: relative;
}

#services::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, transparent 70%);
  z-index: -1;
}

.section-description {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
  color: var(--light-gray);
  font-size: 1.2rem;
  line-height: 1.8;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2.5rem;
  margin-bottom: 4rem;
}

.service-card {
  background: linear-gradient(135deg, rgba(29, 30, 32, 0.8) 0%, rgba(18, 18, 18, 0.9) 100%);
  border-radius: calc(var(--border-radius) * 1.5);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  padding: 2.5rem;
  text-align: center;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(67, 97, 238, 0.3);
}

.service-icon {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  background: rgba(67, 97, 238, 0.1);
  border-radius: 50%;
  transition: var(--transition);
}

.service-card:hover .service-icon {
  transform: scale(1.1);
  background: rgba(67, 97, 238, 0.2);
}

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

.service-card p {
  color: var(--light-gray);
  margin-bottom: 1.8rem;
  line-height: 1.7;
}

.service-features {
  list-style: none;
  text-align: left;
  margin-bottom: 0;
}

.service-features li {
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  color: var(--light);
}

.service-features i {
  color: var(--success);
  margin-right: 0.8rem;
  font-size: 0.9rem;
}

.cta-section {
  text-align: center;
  background: linear-gradient(135deg, rgba(29, 30, 32, 0.8) 0%, rgba(18, 18, 18, 0.9) 100%);
  border-radius: calc(var(--border-radius) * 1.5);
  padding: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.cta-section h3 {
  font-size: 2rem;
  margin-bottom: 1.2rem;
  color: var(--light);
}

.cta-section p {
  color: var(--light-gray);
  max-width: 600px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
  line-height: 1.7;
}

/* References Section */
#references {
  padding: 5rem 0;
  position: relative;
}

#references::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, transparent 70%);
  z-index: -1;
}

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

.section-title .highlight::after {
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2.5rem;
}

.reference-card {
  background: linear-gradient(135deg, rgba(29, 30, 32, 0.8) 0%, rgba(18, 18, 18, 0.9) 100%);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.reference-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(67, 97, 238, 0.3);
}

.reference-header {
  display: flex;
  align-items: center;
  padding: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.reference-img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 1.5rem;
  border: 3px solid var(--accent);
  transition: var(--transition);
}

.reference-card:hover .reference-img {
  transform: scale(1.1);
}

.reference-info h3 {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
  color: var(--light);
}

.position {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 500;
}

.reference-content {
  padding: 2rem;
}

.quote {
  font-style: italic;
  margin-bottom: 1.8rem;
  color: var(--light);
  position: relative;
  line-height: 1.8;
}

/* Use a proper opening quote character */
.quote::before {
  content: "“";
  font-size: 4rem;
  color: var(--accent);
  opacity: 0.2;
  position: absolute;
  left: -1.5rem;
  top: -2rem;
  font-family: Georgia, serif;
}

.reference-meta {
  color: var(--light-gray);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
}

.reference-meta i {
  margin-right: 0.7rem;
  color: var(--accent);
}

/* Projects Section */
#projects {
  padding: 5rem 0;
  position: relative;
}

#projects::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.1) 0%, transparent 70%);
  z-index: -1;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2.5rem;
}

.project-card {
  background: linear-gradient(135deg, rgba(29, 30, 32, 0.8) 0%, rgba(18, 18, 18, 0.9) 100%);
  border-radius: calc(var(--border-radius) * 1.5);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(76, 201, 240, 0.3);
}

.project-image {
  height: 220px;
  overflow: hidden;
}

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

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

.project-content {
  padding: 2rem;
}

.project-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
  color: var(--primary);
  font-weight: 700;
}

.project-content p {
  color: var(--light-gray);
  margin-bottom: 1.8rem;
  line-height: 1.7;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.tech-tag {
  background: linear-gradient(135deg, rgba(29, 30, 32, 0.9) 0%, rgba(18, 18, 18, 1) 100%);
  color: var(--light);
  padding: 0.5rem 1.2rem;
  border-radius: 30px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.tech-tag:hover {
  transform: translateY(-3px);
  border-color: var(--success);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.project-links {
  display: flex;
  gap: 1.2rem;
}

/* Contact Section */
#contact {
  padding: 5rem 0;
  position: relative;
}

#contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: linear-gradient(135deg, rgba(203, 229, 104, 0.1) 0%, transparent 70%);
  z-index: -1;
}

.contact-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 3.5rem;
}

.contact-info p {
  margin-bottom: 2.5rem;
  color: var(--light);
  font-size: 1.1rem;
  line-height: 1.8;
}

.contact-details {
  display: grid;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.contact-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.8rem;
  background: rgba(29, 30, 32, 0.5);
  border-radius: var(--border-radius);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-item:hover {
  transform: translateY(-5px);
  border-color: rgba(203, 229, 104, 0.3);
  box-shadow: var(--shadow);
}

.contact-item i {
  font-size: 1.5rem;
  color: var(--success);
  margin-top: 0.3rem;
  background: rgba(76, 201, 240, 0.1);
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.contact-item h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.contact-item p {
  margin: 0;
  color: var(--light-gray);
  font-size: 1rem;
}

.social-links.large {
  font-size: 1.8rem;
  gap: 1.5rem;
  display: flex;
  justify-content: center;
}

.social-links.large a {
  color: var(--light-gray);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
}

.social-links.large a:hover {
  color: var(--success);
  background-color: rgba(76, 201, 240, 0.15);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.contact-form .form-group { margin-bottom: 1.8rem; }

.contact-form label {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 500;
  color: var(--light);
  font-size: 1rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1.2rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(29, 30, 32, 0.7);
  color: var(--light);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  backdrop-filter: blur(5px);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.2);
}

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

/* Footer */
footer {
  background-color: rgba(29, 30, 32, 0.9);
  padding: 2.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copyright {
  color: var(--light-gray);
  font-size: 0.95rem;
}

.social-links {
  display: flex;
  gap: 1.8rem;
}

.social-links a {
  color: var(--light-gray);
  font-size: 1.3rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
}

.social-links a:hover {
  color: var(--primary);
  background-color: rgba(230, 57, 70, 0.15);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 992px) {
  :root { --border-radius: 10px; }
  .logo { font-size: 2rem; }
  h2 { font-size: 2.5rem; }
  .about-content { gap: 3rem; }
  .image-block { flex: 0 0 350px; }
}

@media (max-width: 768px) {
  :root { --border-radius: 8px; }
  .menu-toggle { display: flex; }
  .header-content { flex-direction: row; gap: 1.5rem; }

  /* Mobile nav as sidebar */
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background-color: rgba(29, 30, 32, 0.95);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    z-index: 999;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
  }

  nav.active { right: 0; }

  nav ul {
    flex-direction: column;
    gap: 0;
    padding: 80px 0 0 0;
    height: 100%;
    align-items: stretch;
  }

  nav li { width: 100%; }

  nav a {
    padding: 1.2rem 2rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1.1rem;
    gap: 1rem;
  }

  .language-switch {
    margin: 1rem 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    justify-content: center;
    flex-direction: column-reverse;
  }

  .switch-container {
    justify-content: center;
    flex-direction: column-reverse;
  }

  nav a:hover,
  nav a.active {
    background-color: rgba(230, 57, 70, 0.15);
  }

  .about-content { flex-direction: column; }
  .image-block { flex: 1; width: 100%; margin-top: 2rem; }
  .cta-buttons { flex-direction: column; }
  .footer-content { flex-direction: column; gap: 1.5rem; }
  .contact-content { grid-template-columns: 1fr; }
  .project-links { flex-direction: column; }
  .reference-grid, .projects-grid { grid-template-columns: 1fr; }
  .tech-stack { gap: 0.8rem; }

  /* Slightly reduce heavy shadows on mobile for performance */
  :root {
    --shadow: 0 6px 18px rgba(0,0,0,0.25);
    --shadow-hover: 0 10px 30px rgba(0,0,0,0.3);
  }

  /* Hamburger animation */
  .menu-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .menu-toggle.active span:nth-child(2) { opacity: 0; }
  .menu-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
}

@media (max-width: 576px) {
  :root { --border-radius: 6px; }
  .container { width: 95%; padding: 0 15px; }
  #about, #references, #projects, #contact { padding: 3rem 0; }
  h2 { font-size: 2.2rem; }
  .logo { font-size: 1.8rem; }
  nav { width: 100%; }
  nav ul { padding: 70px 0 0 0; }
  nav a { padding: 1rem 1.5rem; font-size: 1rem; gap: 0.8rem; }
  .btn { padding: 0.9rem 1.5rem; }
  .cta-buttons { gap: 1rem; }
  .detail-item, .contact-item { padding: 1.2rem; }
  .reference-header { padding: 1.5rem; }
  .reference-content { padding: 1.5rem; }
}

/* Global link styles to ensure no underline */
a[href] { text-decoration: none; }

a:hover,
a:active,
a:focus { text-decoration: none; }

