:root {
  --primary: #002e48;
  --cream: #f5f1e8;
  --grid-color: rgba(0, 46, 72, 0.08);
}

/* ---------------- RESET ---------------- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--cream);
  color: var(--primary);
  position: relative;
  min-height: 100vh;
}

/* ---------------- GRID BACKGROUND ---------------- */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 120px 120px;
  z-index: -1;
}

/* ---------------- LAYOUT ---------------- */

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------------- HEADER ---------------- */

.header {
  background-color: var(--cream);
  padding: 1.5rem 0;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}


.logo {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.logo a {
  text-decoration: none;
  color: inherit;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
   background-color: var(--cream);
 
}

.nav-link {
  position: relative;
  text-decoration: none;
  color: var(--primary);
  font-weight: 400;
  font-size: 0.95rem;
  padding-bottom: 4px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 1px;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active::after {
  width: 100%;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.lang {
  font-family: 'Inter', sans-serif;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
  padding-bottom: 4px;
  position: relative;
}

/* Elimina cualquier subrayado heredado */
.lang::after {
  display: none;
}

/* Subrayado solo para el activo */
.lang.active::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background-color: var(--primary);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;  
  z-index: 1100;       
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--primary);
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------------- HERO ---------------- */

.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
}

.hero-text {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

/* Desktop behaviour */

.hero h1 {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* Desktop */

.hero h1 span {
  display: inline;
}

.hero h1 span:nth-child(4),
.hero h1 span:nth-child(5) {
  display: block;
}

/* ---------------- DECORATIVE IMAGES ---------------- */

.decor {
  position: absolute;
  z-index: 1;
  object-fit: contain;
  pointer-events: none;
}

/* LEFT MAIN */

.decor-left-main {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 520px;
}

/* LEFT SECONDARY */

.decor-left-secondary {
  left: 120px;
  top: 55%;
  transform: translateY(-50%);
  height: 500px;
}

/* RIGHT TOP */

.decor-top-right {
  right: 6%;
  top: 14%;
  height: clamp(180px, 16vw, 300px);
  width: auto;
}

/* RIGHT BOTTOM */

.decor-bottom-right {
  right: 0;
  bottom: 0;
  height: clamp(200px, 22vw, 340px);
  width: auto;
}

/* ---------------- TABLET ---------------- */

@media (max-width: 1100px) {

  .hero-text {
    max-width: 680px;
  }

  .decor-top-right {
    height: clamp(150px, 14vw, 240px);
  }

  .decor-bottom-right {
    height: clamp(170px, 20vw, 280px);
  }
}

/* ---------------- MOBILE ---------------- */

@media (max-width: 768px) {

  .hero {
    align-items: flex-start;
    padding: 2rem 1.5rem 3rem 1.5rem;
  }

  .hero-text {
    max-width: 100%;
    margin-top: 7rem;
    margin-left: 2rem;
  }

  .hero h1 {
    font-size: clamp(3rem, 12vw, 5rem);
    line-height: 1.05;
  }

  .hero h1 span {
    display: block;
  }

  .decor-top-right,
  .decor-bottom-right {
    display: none;
  }

  .decor-left-main,
  .decor-left-secondary {
    opacity: 0.5;
  }

  /* Mostrar hamburguesa */
.hamburger {
  display: flex;
}

/* NAV FULLSCREEN */
.nav {
  position: fixed;
  inset: 0;

  background-color: var(--cream);
  background-image:
  linear-gradient(rgba(0, 46, 72, 0.04) 1px, transparent 1px),
  linear-gradient(90deg, rgba(0, 46, 72, 0.04) 1px, transparent 1px);
  background-size: 120px 120px;

  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease;
  z-index: 1000;
}

/* Cuando está abierto */
.nav.open {
  opacity: 1;
  visibility: visible;
}

}

body.menu-open {
  overflow: hidden;
}

/* ---------------- PROJECTS ---------------- */
/* ---------------- PROJECTS ---------------- */

.projects {
  padding: 12rem 0;
}

.projects-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

/* Contenedor individual */

.project-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;   /* centra verticalmente */
  gap: 6rem;
  min-height: 480px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Quitar estilos default del enlace */

.project,
.project:visited,
.project:hover,
.project:active {
  color: #002e48;
  text-decoration: none;
}

/* ---------------- ALTERNANCIA LIMPIA ---------------- */

/* Invierte el grid en los proyectos pares */
.project:nth-child(even) .project-content {
  direction: rtl;
}

/* Devuelve el contenido interno a normal */
.project:nth-child(even) .project-heading,
.project:nth-child(even) .project-images {
  direction: ltr;
}

/* En los impares el texto queda alineado izquierda */
.project:nth-child(odd) .project-heading {
  text-align: left;
}

/* ---------------- IMÁGENES ---------------- */

.project-images {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 480px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.project-images img {
  position: absolute;
  width: 80%;
  transition: transform 0.5s ease;
}

.project-images img:first-child {
  top: 0;
  left: 0;
  transform: rotate(-4deg);
}

.project-images img:last-child {
  bottom: 0;
  right: 0;
  transform: rotate(4deg);
}

.project:hover .project-images img {
  transform: rotate(0deg) scale(1.03);
}

/* ---------------- BLOQUE TEXTO (titulo + subtitulo) ---------------- */

.project-text {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-self: start;
}

/* En los proyectos impares (texto a la izquierda) */

.project:nth-child(odd) .project-text {
  justify-self: end;     /* lo empuja hacia la imagen */
  text-align: right;     /* alinea el texto hacia la imagen */
}

/* Pares (texto derecha) */
.project:nth-child(even) .project-text {
  justify-self: end;   /* se queda donde está */
  text-align: left;      /* 👈 siempre alineado desde la izquierda */
}

/* ---------------- TÍTULO ---------------- */

.project-heading {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: clamp(3.5rem, 4vw, 4.5rem);
  letter-spacing: -0.03em;
  color: #002e48;

  display: inline-block;   /* 👈 clave real */
  position: relative;
}

/* Subrayado solo bajo el título */

.project-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 4px;
  width: 100%;
  height: 2px;
  background-color: #002e48;
}

/* ---------------- SUBTÍTULO ---------------- */

.project-subtitle {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #002e48;
}


@media (max-width: 768px) {

  /* 1️⃣ Convertimos el grid en una sola columna */
  .project-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: auto;
  }

  /* 2️⃣ Eliminamos el direction hack de los pares */
  .project:nth-child(even) .project-content {
    direction: ltr;
  }

  /* 3️⃣ Ocultamos la primera imagen */
  .project-images img:first-child {
    display: none;
  }

  /* 4️⃣ Quitamos posicionamiento absoluto */
  .project-images {
    height: auto;
  }

  .project-images img {
    position: relative;
    width: 100%;
    transform: none !important;
  }

  /* 5️⃣ Texto alineado normal */
  .project-text {
    justify-self: auto;
    text-align: left !important;
  }
}
/* ---------------- ANIMACIÓN ---------------- */
@media (max-width: 768px) {

  .project-content {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeUp 0.8s ease forwards;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }

  @keyframes fadeUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

}


/* ---------------- FOOTER ---------------- */

.footer {
  background-color: #002e48;
  color: #f5f1e8;
  padding: 4rem 0 2rem 0;
}

.footer-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.footer-name {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.footer-role {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  opacity: 0.8;
}

.footer-right {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  text-align: right;
}

.footer-right a {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: #f5f1e8;
  text-decoration: none;
  position: relative;
}

.footer-right a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0%;
  height: 1px;
  background-color: #f5f1e8;
  transition: width 0.3s ease;
}

.footer-right a:hover::after {
  width: 100%;
}

/* Línea inferior */

.footer-bottom {
  width: 90%;
  max-width: 1200px;
  margin: 3rem auto 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(245, 241, 232, 0.2);
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ---------------- RESPONSIVE ---------------- */

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-right {
    text-align: left;
  }
}

/* ---------------- PROJECT PAGE ---------------- */

.project-page {
  padding: 10rem 0 6rem 0;
}

.project-page-content {
  width: 90%;
  max-width: 900px;
  margin: 0 auto 4rem auto;
}

.project-page-title {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 5vw, 4.5rem);
  color: #002e48;
  margin-bottom: 2rem;
}

.project-description {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #002e48;
  max-width: 60ch;
}

/* ---------------- CARRUSEL ---------------- */

.carousel {
  position: relative;
  width: 100vw;
  overflow: hidden;
  margin-bottom: 6rem;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-track img {
  width: 100%;
  height: auto;        /* 👈 importante */
  object-fit: contain; /* 👈 en vez de cover */
  flex-shrink: 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 46, 72, 0.6);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  z-index: 10;
}

.carousel-btn.prev {
  left: 20px;
}

.carousel-btn.next {
  right: 20px;
}

.carousel-btn:hover {
  background: rgba(0, 46, 72, 0.9);
}

/* ---------------- BACK BUTTON ---------------- */

.back-button-wrapper {
  text-align: center;
}

.back-button {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-decoration: none;
  color: #002e48;
  border: 1px solid #002e48;
  padding: 0.8rem 1.5rem;
  transition: all 0.3s ease;
}

.back-button:hover {
  background-color: #002e48;
  color: #f5f1e8;
}


/* ---------------- REMOVE ANCHOR FOCUS OUTLINE ---------------- */

.project:focus,
.project:focus-visible {
  outline: none;
}

/* ---------------- MASONRY GALLERY ---------------- */

.masonry-gallery {
  padding: 4rem 0 6rem 0;
}

.gallery-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;

  column-count: 3;
  column-gap: 2rem;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 2rem;
}

