/* =========================================================
   HERO — Termo Garaż
   Pełnoekranowa scena, trzy kinowe kadry w crossfade,
   typografia na środku, sterowanie na dole.
   ========================================================= */

/* Hero wchodzi pod przezroczysty header */
body.home {
    padding-top: 0;
}

.tg-hero {
    position: relative;
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 100svh;
    isolation: isolate;
    overflow: clip;
    background-color: #000;
    color: #fff;
}

/* ——— Scena ze zdjęciami ——— */

.tg-hero__stage {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.tg-hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.5s var(--tg-ease);
    will-change: opacity;
}

.tg-hero__slide.is-active {
    opacity: 1;
}

.tg-hero__slide picture {
    display: block;
    width: 100%;
    height: 100%;
}

.tg-hero__slide img {
    display: block;
    width: 108%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 54%;
    --tg-drift: -6%;
    /* Dryf zawsze przypięty do img — przy wyjściu pauza zamiast resetu transform */
    animation: tg-hero-drift 11s linear forwards;
    animation-play-state: paused;
}

/* Bardzo wolny dryf kadru, tylko translate */
@keyframes tg-hero-drift {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(var(--tg-drift, -6%), 0, 0);
    }
}

.tg-hero__slide.is-active img {
    animation-play-state: running;
}

.tg-hero__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(10, 10, 12, 0.82) 0%,
            rgba(10, 10, 12, 0.5) 18%,
            rgba(10, 10, 12, 0.46) 42%,
            rgba(10, 10, 12, 0.74) 78%,
            var(--tg-base) 100%
        ),
        radial-gradient(115% 75% at 50% 44%, rgba(10, 10, 12, 0.38) 0%, rgba(10, 10, 12, 0.1) 46%, rgba(10, 10, 12, 0.72) 100%);
}

.tg-hero__grain {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    mix-blend-mode: overlay;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 160px 160px;
}

/* ——— Treść ——— */

.tg-hero__content {
    position: relative;
    z-index: 2;
    grid-row: 1;
    align-self: center;
    text-align: center;
    padding-block: calc(var(--header-height, 4rem) + clamp(1.5rem, 5vh, 3rem)) clamp(1rem, 3vh, 2rem);
}

.tg-hero__eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin: 0 0 clamp(1.1rem, 2.5vh, 1.75rem);
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(245, 245, 247, 0.62);
    opacity: 0;
    animation: tg-hero-fade 1s var(--tg-ease-out) 0.15s forwards;
}

.tg-hero__eyebrow::before,
.tg-hero__eyebrow::after {
    content: "";
    width: clamp(1.5rem, 4vw, 2.75rem);
    height: 1px;
    background-color: rgba(245, 245, 247, 0.28);
}

.tg-hero__title {
    margin: 0 auto;
    max-width: 18em;
    font-size: clamp(2.6rem, 7.6vw, 6.5rem);
    font-weight: 600;
    line-height: 0.99;
    letter-spacing: -0.035em;
}

.tg-hero__line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.07em;
}

.tg-hero__line > span {
    display: block;
    transform: translateY(108%);
    animation: tg-hero-line 1.15s var(--tg-ease-out) forwards;
}

.tg-hero__line:nth-child(1) > span { animation-delay: 0.12s; }
.tg-hero__line:nth-child(2) > span { animation-delay: 0.26s; }

.tg-hero__lead {
    margin: clamp(1.1rem, 2.6vh, 1.75rem) auto 0;
    max-width: 34rem;
    font-size: clamp(1rem, 1.35vw, 1.1875rem);
    font-weight: 400;
    line-height: 1.55;
    color: rgba(245, 245, 247, 0.76);
    text-wrap: pretty;
    opacity: 0;
    animation: tg-hero-fade 1s var(--tg-ease-out) 0.5s forwards;
}

.tg-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin-top: clamp(1.75rem, 4vh, 2.75rem);
    opacity: 0;
    animation: tg-hero-fade 1s var(--tg-ease-out) 0.68s forwards;
}

/* ——— Pasek dolny ——— */

