/* ==========================================================================
   SWD-2026 · HOME CSS
   ==========================================================================
   Este archivo contiene los estilos exclusivos de la home:

   1. Hero y escena principal
   2. Fondo, overlays y capas visuales
   3. Contenedor y layout interno del hero
   4. Título, texto y acciones del hero
   5. Figura lateral del hero y composición del ojo
   6. Responsive mobile
   7. Responsive tablet y desktop
   8. Movimiento reducido

   Aquí NO deben ir:
   - Tokens globales
   - Reset
   - Header / footer global
   - About
   - Admin
   - Errores

   ========================================================================== */

/* ==========================================================================
   1. HERO Y ESCENA PRINCIPAL
   --------------------------------------------------------------------------
   Estructura principal de la vista home. Define el alto visible completo
   y el aislamiento visual necesario para superponer capas.
   ========================================================================== */

.hero {
  position: relative;
  height: 100svh;
  min-height: 100svh;
  isolation: isolate;
}

.hero {
  scroll-margin-top: 8.8rem;
}

.hero__scene {
  position: relative;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  background-color: #0a0a0a;
  contain: paint;
}

/* ==========================================================================
   2. FONDO, OVERLAYS Y CAPAS VISUALES
   --------------------------------------------------------------------------
   Fondo principal del hero y velo oscuro/lumínico que mejora contraste
   del contenido y profundidad visual de la composición.
   ========================================================================== */

.hero__scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(
      180deg,
      rgba(8, 8, 8, 0.72) 0%,
      rgba(8, 8, 8, 0.28) 26%,
      rgba(8, 8, 8, 0.18) 48%,
      rgba(8, 8, 8, 0.58) 100%
    ),
    radial-gradient(
      circle at top left,
      rgba(242, 194, 48, 0.16),
      transparent 34%
    );
  pointer-events: none;
}

.hero__wall {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero__wall-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.88;
  contain: paint;

  -webkit-mask-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 22%,
    rgba(0, 0, 0, 0.82) 38%,
    rgba(0, 0, 0, 0.48) 54%,
    rgba(0, 0, 0, 0.18) 68%,
    rgba(0, 0, 0, 0) 82%
  );
  mask-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 22%,
    rgba(0, 0, 0, 0.82) 38%,
    rgba(0, 0, 0, 0.48) 54%,
    rgba(0, 0, 0, 0.18) 68%,
    rgba(0, 0, 0, 0) 82%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: left top;
  mask-position: left top;
}

.hero__wall-overlay-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: grayscale(1) brightness(0.9) contrast(1.06);
}

/* ==========================================================================
   3. CONTENEDOR Y LAYOUT INTERNO DEL HERO
   --------------------------------------------------------------------------
   Organiza el contenido textual y las acciones dentro del alto completo
   del hero, respetando el espacio ocupado por el header superpuesto.
   ========================================================================== */

.hero__container {
  position: relative;
  z-index: 4;
  height: 100svh;
  min-height: 100svh;
  padding-top: calc(var(--header-height-mobile) + var(--space-lg));
  padding-bottom: var(--space-lg);
}

.hero__layout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  height: 100%;
  min-height: 100%;
}

.hero__content {
  position: relative;
  top: 0;
  width: min(100%, 38rem);
  transform: none;
}

/* ==========================================================================
   4. TÍTULO, TEXTO Y ACCIONES DEL HERO
   --------------------------------------------------------------------------
   Tipografía principal de la home, bloque descriptivo y botones de llamada
   a la acción visibles en la portada.
   ========================================================================== */

.hero__title {
  margin-bottom: var(--space-md);
  font-size: clamp(3.6rem, 11vw, 6.2rem);
  line-height: var(--line-height-tight);
  text-wrap: balance;
}

.hero__title-line {
  display: block;
}

.hero__text {
  max-width: 28ch;
  font-size: var(--font-size-md);
  color: var(--color-gray-100);
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  width: auto;
  margin-top: auto;
  align-self: flex-start;
}

