/* ================================
   Hero stage — index
   Copy fijo + escenario de imágenes con transición de persiana.
   CSS plano a propósito: no depende de una recompilación de Tailwind.
   ================================= */

.gm-hero {
    /* Gris corporativo (--secondary de custom.css) como fondo del hero.
       Los tonos oscuros de apoyo salen de la paleta de contact-us
       (#2b2b2b / #1c1c1c) y el claro del "spec plate" (#cdd2d6). */
    --gm-hero-grey: #3e3e3e;
    --gm-hero-grey-deep: #2b2b2b;
    --gm-hero-ink: #1c1c1c;
    --gm-hero-zinc: #cdd2d6;
    --gm-hero-orange: #f36b21;
    --gm-hero-orange-light: #ff8a50;
    --gm-hero-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    position: relative;
    background: var(--gm-hero-grey);
    color: #fafafa;
    overflow: hidden;
}

/* Veta de aluminio: rayado vertical tenue + caída hacia el gris profundo,
   para que el bloque no quede plano al perder el negro. */
.gm-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.045) 0 1px,
            transparent 1px 3px
        ),
        linear-gradient(
            160deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(28, 28, 28, 0.35) 100%
        );
    pointer-events: none;
}

/* Canto de aluminio cepillado: cierra el bloque gris contra la sección
   clara que sigue. Mismo degradado que la "spec plate" de contact-us. */
.gm-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        #eef1f3 0%,
        #b9c0c6 38%,
        #dfe4e8 55%,
        #a9b1b8 100%
    );
}

.gm-hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    /* minmax(0,...): sin esto los hijos del grid no bajan de su ancho de
       contenido y el hero desborda horizontalmente en móvil. */
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.gm-hero__copy,
.gm-hero__viewport {
    min-width: 0;
}

.gm-hero__title,
.gm-hero__eyebrow,
.gm-hero-slide__name {
    overflow-wrap: break-word;
}

/* En desktop el copy y los datos comparten la columna izquierda;
   el escenario ocupa la derecha a lo alto de las dos filas. */
@media (min-width: 1024px) {
    .gm-hero__inner {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        grid-template-rows: auto auto;
        column-gap: 3.5rem;
        row-gap: 0;
        align-items: start;
    }

    .gm-hero__copy {
        grid-column: 1;
        grid-row: 1;
    }

    .gm-hero__facts {
        grid-column: 1;
        grid-row: 2;
        margin-top: 2.5rem;
    }

    .gm-hero__viewport {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

/* ---------- Columna de copy ---------- */

/* Sobre gris el naranja pierde contraste en texto pequeño:
   el eyebrow va en claro y el naranja queda en el separador. */
.gm-hero__eyebrow {
    margin: 0 0 1.25rem;
    font-family: var(--gm-hero-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gm-hero-zinc);
}

.gm-hero__eyebrow span {
    color: var(--gm-hero-orange-light);
    padding-inline: 0.35rem;
}

.gm-hero__title {
    margin: 0;
    font-size: clamp(2.1rem, 5.2vw, 4.2rem);
    line-height: 0.95;
    text-transform: uppercase;
    color: #fff;
}

.gm-hero__lede {
    margin: 1.5rem 0 0;
    max-width: 46ch;
    font-size: clamp(0.98rem, 1.3vw, 1.1rem);
    line-height: 1.6;
    color: var(--gm-hero-zinc);
}

.gm-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.gm-hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.6rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: var(--gm-hero-mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease,
        border-color 0.2s ease;
}

.gm-hero__btn--primary {
    background: var(--gm-hero-orange);
    color: #fff;
}

.gm-hero__btn--primary:hover {
    background: #ff8340;
}

.gm-hero__btn--ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
}

.gm-hero__btn--ghost:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.gm-hero__facts {
    /* La separación en móvil la da el gap del grid; en desktop se añade
       margen para despegar los datos de los botones. */
    margin: 0;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: grid;
    gap: 0.85rem;
}

.gm-hero__fact {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.75rem;
    align-items: baseline;
}

.gm-hero__fact dt {
    font-family: var(--gm-hero-mono);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.gm-hero__fact dd {
    margin: 0;
    font-size: 0.9rem;
    color: var(--gm-hero-zinc);
}

.gm-hero__fact a {
    color: var(--gm-hero-zinc);
    text-decoration: none;
    border-bottom: 1px solid rgba(243, 107, 33, 0.6);
}

.gm-hero__fact a:hover {
    color: #fff;
    border-bottom-color: var(--gm-hero-orange);
}

.gm-hero__fact a:focus-visible {
    outline: 3px solid var(--gm-hero-orange);
    outline-offset: 3px;
}

/* ---------- Escenario ---------- */

.gm-hero__stage {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: var(--gm-hero-ink);
    box-shadow: 0 24px 60px rgba(20, 20, 20, 0.5);
}

@media (min-width: 1024px) {
    .gm-hero__stage {
        aspect-ratio: 16 / 11;
    }
}

.gm-hero__slides {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    inset: 0;
}

.gm-hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.gm-hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s ease, visibility 0s;
}

.gm-hero-slide__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Degradado para que el texto del slide sea legible sobre cualquier foto. */
.gm-hero-slide__body {
    position: absolute;
    inset: auto 0 0 0;
    padding: clamp(1.25rem, 3vw, 2rem);
    background: linear-gradient(
        to top,
        rgba(28, 28, 28, 0.94) 0%,
        rgba(28, 28, 28, 0.74) 45%,
        rgba(28, 28, 28, 0) 100%
    );
}

.gm-hero-slide__name {
    margin: 0;
    font-size: clamp(1.25rem, 2.4vw, 1.9rem);
    line-height: 1.1;
    text-transform: uppercase;
    color: #fff;
}

.gm-hero-slide__blurb {
    margin: 0.6rem 0 0;
    max-width: 48ch;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--gm-hero-zinc);
}