.tg-hero__footer {
    position: relative;
    z-index: 2;
    grid-row: 2;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: calc(clamp(1.5rem, 4vh, 2.75rem) + var(--tg-hero-safe, 0px));
    opacity: 0;
    animation: tg-hero-fade 1.2s var(--tg-ease-out) 0.9s forwards;
}

/* Wskaźnik przewijania */
.tg-hero__scroll {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: rgba(245, 245, 247, 0.68);
    transition: color 0.3s var(--tg-ease);
}

.tg-hero__scroll:hover,
.tg-hero__scroll:focus-visible {
    color: #fff;
}

.tg-hero__mouse {
    position: relative;
    width: 1.35rem;
    height: 2.15rem;
    border: 1px solid currentColor;
    border-radius: var(--tg-pill);
    opacity: 0.85;
}

.tg-hero__mouse::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0.4rem;
    width: 2px;
    height: 0.45rem;
    margin-left: -1px;
    border-radius: var(--tg-pill);
    background-color: currentColor;
    animation: tg-hero-wheel 2.4s var(--tg-ease) infinite;
}

.tg-hero__scroll svg {
    width: 0.8rem;
    height: 0.8rem;
    animation: tg-hero-nudge 2.4s var(--tg-ease) infinite;
}

/* Etykieta tylko dla czytników ekranu, wizualnie wystarcza ikona */
.tg-hero__scroll-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ——— Animacje ——— */

@keyframes tg-hero-fade {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@keyframes tg-hero-line {
    from { transform: translateY(108%); }
    to { transform: translateY(0); }
}

@keyframes tg-hero-wheel {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(0.55rem); opacity: 0.35; }
}

@keyframes tg-hero-nudge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* =========================================================
   Breakpointy 1450 / 1201 / 1024 / 768 / 375
   ========================================================= */

@media (max-width: 1200px) {
    .tg-hero__title {
        font-size: clamp(2.5rem, 7.8vw, 4.5rem);
    }

}

@media (max-width: 767px) {
    .tg-hero {
        min-height: 100svh;
    }

    .tg-hero__slide img {
        width: 105%;
        object-position: 50% 50%;
        --tg-drift: -3.5%;
    }

    .tg-hero__title {
        font-size: clamp(2.15rem, 10.5vw, 3rem);
        letter-spacing: -0.025em;
    }

    .tg-hero__eyebrow {
        font-size: 0.62rem;
        letter-spacing: 0.18em;
    }

    .tg-hero__lead {
        max-width: 24rem;
        font-size: 0.975rem;
    }

    .tg-hero__actions {
        flex-direction: column;
        align-items: stretch;
        max-width: 20rem;
        margin-inline: auto;
        gap: 0.35rem;
    }

    .tg-hero__actions .tg-link {
        justify-content: center;
        min-height: 2.75rem;
    }

    /* Pionowy kadr jest ciemniejszy z natury, mniej przyciemniania */
    .tg-hero__scrim {
        background:
            linear-gradient(
                180deg,
                rgba(10, 10, 12, 0.74) 0%,
                rgba(10, 10, 12, 0.4) 20%,
                rgba(10, 10, 12, 0.36) 46%,
                rgba(10, 10, 12, 0.7) 80%,
                var(--tg-base) 100%
            ),
            radial-gradient(130% 70% at 50% 40%, rgba(10, 10, 12, 0.1) 0%, rgba(10, 10, 12, 0.04) 45%, rgba(10, 10, 12, 0.5) 100%);
    }

    .tg-hero__scroll svg {
        display: none;
    }
}

@media (max-width: 380px) {
    .tg-hero__title {
        font-size: 1.95rem;
    }

    .tg-hero__lead {
        font-size: 0.925rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tg-hero__slide img,
    .tg-hero__mouse::after,
    .tg-hero__scroll svg {
        animation: none;
    }

    .tg-hero__eyebrow,
    .tg-hero__lead,
    .tg-hero__actions,
    .tg-hero__footer {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .tg-hero__line > span {
        animation: none;
        transform: none;
    }
}
