/*
 * Strona główna odświeżenia: góra z pływającymi kropkami, „Upamiętnij ważne momenty”, odstępy sekcji.
 * Ładowany z widoku site/home przez @push('styles'); używa zmiennych --ob-* z refresh.css (kolory i skala odstępów).
 */

/* Góra: odstęp nad i pod tekstem należy do sekcji, żeby liczył się w rytmie sekcji */
.ob-home-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 680px;
    padding: var(--ob-space-8) 0 var(--ob-space-7);
    overflow: hidden;
}

/* Komputer: góra zajmuje prawie cały ekran pod menu (62 px), „Zaufali nam” zaczyna się tuż pod jego dolną krawędzią */
@media (min-width: 1024px) {
    .ob-home-hero {
        min-height: max(680px, calc(100svh - 62px - 24px));
    }
}

.ob-home-hero__inner {
    position: relative;
    z-index: 1;
    width: 100%;
}

.ob-home-hero__text {
    max-width: 520px;
}

.ob-home-hero__eyebrow {
    margin: 0;
    font-size: 26px;
    font-weight: 300;
}

.ob-home-hero__title {
    margin: var(--ob-space-2) 0 var(--ob-space-4);
    font-size: 60px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--ob-ink);
}

/* Przycisk, link i linia z oceną to jedna grupa: małe odstępy w środku, duży nad nią */
.ob-home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ob-space-1) var(--ob-space-2);
}

.ob-home-hero__more {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--ob-space-2);
    font-weight: 600;
    color: var(--ob-pink-dark);
    text-decoration: none;
}

/* Zdjęcie stoi obok środka tekstu, nieco niżej niż środek sekcji, jak w starej wersji */
.ob-home-hero__booths {
    position: absolute;
    right: 0;
    top: calc(50% + 24px);
    z-index: 1;
    /* Na wąskim komputerze zdjęcie zwęża się, żeby stać co najmniej 48 px od tekstu (28 px marginesu .ob-wrap i 520 px tekstu) */
    width: min(549px, 58%, calc(100% - 28px - 520px - var(--ob-space-5)));
    /* Ramka ma proporcje grafiki, więc ekran, lampa i przycisk Start stoją w procentach; jednostki cqw liczą się od jej szerokości */
    aspect-ratio: 1176 / 1337;
    container-type: inline-size;
    transform: translateY(-50%);
}

.ob-home-hero__art {
    display: block;
    width: 100%;
    height: auto;
}

/* Fotolustro: lampa nad ramą rozjaśnia się przy każdym odliczeniu */
.ob-mirror__lamp {
    position: absolute;
    left: 43.3%;
    top: 5.2%;
    width: 22.2%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0 42%, rgba(255, 244, 214, 0.75) 62%, rgba(255, 244, 214, 0) 72%);
    box-shadow: 0 0 40px 18px rgba(255, 240, 200, 0.75);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms var(--ob-ease-out);
}

.ob-mirror__screen,
.ob-mirror__start {
    position: absolute;
    left: 34.9%;
    top: 27.8%;
    width: 38.4%;
    height: 58.2%;
    border-radius: 2px;
}

.ob-mirror__screen {
    overflow: hidden;
    background: #101012;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms var(--ob-ease-out);
}

[data-mirror].is-on .ob-mirror__screen {
    opacity: 1;
}

.ob-mirror__count {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17.7cqw;
    font-weight: 700;
    line-height: 1;
}

.ob-mirror__count[hidden] {
    display: none;
}

.ob-mirror__smile {
    margin-top: 1.5cqw;
    font-size: 3.5cqw;
    font-weight: 600;
    opacity: 0;
    transition: opacity 180ms var(--ob-ease-out);
}

.ob-mirror__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 22%;
    opacity: 0;
}

[data-mirror].is-shot .ob-mirror__photo {
    opacity: 1;
}

/* Podpis stoi poza ekranem, żeby na telefonie mógł wyjść obok lustra */
.ob-mirror__caption {
    position: absolute;
    left: 34.9%;
    bottom: 14%;
    z-index: 2;
    width: 38.4%;
    padding: 10cqw 2.3cqw 2.3cqw;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78) 55%);
    color: #fff;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 220ms var(--ob-ease-out), transform 220ms var(--ob-ease-out);
}

[data-mirror].is-shot .ob-mirror__caption {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 260ms;
}

.ob-mirror__label {
    margin: 0;
    color: inherit;
    font-size: 3.2cqw;
    font-weight: 700;
    line-height: 1.2;
}

.ob-mirror__joke {
    margin: 0.6cqw 0 0;
    color: inherit;
    font-size: 2.5cqw;
    line-height: 1.3;
    opacity: 0.86;
}

