/* FUND.lab kinetic identity - the 3D sculpture opens a path through the page. */
@view-transition {
    navigation: auto;
}

::view-transition {
    background: #17212d;
}

::view-transition-old(root) {
    animation: page-fold-out 0.6s cubic-bezier(0.76, 0, 0.24, 1) both;
    transform-origin: left center;
}

::view-transition-new(root) {
    animation: page-fold-in 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
    transform-origin: right center;
}

@keyframes page-fold-out {
    to {
        opacity: 0;
        transform: perspective(1500px) translateX(-8%) rotateY(8deg) scale(0.96);
    }
}

@keyframes page-fold-in {
    from {
        opacity: 0;
        transform: perspective(1500px) translateX(12%) rotateY(-9deg) scale(0.96);
        clip-path: inset(0 0 0 22%);
    }

    to {
        opacity: 1;
        transform: none;
        clip-path: inset(0);
    }
}

html:has(body[data-motion="paused"])::view-transition-old(root),
html:has(body[data-motion="paused"])::view-transition-new(root) {
    animation: none;
}

.menu-open .scene-slot *,
.menu-open .kinetic-track {
    animation-play-state: paused !important;
}

.hero {
    isolation: isolate;
}

.hero h1>span {
    animation: none;
}

.hero-copy {
    transform: perspective(1200px) translate3d(0, calc(var(--hero-progress, 0) * -65px), 0) rotateX(calc(var(--hero-progress, 0) * 6deg));
    transform-origin: center bottom;
}

.hero-grid {
    grid-template-columns: 1fr 1.06fr;
    gap: 0;
}

.hero-art {
    height: 570px;
    margin-left: -20px;
    opacity: 1;
}

.hero-art:before {
    display: none;
}

.scene-slot {
    position: relative;
    width: 100%;
    height: 100%;
    isolation: isolate;
    overflow: hidden;
}

.scene-mount {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.portal-canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.scene-halo {
    position: absolute;
    inset: 4%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center,
            #34bed529 0%,
            #34bed508 48%,
            transparent 70%);
}

