/* PITSTOP Franchise — interface publique JavaScript */

:root {
    --app-ease: cubic-bezier(.18, .82, .22, 1);
    --app-red: #d90000;
    --app-ink: #09090b;
    --app-paper: #f4f4f0;
}

.js-platform {
    position: relative;
}

.js-platform.is-booting #pitstop-app {
    opacity: 0;
}

#pitstop-app {
    min-height: 100%;
    opacity: 1;
    transition: opacity .45s ease;
}

.app-boot {
    position: fixed;
    z-index: 5000;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 25px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 46%, rgba(217, 0, 0, .13), transparent 28%),
        #09090b;
    color: #8d8d94;
    opacity: 1;
    transition: opacity .5s ease, visibility .5s ease;
}

.app-boot::before,
.app-boot::after {
    content: "";
    position: absolute;
    width: min(80vw, 720px);
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, .045);
    border-radius: 50%;
    animation: boot-orbit 7s linear infinite;
}

.app-boot::after {
    width: min(54vw, 440px);
    border-color: rgba(217, 0, 0, .14);
    animation-direction: reverse;
    animation-duration: 4.8s;
}

.app-boot.is-complete {
    visibility: hidden;
    opacity: 0;
}

.app-boot-mark {
    position: relative;
    z-index: 1;
    width: min(280px, 58vw);
}

.app-boot-mark img {
    width: 100%;
}

.app-boot-mark span {
    position: relative;
    display: block;
    height: 2px;
    margin-top: 22px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
}

.app-boot-mark span::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--app-red);
    transform-origin: left;
    animation: boot-progress 1.15s var(--app-ease) infinite;
}

.app-boot p {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.ambient-field {
    position: fixed;
    z-index: 4;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: .72;
}

.global-progress {
    position: fixed;
    z-index: 1100;
    inset: 0 0 auto;
    height: 2px;
    overflow: hidden;
    background: rgba(127, 127, 127, .14);
}

.global-progress i {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--app-red);
    box-shadow: 0 0 14px rgba(217, 0, 0, .55);
    transform: scaleX(.142857);
    transform-origin: left;
    transition: transform .55s var(--app-ease);
}

body[data-slide="1"] .global-progress i { transform: scaleX(.285714); }
body[data-slide="2"] .global-progress i { transform: scaleX(.428571); }
body[data-slide="3"] .global-progress i { transform: scaleX(.571428); }
body[data-slide="4"] .global-progress i { transform: scaleX(.714285); }
body[data-slide="5"] .global-progress i { transform: scaleX(.857142); }
body[data-slide="6"] .global-progress i { transform: scaleX(1); }

.js-command-header .header-inner {
    position: relative;
}

.js-command-header .main-nav > a > span {
    display: inline-block;
    margin-right: 6px;
    color: var(--app-red);
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .06em;
}

.js-command-header .main-nav .nav-cta > span {
    display: none;
}

.header-status {
    position: absolute;
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #74747b;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
    transform: translateX(-50%);
    transition: color .25s ease;
}

.header-status i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--app-red);
    box-shadow: 0 0 0 4px rgba(217, 0, 0, .12);
    animation: live-pulse 1.8s ease-out infinite;
}

.site-header:not(.is-light) .header-status {
    color: #85858d;
}

.section-index {
    position: absolute;
    z-index: 3;
    top: calc(var(--header-height) + 19px);
    right: clamp(54px, 7vw, 118px);
    display: flex;
    align-items: baseline;
    gap: 9px;
    color: rgba(255, 255, 255, .2);
    pointer-events: none;
}

.section-index strong {
    color: var(--app-red);
    font-size: 10px;
    letter-spacing: .1em;
}

.section-index span {
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .2em;
}

.section-index-dark {
    color: rgba(9, 9, 11, .25);
}

.kinetic-title span,
.kinetic-title strong {
    display: block;
    transform-origin: left center;
}

.is-active .kinetic-title span:first-child {
    animation: title-in .78s var(--app-ease) both;
}

.is-active .kinetic-title strong {
    animation: title-in .86s .08s var(--app-ease) both;
}

.is-active .kinetic-title span:last-child {
    animation: title-in .86s .16s var(--app-ease) both;
}

.board-glow {
    position: absolute;
    z-index: 0;
    top: -120px;
    right: -110px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(217, 0, 0, .15);
    filter: blur(45px);
    animation: board-glow 4s ease-in-out infinite alternate;
    pointer-events: none;
}