.ob-mirror__again {
    margin-top: 1.5cqw;
    padding: 0.9cqw 2.3cqw;
    border: 0;
    border-radius: 999px;
    background: var(--ob-pink);
    color: #fff;
    font-size: 2.5cqw;
    font-weight: 600;
    cursor: pointer;
    pointer-events: auto;
}

.ob-mirror__cta {
    display: none;
    margin-top: 1.2cqw;
    color: inherit;
    font-size: 2.4cqw;
    font-weight: 600;
    text-decoration: underline;
    pointer-events: auto;
}

[data-mirror].is-unlimited .ob-mirror__cta {
    display: block;
}

/* Cały ekran jest przyciskiem, tak jak mówi napis „Dotknij, aby rozpocząć” */
.ob-mirror__start {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ob-mirror__start:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -5px;
}

[data-mirror].is-busy .ob-mirror__start {
    cursor: default;
}

/* Podpowiedź: pierścień wokół przycisku Start, kilka razy po wczytaniu i pod myszą */
.ob-mirror__hint {
    position: absolute;
    left: 45.9%;
    top: 64.1%;
    width: 16.5%;
    height: 5.2%;
    border-radius: 999px;
    pointer-events: none;
}

.ob-mirror__hint::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--ob-pink);
    border-radius: inherit;
    opacity: 0;
}

[data-mirror].is-ready .ob-mirror__hint::after {
    animation: ob-mirror-hint 1.8s var(--ob-ease-out) 1.4s 4;
}

[data-mirror].is-on .ob-mirror__hint {
    display: none;
}

@keyframes ob-mirror-hint {
    from {
        opacity: 0.9;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(1.22, 1.7);
    }
}

@media (hover: hover) and (pointer: fine) {
    [data-mirror].is-ready .ob-mirror__start:hover ~ .ob-mirror__hint::after {
        opacity: 0.9;
        transform: scale(1.1, 1.3);
        animation: none;
        transition: opacity 160ms ease, transform 160ms var(--ob-ease-out);
    }
}

.ob-mirror__status {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
}

/* Błysk i kropki */
.ob-mirror__flash {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #fff;
    opacity: 0;
    pointer-events: none;
}

.ob-mirror__dot {
    position: absolute;
    left: 54%;
    top: 56%;
    border-radius: 50%;
    pointer-events: none;
}

/* Pływające kropki */
.ob-floating-dots {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.ob-floating-dots svg {
    display: block;
    width: 100%;
    height: 100%;
}

.ob-dot {
    transform-box: fill-box;
    transform-origin: center;
    animation-name: ob-drift;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

@keyframes ob-drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(calc(var(--dx) * 0.6), var(--dy)) scale(var(--s));
    }

    100% {
        transform: translate(var(--dx), calc(var(--dy) * 0.3)) scale(1);
    }
}

/* Upamiętnij ważne momenty */
.ob-home-about {
    padding: var(--ob-section-y) 0;
}

/* Realizacje i karty fotobudek niosą własny odstęp sekcji, więc między sekcjami jest jeden odstęp, a nie dwa */
.ob-home-about + .ob-home-realizations,
.ob-home-realizations + .ob-machine-cards {
    padding-top: 0;
}

.ob-home-realizations {
    padding: var(--ob-section-y) 0;
}

.ob-home-realizations__cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--ob-space-2) var(--ob-space-3);
    margin-top: var(--ob-space-5);
    text-align: center;
}

.ob-home-realizations__cta p {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ob-home-about__inner {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: var(--ob-space-7);
    align-items: center;
}

.ob-home-about__photo img {
    display: block;
    width: 100%;
    height: auto;
}

/* Subtelnie podkreśla detale, zachowując oryginalne zdjęcia i ich przezroczystość. */
.ob-home-about__photo img,
.ob-home-seo + .ob-faces-band .b--face .b__in {
    filter: url("#home-photo-detail");
}

.ob-home-about__title {
    margin: 0 0 var(--ob-space-3);
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.ob-home-about__lead {
    margin: 0;
    line-height: 1.7;
    color: var(--ob-muted);
}

.ob-home-about__points {
    display: grid;
    gap: var(--ob-space-3);
    margin: var(--ob-space-5) 0;
    padding: 0;
    list-style: none;
}

.ob-home-about__points li {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: var(--ob-space-2);
    align-items: start;
}

.ob-home-about__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--ob-radius);
    background: var(--ob-pink-badge);
    color: var(--ob-pink-dark);
}

.ob-home-about__icon svg {
    width: 20px;
    height: 20px;
}