.scene-grid {
    position: absolute;
    width: 120%;
    height: 45%;
    left: -10%;
    top: 55%;
    background-image:
        linear-gradient(#34bed517 1px, transparent 1px),
        linear-gradient(90deg, #34bed517 1px, transparent 1px);
    background-size: 52px 52px;
    transform: perspective(600px) rotateX(65deg);
    transform-origin: center top;
    mask-image: radial-gradient(ellipse at 50% 10%, #000, transparent 65%);
}

.scene-caption {
    position: absolute;
    top: 18px;
    left: 6%;
    font-size: 10px;
    letter-spacing: 0.16em;
    color: #b5d3df;
    z-index: 3;
}

.scene-coordinate {
    position: absolute;
    top: 34%;
    right: 3%;
    writing-mode: vertical-rl;
    font-size: 9px;
    letter-spacing: 0.17em;
    color: #9bb3c1;
    z-index: 3;
}

.scene-legend {
    position: absolute;
    bottom: 25px;
    left: 6%;
    right: 6%;
    display: flex;
    justify-content: space-between;
    padding-top: 18px;
    border-top: 1px solid #34bed536;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.13em;
    color: #bdd5df;
    z-index: 3;
}

.scene-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scene-legend i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px #34bed5;
}

.scene-legend span:last-child {
    color: var(--accent);
}

.scene-fallback {
    position: absolute;
    inset: 0;
    perspective: 850px;
    transition: opacity 0.5s;
}

.scene-live .scene-fallback {
    opacity: 0;
    visibility: hidden;
}

.scene-live .fallback-orbit,
.scene-live .fallback-frame {
    animation-play-state: paused !important;
}

.fallback-orbit {
    position: absolute;
    width: 42%;
    height: 48%;
    left: 28%;
    top: 25%;
    transform-style: preserve-3d;
    transform: rotateX(-18deg) rotateY(-30deg) rotateZ(-8deg);
}

.fallback-frame {
    position: absolute;
    inset: 0;
    border: 10px solid #34bed5;
    background: transparent;
    box-shadow:
        inset 2px 2px 0 #beeff7,
        2px 2px 0 #0b6177;
    transform: translateZ(calc((var(--frame) - 3) * 35px));
}

.fallback-frame-0 {
    --frame: 0;
}

.fallback-frame-1 {
    --frame: 1;
}

.fallback-frame-2 {
    --frame: 2;
}

.fallback-frame-3 {
    --frame: 3;
    border-color: #d3f5f9;
}

.fallback-frame-4 {
    --frame: 4;
}

.fallback-frame-5 {
    --frame: 5;
}

.fallback-frame-6 {
    --frame: 6;
}

.fallback-core {
    position: absolute;
    width: 12px;
    height: 12px;
    left: 50%;
    top: 50%;
    background: white;
    box-shadow: 0 0 30px #34bed5;
    transform: translateZ(130px) rotate(45deg);
}

.motion-ready .fallback-orbit {
    animation: fallback-turn 12s ease-in-out infinite;
}

.motion-ready .fallback-frame {
    animation: fallback-fan 7s ease-in-out calc(var(--frame) * -0.4s) infinite alternate;
}

@keyframes fallback-turn {

    0%,
    100% {
        transform: rotateX(-18deg) rotateY(-35deg) rotateZ(-8deg);
    }

    50% {
        transform: rotateX(18deg) rotateY(38deg) rotateZ(9deg);
    }
}

@keyframes fallback-fan {
    from {
        transform: translateZ(calc((var(--frame) - 3) * 35px)) rotateZ(calc((var(--frame) - 3) * -4deg));
    }

    to {
        transform: translateZ(calc((var(--frame) - 3) * 42px)) rotateZ(calc((var(--frame) - 3) * 5deg));
    }
}

.word-mask {
    display: inline-block;
    overflow: clip;
    vertical-align: top;
    padding-bottom: 0.14em;
    margin-bottom: -0.14em;
}

.motion-word {
    display: inline-block;
    transform-origin: left bottom;
}

.split-heading {
    perspective: 1100px;
}

.kinetic-ribbon {
    overflow: hidden;
    background: var(--accent);
    color: var(--ink);
    padding: 26px 0 32px;
    position: relative;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
}

.kinetic-track {
    display: flex;
    width: max-content;
    align-items: center;
}

.kinetic-track>span {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 42px;
    padding-right: 42px;
    font-size: clamp(50px, 7vw, 106px);
    line-height: 1;
    letter-spacing: -0.055em;
    font-weight: 900;
}

.kinetic-track b {
    font-weight: 900;
}

.kinetic-track i {
    font-style: normal;
    color: transparent;
    -webkit-text-stroke: 1.2px var(--ink);
}

.kinetic-track svg {
    width: 64px;
    height: 64px;
}

.motion-ready .kinetic-track {
    animation: kinetic-travel 26s linear infinite;
}

@keyframes kinetic-travel {
    to {
        transform: translateX(-50%);
    }
}

.method-sticky {
    top: 125px;
}

.method-grid {
    gap: 90px;
}

.method-sticky h2 {
    font-size: clamp(38px, 3.8vw, 58px);
}

.scene-slot-method {
    height: 320px;
    margin-top: 12px;
    max-width: 520px;
}

.scene-slot-method .scene-caption {
    top: 5px;
    left: 0;
    font-size: 8px;
    color: #9bb3c1;
}

.scene-slot-method .scene-mount {
    inset: -35px 0 0;
}

.scene-slot-method .fallback-orbit {
    height: 50%;
    width: 34%;
    left: 32%;
    top: 23%;
}

.scene-slot-method .fallback-frame {
    border-width: 7px;
}

.scene-phase {
    display: flex;
    align-items: center;
    gap: 15px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
}

.scene-phase-number {
    color: var(--accent);
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.05em;
}

.scene-phase-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #b7d0dd;
    white-space: nowrap;
}

.scene-phase-line {
    height: 1px;
    flex: 1;
    background: #34bed53a;
    position: relative;
    overflow: hidden;
}

.scene-phase-line:after {
    content: "";
    background: var(--accent);
    position: absolute;
    inset: 0;
    transform-origin: left;
    transform: scaleX(var(--phase-progress, 0));
}

.method-step {
    min-height: 360px;
    padding: 70px 0;
    transition: border-color 0.4s;
}

.method-step h3 {
    transition:
        color 0.5s,
        transform 0.65s var(--ease);
}

.method-step.is-active {
    border-top-color: var(--accent);
}

.method-step.is-active h3 {
    transform: translateX(12px);
}

.method-step .step-index {
    width: fit-content;
    transition: transform 0.65s var(--ease);
    transform-origin: left center;
}

.method-step.is-active .step-index {
    transform: scale(1.4);
}

.expertise-row {
    perspective: 900px;
}

.expertise-row h3 {
    transition: transform 0.5s var(--ease);
    transform-origin: left center;
}

.expertise-row:hover h3 {
    transform: translateX(10px) rotateY(-6deg);
}

.expertise-row .row-number {
    transition:
        transform 0.5s,
        color 0.3s;
}

.expertise-row:hover .row-number {
    transform: rotate(360deg);
    color: #087b90;
}

[data-tilt] {
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform 0.45s var(--ease);
}

.site-menu:before {
    content: "";
    position: absolute;
    pointer-events: none;
    width: 50vw;
    height: 65vw;
    right: -10vw;
    top: 5vh;
    border: 1px solid #34bed528;
    transform: rotate(-20deg) skewY(10deg);
}

.site-menu:after {
    content: "";
    position: absolute;
    pointer-events: none;
    width: 50vw;
    height: 65vw;
    right: -14vw;
    top: 8vh;
    border: 1px solid #34bed516;
    transform: rotate(-20deg) skewY(10deg);
}

.menu-body,
.menu-heading {
    position: relative;
    z-index: 1;
}

.reading-progress {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--accent);
    transform: scaleX(var(--page-progress, 0));
    transform-origin: left;
    z-index: 110;
    pointer-events: none;
}