.gallery-item img {
  width: 100%;
  border-radius: 16px;
  display: block;
}

.gallery-caption {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  margin-top: 0.6rem;
  color: #002e48;
  line-height: 1.4;
}

.masonry-gallery .back-button-wrapper {
  text-align: center;
  margin-top: 6rem;
}

/* ---------------- RESPONSIVE ---------------- */

@media (max-width: 1024px) {
  .gallery-container {
    column-count: 2;
  }
}

@media (max-width: 768px) {
  .gallery-container {
    column-count: 1;
  }
}



/* ---------------- ABOUT PAGE ---------------- */
/* ---------------- ABOUT PAGE ---------------- */
/* ---------------- ABOUT PAGE ---------------- */

.about-page {
  padding: 10rem 0 6rem 0;
  min-height: 70vh;
}

.about-container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

.about-title {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 5vw, 4.5rem);
  letter-spacing: -0.03em;
  margin-bottom: 4rem;
}


/* ---------------- ABOUT BACKGROUND IMAGE ---------------- */

.about-page {
  position: relative;
  padding: 12rem 0 8rem 0;
  overflow: hidden;
}

.about-background {
  position: absolute;
  top: 0px;   /* 👈 ajusta este valor */
  left: 0;
  width: 100%;
  height: 100vh; /* controla la altura */
  z-index: 0;
}