.hero-data-stream {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: 26px;
    overflow: hidden;
    border-top: 1px solid rgba(9, 9, 11, .06);
    color: rgba(9, 9, 11, .38);
    font-size: 6px;
    font-weight: 900;
    letter-spacing: .22em;
}

.hero-data-stream i {
    width: 24px;
    height: 1px;
    background: var(--app-red);
}

.js-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .72s var(--app-ease), transform .72s var(--app-ease);
}

.js-reveal.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.js-stagger > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .5s var(--app-ease), transform .5s var(--app-ease);
}

.is-revealed.js-stagger > *,
.is-revealed .js-stagger > *,
.js-reveal.is-revealed .js-stagger > * {
    opacity: 1;
    transform: translateY(0);
}

.js-stagger > *:nth-child(2) { transition-delay: .06s; }
.js-stagger > *:nth-child(3) { transition-delay: .12s; }
.js-stagger > *:nth-child(4) { transition-delay: .18s; }
.js-stagger > *:nth-child(5) { transition-delay: .24s; }

.territory-map-card,
.investment-board,
.profile-card {
    transform-style: preserve-3d;
    will-change: transform;
}

.map-scan {
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    top: -20%;
    height: 18%;
    background: linear-gradient(to bottom, transparent, rgba(217, 0, 0, .08), rgba(217, 0, 0, .24), transparent);
    mix-blend-mode: multiply;
    animation: map-scan 4.8s ease-in-out infinite;
    pointer-events: none;
}

.map-region-tag::after {
    content: "";
    position: absolute;
    left: 7px;
    width: 5px;
    height: 5px;
    border: 1px solid var(--app-red);
    border-radius: 50%;
    animation: map-ping 2.4s ease-out infinite;
}

.map-region-centre::after { animation-delay: .6s; }
.map-region-south::after { animation-delay: 1.2s; }

.live-project-card {
    position: relative;
    display: grid;
    gap: 2px;
    margin-top: 20px;
    padding: 15px 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 13px;
    background: rgba(255, 255, 255, .035);
}

.live-project-card span {
    color: var(--app-red);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .16em;
}

.live-project-card strong {
    margin-top: 5px;
    font-size: 15px;
}

.live-project-card small {
    color: #8c8c94;
    font-size: 10px;
}

.live-project-card i {
    position: absolute;
    right: -16px;
    top: -18px;
    width: 72px;
    height: 72px;
    border: 1px solid rgba(217, 0, 0, .34);
    border-radius: 50%;
    box-shadow: 0 0 0 13px rgba(217, 0, 0, .035);
}

.app-toast {
    position: fixed;
    z-index: 1800;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
}

.js-success-screen {
    position: fixed;
    z-index: 4000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow: auto;
    background:
        radial-gradient(circle at 50% 45%, rgba(217, 0, 0, .14), transparent 30%),
        rgba(7, 7, 9, .98);
    opacity: 0;
    transition: opacity .45s ease;
}

.js-success-screen.is-visible {
    opacity: 1;
}

.success-card {
    position: relative;
    z-index: 2;
    width: min(620px, 100%);
    padding: clamp(30px, 5vw, 62px);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 28px;
    background: rgba(18, 18, 21, .94);
    box-shadow: 0 35px 100px rgba(0, 0, 0, .48);
    color: #fff;
    text-align: center;
    transform: translateY(25px) scale(.97);
    transition: transform .62s var(--app-ease);
}

.is-visible .success-card {
    transform: translateY(0) scale(1);
}

.success-card > img {
    width: 160px;
    margin: 0 auto 28px;
}

.success-card .confirmation-icon {
    margin-inline: auto;
}

.success-kicker {
    display: block;
    margin-top: 18px;
    color: #ff6969;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .18em;
}

.success-card h1 {
    margin: 12px 0;
    font-size: clamp(34px, 6vw, 56px);
    line-height: 1;
    letter-spacing: -.045em;
}

.success-card > p {
    margin: 0 auto 22px;
    max-width: 470px;
    color: #aaaab1;
}

.success-card .reference-box {
    margin-inline: auto;
}

.success-card .confirmation-note {
    color: #96969d;
    text-align: left;
}

.success-pulse {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 1px;
    height: 1px;
}

