/* Explain: Styles for animated street traffic elements in the hero section. */
/* ==========================================================================
   Traffic on the models' own street.

   The figures of the BST opening stand in a live New York street. Behind them,
   on their own stretch of road, cars now come up out of the distance, brake,
   and come to a stop with their headlamps lit — the way the traffic pulls up
   behind anyone standing in the middle of a Manhattan avenue at night. The
   light of each car pools on the wet asphalt in front of it.

   Every car is drawn entirely in CSS — a dark body, a slip of windscreen, two
   warm headlamps and a soft pool of light on the road — so the page carries no
   extra pictures or clips for the traffic, and nothing has to download before a
   car appears. The cars sit on the street behind each figure, so a body
   standing in front of one simply hides it and the traffic never crosses the
   models.

   The whole layer is dropped for a visitor who prefers reduced motion, and the
   traffic of a scene that is not on screen is held exactly where it stands, so
   only one scene's cars are ever moving.
   ========================================================================== */

.bst-traffic {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    overflow: hidden;
    pointer-events: none;
}

/* One car. It waits far up the road, small and pale, comes up the street, slows
   hard and settles to a standstill in front of the figures, then lets go and
   the next pass begins. */
.bst-car {
    position: absolute;
    left: var(--car-left, 50%);
    bottom: var(--car-bottom, 14%);
    display: block;
    width: clamp(3rem, 6.2vw, 6rem);
    aspect-ratio: 31 / 20;
    /* The wheels keep their line on the road while the rest of the car rises in
       the frame as it comes nearer, the way a car does when it drives at you. */
    transform-origin: 50% 100%;
    opacity: 0;
    animation: bst-car-roll var(--car-speed, 26s) cubic-bezier(0.16, 1, 0.3, 1) var(--car-delay, 0s) infinite;
    will-change: transform, opacity;
}

/* The body of the car: a near-black shape with a whisper of rim light along its
   roof, so it reads as a solid mass standing on the dark road. */