.motion-toggle {
    position: fixed;
    bottom: 18px;
    right: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 60;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 30px;
    border: 1px solid #688898;
    background: #17212df5;
    color: #fff;
    font-size: 11px;
    line-height: 1.3;
    box-shadow: 0 5px 20px #0002;
}

.motion-toggle[hidden] {
    display: none;
}

.motion-toggle i {
    width: 8px;
    height: 10px;
    border-inline: 2px solid var(--accent);
}

.motion-toggle[aria-pressed="true"] i {
    width: 0;
    height: 0;
    border: 5px solid transparent;
    border-left: 8px solid var(--accent);
    margin-right: -5px;
}

.motion-toggle:hover {
    border-color: var(--accent);
}

.motion-toggle:disabled {
    cursor: default;
    opacity: 1;
}

.motion-sleep *,
.motion-suspended *,
body[data-motion="paused"] *,
body[data-motion="paused"] *:before,
body[data-motion="paused"] *:after {
    animation-play-state: paused !important;
}

body[data-motion="paused"] {
    scroll-behavior: auto;
}

body[data-motion="paused"] .hero-copy,
body[data-motion="paused"] [data-tilt] {
    transform: none;
}

body[data-motion="paused"] .method-step h3,
body[data-motion="paused"] .method-step .step-index {
    transform: none;
    transition: none;
}

body[data-reduced-motion="true"] *,
body[data-reduced-motion="true"] *:before,
body[data-reduced-motion="true"] *:after {
    animation: none !important;
    transition: none !important;
}

body:has(input:focus, textarea:focus, select:focus) .motion-toggle {
    visibility: hidden;
}

@media (min-width: 1700px) {
    .hero-art {
        height: 670px;
    }

    .hero-grid {
        grid-template-columns: 1fr 1.08fr;
    }
}

@media (max-width: 1200px) {
    .hero-grid {
        grid-template-columns: 1.1fr 1fr;
    }

    .hero-art {
        height: 480px;
    }

    .method-grid {
        gap: 50px;
    }

    .scene-slot-method {
        height: 280px;
    }
}

@media (max-width: 1000px) and (min-width: 701px) {
    .hero-art {
        margin-left: -55px;
        width: calc(100% + 55px);
        height: 440px;
    }

    .method-sticky {
        top: 115px;
    }

    .method-sticky h2 {
        font-size: 41px;
    }

    .scene-slot-method {
        height: 260px;
    }

    .scene-phase-label {
        font-size: 9px;
    }

    .method-grid {
        gap: 40px;
    }
}