.gm-hero-slide__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-family: var(--gm-hero-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gm-hero-orange);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.gm-hero-slide__link:hover {
    border-bottom-color: var(--gm-hero-orange);
}

.gm-hero-slide__link svg {
    width: 0.9rem;
    height: 0.9rem;
    transition: transform 0.2s ease;
}

.gm-hero-slide__link:hover svg {
    transform: translateX(3px);
}

/* ---------- Firma: lamas de persiana ---------- */

.gm-hero__louvers {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    background-image: repeating-linear-gradient(
        180deg,
        rgba(28, 28, 28, 0.94) 0 55%,
        rgba(28, 28, 28, 0) 55% 100%
    );
    /* En reposo las lamas están abiertas; al cerrar, se juntan. */
    background-size: 100% 46px;
    transition: opacity 0.22s ease,
        background-size 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.gm-hero__stage.is-wiping .gm-hero__louvers {
    opacity: 1;
    background-size: 100% 14px;
}

/* El cambio de slide ocurre con las lamas cerradas: sin crossfade,
   así los dos textos no se superponen a mitad de transición. */
.gm-hero__stage.is-wiping .gm-hero-slide {
    transition: none;
}

/* ---------- Rail de categorías ---------- */

.gm-hero__rail {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 0;
    margin-top: 2rem;
    overflow-x: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    scrollbar-width: none;
}

.gm-hero__rail::-webkit-scrollbar {
    display: none;
}

@media (min-width: 768px) {
    .gm-hero__rail {
        overflow-x: visible;
    }
}

.gm-hero__rail-btn {
    position: relative;
    flex: 1 0 auto;
    padding: 1rem 1.25rem 1.1rem;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--gm-hero-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease;
}

.gm-hero__rail-btn:hover {
    color: #fff;
}

.gm-hero__rail-btn[aria-current="true"] {
    color: #fff;
}

/* Base gris del activo: deja marca aunque la regla naranja esté en 0. */
.gm-hero__rail-btn[aria-current="true"]::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.28);
}

/* Regla naranja: marca el activo y avanza con el autoplay. */
.gm-hero__rail-btn::after {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gm-hero-orange);
    transform: scaleX(0);
    transform-origin: left;
}

.gm-hero__rail-btn[aria-current="true"]::after {
    transform: scaleX(1);
}

/* Con autoplay corriendo, la regla se rellena en el tiempo del intervalo.
   El JS quita y repone la clase para reiniciar la animación. */
.gm-hero__rail-btn.is-progressing::after {
    animation: gm-hero-progress var(--gm-hero-progress, 6s) linear forwards;
}

@keyframes gm-hero-progress {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

/* ---------- Accesibilidad ---------- */

.gm-hero__btn:focus-visible,
.gm-hero__rail-btn:focus-visible,
.gm-hero-slide__link:focus-visible {
    outline: 3px solid var(--gm-hero-orange);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .gm-hero__louvers {
        display: none;
    }

    .gm-hero-slide,
    .gm-hero__btn,
    .gm-hero-slide__link svg,
    .gm-hero__rail-btn,
    .gm-hero__rail-btn::after {
        transition: none;
    }

    .gm-hero__rail-btn.is-progressing::after {
        animation: none;
    }
}