.ob-home-about__points b {
    display: block;
    margin-bottom: 2px;
    font-weight: 600;
}

.ob-home-about__points div span {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ob-muted);
}

/*
 * Odstępy między sekcjami: tekst SEO stoi tuż pod sekcją karty AI, która kończy się odstępem sekcji, i sam kończy się
 * odstępem sekcji, więc sekcja z twarzami pod nim zaczyna się bez swojego
 */
.ob-home-seo {
    padding: 0 0 var(--ob-section-y);
}

.ob-home-seo + .ob-faces-band {
    padding-top: 0;
}

/* Tablet: tekst i zdjęcie dzielą szerokość, bo stałe 520 px tekstu wchodziłoby pod zdjęcie */
@media (min-width: 768px) and (max-width: 1023px) {
    .ob-home-hero__text {
        max-width: 52%;
    }

    .ob-home-hero__title {
        font-size: clamp(46px, 6.5vw, 60px);
    }

    .ob-home-hero__booths {
        top: 50%;
        width: 44%;
        height: auto;
        max-width: none;
    }

    /* Przycisk i link mieszczą się obok siebie od ok. 960 px, węziej link stoi pod przyciskiem; odstęp między nimi daje sam gap */
    .ob-home-hero__more {
        padding-inline: 0;
    }
}

/* Telefon */
@media (max-width: 767px) {
    .ob-home-hero {
        display: block;
        min-height: 0;
        padding: 0 0 var(--ob-space-3);
    }

    .ob-home-hero__text {
        max-width: none;
        padding: var(--ob-space-5) 0 var(--ob-space-3);
        text-align: center;
    }

    .ob-home-hero__eyebrow {
        font-size: 20px;
    }

    .ob-home-hero__title {
        font-size: 38px;
        line-height: 1.06;
    }

    .ob-home-hero__actions {
        flex-direction: column;
        gap: var(--ob-space-1);
    }

    /*
     * Mniejszy odstęp w poziomie trzyma ocenę w jednym wierszu przy 375 px. Pole dotyku linku (44 px) dokłada ok. 12 px
     * pod jego tekstem, więc 12 px marginesu (16 − 4 optycznie) daje 24 px od tekstu linku do oceny.
     */
    .ob-trust {
        justify-content: center;
        gap: var(--ob-space-1) var(--ob-space-2);
        margin-top: calc(var(--ob-space-2) - 4px);
    }

    .ob-home-hero__booths {
        position: relative;
        top: auto;
        right: auto;
        display: block;
        width: 58%;
        height: auto;
        max-width: none;
        /* Mniejsze zdjęcie wychodzi trochę za prawą krawędź; sekcja ma overflow: hidden, więc strona się nie przewija w bok */
        margin: var(--ob-space-4) -6% 0 auto;
        transform: none;
    }

    /* Ekran lustra ma tu ok. 84 px, więc podpis staje obok niego, w wolnym miejscu po lewej */
    .ob-mirror__caption {
        left: auto;
        right: 100%;
        bottom: 10%;
        width: 60%;
        margin-right: var(--ob-space-1);
        padding: 0;
        background: none;
        color: var(--ob-ink);
        text-align: left;
    }

    .ob-mirror__label {
        font-size: 16px;
    }

    .ob-mirror__joke {
        margin-top: 4px;
        font-size: 14px;
        opacity: 0.7;
    }

    .ob-mirror__again {
        min-height: 44px;
        margin-top: var(--ob-space-2);
        padding: 0 var(--ob-space-2);
        font-size: 14px;
    }

    .ob-mirror__cta {
        margin-top: var(--ob-space-1);
        padding-block: var(--ob-space-1);
        color: var(--ob-pink-dark);
        font-size: 13px;
    }

    .ob-home-about__inner {
        grid-template-columns: 1fr;
        gap: var(--ob-space-5);
    }

    .ob-home-about__photo {
        width: 78%;
        margin: 0 auto;
    }

    .ob-home-about__title {
        font-size: 28px;
    }

    /* Grupy w sekcji stoją na telefonie bliżej siebie, żeby odstęp między sekcjami był wyraźnie większy od nich */
    .ob-home-about__points {
        margin: var(--ob-space-4) 0;
    }

    .ob-home-realizations__cta {
        margin-top: var(--ob-space-4);
    }
}

/* Ruch */
@media (prefers-reduced-motion: reduce) {
    [data-mirror].is-ready .ob-mirror__hint::after {
        animation: none;
    }

    .ob-mirror__caption {
        transform: none;
    }

    .ob-dot {
        animation: none;
    }
}
