/* Estilos personalizados para un diseño único y creativo */

/* Variables personalizadas */
:root {
  --primary-gradient: linear-gradient(135deg, #9A0019 0%, #E60023 100%);
  --secondary-gradient: linear-gradient(135deg, #E60023 0%, #9A0019 100%);
  --accent-gradient: linear-gradient(135deg, #E60023 0%, #9A0019 100%);
  --text-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  --glass-bg: rgba(230, 0, 35, 0.05);
  --glass-border: rgba(230, 0, 35, 0.1);
}

/* Tipografía personalizada */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* Animaciones personalizadas */
@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-20px);
  }

  100% {
    transform: translateY(0px);
  }
}

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

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes text-reveal {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(220, 38, 38, 0.5);
  }

  50% {
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.8), 0 0 30px rgba(220, 38, 38, 0.6);
  }

  100% {
    box-shadow: 0 0 5px rgba(220, 38, 38, 0.5);
  }
}

/* Estilos base mejorados */
body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: #0a0a0a;
  color: #e0e0e0;
  overflow-x: hidden;
}

/* Header personalizado */
header {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

header.scrolled {
  background: rgba(15, 15, 15, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.logo-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--primary-gradient);
  border-radius: 8px;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}



.logo-container img {
  height: 80px;
  filter: grayscale(100%);
  transition: all 0.3s ease;
}

.logo-container:hover img {
  filter: grayscale(0%);
  transform: scale(1.05);
}

/* Navegación personalizada */
nav ul {
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav a {
  position: relative;
  font-weight: 500;
  text-decoration: none;
  color: #e0e0e0;
  transition: all 0.3s ease;
  padding: 0.5rem 0;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

nav a:hover {
  color: #fff;
  transform: translateY(-2px);
}

/* Botón de idioma personalizado */
.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.language-switcher a {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.language-switcher a.active {
  background: var(--primary-gradient);
  color: white;
}

/* Sección Hero mejorada */
#inicio {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(79, 172, 254, 0.1) 0%, transparent 50%);
}

.hero-bg-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.hero-bg-shapes::before,
.hero-bg-shapes::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.hero-bg-shapes::before {
  width: 400px;
  height: 400px;
  background: var(--primary-gradient);
  top: -100px;
  left: -100px;
  animation: float 8s ease-in-out infinite;
}

.hero-bg-shapes::after {
  width: 300px;
  height: 300px;
  background: var(--secondary-gradient);
  bottom: -50px;
  right: -50px;
  animation: float 10s ease-in-out infinite reverse;
}

.hero-content {
  text-align: center;
  z-index: 1;
  position: relative;
}

.hero-title {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  line-height: 0.9;
  margin-bottom: 1.5rem;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-reveal 1s ease-out;
  position: relative;
}

.hero-title span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 300;
  max-width: 800px;
  margin: 0 auto 2rem;
  opacity: 0.8;
  line-height: 1.6;
}

.hero-cta {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--primary-gradient);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.hero-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.5s ease;
}

.hero-cta:hover::before {
  left: 100%;
}

.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

/* Sección de Proyectos mejorada */
#proyectos {
  padding: 100px 0;
  background: linear-gradient(180deg, #0a0a0a 0%, #111111 100%);
  position: relative;
}

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

.projects-title {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
  display: inline-block;
  width: 100%;
}

.projects-title,
.services-title,
.about-title,
.contact-title {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.projects-title.is-visible,
.services-title.is-visible,
.about-title.is-visible,
.contact-title.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  position: relative;
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Force the 5th child (Architecture) to span 2 columns */
  .projects-grid>.project-card:nth-child(5) {
    grid-column: span 2;
  }
}

.project-card {
  content-visibility: auto;
  contain-intrinsic-size: 500px;
  /* Placeholder size to prevent scroll jank */
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  cursor: pointer;

  /* Initial state for reveal animation */
  opacity: 0;
  transform: translateY(50px);

  /* Combined transitions for reveal and hover */
  transition: opacity 0.4s ease-out,
    transform 0.4s ease-out,
    box-shadow 0.4s ease,
    border-color 0.4s ease;
}

.project-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.project-card:hover::before {
  opacity: 0.1;
}

.project-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(220, 38, 38, 0.5);
}