@media (max-width: 700px) {
    .hero-grid {
        display: flex;
        flex-direction: column;
        padding-top: 35px;
    }

    .hero-copy {
        width: 100%;
        transform: none;
    }

    .hero-art {
        width: calc(100% + 48px);
        height: 345px;
        max-width: 500px;
        margin: 16px -24px -3px;
        order: 2;
    }

    .scene-caption {
        top: 8px;
        font-size: 8px;
        left: 8%;
    }

    .scene-legend {
        left: 8%;
        right: 8%;
        bottom: 14px;
        font-size: 8px;
    }

    .scene-coordinate {
        font-size: 7px;
        right: 5%;
    }

    .scene-grid {
        background-size: 36px 36px;
    }

    .fallback-frame {
        border-width: 7px;
    }

    .kinetic-ribbon {
        padding: 22px 0 25px;
    }

    .kinetic-track>span {
        font-size: 58px;
        gap: 24px;
        padding-right: 24px;
    }

    .kinetic-track svg {
        width: 36px;
        height: 36px;
    }

    .method-sticky {
        position: static;
    }

    .scene-slot-method {
        display: block;
        height: 300px;
        margin-block: 15px;
    }

    .method-grid {
        gap: 25px;
    }

    .method-step {
        min-height: 0;
        padding: 34px 0 38px 42px;
    }

    .method-step.is-active h3 {
        transform: none;
    }

    .scene-phase-label {
        font-size: 10px;
    }

    .scene-phase-number {
        font-size: 30px;
    }

    .motion-toggle {
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        min-height: 44px;
        padding: 9px 13px;
        font-size: 10px;
    }

    .expertise-row:hover h3 {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    @view-transition {
        navigation: none;
    }

    .hero-copy,
    [data-tilt] {
        transform: none !important;
    }

    .motion-word {
        transform: none !important;
        opacity: 1 !important;
    }

    .fallback-orbit,
    .fallback-frame,
    .kinetic-track {
        animation: none !important;
    }
}

@media print {

    .motion-toggle,
    .reading-progress,
    .scene-slot,
    .kinetic-ribbon {
        display: none !important;
    }

    .word-mask {
        overflow: visible;
    }
}
/* Mobile : la scène 3D passe derrière le texte de l'accueil, en filigrane */
@media (max-width: 700px) {
    .hero-grid {
        position: relative;
    }
    .hero-copy {
        position: relative;
        z-index: 1;
    }
    .hero-art {
        position: absolute;
        z-index: 0;
        top: 0;
        right: -32%;
        bottom: 0;
        width: 115%;
        height: auto;
        max-width: none;
        margin: 0;
        opacity: 0.6;
        pointer-events: none;
    }
    .hero-art .scene-caption,
    .hero-art .scene-legend,
    .hero-art .scene-coordinate {
        display: none;
    }
    .hero-art .fallback-orbit {
        top: 16%;
        height: 34%;
    }
    /* Voile qui garantit la lisibilité du texte au-dessus des cadres */
    .hero-art::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 3;
        background: linear-gradient(90deg, #17212df2 0%, #17212dbf 40%, #17212d40 100%);
    }
}

/* Mobile : la scène 3D de « Notre démarche » passe derrière le titre, comme sur l'accueil */
@media (max-width: 700px) {
    .method-section {
        overflow-x: clip;
    }
    .method-sticky {
        position: relative;
        top: auto;
        height: auto;
        isolation: isolate;
        padding-block: 8px 4px;
    }
    .method-sticky > :not(.scene-slot) {
        position: relative;
        z-index: 1;
    }
    .method-sticky .scene-slot-method {
        position: absolute;
        z-index: 0;
        top: -24px;
        right: -38%;
        bottom: -24px;
        width: 110%;
        height: auto;
        min-height: 240px;
        margin: 0;
        opacity: 0.6;
        pointer-events: none;
    }
    .scene-slot-method .scene-caption,
    .scene-slot-method .scene-phase {
        display: none;
    }
    .scene-slot-method::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 3;
        background: linear-gradient(90deg, #17212df2 0%, #17212dbf 45%, #17212d40 100%);
    }
}

/* ===== Soulignement qui glisse sous les onglets et filtres =====
   Uniquement si l'appareil accepte les animations et que le « Mode calme » n'est pas activé. */
@media (prefers-reduced-motion: no-preference) {
    body:not([data-motion="paused"]) :is(.product-nav a, .company-switch a, .sector-filter a) {
        background-image: linear-gradient(var(--accent), var(--accent));
        background-repeat: no-repeat;
        background-position: left bottom;
        background-size: 0 2px;
        transition: background-size 0.45s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s;
    }
    body:not([data-motion="paused"]) :is(.product-nav a, .company-switch a, .sector-filter a):hover {
        background-size: 100% 2px;
    }
    body:not([data-motion="paused"]) :is(.product-nav a, .company-switch a, .sector-filter a)[aria-current="page"] {
        background-size: 0 2px;
    }
    /* Lignes d'institutions : le logo s'approche légèrement au survol. */
    body:not([data-motion="paused"]) .institution-logo img {
        transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }
    body:not([data-motion="paused"]) .institution-row:hover .institution-logo img {
        transform: scale(1.06);
    }
}

/* Bandeau VISION / STRUCTURE / ACTION : pictogrammes de la charte, trait encre sur fond turquoise. */
.kinetic-track .ui-icon {
    width: clamp(64px, 6.5vw, 92px);
    height: clamp(64px, 6.5vw, 92px);
    stroke: var(--ink);
    stroke-width: 1.5;
}
@media (max-width: 640px) {
    .kinetic-track .ui-icon {
        width: 46px;
        height: 46px;
        stroke-width: 1.6;
    }
}
