body {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: "Lato", sans-serif;
  overflow-x: hidden;
  color: #333333;
  background-image: url("../01-img/Backgrounds/background-02.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  /* añadido */
  height: 100dvh;
  overflow: hidden; /* evita scroll en el body */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

img,
video {
  width: 100%;
  -o-object-fit: cover;
  object-fit: cover;
}

h1 {
  font-size: 50px;
  font-family: "Outfit", serif;
  line-height: 1.1;
}

h3 {
  font-size: 16px;
  font-family: "Outfit", serif;
  padding: 0% 0% 0% 2%;
  font-weight: 400;
  line-height: 1.1;
}

/* =========================
   Header lateral fijo
========================= */

#logo {
  width: 50%;
  padding-top: 1em;
  padding-bottom: 1em;
}

#s1 {
  position: fixed;
  width: 32%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  text-align: right;
  padding-right: 2%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  -ms-overflow-style: none;
}

#s1::-webkit-scrollbar {
  display: thick;
}

/* =========================
   Servicios
========================= */

#servicios {
  padding-top: 1em;
  padding-bottom: 1em;
}

h2 {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-family: "Outfit", serif;
  font-weight: 500;
  line-height: 1.1;
  padding-bottom: 5%;
  padding-top: 1%;
  text-wrap: balance;
  padding-left: 2em;
}

#servicios h2 {
  display: flex;
  align-items: center;
  font-size: 18px;
  font-family: "Outfit", serif;
  font-weight: 500;
  line-height: 1;
  padding-bottom: 5%;
  padding-top: 1%;
}

.icon {
  width: 22px;
  height: 22px;
}

/* =========================
   h1 Animado
========================= */

.changing-title {
  line-height: 1;
}

.words {
  position: relative;
  display: inline-block;
  min-width: 320px;
  height: 0.85em;
}

.words span {
  position: absolute;
  right: 0;
  top: 0;
  opacity: 0;
  -webkit-animation-duration: 6s;
  animation-duration: 6s;
  -webkit-animation-iteration-count: infinite;
  animation-iteration-count: infinite;
}

/* gráfico */

.grafico {
  color: #f4a028;
  -webkit-animation-name: grafico;
  animation-name: grafico;
}

/* editorial */

.editorial {
  color: #eb4f72;
  -webkit-animation-name: editorial;
  animation-name: editorial;
}

/* web */

.web {
  color: transparent;
  -webkit-text-stroke: 1.5px #333333;
  -webkit-animation-name: web;
  animation-name: web;
  font-family: "lato", sans-serif;
}

/* animaciones */

@-webkit-keyframes grafico {
  0%,
  30% {
    opacity: 1;
  }

  33%,
  100% {
    opacity: 0;
  }
}

@keyframes grafico {
  0%,
  30% {
    opacity: 1;
  }

  33%,
  100% {
    opacity: 0;
  }
}

@-webkit-keyframes editorial {
  0%,
  33% {
    opacity: 0;
  }

  36%,
  63% {
    opacity: 1;
  }

  66%,
  100% {
    opacity: 0;
  }
}

@keyframes editorial {
  0%,
  33% {
    opacity: 0;
  }

  36%,
  63% {
    opacity: 1;
  }

  66%,
  100% {
    opacity: 0;
  }
}

@-webkit-keyframes web {
  0%,
  66% {
    opacity: 0;
  }

  69%,
  96% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes web {
  0%,
  66% {
    opacity: 0;
  }

  69%,
  96% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* =========================
   Dragonfly
========================= */

.dragonfly {
  /* En las últimas lineas se especifican más aspectos de la dragonfly */
  -webkit-animation: fly 2.5s ease-in-out infinite;
  animation: fly 2.5s ease-in-out infinite;
}

.dragonfly-svg {
  overflow: visible;
}

.dragonfly-move {
  transition: transform 0.6s ease;
  cursor: pointer;
}

.dragonfly-move:hover {
  transform: translateX(-120px);
}

/* alas */

.wing-top-left,
.wing-bottom-left {
  transform-origin: 95px 40px;
  -webkit-animation: wingLeft 0.06s infinite alternate;
  animation: wingLeft 0.06s infinite alternate;
}

.wing-top-right,
.wing-bottom-right {
  transform-origin: 97px 40px;
  -webkit-animation: wingRight 0.06s infinite alternate;
  animation: wingRight 0.06s infinite alternate;
}

/* movimiento alas */

@-webkit-keyframes wingLeft {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-7deg);
  }
}

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

  to {
    transform: rotate(-7deg);
  }
}

