/* Portada por capas. Sin JS y con movimiento reducido el contenido es estático;
   la secuencia (.is-depth) la activa home.js y la pinta con variables --hero-*. */
.hero--depth {
  display: block;
  padding: 0;
  overflow: visible; /* El ancestro del sticky no debe ser un contenedor de scroll. */
  min-height: 0;
  background: var(--bg);
}
.hero--depth::before { display: none; }
.hero__stage {
  position: relative;
  isolation: isolate;
  overflow: clip;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: calc(var(--header-h) + 72px) 80px;
}
.hero__opening, .hero__continue { display: none; }
.hero--depth .hero__media { background: url('../img/hero-industrial.webp') center / cover; }
.hero--depth .hero__details { position: relative; z-index: 4; }
.hero--depth .hero__fade, .hero--depth .hero__title .w > span {
  animation: none;
  opacity: 1;
  transform: none;
}
/* Rubros del kicker separados por puntos en la portada estática */
.hero--depth .hero__kicker > span:not(.dot) + span::before {
  content: "•";
  margin-inline: .45em;
}
.hero--depth .hero__kicker .solo-desktop { margin-left: 0; }

@media (prefers-reduced-motion: no-preference) {
  .hero--depth.is-depth {
    height: calc(100svh + var(--hero-travel, 280svh));
  }
  .is-depth .hero__stage {
    position: sticky;
    top: 0;
    height: 100svh;
    min-height: 0;
    padding: 0;
    display: block;
  }
  .is-depth:not(.hero--video) .hero__media, .is-depth .hero__gear, .is-depth .hero__tag, .is-depth .scroll-cue { display: none; }

  /* Con video: la escena queda transparente y el video, detrás, hace de fondo
     con el mismo acercamiento que la fotografía. */
  .is-depth.hero--video .hero__opening { background: transparent; }
  .is-depth.hero--video .hero__media {
    transform-origin: 70% 60%;
    transform: scale(var(--hero-back-scale, 1));
  }
  .is-depth.hero--video .hero__media::after { display: none; }

  /* Escena a pantalla completa: fondo, nombre, máquina recortada y sombra */
  .is-depth .hero__opening {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: clip;
    background: #0a0e18;
    pointer-events: none;
  }
  .hero__backdrop, .hero__foreground, .hero__opening-shade {
    position: absolute;
    inset: 0;
  }
  .hero__backdrop, .hero__foreground { will-change: transform; }
  .hero__backdrop {
    transform-origin: 70% 60%;
    transform: scale(var(--hero-back-scale, 1));
  }
  .hero__industrial {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100%, calc(var(--hero-frame-h, 100svh) * 1.777));
    height: auto;
    max-width: none;
    transform: translate(-50%, -50%);
  }
  .hero__foreground {
    z-index: 2;
    transform-origin: 80% 70%;
    transform: scale(var(--hero-front-scale, 1));
  }

  /* Nombre: home.js ajusta el tamaño al ancho de la pantalla y lo estira en
     alto (--hero-word-sy) desde su línea base, apoyada en el borde inferior. */
  .hero__word {
    position: absolute;
    z-index: 1;
    inset: 0;
    -webkit-mask-image: linear-gradient(180deg, rgb(0 0 0 / var(--hero-mask-top, 1)) 0%, rgb(0 0 0 / var(--hero-mask-bottom, 1)) 100%);
    mask-image: linear-gradient(180deg, rgb(0 0 0 / var(--hero-mask-top, 1)) 0%, rgb(0 0 0 / var(--hero-mask-bottom, 1)) 100%);
  }
  .hero__letters {
    position: absolute;
    top: 0;
    left: 50%;
    width: max-content;
    display: flex;
    gap: .035em;
    color: #f6f7fb;
    font-family: "Anton", "Arial Narrow", Impact, sans-serif;
    font-size: var(--hero-word-fs, 16vw);
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    transform-origin: 50% var(--hero-word-base, 0px);
    transform: translate(-50%, var(--hero-word-y, 0px)) scaleY(var(--hero-word-sy, 1));
  }
  .hero__line { display: contents; }
  .hero__letters [data-r] {
    display: block;
    opacity: 0;
    will-change: transform, opacity, filter;
  }
  /* En vertical se apila MAQ / SERVICE: cada línea ocupa el ancho de la
     pantalla con su propio tamaño; home.js calcula --fs, --top y --base. */
  .is-stacked .hero__letters {
    left: 0;
    width: 100%;
    transform: translateY(var(--hero-word-y, 0px));
  }
  .hero__letters .hero__logo { display: none; }
  .is-stacked .hero__logo {
    position: absolute;
    top: var(--hero-logo-top, 0px);
    left: 50%;
    display: block;
    width: var(--hero-logo-w, 100px);
    height: auto;
    margin-left: calc(var(--hero-logo-w, 100px) / -2);
  }
  .is-stacked .hero__line {
    position: absolute;
    top: var(--top, 0px);
    left: 50%;
    width: max-content;
    display: flex;
    gap: .035em;
    font-size: var(--fs, 100px);
    transform-origin: 50% var(--base, 0px);
    transform: translateX(-50%) scaleY(var(--hero-word-sy, 1));
  }

  /* Sombra: arriba y abajo siempre (lectura del menú); al aparecer el
     contenido se oscurece el centro (titular) y se refuerzan las franjas de
     rubros y cifras. */
  .hero__opening-shade {
    z-index: 3;
    background: linear-gradient(180deg, #05080f8c 0%, transparent 22%, transparent 78%, #05080f73 100%);
  }
  .hero__opening-shade::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: var(--hero-reveal, 0);
    background: radial-gradient(ellipse 62% 52% at 50% 50%, #05080fc2 0%, #05080f80 55%, transparent 100%),
      linear-gradient(180deg, #05080fb3 0%, transparent 26%),
      linear-gradient(0deg, #05080fe6 0%, #05080f99 18%, transparent 34%);
  }

  /* Contenido: se superpone a toda la escena en tres filas, como la referencia */
  .is-depth .hero__details {
    position: absolute;
    z-index: 4;
    inset: 0;
    max-width: none;
    padding: calc(var(--header-h) + 40px) clamp(20px, 4vw, 64px) clamp(22px, 3.2vw, 44px);
    visibility: hidden;
  }
  .is-depth.is-revealing .hero__details { visibility: visible; }
  .is-depth .hero__content {
    height: 100%;
    max-width: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 24px;
  }
  .is-depth [data-hero-item] {
    opacity: var(--o, 0);
    transform: translateY(var(--y, 24px));
  }
  /* Rubros: píldoras sobre vidrio oscuro, con punto lima */
  .is-depth .hero__kicker {
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .2em;
    color: #fff;
  }
  .is-depth .hero__kicker > span:not(.dot) {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 9px 16px;
    border: 1px solid #ffffff2e;
    border-radius: var(--pill);
    background: #05080f99;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
  .is-depth .hero__kicker > span:not(.dot)::before,
  .is-depth .hero__kicker > span:not(.dot) + span::before {
    content: "";
    width: 7px;
    height: 7px;
    margin: 0;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 10px #9fe22e99;
  }
  .is-depth .hero__kicker .dot { display: none; }
  /* Titular, bajada y botones centrados en la escena */
  .is-depth .hero__main {
    align-self: center;
    justify-self: center;
    max-width: 900px;
    text-align: center;
  }
  .is-depth .hero__title {
    font-size: clamp(36px, 4.6vw, 70px);
    margin-bottom: 20px;
    text-shadow: 0 2px 30px #05080f80;
  }
  .is-depth .hero__lead {
    max-width: 720px;
    margin: 0 auto 28px;
    color: #f3f5fbd9;
  }
  .is-depth .hero__cta { margin: 0; justify-content: center; }
  .is-depth .stats {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    max-width: none;
    padding-top: 18px;
    border-top: 1px solid #ffffff40;
  }
  .is-depth .stat {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    backdrop-filter: none;
  }
  .is-depth .stat:nth-child(2) { text-align: center; }
  .is-depth .stat:last-child:not(:first-child) { text-align: right; }
  /* Cifras: valor grande en lima y etiqueta legible */
  .is-depth .stat__value {
    font-size: clamp(30px, 2.9vw, 46px);
    color: var(--lime);
    text-shadow: 0 2px 18px #05080fcc;
  }
  .is-depth .stat__label {
    display: block;
    margin-top: 2px;
    color: #f3f5fbeb;
    font-size: 15px;
    font-weight: 600;
    text-shadow: 0 1px 10px #05080fcc;
  }

  /* Indicación inicial: se desvanece apenas empieza el nombre */
  .is-depth .hero__continue {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .3em;
    color: var(--text);
    opacity: var(--hero-cue, 1);
    transform: translateX(-50%);
  }
  .hero__continue span {
    color: var(--lime);
    font-size: 20px;
    letter-spacing: 0;
    animation: heroCue 1.8s var(--ease-in-out) infinite;
  }
  @keyframes heroCue {
    0%, 100% { transform: translateY(-3px); }
    50% { transform: translateY(5px); }
  }
  .is-depth.is-started .hero__continue { pointer-events: none; }

  @media (max-width: 640px) {
    /* En vertical se encuadra la máquina, no el centro de la foto */
    .hero__industrial { left: 82%; transform: translate(-82%, -50%); }
    .is-depth .hero__details { padding: calc(var(--header-h) + 36px) 18px 20px; }
    .is-depth .hero__content { gap: 16px; }
    .is-depth .hero__kicker { gap: 6px; font-size: 10px; letter-spacing: .1em; }
    .is-depth .hero__kicker > span:not(.dot) { gap: 6px; padding: 7px 10px; }
    .is-depth .hero__kicker > span:not(.dot)::before,
    .is-depth .hero__kicker > span:not(.dot) + span::before { width: 5px; height: 5px; }
    .is-depth .hero__kicker > span.solo-desktop { display: none; }
    .is-depth .hero__title { font-size: clamp(32px, 9vw, 40px); }
    .is-depth .hero__lead { font-size: 15.5px; margin-bottom: 22px; }
    .is-depth .hero__cta { display: grid; grid-template-columns: 1fr 1fr; }
    .is-depth .hero__cta .btn { padding-inline: 12px; --h: 52px; font-size: 15px; }
    .is-depth .stats { gap: 10px; padding-top: 14px; }
    .is-depth .stat__value { font-size: 24px; }
    .is-depth .stat__label { font-size: 12.5px; line-height: 1.3; }
  }  /* Pantallas bajas (p. ej. notebook 1080p con Windows al 150 %: ~1280×550):
     el contenido se ajusta al alto para que la secuencia siga cabiendo. */
  @media (min-width: 641px) and (max-height: 760px) {
    .is-depth .hero__details { padding: calc(var(--header-h) + 22px) clamp(20px, 4vw, 64px) 18px; }
    .is-depth .hero__content { gap: 14px; }
    .is-depth .hero__title { font-size: clamp(28px, min(4.4vw, 9svh), 58px); margin-bottom: 12px; }
    .is-depth .hero__lead { font-size: clamp(14px, 2.6svh, 17px); margin-bottom: clamp(12px, 2.6svh, 20px); }
    .is-depth .hero__cta .btn { --h: clamp(42px, 8svh, 52px); }
    .is-depth .hero__kicker > span:not(.dot) { padding-block: 6px; }
    .is-depth .stats { padding-top: 12px; }
    .is-depth .stat__value { font-size: clamp(22px, 5.4svh, 34px); }
    .is-depth .stat__label { font-size: 13.5px; }
  }
}
@media (max-width: 899px) {
  .hero__stage { padding-block: calc(var(--header-h) + 48px) 68px; }
}
@media (max-width: 380px) {
  .hero--depth .hero__cta { grid-template-columns: 1fr; }
  .hero--depth .hero__kicker { letter-spacing: .12em; }
}
@media (min-width: 900px) and (max-height: 800px) {
  .hero--depth:not(.is-depth) .hero__stage { padding-block: calc(var(--header-h) + 40px) 64px; }
  .hero--depth:not(.is-depth) .hero__title { font-size: clamp(40px, 4.4vw, 64px); margin-bottom: 20px; }
  .hero--depth:not(.is-depth) .hero__kicker { margin-bottom: 16px; }
  .hero--depth:not(.is-depth) .hero__lead, .hero--depth:not(.is-depth) .hero__cta { margin-bottom: 24px; }
}
