@layer components {
  .hero {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: end;
    min-height: 100svh;
    overflow: clip;
    color: var(--blanco);
    background: var(--petroleo-hondo);
  }

  .hero--truss, .hero--mast { min-height: min(100svh, 56rem); }

  /* Foto: acercamiento lento (1.08 -> 1) y luego un paneo sutil. */
  .hero__photo {
    position: absolute;
    inset: -2%;
    z-index: -3;
    animation: hero-pan 32s ease-in-out 2.4s infinite alternate;
  }
  .hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: hero-zoom 2.6s var(--ease) backwards;
  }
  .hero__shade {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: color-mix(in srgb, var(--petroleo-hondo) 62%, transparent);
  }

  @keyframes hero-zoom { from { scale: 1.08; } }
  @keyframes hero-pan { to { translate: -1.8% 0.8%; } }

  .hero__inner {
    padding-top: calc(var(--header-h) + 3rem);
    padding-bottom: clamp(3rem, 8vw, 6.5rem);
  }

  .hero__title {
    max-width: 11em;
    font-size: var(--fs-hero);
    font-stretch: 100%;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.025em;
  }

  /* El título entra línea por línea desde una máscara. */
  .hero__line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.14em;
    margin-bottom: -0.14em;
  }
  .hero__line-in {
    display: block;
    animation: line-in 1.1s var(--ease) calc(0.3s + var(--i, 0) * 0.16s) backwards;
  }
  @keyframes line-in { from { translate: 0 112%; } }

  .hero__text {
    margin-top: clamp(1.25rem, 2.5vw, 2rem);
    max-width: 34rem;
    font-size: var(--fs-1);
    line-height: 1.4;
    font-weight: 400;
    animation: hero-fade var(--t-slow) var(--ease) 1.1s backwards;
  }
  .hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: clamp(1.5rem, 3vw, 2.25rem);
    animation: hero-fade var(--t-slow) var(--ease) 1.3s backwards;
  }
  @keyframes hero-fade { from { opacity: 0; translate: 0 0.75rem; } }

  /* Silueta que se construye sola. */
  .hero__structure {
    position: absolute;
    right: max(0px, calc(var(--gutter) - 3rem));
    bottom: 0;
    z-index: -1;
    width: min(58vw, 52rem);
    height: 100%;
    padding-top: var(--header-h);
    pointer-events: none;
  }
  .hero--truss .hero__structure,
  .hero--mast .hero__structure { width: min(54vw, 46rem); }

  /* Móvil y tableta: la estructura ocupa el cielo, sobre el texto y sin taparlo. */
  @media (max-width: 59.99rem) {
    .hero { grid-template-rows: minmax(0, 1fr) auto; align-items: stretch; }
    .hero__structure {
      position: relative;
      grid-row: 1;
      right: auto;
      width: 100%;
      height: auto;
      min-height: 12rem;
      padding: 0;
      margin-top: calc(var(--header-h) + 0.5rem);
    }
    .hero__structure .structure { position: absolute; inset: 0; }
    .hero__inner { grid-row: 2; padding-top: 1.5rem; padding-bottom: 3rem; }
    /* Sin JS el header no es fijo (ver layout.css). */
    :root:not(.js) .hero__structure { margin-top: 1.5rem; }
  }
}