.about-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 1; /* ajusta intensidad */
}

/* Aseguramos que el contenido esté encima */

.about-container {
  position: relative;
  z-index: 2;
}


/* ---------------- ABOUT CONTENT LAYOUT ---------------- */

.about-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 6rem;
  align-items: start;
}

.about-text {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  max-width: 60ch;
}

.about-text p {
  margin-bottom: 2.5rem;
}

.about-text strong {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  display: block;
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
}

.about-photo img {
  width: 100%;
  border-radius: 28px;
  object-fit: cover;
}

@media (max-width: 900px) {

  .about-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
  }

  /* Foto debajo del título */
  .about-photo {
    order: -1;
  }

}


/* ---------------- CONTACT PAGE ---------------- */
/* ---------------- CONTACT PAGE ---------------- */

.contact-page {
  padding: 10rem 0 6rem 0;
  min-height: 70vh;
}

.contact-container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
}

.contact-title {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 5vw, 4.5rem);
  letter-spacing: -0.03em;
  margin-bottom: 4rem;
}


/* ---------------- CONTACT BACKGROUND ---------------- */

.contact-page {
  position: relative;
  padding: 12rem 0 8rem 0;
  overflow: hidden;
}

.contact-background {
  position: absolute;
  top: 0px;   /* 👈 ajusta este valor */
  left: 0;
  width: 100%;
  height: 100vh; /* controla la altura */
  z-index: 0;
}

.contact-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 1; /* intensidad de la imagen */
}

/* Contenido por encima */

.contact-container {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
}

.contact-title {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 5vw, 4.5rem);
  letter-spacing: -0.03em;
  margin-bottom: 3rem;
}

.contact-content {
  max-width: 600px;
}

.contact-intro {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-links a {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #002e48;
  text-decoration: none;
  position: relative;
  display: inline-block;
  display: inline;       /* 👈 importante */
  width: fit-content; 
}

.contact-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background-color: #002e48;
  transition: width 0.3s ease;
}

.contact-links a:hover::after {
  width: 100%;
}


/* ---------------- SPANISH PAGE ---------------- */

/* ---------------- SPANISH PAGE ---------------- */

.es-page {
  padding: 12rem 0 8rem 0;
  min-height: 70vh;
}

.es-container {
  width: 90%;
  max-width: 700px;
  margin: 0 auto;
}

.es-title {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 5vw, 4.5rem);
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}

.es-text {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 3rem;
}

.back-english {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-decoration: none;
  color: #002e48;
  border: 1px solid #002e48;
  padding: 0.8rem 1.5rem;
  transition: all 0.3s ease;
}

.back-english:hover {
  background-color: #002e48;
  color: #f5f1e8;
}