/* Explain: CSS for subtle life animations on BST page hero figures. */
/* The life in the four opening figures of the BST page.

   The four models who hold the opening of the apparel page used to stand as
   perfectly still photographs. They now carry a full, quiet life of their own —
   and that life is made of movement only. Nothing is painted over the pictures:
   no glow, no pool of light, no shadow is laid on a face, and the photographs
   themselves are untouched.

   Each figure settles at her own resting angle. She breathes, shifts her weight
   from hip to hip, leans and turns her head, drifts a little inside her frame
   and sinks and rises on a long, uneven settle — so she is met at a different
   place, a different angle and a different moment from the model before her.
   Every figure rests at her own offset and runs each of her movements on her own
   length and her own starting point, so the four are never in the same pose at
   the same time and the faces no longer read as one repeated feature.

   The movements are held just under the line where they would read as an
   animation: they stay a person standing and shifting her weight, only larger
   and more present than a still photograph. They are carried on separate
   properties — the breath on `scale`, the drift on `translate`, the lean on
   `rotate`, and the settle on the scene's own `translate` — so all four run at
   once without fighting each other, and each one composes with the phone
   layout's own framing instead of replacing it.

   This file touches the BST page only: the homepage apparel lookbook and the
   homepage design strip are untouched. */

/* The figure's breath: she rises and settles on her own long cycle. */
@keyframes bst-figure-breathe {
    0%,
    100% {
        scale: var(--pose-scale, 1);
    }
    38% {
        scale: calc(var(--pose-scale, 1) + 0.035);
    }
    62% {
        scale: calc(var(--pose-scale, 1) + 0.022);
    }
    82% {
        scale: calc(var(--pose-scale, 1) + 0.041);
    }
}

/* Her weight shift: she eases hard onto one side, settles, rolls back through
   the middle and onto the other hip. Each figure rests at her own offset, so the
   same drift catches every model in a different place inside her frame. */
@keyframes bst-figure-sway {
    0%,
    100% {
        translate: var(--pose-x, 0%) var(--pose-y, 0%);
    }
    16% {
        translate: calc(var(--pose-x, 0%) - 1.25%) calc(var(--pose-y, 0%) + 0.55%);
    }
    38% {
        translate: calc(var(--pose-x, 0%) - 0.45%) calc(var(--pose-y, 0%) - 0.62%);
    }
    58% {
        translate: calc(var(--pose-x, 0%) + 0.9%) calc(var(--pose-y, 0%) - 0.2%);
    }
    78% {
        translate: calc(var(--pose-x, 0%) + 1.35%) calc(var(--pose-y, 0%) + 0.68%);
    }
    92% {
        translate: calc(var(--pose-x, 0%) + 0.3%) calc(var(--pose-y, 0%) + 0.14%);
    }
}

/* The lean: her head and shoulders ease a good degree one way and settle, then
   swing the other way, so the line of the face — jaw, mouth, eyes — is met at a
   clearly different angle on every figure and at a different moment on each
   pass. The turn is slow enough to read as someone letting their head drift
   while they stand, never as a swipe. */
@keyframes bst-figure-turn {
    0%,
    100% {
        rotate: var(--pose-tilt, 0deg);
    }
    20% {
        rotate: calc(var(--pose-tilt, 0deg) - 1.6deg);
    }
    44% {
        rotate: calc(var(--pose-tilt, 0deg) - 0.3deg);
    }
    64% {
        rotate: calc(var(--pose-tilt, 0deg) + 1.25deg);
    }
    86% {
        rotate: calc(var(--pose-tilt, 0deg) + 1.75deg);
    }
}

/* The settle: the whole scene carries a slow sink and rise of its own, a step
   further down the body than the photograph's own drift, so the figure appears
   to take her weight and give it back rather than only floating in place. */
