/* Shared motion and interaction layer. */
:root {
    --tourbier-motion-duration: 540ms;
    --tourbier-motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --tourbier-focus: #6f9ac4;
    scrollbar-color: #577895 #e8eef3;
    scrollbar-width: thin;
}

[role="dialog"][aria-modal="true"],
.tourbier-header__navigation,
.tourbier-simulators__nav .tourbier-simulators__shell {
    scrollbar-color: #577895 #edf2f6;
    scrollbar-width: thin;
}

html::-webkit-scrollbar,
[role="dialog"][aria-modal="true"]::-webkit-scrollbar,
.tourbier-header__navigation::-webkit-scrollbar,
.tourbier-simulators__nav .tourbier-simulators__shell::-webkit-scrollbar {
    width: 10px;
    height: 8px;
}

html::-webkit-scrollbar-track,
[role="dialog"][aria-modal="true"]::-webkit-scrollbar-track,
.tourbier-header__navigation::-webkit-scrollbar-track,
.tourbier-simulators__nav .tourbier-simulators__shell::-webkit-scrollbar-track {
    border-radius: 999px;
    background: #e8eef3;
}

html::-webkit-scrollbar-thumb,
[role="dialog"][aria-modal="true"]::-webkit-scrollbar-thumb,
.tourbier-header__navigation::-webkit-scrollbar-thumb,
.tourbier-simulators__nav .tourbier-simulators__shell::-webkit-scrollbar-thumb {
    min-height: 44px;
    border: 2px solid #e8eef3;
    border-radius: 999px;
    background: #577895;
}

html::-webkit-scrollbar-thumb:hover,
[role="dialog"][aria-modal="true"]::-webkit-scrollbar-thumb:hover,
.tourbier-header__navigation::-webkit-scrollbar-thumb:hover,
.tourbier-simulators__nav .tourbier-simulators__shell::-webkit-scrollbar-thumb:hover {
    background: #244b78;
}

html::-webkit-scrollbar-button,
[role="dialog"][aria-modal="true"]::-webkit-scrollbar-button,
.tourbier-header__navigation::-webkit-scrollbar-button,
.tourbier-simulators__nav .tourbier-simulators__shell::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    border: 0 !important;
    background: transparent !important;
    appearance: none;
}

::view-transition-group(root),
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 220ms !important;
    animation-timing-function: ease-out !important;
}

:where(
    .tourbier-home,
    .tourbier-assurances,
    .tourbier-service,
    .tourbier-journal,
    .tourbier-contact,
    .tourbier-rgpd,
    .tourbier-legal,
    .tourbier-single,
    .tourbier-simulators,
    .tourbier-partners,
    .tourbier-loans,
    .tourbier-wealth
) :is(h1, h2, h3) {
    text-wrap: balance;
}

:where(
    .tourbier-home,
    .tourbier-assurances,
    .tourbier-service,
    .tourbier-journal,
    .tourbier-contact,
    .tourbier-rgpd,
    .tourbier-legal,
    .tourbier-single,
    .tourbier-simulators,
    .tourbier-partners,
    .tourbier-loans,
    .tourbier-wealth
) p {
    text-wrap: pretty;
}

:where(
    .tourbier-home,
    .tourbier-assurances,
    .tourbier-service,
    .tourbier-journal,
    .tourbier-contact,
    .tourbier-rgpd,
    .tourbier-legal,
    .tourbier-single,
    .tourbier-simulators,
    .tourbier-partners,
    .tourbier-loans,
    .tourbier-wealth
) :is(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--tourbier-focus);
    outline-offset: 3px;
}

:where(
    .tourbier-home,
    .tourbier-assurances,
    .tourbier-service,
    .tourbier-journal,
    .tourbier-contact,
    .tourbier-rgpd,
    .tourbier-legal,
    .tourbier-single,
    .tourbier-simulators,
    .tourbier-partners,
    .tourbier-loans,
    .tourbier-wealth
) section[id] {
    scroll-margin-top: 104px;
}