.success-pulse i {
    position: absolute;
    width: 320px;
    height: 320px;
    border: 1px solid rgba(217, 0, 0, .2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(.3);
    animation: success-ring 3s ease-out infinite;
}

.success-pulse i:nth-child(2) { animation-delay: 1s; }
.success-pulse i:nth-child(3) { animation-delay: 2s; }

.app-failure,
.js-required {
    min-height: 100vh;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 16px;
    width: min(700px, calc(100% - 48px));
    margin: auto;
    padding: 80px 0;
    color: #fff;
}

.app-failure img,
.js-required img {
    width: 220px;
    margin-bottom: 25px;
}

.app-failure > span {
    color: #ff6262;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .18em;
}

.app-failure h1,
.js-required h1 {
    margin: 0;
    font-size: clamp(42px, 8vw, 74px);
    line-height: .95;
    letter-spacing: -.05em;
}

.app-failure p,
.js-required p {
    max-width: 570px;
    margin: 0 0 12px;
    color: #aaaab1;
}

/* Pages secondaires, elles aussi construites par JavaScript. */
.js-inner-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 82% 10%, rgba(217, 0, 0, .08), transparent 26%),
        var(--app-paper);
    color: var(--app-ink);
}

.js-inner-page .site-header {
    background: rgba(9, 9, 11, .96);
}

.js-legal-root,
.js-confirmation-root {
    min-height: 100vh;
}

.legal-loading {
    min-height: 100vh;
    display: grid;
    place-content: center;
    color: #77777e;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.legal-loading::before {
    content: "";
    width: 28px;
    height: 28px;
    margin: 0 auto 16px;
    border: 2px solid rgba(9, 9, 11, .12);
    border-top-color: var(--app-red);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.js-inner-page .inner-page {
    background: transparent;
}

.js-inner-page .legal-card,
.js-inner-page .confirmation-card {
    box-shadow: 0 28px 80px rgba(9, 9, 11, .09);
}

.inner-page-header .page-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--app-red);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.confirmation-card .page-kicker {
    display: block;
    margin: 0 0 12px;
    color: var(--app-red);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.inner-page-header .page-kicker::before {
    content: "";
    width: 24px;
    height: 2px;
    background: currentColor;
}

.legal-card h2 {
    scroll-margin-top: calc(var(--header-height) + 24px);
}

@keyframes boot-orbit {
    to { transform: rotate(360deg); }
}

@keyframes boot-progress {
    0% { transform: scaleX(0); transform-origin: left; }
    48% { transform: scaleX(1); transform-origin: left; }
    52% { transform: scaleX(1); transform-origin: right; }
    100% { transform: scaleX(0); transform-origin: right; }
}

@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(217, 0, 0, .28); }
    70%, 100% { box-shadow: 0 0 0 7px rgba(217, 0, 0, 0); }
}

@keyframes title-in {
    from { opacity: 0; transform: translateY(32px) skewY(2deg); }
    to { opacity: 1; transform: translateY(0) skewY(0); }
}

@keyframes board-glow {
    to { transform: translate(-45px, 35px) scale(1.18); opacity: .55; }
}

@keyframes map-scan {
    0%, 12% { transform: translateY(-20%); opacity: 0; }
    24% { opacity: 1; }
    78% { opacity: 1; }
    92%, 100% { transform: translateY(690%); opacity: 0; }
}

@keyframes map-ping {
    0% { opacity: .8; transform: scale(1); }
    75%, 100% { opacity: 0; transform: scale(5); }
}

@keyframes success-ring {
    0% { opacity: .8; transform: translate(-50%, -50%) scale(.3); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); }
}

@media (max-width: 1180px) {
    .header-status {
        display: none;
    }
}

@media (max-width: 980px) {
    .ambient-field {
        opacity: .42;
    }

    .section-index {
        right: 25px;
    }

    .js-command-header .main-nav > a > span {
        min-width: 20px;
    }
}