@keyframes bst-scene-settle {
    0%,
    100% {
        translate: 0 0;
    }
    34% {
        translate: -0.35% 0.85%;
    }
    61% {
        translate: 0.45% -0.35%;
    }
    84% {
        translate: 0.15% 0.55%;
    }
}

/* The figures of the opening — and only these four. */
.bst-hero-stack .bst-scene .bst-hero-shot {
    transform-origin: 50% 62%;
    /* The figures no longer lean.

       Every opening shot used to ride a slow tilt of a degree or two, and that
       tilt turned the whole photograph with the figure — the street, the
       buildings and the traffic behind her stayed perfectly upright while her
       picture swung, so she read as a body dropped into the scene at the wrong
       angle. The shot is now held exactly upright at every moment, its
       verticals standing true to the city behind it, and only her breath and
       her quiet shift of weight are left: she settles, she sways a hair, and
       she never tips off her own axis. */
    animation:
        bst-figure-breathe 23s ease-in-out infinite,
        bst-figure-sway 29s ease-in-out infinite;
    will-change: scale, translate;
}

/* The slow settle underneath every figure, carried by the scene so it does not
   touch the photograph's own three movements. */
.bst-hero-stack .bst-scene {
    animation: bst-scene-settle 43s ease-in-out infinite;
    will-change: translate;
}

/* Each figure is given her own resting pose, her own lengths and her own
   starting point in every cycle, so whichever one steps into the street arrives
   already mid-movement — and no two are ever caught at the same angle. */
.bst-hero-stack .bst-scene:nth-child(2) .bst-hero-shot {
    --pose-x: -0.45%;
    --pose-y: 0.35%;
    --pose-tilt: -0.95deg;
    animation-duration: 23s, 29s, 37s;
    animation-delay: 0s, 0s, 0s;
}

.bst-hero-stack .bst-scene:nth-child(3) .bst-hero-shot {
    --pose-x: 0.6%;
    --pose-y: -0.55%;
    --pose-tilt: 0.7deg;
    animation-duration: 26s, 33s, 34s;
    animation-delay: -7s, -12s, -18s;
}

.bst-hero-stack .bst-scene:nth-child(4) .bst-hero-shot {
    --pose-x: 0.2%;
    --pose-y: 0.85%;
    --pose-tilt: -0.4deg;
    animation-duration: 20s, 31s, 41s;
    animation-delay: -13s, -21s, -6s;
}

.bst-hero-stack .bst-scene:nth-child(5) .bst-hero-shot {
    --pose-x: -0.7%;
    --pose-y: -0.3%;
    --pose-tilt: 1.1deg;
    animation-duration: 18s, 26s, 32s;
    animation-delay: -5s, -27s, -31s;
}

/* The settle runs on its own clock for each figure too, so the four never sink
   or rise together. */
.bst-hero-stack .bst-scene:nth-child(3) {
    animation-duration: 47s;
    animation-delay: -9s;
}

.bst-hero-stack .bst-scene:nth-child(4) {
    animation-duration: 39s;
    animation-delay: -17s;
}

.bst-hero-stack .bst-scene:nth-child(5) {
    animation-duration: 51s;
    animation-delay: -3s;
}

/* On phones the movement is eased a little slower and a touch smaller: the
   smaller screen sits closer to the figure, so the same drift is given a longer
   breath and a shorter reach to stay as quiet as it reads on a wide screen. */
@media (max-width: 767px) {
    .bst-hero-stack .bst-scene .bst-hero-shot {
        animation-duration: 30s, 38s, 46s;
    }

    .bst-hero-stack .bst-scene {
        animation-duration: 52s;
    }
}

/* A visitor who prefers reduced motion meets the four figures standing perfectly
   still, exactly as they were photographed. */
@media (prefers-reduced-motion: reduce) {
    .bst-hero-stack .bst-scene .bst-hero-shot,
    .bst-hero-stack .bst-scene {
        animation: none;
        will-change: auto;
    }
}