:where(
    .tourbier-home,
    .tourbier-assurances,
    .tourbier-service,
    .tourbier-journal,
    .tourbier-contact,
    .tourbier-rgpd,
    .tourbier-legal,
    .tourbier-single,
    .tourbier-simulators,
    .tourbier-partners,
    .tourbier-loans,
    .tourbier-wealth
) :is(a, button) {
    -webkit-tap-highlight-color: transparent;
}

:where(
    .tourbier-home,
    .tourbier-assurances,
    .tourbier-service,
    .tourbier-journal,
    .tourbier-contact,
    .tourbier-rgpd,
    .tourbier-legal,
    .tourbier-single,
    .tourbier-simulators,
    .tourbier-partners,
    .tourbier-loans,
    .tourbier-wealth
) :is(a, button):active {
    translate: 0 1px;
}

@keyframes tourbier-motion-reveal {
    from {
        opacity: 0;
        transform: var(--tourbier-motion-origin, translate3d(0, 18px, 0));
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.tourbier-motion-reveal {
    --tourbier-motion-origin: translate3d(0, 18px, 0);
    opacity: 0;
    transform: var(--tourbier-motion-origin);
    backface-visibility: hidden;
    will-change: opacity, transform;
}

.tourbier-motion-reveal[data-motion-style="from-left"] {
    --tourbier-motion-origin: translate3d(-24px, 0, 0);
}

.tourbier-motion-reveal[data-motion-style="from-right"] {
    --tourbier-motion-origin: translate3d(24px, 0, 0);
}

.tourbier-motion-reveal[data-motion-style="scale"] {
    --tourbier-motion-origin: translate3d(0, 10px, 0) scale(0.975);
}

.tourbier-motion-reveal[data-motion-style="soft-rise"] {
    --tourbier-motion-origin: translate3d(0, 12px, 0);
}

.tourbier-motion-reveal.is-visible {
    animation: tourbier-motion-reveal var(--tourbier-motion-duration) var(--tourbier-motion-ease)
        var(--tourbier-motion-delay, 0ms) both;
}

.tourbier-motion-card:not(.tourbier-motion-reveal) {
    transition:
        border-color 220ms ease,
        box-shadow 260ms ease,
        transform 260ms var(--tourbier-motion-ease),
        translate 260ms var(--tourbier-motion-ease),
        scale 260ms var(--tourbier-motion-ease);
}

.tourbier-motion-decorative {
    animation-play-state: paused !important;
}

.tourbier-motion-decorative.is-motion-active {
    animation-play-state: running !important;
}

.tourbier-motion-attention {
    --tourbier-attention-glint: rgba(255, 255, 255, 0.42);
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.tourbier-home__button--light.tourbier-motion-attention {
    --tourbier-attention-glint: rgba(36, 75, 120, 0.18);
}

.tourbier-motion-attention::after {
    position: absolute;
    z-index: 1;
    top: -70%;
    bottom: -70%;
    left: -45%;
    width: 32%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--tourbier-attention-glint), transparent);
    content: "";
    opacity: 0;
    transform: translateX(-220%) rotate(14deg);
    animation: tourbier-cta-glint 4.8s var(--tourbier-motion-ease) 1 both;
    animation-play-state: paused;
}

.tourbier-motion-attention.is-motion-active::after {
    animation-play-state: running;
}

.tourbier-motion-attention:is(:hover, :focus-visible)::after {
    opacity: 0;
    animation-play-state: paused;
}

@media (hover: hover) and (pointer: fine) {
    .tourbier-wealth__lever-card:hover {
        translate: 0 -3px;
        scale: 1.008;
        box-shadow: 0 20px 42px rgba(16, 42, 70, 0.11);
    }

    .tourbier-calculator:hover {
        box-shadow: 0 26px 70px rgba(16, 42, 70, 0.12);
    }

    .tourbier-home__portrait-wrap img {
        transition: scale 620ms var(--tourbier-motion-ease);
    }

    .tourbier-home__portrait-wrap:hover img {
        scale: 1.025;
    }

    .tourbier-home__local-city {
        transition: scale 220ms var(--tourbier-motion-ease), box-shadow 220ms ease;
    }

    .tourbier-home__local-city:hover {
        scale: 1.06;
        box-shadow: 0 9px 22px rgba(16, 42, 70, 0.18);
    }
}

.tourbier-motion-result {
    animation: tourbier-result-update 260ms var(--tourbier-motion-ease);
}

.tourbier-assurances__faq details[open] > p {
    animation: tourbier-faq-open 240ms var(--tourbier-motion-ease);
}

.tourbier-home__hero-orbit,
.tourbier-contact__orbit {
    animation: tourbier-orbit-breathe 8s ease-in-out infinite alternate;
}

.tourbier-home__hero-orbit--two,
.tourbier-contact__orbit--two {
    animation-delay: -4s;
    animation-duration: 10s;
}

.tourbier-home__local-ring--one,
.tourbier-home__local-ring--two,
.tourbier-home__local-ring--three {
    animation: tourbier-ring-pulse 8s ease-in-out infinite;
}

.tourbier-home__local-ring--two { animation-delay: 1.4s; }
.tourbier-home__local-ring--three { animation-delay: 2.8s; }

.tourbier-home__local-city--montpellier,
.tourbier-home__local-city--lunel,
.tourbier-home__local-city--nimes {
    animation: tourbier-city-drift 6.5s ease-in-out infinite alternate;
}

.tourbier-home__local-city--beziers,
.tourbier-home__local-city--sete,
.tourbier-home__local-city--ales,
.tourbier-home__local-city--bagnols {
    animation: tourbier-city-drift 7.5s -2.5s ease-in-out infinite alternate-reverse;
}

/* Repainting a blurred sticky surface on every scroll frame causes visible jank. */
.tourbier-simulators__nav {
    background: rgba(255, 255, 255, 0.985);
    backdrop-filter: none;
}

.tourbier-consent-modal__backdrop,
.tourbier-simulation-modal__backdrop {
    backdrop-filter: none !important;
}

@keyframes tourbier-result-update {
    from { opacity: 0.55; translate: 0 4px; scale: 0.985; }
    to { opacity: 1; translate: none; scale: 1; }
}

@keyframes tourbier-faq-open {
    from { opacity: 0; translate: 0 -5px; }
    to { opacity: 1; translate: none; }
}

@keyframes tourbier-orbit-breathe {
    from { opacity: 0.48; scale: 0.99; }
    to { opacity: 0.88; scale: 1.01; }
}

@keyframes tourbier-ring-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 0.88; }
}

@keyframes tourbier-city-drift {
    from { translate: 0 -1px; }
    to { translate: 0 2px; }
}

@keyframes tourbier-cta-glint {
    0%, 55% {
        opacity: 0;
        transform: translateX(-220%) rotate(14deg);
    }

    60% {
        opacity: 0.62;
    }

    78% {
        opacity: 0;
        transform: translateX(620%) rotate(14deg);
    }

    100% {
        opacity: 0;
        transform: translateX(620%) rotate(14deg);
    }
}

@media (max-width: 760px) {
    :root {
        --tourbier-motion-duration: 420ms;
    }

    .tourbier-motion-reveal[data-motion-style="from-left"],
    .tourbier-motion-reveal[data-motion-style="from-right"] {
        --tourbier-motion-origin: translate3d(0, 10px, 0);
    }

    .tourbier-motion-decorative {
        animation: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tourbier-motion-reveal,
    .tourbier-motion-reveal.is-visible,
    .tourbier-motion-card,
    .tourbier-motion-result,
    .tourbier-assurances__faq details[open] > p,
    .tourbier-motion-decorative {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        will-change: auto !important;
    }

    .tourbier-motion-attention::after {
        animation: none !important;
        opacity: 0 !important;
    }
}