@-webkit-keyframes wingRight {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(7deg);
  }
}

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

  to {
    transform: rotate(7deg);
  }
}

/* vuelo */

@-webkit-keyframes fly {
  0% {
    transform: translate(0px, 0px);
  }

  20% {
    transform: translate(3px, -4px);
  }

  40% {
    transform: translate(-2px, 2px);
  }

  60% {
    transform: translate(4px, -2px);
  }

  80% {
    transform: translate(-3px, 3px);
  }

  100% {
    transform: translate(0px, 0px);
  }
}

@keyframes fly {
  0% {
    transform: translate(0px, 0px);
  }

  20% {
    transform: translate(3px, -4px);
  }

  40% {
    transform: translate(-2px, 2px);
  }

  60% {
    transform: translate(4px, -2px);
  }

  80% {
    transform: translate(-3px, 3px);
  }

  100% {
    transform: translate(0px, 0px);
  }
}

/* =========================
   Contacto
========================= */

.contact-info {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1em;
  margin-top: 1em;
  margin-bottom: 1em;
  font-family: "Outfit", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(51, 51, 51, 0.75);
}

.contact-info a {
  color: inherit;
  text-decoration: none;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}

.contact-info a:hover {
  opacity: 0.6;
}

.contact-info span {
  opacity: 0.4;
}

/* =========================
   Menú
========================= */

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 420px;
  padding-bottom: 1em;
}

nav a {
  text-decoration: none;
  color: white;
  font-weight: 900;
  font-size: 16px;
  font-family: "Outfit", sans-serif;
  display: inline-block;
  padding: 3px 9px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

/* naranja */

.btn-orange {
  background-color: #f4a028;
}

.btn-orange:hover {
  background-color: transparent;
  border-color: #333333;
  color: #333333;
}

/* lila */

.btn-purple {
  background-color: #8589c4;
}

.btn-purple:hover {
  background-color: transparent;
  border-color: #333333;
  color: #333333;
}

/* azul */

.btn-blue {
  background-color: #4e97d1;
}

.btn-blue:hover {
  background-color: transparent;
  border-color: #333333;
  color: #333333;
}

/* rosa */

#s1 .btn-pink {
  background-color: #eb4f72;
}

#s1 .btn-pink:hover {
  background-color: transparent;
  border-color: #333333;
  color: #333333;
}

#s1 .legal-link {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 0.3em;
  font-size: 0.75em;
  color: #666;
  font-weight: 700;
  text-decoration: underline;
}

/* rojo */

.btn-red {
  animation: redBlink 4s infinite;
  border-color: #ff0000;
  background-color: #ff0000;
  color: #ffffff;
}

/* Safari */
@-webkit-keyframes redBlink {
  0%,
  80%,
  100% {
    background-color: #ff0000;
    color: #ffffff;
  }

  /* Primer flash */
  84%,
  87% {
    background-color: transparent;
    color: #ff0000;
  }

  /* Vuelta a rojo */
  88%,
  91% {
    background-color: #ff0000;
    color: #ffffff;
  }

  /* Segundo flash */
  92%,
  95% {
    background-color: transparent;
    color: #ff0000;
  }
}

/* Resto de navegadores */
@keyframes redBlink {
  0%,
  80%,
  100% {
    background-color: #ff0000;
    color: #ffffff;
  }

  /* Primer flash */
  84%,
  87% {
    background-color: transparent;
    color: #ff0000;
  }

  /* Vuelta a rojo */
  88%,
  91% {
    background-color: #ff0000;
    color: #ffffff;
  }

  /* Segundo flash */
  92%,
  95% {
    background-color: transparent;
    color: #ff0000;
  }
}

.btn-red:hover {
  animation: none;
  background-color: transparent;
  border-color: #333333;
  color: #333333;
}

/* =========================
      Proyectos (Main)
========================= */

#work {
  margin-left: 32%;
  width: 68%;
  height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  border-left: 1px solid #333333;
}

#work article {
  width: 50%;
  overflow: hidden;
  cursor: pointer;
}

