/* ==========================================================================
   Home · Fondo + Hero
   Valores de Framer: contenedor 130/59/40/72 (desktop), 210/24/40 (tablet),
   130/12/0 (teléfono). Titular del componente TypewriterHeadline.
   ========================================================================== */

@layer sections {
  /* --- Fondo (capas de la plantilla, desde el borde superior de la página) --- */
  /* En teléfono Framer oculta todas las capas (y así no se descarga el video) */
  .home-backdrop {
    position: absolute;
    inset: 0 0 auto;
    z-index: 0;
    display: none;
    height: 860px;
    overflow: hidden;
    pointer-events: none;
  }

  .home-backdrop__video {
    position: absolute;
    top: 0;
    right: 0;
    width: max(1440px, 100%);
    height: 860px;
    object-fit: fill;
  }

  .home-backdrop__shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgb(0 0 0 / 50%) 0%, var(--color-bg) 100%);
  }

  /* "Center Light": brillo blanco difuminado bajo el objeto */
  .home-backdrop__light {
    position: absolute;
    top: 600px;
    left: 50%;
    z-index: 2;
    width: 195px;
    height: 72px;
    background: var(--color-text);
    filter: blur(70px);
    translate: -50% 0;
  }

  /* "3D Ball": recuadro de 948×667 con la imagen en modo cover */
  .home-backdrop__object {
    position: absolute;
    top: 202px;
    left: 50%;
    z-index: 2;
    width: 948px;
    max-width: none;
    height: 667px;
    object-fit: cover;
    translate: -50% 0;
  }

  /* --- Hero --- */
  .hero {
    position: relative;
    z-index: 4;
    max-width: 1920px;
    margin-inline: auto;
    overflow: hidden;
  }

  .hero__container {
    display: flex;
    flex-direction: column;
    padding: 130px 12px 0;
  }

  .hero__headline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__title {
    margin: 0;
    color: var(--color-text);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.02em;
    text-wrap: initial;
  }

  .hero__prefix {
    display: block;
  }

  .hero__phrase {
    display: inline-block;
    min-height: 1.1em;
    color: var(--color-accent-bright);
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
  }

  .hero__cursor {
    display: inline-block;
    width: 3px;
    height: 0.85em;
    margin-left: 4px;
    background-color: currentColor;
    vertical-align: baseline;
    animation: hero-cursor 1s step-end infinite;
  }

  @keyframes hero-cursor {
    0%,
    100% {
      opacity: 1;
    }

    50% {
      opacity: 0;
    }
  }

  .hero__sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: rgb(255 255 255 / 65%);
    font-size: 14px;
    letter-spacing: -0.01em;
  }

  .hero__flags {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: var(--radius-sm);
    background-color: rgb(255 255 255 / 5%);
  }

  .hero__flag {
    width: 18px;
    height: 18px;
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.3s ease;

    &.is-active {
      opacity: 1;
      transform: scale(1.2);
    }
  }

  /* --- Fila inferior: "Hacemos" + bloque de contacto --- */
  .hero__bottom {
    display: flex;
    flex-direction: column;
    gap: 36px;
    margin-top: 60px;
    padding-bottom: 70px; /* 25 + 45 de Framer */
  }

  .hero__services {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 250px;
  }

  .hero__services-label {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-line);
    color: var(--color-text-soft);
    font-size: 16px;
    line-height: 24px;
  }

  .hero__services-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--palette-dim-gray);
    font-size: 14px;
    line-height: 20px;

    a:hover {
      color: var(--color-text-soft);
    }
  }

  .hero__aside {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 462px;
  }

  .hero__tagline {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-line);
    color: var(--color-text-soft);
    font-size: 16px;
    font-weight: 500;
    line-height: 22px;
  }

  .hero__contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 0;
  }

  /* Borde inferior: degradado negro → gris → negro */
  .hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: linear-gradient(90deg, var(--palette-black) 0%, var(--palette-medium-gray) 50.5%, var(--palette-black) 100%);
  }

  /* --- Tablet --- */
  @media (min-width: 810px) {
    .home-backdrop {
      display: block;
    }

    .hero__container {
      padding: 210px 24px 40px;
    }

    .hero__tagline {
      padding-bottom: 27px;
      font-size: 24px;
      line-height: 26px;
    }

    .hero__title {
      font-size: 52px;
      line-height: 1.08;
      letter-spacing: -0.03em;
    }

    .hero__sub {
      gap: 10px;
      margin-top: 20px;
      font-size: 18px;
    }

    .hero__bottom {
      flex-direction: row;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      margin-top: 100px;
      padding-bottom: 45px;
    }

    /* El padding inferior de 50px de Framer está solo en la columna izquierda */
    .hero__services {
      padding-bottom: 50px;
    }

    .hero__services-list {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px 14px;
      font-size: 16px;
      letter-spacing: -0.48px;
      line-height: 24px;

      /* Separador "/" entre las dos columnas (Framer "Line" 14×25) */
      li:nth-child(2n) {
        position: relative;
        padding-left: 14px;

        &::before {
          content: "";
          position: absolute;
          top: -1px;
          left: -7px;
          width: 1px;
          height: 25px;
          background-color: var(--palette-dim-gray);
          transform: rotate(30deg);
        }
      }
    }

    .hero__aside {
      gap: 27px;
      padding: 36px 15px 0 0;
    }
  }

  /* --- Desktop --- */
  @media (min-width: 992px) {
    .hero__title {
      font-size: 72px;
      line-height: 1.05;
    }
  }

  @media (min-width: 1440px) {
    .hero__container {
      padding: 130px 59px 40px 72px;
    }

    .hero__bottom {
      margin-top: 150px;
    }
  }
}