.project-card img {
  width: 100%;
  height: auto;
  background: rgba(0, 0, 0, 0.3);
  transition: transform 0.4s ease;
}

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

.project-card-content {
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.project-card h3 {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.project-card p {
  color: #b0b0b0;
  margin-bottom: 1rem;
}

.view-project {
  color: #4facfe;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.view-project::after {
  content: '→';
  transition: transform 0.3s ease;
}

.view-project:hover::after {
  transform: translateX(5px);
}

/* Sección de Servicios mejorada */
#servicios {
  padding: 100px 0;
  background: #0a0a0a;
  position: relative;
}

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

.services-title {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
  display: inline-block;
  width: 100%;
}

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

.service-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;

  /* Initial state for reveal animation */
  opacity: 0;
  transform: scale(0.9);

  /* Transitions for reveal and hover */
  transition: opacity 0.4s ease-out, transform 0.4s ease-out, border-color 0.4s ease;
}

.service-card.is-visible {
  opacity: 1;
  transform: scale(1);
}

.service-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(79, 172, 254, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.service-card:hover::before {
  opacity: 1;
}

.service-card:hover {
  transform: translateY(-10px);
  border-color: rgba(79, 172, 254, 0.5);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.service-card h3 {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #fff;
  position: relative;
  z-index: 1;
  letter-spacing: 1px;
}

.service-card p {
  color: #b0b0b0;
  line-height: 1.6;
  position: relative;
  z-index: 1;
  flex-grow: 1;
}

/* Sección Sobre Mí mejorada */
#about {
  padding: 100px 0;
  background: linear-gradient(180deg, #0a0a0a 0%, #111111 100%);
  position: relative;
}

.about-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.about-title {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
  width: 100%;
}

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

.about-content p {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: #e0e0e0;
}

.about-content a {
  color: #4facfe;
  text-decoration: none;
  transition: all 0.3s ease;
}

.about-content a:hover {
  color: #00f2fe;
  text-shadow: 0 0 10px rgba(79, 172, 254, 0.5);
}

/* Sección de Contacto mejorada */
#contacto {
  padding: 100px 0;
  background: #0a0a0a;
  position: relative;
}

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

.contact-title {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
  width: 100%;
}

.contact-subtitle {
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 3rem;
  color: #b0b0b0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.contact-form {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #e0e0e0;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: #e0e0e0;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4facfe;
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.5s ease;
}

.submit-btn:hover::before {
  left: 100%;
}

.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* Footer mejorado */
footer {
  background: #0a0a0a;
  border-top: 1px solid var(--glass-border);
  padding: 2rem 0;
  text-align: center;
}

footer p {
  color: #b0b0b0;
}

/* Modal mejorado */
#project-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  z-index: 1000;
  opacity: 0;
}

#modal-content {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  opacity: 0;
}

#modal-content img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  /* Allow image to be much larger */
  object-fit: contain;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px 15px 0 0;
}

#modal-content h3 {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.5rem;
  margin: 1.5rem 0 0.5rem;
  color: #fff;
}

#modal-content p {
  color: #4facfe;
  margin-bottom: 1rem;
}

#modal-content .technologies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.technologies span {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

#modal-content .project-links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

#modal-content .project-links a {
  padding: 0.8rem 1.5rem;
  background: var(--primary-gradient);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
}

#modal-content .project-links a:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

#close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

#close-modal:hover {
  color: #fff;
  transform: rotate(90deg);
}

/* Media Queries para responsividad */
@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .projects-grid,
  .services-grid {
    grid-template-columns: 1fr;
  }

  nav ul {
    gap: 1rem;
  }

  .project-card img {
    height: 250px;
  }
}

/* Lightbox for single image view */
#image-lightbox {
  display: none;
  /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  /* Higher than the project modal */
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

#image-lightbox.visible {
  display: flex;
  /* Show the lightbox */
}

#image-lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  cursor: default;
}

#close-lightbox {
  position: absolute;
  top: 2rem;
  right: 2rem;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  transition: transform 0.3s ease;
  z-index: 2001;
}

#close-lightbox:hover {
  transform: scale(1.1);
}