#work article img {
  width: 100%;
  display: block;
  transition:
    transform 0.45s ease,
    opacity 0.45s ease;
}

#work article:hover img {
  transform: scale(1.03);
  opacity: 0.88;
}

/* =========================
   Info Proyectos
========================= */

.work-info {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px 18px;
  text-align: left;
  padding-bottom: 2em;
}

/* línea vertical SOLO en textos */

#work article:nth-child(odd) .work-info::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 0;
  width: 1px;
  height: calc(100% - 24px);
  background-color: rgba(51, 51, 51, 0.1);
}

/* grupo iconos + texto */

.work-info-content {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  max-width: 90%;
}

/* iconos */

.work-info-icons {
  display: flex;
  gap: 2px;
  margin-top: 3px;
  flex-shrink: 0;
}

.work-info .icon {
  width: 18px;
  height: 18px;
}

/* texto */

.work-info h3 {
  margin: 0;
  font-size: 16px;
  font-family: "Outfit", serif;
  font-weight: 400;
  line-height: 1.25;
}

.work-info h3 b {
  font-weight: 700;
}

.square-project img {
  aspect-ratio: 1 / 1;
  -o-object-fit: cover;
  object-fit: cover;
  -o-object-position: center;
  object-position: center;
}

/* =========================
     Coockies banner
========================= */

#cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;

  width: 340px;
  max-width: calc(100vw - 40px);

  background: white;
  border: 1px solid #333333;

  padding: 20px;
  z-index: 99999;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

#cookie-banner p {
  font-family: "Outfit", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 15px;
}

.cookie-buttons {
  display: flex;
  gap: 10px;
}

.cookie-buttons button {
  border: 1px solid #333333;
  background: transparent;
  padding: 8px 14px;

  font-family: "Outfit", sans-serif;
  cursor: pointer;
}

#accept-cookies {
  background: #333333;
  color: white;
}

#accept-cookies:hover {
  opacity: 0.8;
}

#reject-cookies:hover {
  background: #f2f2f2;
}

/* =========================
   Animaciones proyectos
========================= */

#work article {
  opacity: 0;
}

.effect-up {
  transform: translateY(40%) scale(0.75);
}

.effect-down {
  transform: translateY(-40%) scale(0.75);
}

.effect-zoom {
  transform: scale(0.45) rotate(-12deg);
}

.effect-spin {
  transform: scale(0.55) rotate(25deg);
}

#work article.visible {
  opacity: 1;
  transform: none;

  transition:
    opacity 1s ease,
    transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================
   Dragonfly Intro
========================= */

.dragonfly {
  z-index: 9999;
  width: 35%;
  position: relative;
  z-index: 3;
  transform: translateX(-450px) translateY(-80px) rotate(-18deg);

  -webkit-animation:
    dragonflyEntrance 1.8s cubic-bezier(0.17, 0.67, 0.32, 1.2) forwards,
    fly 2.5s ease-in-out infinite 1.8s;

  animation:
    dragonflyEntrance 1.8s cubic-bezier(0.17, 0.67, 0.32, 1.2) forwards,
    fly 2.5s ease-in-out infinite 1.8s;
}

/* entrada */

@-webkit-keyframes dragonflyEntrance {
  0% {
    transform: translateX(-450px) translateY(-80px) rotate(-18deg);
  }

  15% {
    transform: translateX(-320px) translateY(-40px) rotate(-12deg);
  }

  30% {
    transform: translateX(-250px) translateY(-60px) rotate(-9deg);
  }

  45% {
    transform: translateX(-180px) translateY(-20px) rotate(-6deg);
  }

  60% {
    transform: translateX(-120px) translateY(-35px) rotate(-4deg);
  }

  75% {
    transform: translateX(-50px) translateY(-10px) rotate(-2deg);
  }

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

@keyframes dragonflyEntrance {
  0% {
    transform: translateX(-450px) translateY(-80px) rotate(-18deg);
  }

  15% {
    transform: translateX(-320px) translateY(-40px) rotate(-12deg);
  }

  30% {
    transform: translateX(-250px) translateY(-60px) rotate(-9deg);
  }

  45% {
    transform: translateX(-180px) translateY(-20px) rotate(-6deg);
  }

  60% {
    transform: translateX(-120px) translateY(-35px) rotate(-4deg);
  }

  75% {
    transform: translateX(-50px) translateY(-10px) rotate(-2deg);
  }

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

/* =========================
   Intro Visibility
========================= */

#s1 > *:not(.dragonfly),
#work {
  opacity: 0;
  -webkit-animation: revealSite 0.8s ease forwards;
  animation: revealSite 0.8s ease forwards;
  -webkit-animation-delay: 1.8s;
  animation-delay: 1.8s;
}

@-webkit-keyframes revealSite {
  to {
    opacity: 1;
  }
}

@keyframes revealSite {
  to {
    opacity: 1;
  }
}

/* =========================
   DESKTOP ESTRECHO
========================= */

@media screen and (max-width: 1400px) {
  #servicios h2 {
    font-size: 15px;
    padding-top: 0;
    padding-bottom: 2%;
  }

  .icon {
    width: 18px;
    height: 18px;
  }

  .dragonfly {
    width: 38%;
  }
}