.bst-car-body {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    border-radius: 46% 46% 16% 16% / 54% 54% 20% 20%;
    background:
        radial-gradient(120% 78% at 50% 120%, rgba(255, 226, 160, 0.18) 0%, rgba(255, 226, 160, 0) 62%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 22%),
        linear-gradient(180deg, #1b1b1f 0%, #0d0d10 52%, #040406 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -8px 16px rgba(0, 0, 0, 0.85),
        0 10px 24px rgba(0, 0, 0, 0.9);
}

/* The windscreen catching the street: one cold slip of light across the top of
   the shape, which is what tells the eye the car is facing us. */
.bst-car-glass {
    position: absolute;
    left: 16%;
    right: 16%;
    top: 9%;
    display: block;
    height: 40%;
    border-radius: 60% 60% 14% 14% / 74% 74% 16% 16%;
    background: linear-gradient(180deg, rgba(150, 172, 196, 0.4) 0%, rgba(96, 112, 132, 0.18) 52%, rgba(8, 10, 14, 0.04) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.bst-car-lamps {
    position: absolute;
    left: 9%;
    right: 9%;
    bottom: 23%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* The two headlamps: the brightest thing on the whole scene, and the reason the
   traffic reads at all from this distance. */
.bst-car-lamp {
    display: block;
    width: 30%;
    aspect-ratio: 7 / 5;
    border-radius: 50%;
    background: radial-gradient(closest-side, #fffef6 0%, #fff4cd 30%, #ffdf9c 60%, rgba(255, 210, 128, 0) 100%);
    filter:
        drop-shadow(0 0 5px rgba(255, 246, 214, 1))
        drop-shadow(0 0 14px rgba(255, 220, 150, 0.85))
        drop-shadow(0 0 30px rgba(255, 200, 110, 0.5));
    animation: bst-car-lamp-breathe 7.5s ease-in-out var(--car-delay, 0s) infinite;
}

/* The light the car throws down on the road in front of itself: one wide, very
   soft pool of warm white that reaches out past the wheels. */
.bst-car-glow {
    position: absolute;
    left: 50%;
    bottom: 4%;
    z-index: 0;
    display: block;
    width: 340%;
    height: 150%;
    translate: -50% 0;
    border-radius: 50%;
    background: radial-gradient(closest-side,
        rgba(255, 248, 220, 0.42) 0%,
        rgba(255, 232, 168, 0.22) 32%,
        rgba(255, 218, 132, 0.08) 60%,
        rgba(255, 210, 120, 0) 100%);
    filter: blur(10px);
    animation: bst-car-glow-breathe 9s ease-in-out var(--car-delay, 0s) infinite;
}

/* The approach: the car arrives from far up the road, braking the whole way,
   comes to a standstill, holds there with its lamps lit, and then lets go. */
@keyframes bst-car-roll {
    0% {
        opacity: 0;
        transform: translate3d(0, -40%, 0) scale(0.26);
    }
    9% {
        opacity: 0.75;
    }
    46% {
        opacity: 1;
        transform: translate3d(var(--car-drift, 3%), -14%, 0) scale(0.58);
    }
    68% {
        opacity: 1;
        transform: translate3d(var(--car-drift, 3%), 0, 0) scale(1);
    }
    86% {
        opacity: 1;
        transform: translate3d(var(--car-drift, 3%), 0.8%, 0) scale(1.014);
    }
    94% {
        opacity: 0;
        transform: translate3d(var(--car-drift, 3%), 0.8%, 0) scale(1.014);
    }
    100% {
        opacity: 0;
        transform: translate3d(0, -40%, 0) scale(0.26);
    }
}

/* A car standing at the kerb keeps a small living flicker in its lamps, the way
   an engine left running never goes perfectly still. */
@keyframes bst-car-lamp-breathe {
    0%,
    100% {
        opacity: 0.9;
    }
    38% {
        opacity: 1;
    }
    62% {
        opacity: 0.95;
    }
    84% {
        opacity: 1;
    }
}

/* The pool of light on the asphalt breathes very shallowly, so the road under a
   standing car keeps a quiet life. */
@keyframes bst-car-glow-breathe {
    0%,
    100% {
        opacity: 0.74;
    }
    50% {
        opacity: 1;
    }
}

/* The avenue's traffic, in its own lanes, distances and paces — the nearest car
   large and low in the frame, the others smaller and further up the receding
   street, so the traffic reads as real depth instead of one shape repeated.

   The passes are staggered and overlapping, so at almost any moment one car is
   coming up the road out of the distance, a second is braking to a stop with its
   headlamps lit, and a third is pulling away again: the avenue is always busy,
   the way a Manhattan street is, instead of one car appearing now and then. */
.bst-car-a {
    --car-left: 50%;
    --car-bottom: 13%;
    --car-drift: 4%;
    --car-speed: 26s;
    --car-delay: 0s;
    width: clamp(3rem, 6.2vw, 6rem);
}

.bst-car-b {
    --car-left: 45%;
    --car-bottom: 19%;
    --car-drift: -3.5%;
    --car-speed: 31s;
    --car-delay: -13s;
    width: clamp(2.5rem, 5vw, 4.8rem);
}

.bst-car-c {
    --car-left: 41%;
    --car-bottom: 25%;
    --car-drift: 3%;
    --car-speed: 23s;
    --car-delay: -19s;
    width: clamp(2rem, 4vw, 3.8rem);
}

/* A second lane beside the first: these cars come up the road on their own
   timing, so the two lanes are never in step with one another. */
.bst-car-d {
    --car-left: 34%;
    --car-bottom: 16%;
    --car-drift: 2.6%;
    --car-speed: 28s;
    --car-delay: -6s;
    width: clamp(2.6rem, 5.2vw, 4.6rem);
}

.bst-car-e {
    --car-left: 29%;
    --car-bottom: 23%;
    --car-drift: -2.2%;
    --car-speed: 20s;
    --car-delay: -9s;
    width: clamp(2.1rem, 4.2vw, 3.6rem);
}

/* The smallest of the run sit well up the avenue, where the street narrows
   away and the lights of the junction begin. */
.bst-car-f {
    --car-left: 38%;
    --car-bottom: 30%;
    --car-drift: 1.8%;
    --car-speed: 34s;
    --car-delay: -16s;
    width: clamp(1.6rem, 3.2vw, 2.6rem);
}

.bst-car-g {
    --car-left: 33%;
    --car-bottom: 34%;
    --car-drift: -1.6%;
    --car-speed: 25s;
    --car-delay: -22s;
    width: clamp(1.3rem, 2.6vw, 2.1rem);
}

/* Two cars standing at the kerb: they never move along the road. They simply
   wait with their headlamps lit and the light breathing gently on the asphalt
   in front of them, the way every block in the city has a few standing cars
   along it at night. */
.bst-car-park-a {
    --car-left: 27%;
    --car-bottom: 18%;
    --car-drift: 0%;
    width: clamp(2.8rem, 5.6vw, 5rem);
}

.bst-car-park-b {
    --car-left: 46%;
    --car-bottom: 11%;
    --car-drift: 0%;
    width: clamp(2.4rem, 4.8vw, 4.2rem);
}

/* A standing car holds the pose at the end of its roll — stopped, lamps on, the
   pool of light resting on the road — and never lets go of it. */
.bst-car.bst-car-still {
    opacity: 1;
    transform: translate3d(var(--car-drift, 0%), 0.8%, 0) scale(1.014);
    animation: none;
}

/* Only the scene on screen keeps its traffic moving; every other street holds
   its cars, its distant lights and its steam exactly where they stand. */
.bst-scene:not(.is-active) .bst-car,
.bst-scene:not(.is-active) .bst-car-lamp,
.bst-scene:not(.is-active) .bst-car-glow,
.bst-scene:not(.is-active) .bst-far-light,
.bst-scene:not(.is-active) .bst-steam {
    animation-play-state: paused;
}

/* ==========================================================================
   The far end of the avenue — cross traffic at the junction and street steam.

   Further up the road, other traffic slips across the junction: pairs of small
   red tail-lights drifting one way and pairs of warm headlamps drifting the
   other, each on its own unhurried pass with long gaps between them, so the
   stretch of street the near cars never reach still reads as a living city.

   A manhole breathes one soft column of steam up out of the road on the left,
   the way the streets do, and it is gone again before it ever reaches the copy.
   ========================================================================== */

.bst-far-light {
    position: absolute;
    left: var(--far-left, 40%);
    bottom: var(--far-bottom, 32%);
    display: block;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #ff6a45;
    box-shadow: 0 0 4px rgba(255, 104, 64, 0.9), 0 0 10px rgba(255, 60, 24, 0.45);
    opacity: 0;
    animation: bst-far-cross var(--far-speed, 24s) linear var(--far-delay, 0s) infinite;
    will-change: transform, opacity;
}

/* The second lamp of the pair, set a few pixels beside the first. */
.bst-far-light::after {
    content: '';
    position: absolute;
    top: 0;
    left: 5px;
    display: block;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: inherit;
    box-shadow: inherit;
}

/* A car coming the other way is read by its headlamps instead of its
   tail-lights: the pair turns warm white and lights the air around itself. */
.bst-far-d,
.bst-far-f {
    background: #fff2d2;
    box-shadow:
        0 0 5px rgba(255, 246, 220, 0.95),
        0 0 12px rgba(255, 222, 156, 0.6),
        0 0 22px rgba(255, 206, 120, 0.32);
}

/* One crossing: the light waits out of sight, rises as it comes round the
   corner, crosses the junction at its own uneven pace and is gone again. */
@keyframes bst-far-cross {
    0% {
        opacity: 0;
        transform: translate3d(var(--far-from, -50px), 0, 0);
    }
    16% {
        opacity: 0.85;
    }
    80% {
        opacity: 0.85;
    }
    100% {
        opacity: 0;
        transform: translate3d(var(--far-to, 70px), 0, 0);
    }
}

.bst-far-a {
    --far-left: 31%;
    --far-bottom: 33%;
    --far-speed: 26s;
    --far-delay: -3s;
}

.bst-far-b {
    --far-left: 47%;
    --far-bottom: 35%;
    --far-speed: 34s;
    --far-delay: -17s;
    --far-from: 60px;
    --far-to: -80px;
}

.bst-far-c {
    --far-left: 38%;
    --far-bottom: 37%;
    --far-speed: 21s;
    --far-delay: -9s;
    --far-from: -30px;
    --far-to: 50px;
}

.bst-far-d {
    --far-left: 44%;
    --far-bottom: 34%;
    --far-speed: 29s;
    --far-delay: -22s;
    --far-from: 70px;
    --far-to: -90px;
}

.bst-far-e {
    --far-left: 27%;
    --far-bottom: 38%;
    --far-speed: 24s;
    --far-delay: -13s;
}

.bst-far-f {
    --far-left: 36%;
    --far-bottom: 31%;
    --far-speed: 31s;
    --far-delay: -25s;
    --far-from: 40px;
    --far-to: -60px;
}

/* The steam: a pale, heavily softened column lifting off the road, widening and
   thinning as it rises, then gone. Two vents breathe on their own clocks so the
   street is never without one of them. */
.bst-steam {
    position: absolute;
    left: var(--steam-left, 30%);
    bottom: var(--steam-bottom, 20%);
    display: block;
    width: 4.5rem;
    height: 11rem;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(50% 42% at 50% 100%, rgba(206, 214, 224, 0.2) 0%, rgba(206, 214, 224, 0.07) 46%, rgba(206, 214, 224, 0) 78%);
    filter: blur(9px);
    opacity: 0;
    animation: bst-steam-rise var(--steam-speed, 19s) ease-in-out var(--steam-delay, 0s) infinite;
    will-change: transform, opacity;
}

@keyframes bst-steam-rise {
    0% {
        opacity: 0;
        transform: translate3d(0, 12%, 0) scale(0.72);
    }
    28% {
        opacity: 0.58;
    }
    60% {
        opacity: 0.26;
    }
    100% {
        opacity: 0;
        transform: translate3d(8%, -64%, 0) scale(1.55);
    }
}

.bst-steam-a {
    --steam-left: 30%;
    --steam-bottom: 19%;
    --steam-speed: 19s;
    --steam-delay: -5s;
}

.bst-steam-b {
    --steam-left: 43%;
    --steam-bottom: 15%;
    --steam-speed: 27s;
    --steam-delay: -16s;
    width: 3.6rem;
    height: 9rem;
}

/* On tablets and phones the figure holds the middle of the short opening scene,
   so the whole avenue — every lane, the parked cars, the distant lights and the
   steam — is moved into the open street beside her and shrunk with the smaller
   frame. */
@media (max-width: 1023px) {
    .bst-car-a {
        --car-left: 30%;
        --car-bottom: 12%;
        width: clamp(2.4rem, 9vw, 3.6rem);
    }

    .bst-car-b {
        --car-left: 22%;
        --car-bottom: 20%;
        width: clamp(2rem, 7vw, 2.9rem);
    }

    .bst-car-c {
        --car-left: 14%;
        --car-bottom: 28%;
        width: clamp(1.6rem, 5.4vw, 2.3rem);
    }

    .bst-car-d {
        --car-left: 26%;
        --car-bottom: 16%;
        width: clamp(2rem, 6.6vw, 2.8rem);
    }

    .bst-car-e {
        --car-left: 9%;
        --car-bottom: 23%;
        width: clamp(1.7rem, 5.4vw, 2.3rem);
    }

    .bst-car-f {
        --car-left: 20%;
        --car-bottom: 31%;
        width: clamp(1.3rem, 4vw, 1.8rem);
    }

    .bst-car-g {
        --car-left: 31%;
        --car-bottom: 35%;
        width: clamp(1.1rem, 3.2vw, 1.5rem);
    }

    .bst-car-park-a {
        --car-left: 8%;
        --car-bottom: 13%;
        width: clamp(2rem, 6.4vw, 2.8rem);
    }

    .bst-car-park-b {
        --car-left: 33%;
        --car-bottom: 9%;
        width: clamp(1.8rem, 5.6vw, 2.5rem);
    }

    .bst-far-a {
        --far-left: 12%;
        --far-bottom: 33%;
    }

    .bst-far-b {
        --far-left: 24%;
        --far-bottom: 36%;
    }

    .bst-far-c {
        --far-left: 18%;
        --far-bottom: 38%;
    }

    .bst-far-d {
        --far-left: 28%;
        --far-bottom: 34%;
    }

    .bst-far-e {
        --far-left: 6%;
        --far-bottom: 39%;
    }

    .bst-far-f {
        --far-left: 20%;
        --far-bottom: 31%;
    }

    .bst-steam-a {
        --steam-left: 12%;
        --steam-bottom: 20%;
    }

    .bst-steam-b {
        --steam-left: 24%;
        --steam-bottom: 16%;
    }
}

/* ==========================================================================
   The avenue runs at an unhurried pace.

   The street behind the figures has been eased right down, so the traffic now
   keeps the same slow tempo as the city it belongs to: cars come up the road,
   brake and settle at a walking pace instead of hurrying through the frame, the
   distant junction lights slip past more slowly, and the steam lifts and thins
   over a longer breath. Every lane keeps its own timing, so the avenue is still
   busy — one car always arriving while another stands at the kerb.
   ========================================================================== */

.bst-car-a {
    --car-speed: 38s;
}

.bst-car-b {
    --car-speed: 46s;
}

.bst-car-c {
    --car-speed: 33s;
}

.bst-car-d {
    --car-speed: 42s;
}

.bst-car-e {
    --car-speed: 29s;
}

.bst-car-f {
    --car-speed: 50s;
}

.bst-car-g {
    --car-speed: 36s;
}

.bst-far-a {
    --far-speed: 34s;
}

.bst-far-b {
    --far-speed: 45s;
}

.bst-far-c {
    --far-speed: 28s;
}

.bst-far-d {
    --far-speed: 39s;
}

.bst-far-e {
    --far-speed: 32s;
}

.bst-far-f {
    --far-speed: 41s;
}

.bst-steam-a {
    --steam-speed: 26s;
}

.bst-steam-b {
    --steam-speed: 35s;
}

/* A visitor who prefers reduced motion meets the street exactly as it was
   photographed, with no traffic moving through it. */
@media (prefers-reduced-motion: reduce) {
    .bst-traffic {
        display: none;
    }
}

/* On a phone the avenue's traffic steps out of the picture entirely.

   The cars, the junction lights and the steam are all drawn with heavy blurring
   and shading, and on a small screen they sit far behind the figure, sunk in the
   dark beneath the copy — barely seen at all, yet still re-painted frame after
   frame. With them gone the street keeps its own moving footage, the night still
   reads as a live city, and the opening is far lighter for the handset. */
@media (max-width: 767px) {
    .bst-traffic {
        display: none;
    }
}