@media (max-width: 900px) {
    .slide-page.nav-open .site-header,
    .slide-page.nav-open .site-header.is-light,
    .slide-page.nav-open .site-header.is-light.is-scrolled {
        background: #09090b;
        border-bottom-color: rgba(255, 255, 255, .1);
        box-shadow: none;
    }

    .slide-page.nav-open .site-header .main-nav,
    .slide-page.nav-open .site-header.is-light .main-nav {
        color: #f4f4f6;
    }

    .slide-page .main-nav {
        padding: 22px 24px calc(34px + env(safe-area-inset-bottom));
        background:
            radial-gradient(circle at 100% 0, rgba(217, 0, 0, .12), transparent 30%),
            #09090b;
    }

    .slide-page .main-nav > a:not(.nav-cta) {
        padding: 16px 5px;
        color: #d8d8dd;
        border-bottom-color: rgba(255, 255, 255, .11);
        font-size: 15px;
    }

    .slide-page .main-nav > a:not(.nav-cta):hover,
    .slide-page .main-nav > a.is-active:not(.nav-cta) {
        color: #fff;
    }

    .slide-page .main-nav > a.is-active:not(.nav-cta)::after {
        right: auto;
        bottom: 8px;
        width: 28px;
    }

    .slide-page .main-nav .nav-cta,
    .slide-page .site-header.is-light .main-nav .nav-cta {
        margin-top: 20px;
        padding: 14px 20px;
        background: #fff;
        color: #09090b;
        font-size: 15px;
    }
}

@media (max-width: 700px) {
    .slide-deck {
        scroll-snap-type: y proximity;
    }

    .slide {
        scrollbar-width: none;
        scroll-snap-stop: normal;
    }

    .slide::-webkit-scrollbar,
    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .slide.section,
    .hero.hero-light {
        padding-top: calc(var(--header-height) + 30px);
        padding-bottom: calc(116px + env(safe-area-inset-bottom));
    }

    .slide > .container {
        padding-bottom: 44px;
    }

    .section-index {
        display: none;
    }

    .hero-data-stream {
        display: none;
    }

    .hero.hero-light h1 {
        font-size: clamp(43px, 11.5vw, 56px);
        line-height: .94;
        letter-spacing: -.05em;
    }

    .territory-copy h2,
    .investment-heading h2,
    .profile-heading h2,
    .process-heading h2,
    .faq-slide .faq-heading h2,
    .slide.section-form .form-intro h2 {
        font-size: clamp(38px, 10vw, 48px);
        line-height: .98;
        letter-spacing: -.045em;
    }

    .territory-copy > p,
    .investment-heading > p,
    .profile-heading > p,
    .process-heading > p,
    .faq-slide .faq-heading > p {
        font-size: 14px;
        line-height: 1.62;
    }

    .territory-criteria {
        gap: 9px;
    }

    .territory-criteria article {
        min-height: 0;
        padding: 16px 15px;
    }

    .floating-investment-cta {
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        grid-template-columns: minmax(0, 1fr) 38px;
        gap: 8px;
        min-width: 164px;
        padding: 7px 7px 7px 14px;
    }

    .floating-cta-copy strong {
        font-size: 0;
    }

    .floating-cta-copy strong::after {
        content: "Candidater";
        font-size: 11px;
        letter-spacing: 0;
    }

    .floating-cta-arrow {
        width: 38px;
        height: 38px;
    }

    .faq-slide-scroll {
        padding-bottom: calc(88px + env(safe-area-inset-bottom));
    }

    .js-success-screen {
        align-items: start;
        padding: 14px;
    }

    .success-card {
        margin-block: 14px;
        border-radius: 20px;
    }
}

@media (max-width: 430px) {
    .container {
        width: min(var(--container), calc(100% - 30px));
    }

    .floating-investment-cta {
        display: grid;
        grid-template-columns: 42px;
        min-width: 0;
        width: 54px;
        height: 54px;
        padding: 6px;
        border-radius: 50%;
    }

    .floating-cta-copy {
        display: none;
    }

    .floating-cta-arrow {
        width: 42px;
        height: 42px;
    }

    .hero.hero-light h1 {
        font-size: clamp(42px, 12.2vw, 52px);
    }

    .territory-copy h2,
    .investment-heading h2,
    .profile-heading h2,
    .process-heading h2,
    .faq-slide .faq-heading h2,
    .slide.section-form .form-intro h2 {
        font-size: clamp(37px, 10.5vw, 44px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-boot::before,
    .app-boot::after,
    .app-boot-mark span::after,
    .header-status i,
    .board-glow,
    .map-scan,
    .map-region-tag::after,
    .success-pulse i,
    .kinetic-title span,
    .kinetic-title strong {
        animation: none !important;
    }

    .js-reveal,
    .js-stagger > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