/* =========================
   TABLET RESPONSIVE
========================= */

@media screen and (max-width: 1100px) {
  /* Header */

  #s1 {
    width: 50%;
    padding: 2em;
    height: 100dvh;
  }

  /* Main */

  #work {
    margin-left: 50%;
    width: 50%;
  }

  /* Proyectos a una columna */

  #work article {
    width: 100%;
  }

  /* Eliminamos línea vertical */

  #work article:nth-child(odd) .work-info::after {
    display: none;
  }

  /* Ajustes visuales */

  h1 {
    font-size: 42px;
  }

  .words {
    min-width: 260px;
  }

  #logo {
    padding-top: 0;
    margin-top: 0;
    width: 40%;
  }

  nav {
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .contact-info {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
  }

  .contact-info span {
    display: none;
  }
}

/* =========================
   MOBILE RESPONSIVE
========================= */

#toggle-menu {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  right: -5px;
  width: 40px;
  height: 80px;
  border: none;
  background: transparent;
  color: #333333;
  font-size: 42px;
  font-weight: 700;
  cursor: pointer;
  z-index: 9999;
  padding: 0;
  line-height: 1;
  -webkit-animation: menuHint 4s infinite !important;
  animation: menuHint 4s infinite !important;
}

@media screen and (max-width: 768px) {
  #toggle-menu {
    display: flex;
  }

  body {
    overflow: hidden;
  }

  /* HEADER */

  #s1 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    padding: 1.5rem;
    z-index: 1000;
    transition: transform 0.4s ease;
    padding: 1.5rem 3rem 1.5rem 1.5rem;
    background-image: url("../01-img/Backgrounds/background-02.jpg");

    /* NUEVO */
    overscroll-behavior-y: contain;
  }

  /* HEADER OCULTO */

  #s1.closed {
    transform: translateX(calc(-100vw + 30px));
  }

  /* MAIN */

  #work {
    margin-left: 0;
    width: 100%;
    height: 100dvh;
    border-left: none;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;

    /* NUEVO */
    overscroll-behavior-y: contain;
  }

  #work article {
    width: 100%;
  }

  /* QUITAR LÍNEA VERTICAL */

  #work article:nth-child(odd) .work-info::after {
    display: none;
  }

  /* AJUSTES VISUALES */

  /* #logo {
    width: 55%;
  } */

  h1 {
    font-size: 34px;
  }

  .words {
    min-width: 220px;
  }

  .dragonfly {
    width: 50%;
  }

  .contact-info {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
  }

  .contact-info span {
    display: none;
  }

  .work-info {
    justify-content: flex-start;
    padding-left: 40px;
  }
}

/* ANIMACIÓN FLECHA */

@-webkit-keyframes menuHint {
  0%,
  100% {
    transform: translateY(-50%) translateX(0);
  }

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

@keyframes menuHint {
  0%,
  100% {
    transform: translateY(-50%) translateX(0);
  }

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

/* =========================
   Animación flecha
========================= */

@keyframes menuHint {
  0%,
  75%,
  100% {
    opacity: 1;

    font-size: 42px;
  }

  80% {
    opacity: 0.2;

    font-size: 52px;
  }

  85% {
    opacity: 1;

    font-size: 42px;
  }

  90% {
    opacity: 0.2;

    font-size: 52px;
  }

  95% {
    opacity: 1;

    font-size: 42px;
  }
}