/* ==========================================================================
   5. FIGURA LATERAL DEL HERO Y COMPOSICIÓN DEL OJO
   --------------------------------------------------------------------------
   Capas visuales del personaje, glóbulo ocular e iris. Mantiene además
   los ajustes finos ya definidos en el proyecto para la posición del ojo.
   ========================================================================== */

.hero__figure {
  --iris-left: 63.5%;
  --iris-top: 49.6%;
  --iris-width: 16.14%;

  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 100%;
  aspect-ratio: 175 / 420;
  pointer-events: none;
  contain: paint;
}

.hero__sergio,
.hero__eyeball-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: right bottom;
}

.hero__sergio {
  z-index: 5;
}

.hero__eyeball-layer {
  z-index: 3;
}

.hero__iris {
  position: absolute;
  top: var(--iris-top);
  left: var(--iris-left);
  z-index: 4;
  width: var(--iris-width);
  height: auto;
  aspect-ratio: 23 / 22;
  transform: translate(-50%, -50%);
  backface-visibility: hidden;
}

/* ==========================================================================
   6. RESPONSIVE MOBILE
   --------------------------------------------------------------------------
   Ajustes específicos para móviles: ocultar CTA secundaria, centrar
   acciones en portrait y reorganizar composición en landscape.
   ========================================================================== */

@media (max-width: 767.98px) {
  .hero__projects-button {
    display: none;
  }
}

@media (max-width: 767.98px) and (orientation: portrait) {
  .hero__layout {
    align-items: stretch;
  }

  .hero__content {
    top: 50%;
    transform: translateY(-50%);
  }

  .hero__actions {
    width: 100%;
    justify-content: center;
    align-self: center;
  }
}

@media (max-width: 767.98px) and (orientation: landscape) {
  .hero__container {
    padding-top: calc(var(--header-height-mobile) + var(--space-md));
    padding-bottom: var(--space-md);
  }

  .hero__layout {
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-start;
    gap: var(--space-lg);
  }

  .hero__content {
    top: 0;
    width: min(100%, 32rem);
    transform: none;
  }

  .hero__actions {
    margin-top: 0;
    align-self: flex-end;
    justify-content: flex-start;
    width: auto;
  }

  .hero__figure {
    height: 100%;
  }
}

/* ==========================================================================
   7. RESPONSIVE TABLET Y DESKTOP
   --------------------------------------------------------------------------
   Recoloca el contenido del hero, recupera la CTA secundaria y reserva
   espacio lateral para la figura visual en pantallas más amplias.
   ========================================================================== */

@media (min-width: 768px) {
  .hero {
    scroll-margin-top: 9.6rem;
  }

  .hero__container {
    padding-top: calc(var(--header-height-mobile) + var(--space-md));
    padding-bottom: var(--space-2xl);
    padding-right: clamp(20rem, 28vw, 34rem);
  }

  .hero__layout {
    justify-content: center;
    gap: var(--space-lg);
  }

  .hero__content {
    top: 0;
    width: min(100%, 44rem);
    transform: none;
  }

  .hero__title {
    font-size: clamp(4.8rem, 6vw, 7rem);
  }

  .hero__text {
    font-size: var(--font-size-lg);
  }

  .hero__actions {
    margin-top: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: auto;
    align-self: flex-start;
  }

  .hero__projects-button {
    display: inline-flex;
  }

}

@media (min-width: 1024px) {
  .hero__container {
    padding-right: clamp(26rem, 34vw, 46rem);
  }

  .hero__content {
    width: min(100%, 48rem);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hero__iris {
    will-change: transform;
  }
}

/* ==========================================================================
   8. MOVIMIENTO REDUCIDO
   --------------------------------------------------------------------------
   Mantiene la posición correcta del iris cuando el usuario solicita
   reducción de animaciones o transiciones del sistema.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .hero__iris {
    transform: translate(-50%, -50%) !important;
  }
}

