* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: black;
  background-image: url('background.gif');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

.container {
  position: relative;
  width: 90vw;
  max-width: 420px;
  aspect-ratio: 1 / 1;
}

.gif {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.gif.default {
  opacity: 1;
  z-index: 1;
}

.gif.active {
  opacity: 1;
  z-index: 2;
}

.link-area {
  position: absolute;
  color: white;
  text-decoration: none;
  font-size: 1.3rem;
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3;
  text-align: center;
  transition: outline 0.3s ease, text-shadow 0.4s ease;
}

.link-area:hover {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 5px;
  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.6),
    0 0 10px rgba(255, 255, 255, 0.5),
    0 0 20px rgba(255, 255, 255, 0.4);
}

.top    { top: -20%; left: 50%; transform: translateX(-50%); }
.bottom { bottom: -20%; left: 50%; transform: translateX(-50%); }
.left   { left: -30%; top: 50%; transform: translateY(-50%); }
.right  { right: -30%; top: 50%; transform: translateY(-50%); }

.center-hover-zone {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10%;
  height: 25%;
  transform: translate(-50%, -50%);
  z-index: 5;
  background: transparent;
}

/* Mobile-specific adjustments */
@media (max-width: 600px) {
  .link-area {
    font-size: 1rem;
    padding: 1rem;
  }

  .top, .bottom {
    top: auto;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .top {
    top: 5%;
  }

  .bottom {
    bottom: 5%;
  }

  .left, .right {
    top: auto;
    bottom: auto;
    transform: translateY(0);
  }

  .left {
    top: 45%;
    left: 5%;
  }

  .right {
    top: 45%;
    right: 5%;
  }

  .gif {
    position: absolute;
    top: 50%;
    left: 51%;
    transform: translate(-50%, -50%) scale(0.7);
    transform-origin: center center;
  }
}
/* Rectángulo vertical blanco */
.about-container {
  position: relative;
  max-width: 600px;  /* o el ancho que prefieras */
  height: auto;      /* que crezca según contenido */
  min-height: 200px; /* aseguras altura mínima */
  border: 2px solid white;
  padding: 2rem 3rem 3rem 3rem; /* más padding abajo para dar espacio */
  background: rgba(0,0,0,0.6); /* opcional para mejor lectura */
  margin: 3rem auto;
  box-sizing: border-box;
    overflow: visible;    /* IMPORTANTE: para que el gif no se recorte */
}

/* Título en italic bold más pequeño */
.about-title {
  font-style: italic;
  font-weight: 700;
  font-size: 1.7rem;   /* Más pequeño que antes */
  margin-bottom: 0.4rem;
  color: white
}

/* Texto dentro del recuadro */
.about-text {
  font-size: 1rem;  /* Más pequeño */
  line-height: 1.6;
  margin-right: 3.5rem;  /* Margen a la derecha para separar del gif */
  margin-bottom: 2rem;
  text-align: justify;
  color: white
}

/* Gif grande abajo a la derecha */
.milk-gif {
  position: absolute;
  bottom: -160px;
  right: -560px;
  width: 1000px;
  height: auto;
  z-index: 10;
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 1));
}

.back-arrow {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 2rem;
  text-decoration: none;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
  transition: transform 0.2s, background 0.2s;
  z-index: 999;
}

.back-arrow:hover {
  transform: scale(1.2);
  background: rgba(255, 255, 255, 0.3);
}

/* Responsive */

@media screen and (max-width: 768px) {
  body {
    overflow-x: hidden; /* No horizontal scroll */
    position: relative;
  }

  .about-container {
    max-width: 85vw;       /* smaller width */
    min-height: 80px;     /* slightly taller so content fits */
    padding: 0.5rem 1rem 0.5rem 1rem;
    margin: -10vh auto 0 auto;
    position: relative;    /* for absolute positioning inside */
  }

.about-title {
  font-style: italic;
  font-weight: 700;
  font-size: 1.4rem;   /* Más pequeño que antes */
  margin-bottom: 0.4rem;
  color: white
}

  .about-text {
    margin-right: 0rem;       /* reset margin */
    font-size: 0.7rem;     /* smaller text */
  }
  
  .about-text p:last-of-type {
    margin-right: 60px;    /* space for gif */
  }


  .milk-gif {
    width: 500px;          /* smaller gif */
    position: absolute;    /* ensure positioned relative to container */
    bottom: -80px;         /* proportional bottom */
    right: -255px;         /* proportional right */
    z-index: 10;
  }
}
