/* ================================================================
   rk.css — composants portés de RECKLESS-CUP (adaptation vanilla)
   hero 3D + menu drawer + slide services 3D + story pin+inkmask
   ================================================================ */

/* ---------- reset léger porté de hero2.css ---------- */
body {
    overflow-x: clip;
}

/* neutralise le letter-spacing global hérité sur les blocs portés */
.hero,
.story,
.slide--xd,
.menu-panel,
.hero--menu--2-col {
    letter-spacing: normal;
}

/* ============================ HERO ============================ */

.hero {
    grid-column: 1 / -1;
    grid-row: 1 / 2; /* ligne 1 : l'ancien .accueil avait grid-row:1/-1, sans quoi .header vide mangeait les 80vh */
    position: relative;
    overflow: hidden;
    height: 100vh;
    height: 100svh;
    min-height: 680px;
    margin: 0;
}

@media (min-width: 1051px) {
    .hero { margin-left: 2rem; margin-right: 2rem; }
}

/* cadre arrondi du hero (ex .headera) */
.headera {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    height: calc(100% - 10rem);
    margin-left: 4rem;
    margin-right: 4rem;
    margin-top: 1.5rem;
    border-radius: 26px;
    border: 0;
    background:
        radial-gradient(
            ellipse at 55% 85%,
            color-mix(in srgb, var(--rk-accent) 10%, transparent),
            transparent 55%
        ),
        linear-gradient(180deg, var(--rk-hero-bg, #e9eef4), var(--rk-hero-bg2, #dfe7ef));
}

/* ==== Encoches inversées (logo haut-gauche & burger haut-droite) ==== */
.hero-notch {
    --notch-r: 18px;
    position: absolute;
    top: 0;
    width: 84px;
    height: 52px;
    background: var(--rk-bg, #ffffff);
    z-index: 6;
    pointer-events: none;
}
.hero-notch::before,
.hero-notch::after {
    content: "";
    position: absolute;
    width: var(--notch-r);
    height: var(--notch-r);
    pointer-events: none;
}

.hero-notch--left {
    left: 0;
    border-bottom-right-radius: var(--notch-r);
}
.hero-notch--left::before {
    top: 0;
    right: calc(-1 * var(--notch-r));
    background: radial-gradient(circle at 100% 100%, transparent var(--notch-r), var(--rk-bg, #ffffff) calc(var(--notch-r) + 0.6px));
}
.hero-notch--left::after {
    left: 0;
    bottom: calc(-1 * var(--notch-r));
    background: radial-gradient(circle at 100% 100%, transparent var(--notch-r), var(--rk-bg, #ffffff) calc(var(--notch-r) + 0.6px));
}

.hero-notch--right {
    right: 0;
    border-bottom-left-radius: var(--notch-r);
}
.hero-notch--right::before {
    top: 0;
    left: calc(-1 * var(--notch-r));
    background: radial-gradient(circle at 0% 100%, transparent var(--notch-r), var(--rk-bg, #ffffff) calc(var(--notch-r) + 0.6px));
}
.hero-notch--right::after {
    right: 0;
    bottom: calc(-1 * var(--notch-r));
    background: radial-gradient(circle at 0% 100%, transparent var(--rk-r, var(--notch-r)), var(--rk-bg, #ffffff) calc(var(--notch-r) + 0.6px));
}

/* Alignement de .logo et .flexa au centre exact des encoches du hero (84x52) */
@media (min-width: 1051px) {
    .logo {
        top: calc(1.5rem + 6px);
        left: calc(6rem + 21px);
    }
    .flexa {
        top: calc(1.5rem + 6px);
        right: calc(6rem + 22px);
    }
}
@media (min-width: 901px) and (max-width: 1050px) {
    .logo {
        top: calc(1rem + 6px);
        left: calc(1.25rem + 21px);
    }
    .flexa {
        top: calc(1rem + 6px);
        right: calc(1.25rem + 22px);
    }
}

.hero .webgl {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    outline: none;
}

.hero-model-reveal {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* grille technique type blueprint au-dessus du rendu 3D */
.hero-grid {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(-90deg, var(--rk-grid-line, rgba(10, 26, 38, 0.05)) 1px, transparent 1px),
        linear-gradient(var(--rk-grid-line, rgba(10, 26, 38, 0.05)) 1px, transparent 1px),
        linear-gradient(-90deg, var(--rk-grid-line2, rgba(10, 26, 38, 0.025)) 1px, transparent 1px),
        linear-gradient(var(--rk-grid-line2, rgba(10, 26, 38, 0.025)) 1px, transparent 1px);
    background-size: 4px 4px, 4px 4px, 72px 72px, 72px 72px;
}

.hero-fade {
    position: absolute;
    left: -10%;
    right: -10%;
    top: 63%;
    height: 40%;
    background:
        radial-gradient(
            ellipse at 50% 100%,
            color-mix(in srgb, var(--rk-accent) 16%, transparent) 0%,
            color-mix(in srgb, var(--rk-accent) 8%, transparent) 28%,
            color-mix(in srgb, var(--rk-accent) 2%, transparent) 52%,
            transparent 75%
        ),
        linear-gradient(
            to bottom,
            transparent 0%,
            rgba(220, 247, 255, 0.08) 35%,
            rgba(239, 250, 253, 0.58) 72%,
            #f4fbfd 100%
        );
    filter: blur(4px);
    z-index: 5;
    pointer-events: none;
}
/* Sur desktop, le bord bas du cadre reste net pour faire ressortir la
   découpe blanche en escalier du .hero-copy (Images 1 & 2) */
@media (min-width: 901px) {
    .hero-fade,
    .hero::after {
        display: none;
    }
}

/* fallback si WebGL indisponible : blobs statiques */
.hero-ambient {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    opacity: 0;
    background:
        radial-gradient(circle at 62% 52%, color-mix(in srgb, var(--rk-accent) 18%, transparent), transparent 18%),
        linear-gradient(145deg, var(--rk-hero-bg), var(--rk-hero-bg2));
    transition: opacity 0.35s ease;
}

.hero--fallback .hero-ambient { opacity: 1; }

.hero-ambient span {
    position: absolute;
    left: 63%;
    top: 50%;
    width: clamp(170px, 22vw, 340px);
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--rk-accent) 35%, transparent);
    transform: translate(-50%, -50%) rotate(45deg);
}
.hero-ambient span:nth-child(1) {
    border-radius: 34% 66% 58% 42%;
    background: color-mix(in srgb, var(--rk-accent) 10%, transparent);
}
.hero-ambient span:nth-child(2) {
    width: clamp(110px, 14vw, 220px);
    border-radius: var(--rk-radius-round);
    transform: translate(-18%, -88%);
}
.hero-ambient span:nth-child(3) {
    width: clamp(55px, 7vw, 110px);
    border-radius: var(--rk-radius-md);
    background: var(--rk-accent-soft);
    transform: translate(75%, 40%) rotate(18deg);
}

/* panneau statut bas-droite */
.hero-signal {
    position: absolute;
    right: clamp(1.5rem, 4vw, 4.5rem);
    bottom: clamp(2rem, 5vh, 4rem);
    z-index: 10;
    width: 190px;
    display: grid;
    gap: 0.45rem;
    padding: 1rem 1.1rem;
    color: var(--rk-ink);
    background: color-mix(in srgb, var(--rk-surface) 78%, transparent);
    border: 1px solid color-mix(in srgb, var(--rk-border) 80%, transparent);
    border-radius: var(--rk-radius-md);
    box-shadow: 0 20px 45px -32px rgba(10, 26, 38, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.hero-signal::before {
    content: "";
    position: absolute;
    top: -1px;
    right: 18px;
    width: 46px;
    height: 2px;
    background: var(--rk-accent);
}
.hero-signal__index,
.hero-signal__status {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.57rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rk-muted);
}
.hero-signal strong {
    font-family: var(--rk-font-display);
    font-size: 0.78rem;
    color: var(--rk-title);
}
.hero-signal__status {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--rk-accent-hover);
}
.hero-signal__status i {
    width: 6px;
    height: 6px;
    border-radius: var(--rk-radius-round);
    background: var(--rk-accent);
    box-shadow: 0 0 0 4px var(--rk-accent-soft);
}

/* petite aura au raccord bas du cadre */
.hero::after {
    content: "";
    position: absolute;
    left: 15%;
    right: 15%;
    bottom: 0;
    height: 180px;
    background:
        radial-gradient(
            ellipse,
            color-mix(in srgb, var(--rk-accent) 12%, transparent) 0%,
            color-mix(in srgb, var(--rk-accent) 4%, transparent) 38%,
            transparent 72%
        );
    filter: blur(35px);
    pointer-events: none;
    z-index: 4;
}

/* ---- copy hero : découpe en escalier 3 paliers + congés concaves (desktop) ----
   Architecture sans marge négative : .hero-copy englobe réellement tout son contenu
   (tag + h1 + description + bouton) et les 3 marches blanches sont alignées du haut
   vers le bas avec height >= 2 * --copy-r pour éviter tout chevauchement de rayons. */
.hero-copy {
    --copy-r: 22px;
    --step1-h: 43px;
    --step1-w: 46%;
    --step2-h: 108px;
    --step2-w: 64%;
    position: absolute;
    left: 0;
    bottom: 0;
    width: max-content;
    max-width: min(640px, 50vw);
    z-index: 10;
    padding: 0.95rem 2.75rem 1.5rem 1.75rem;
    background: transparent;
    isolation: isolate;
}

/* Couche 1 (haut) : palier étroit qui porte le tag "01 // PORTFOLIO" */
.hero-copy__ledge {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--step1-w);
    height: calc(var(--step1-h) + 2px);
    background: var(--rk-bg, #ffffff);
    border-top-right-radius: var(--copy-r);
    z-index: -1;
    pointer-events: none;
}
/* Congé concave entre le bord gauche de .headera et le haut de la couche 1 */
.hero-copy__ledge::before {
    content: "";
    position: absolute;
    left: 0;
    top: calc(-1 * var(--copy-r));
    width: var(--copy-r);
    height: var(--copy-r);
    background: radial-gradient(circle at 100% 0%, transparent var(--copy-r), var(--rk-bg, #ffffff) calc(var(--copy-r) + 0.5px));
}
/* Congé concave à la marche entre la couche 1 et la couche 2 */
.hero-copy__ledge::after {
    content: "";
    position: absolute;
    right: calc(-1 * var(--copy-r));
    bottom: 2px;
    width: var(--copy-r);
    height: var(--copy-r);
    background: radial-gradient(circle at 100% 0%, transparent var(--copy-r), var(--rk-bg, #ffffff) calc(var(--copy-r) + 0.5px));
}

/* Couche 2 (milieu) : palier intermédiaire qui enveloppe "Fullstack / developer." */
.hero-copy__ledge2 {
    position: absolute;
    left: 0;
    top: var(--step1-h);
    width: var(--step2-w);
    height: calc(var(--step2-h) + 2px);
    background: var(--rk-bg, #ffffff);
    border-top-right-radius: var(--copy-r);
    z-index: -1;
    pointer-events: none;
}
/* Repère vertical cyan à gauche du tag (couche 1) */
.hero-copy__ledge2::before {
    content: "";
    position: absolute;
    left: 1.1rem;
    top: calc(-1 * var(--step1-h) + 16px);
    width: 2.5px;
    height: 15px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--rk-accent), #1b88c7);
    box-shadow: 0 0 8px color-mix(in srgb, var(--rk-accent) 45%, transparent);
    pointer-events: none;
}
/* Congé concave à la marche entre la couche 2 et la couche 3 (base) */
.hero-copy__ledge2::after {
    content: "";
    position: absolute;
    right: calc(-1 * var(--copy-r));
    bottom: 2px;
    width: var(--copy-r);
    height: var(--copy-r);
    background: radial-gradient(circle at 100% 0%, transparent var(--copy-r), var(--rk-bg, #ffffff) calc(var(--copy-r) + 0.5px));
}

/* Couche 3 (base) : fond blanc complet sous la description + bouton */
.hero-copy::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--step1-h) + var(--step2-h));
    bottom: 0;
    background: var(--rk-bg, #ffffff);
    border-top-right-radius: var(--copy-r);
    z-index: -1;
    pointer-events: none;
}

/* Congé concave bas-droite raccordant la couche 3 au bord inférieur de .headera */
.hero-copy::after {
    content: "";
    position: absolute;
    right: calc(-1 * var(--copy-r));
    bottom: 0;
    width: var(--copy-r);
    height: var(--copy-r);
    background: radial-gradient(circle at 100% 0%, transparent var(--copy-r), var(--rk-bg, #ffffff) calc(var(--copy-r) + 0.5px));
    pointer-events: none;
}

.hero-eyebrow {
    display: none;
}

.hero-copy h1 {
    position: relative;
    margin: 0;
    padding-right: 1.25rem;
    font-family: "Orbitron", sans-serif;
    font-size: clamp(2.15rem, 3.15vw, 2.85rem);
    font-weight: 800;
    line-height: 0.96;
    letter-spacing: -0.035em;
    color: var(--rk-ink);
}
.hero-copy h1::before {
    content: "01  //  PORTFOLIO";
    display: block;
    margin-bottom: 1.55rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--rk-ink) 58%, transparent);
    -webkit-text-fill-color: color-mix(in srgb, var(--rk-ink) 58%, transparent);
}
.hero-copy h1 > span {
    display: block;
    margin-top: 0.06em;
    margin-left: 0;
    padding-bottom: 0.14em;
    font-family: "League Spartan", sans-serif;
    font-size: 1.08em;
    font-weight: 700;
    line-height: 0.96;
    letter-spacing: -0.035em;
    background: linear-gradient(96deg, #0f3047 0%, #196b9c 46%, #3fc5ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    max-width: min(500px, 40vw);
    margin-top: 1.55rem;
    font-family: "League Spartan", sans-serif;
    font-size: clamp(1rem, 1.1vw, 1.1rem);
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0.005em;
    color: color-mix(in srgb, var(--rk-ink) 78%, transparent);
}

.hero--btn {
    display: flex;
    align-items: center;
    margin-top: 1.25rem;
}
.hero--btn .continue {
    position: relative;
    display: grid;
    grid-template-columns: 42px max-content;
    align-items: center;
    gap: 12px;
    padding: 0.35rem 1.5rem 0.35rem 0.35rem;
    border: 1px solid color-mix(in srgb, var(--rk-accent) 35%, transparent);
    border-radius: var(--rk-radius-sm);
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--rk-accent) 95%, transparent),
            color-mix(in srgb, var(--rk-accent-hover) 95%, transparent));
    color: #ffffff;
    font-family: "League Spartan", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    box-shadow:
        0 8px 30px color-mix(in srgb, var(--rk-accent) 18%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
}
.hero--btn .continue:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--rk-accent) 75%, transparent);
    box-shadow:
        0 12px 40px color-mix(in srgb, var(--rk-accent) 32%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.hero--btn .continue:active { transform: translateY(0); }

.recta--lefta {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rk-radius-sm);
    background: rgba(5, 25, 35, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background 250ms ease, transform 250ms ease;
}
.hero--btn .continue:hover .recta--lefta {
    transform: translateX(3px);
    background: rgba(5, 25, 35, 0.75);
}
.recta--lefta svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
}

@media (max-width: 900px) {
    .hero { min-height: 620px; }
    .hero-signal { display: none; }
    .hero-copy {
        left: 1.5rem;
        bottom: 5rem;
        width: calc(100% - 3rem);
        padding: 1rem;
    }
    .hero-copy::after { display: none; }
    .hero-copy h1 { font-size: clamp(2.2rem, 9vw, 3.5rem); line-height: 1; }
    .hero-description { max-width: 500px; font-size: 1rem; }
}

@media (max-width: 560px) {
    .hero-copy { left: 1rem; bottom: 3rem; width: calc(100% - 2rem); padding: 0.5rem; }
    .hero-eyebrow { font-size: 0.6rem; letter-spacing: 0.16em; }
    .hero-copy h1 { font-size: clamp(2rem, 11vw, 3rem); }
    .hero-description { margin-top: 1.1rem; font-size: 0.95rem; line-height: 1.45; }
    .hero--btn { margin-top: 1.4rem; }
}

/* mobile + tablette : .container est position:absolute → sa grille
   se shrink-wrappe au contenu et peut être plus etroite (ou plus
   large) que le viewport. On la cale sur la largeur ecran pour que
   .hero remplisse reellement 100% de la largeur. */
@media (max-width: 1050px) {
    .container { width: 100vw; }
    .hero { width: 100vw; justify-self: start; }
}

/* tablette : inset réduit du cadre (base = 4rem/2rem → trop serré
   entre 901 et 1050px) */
@media (min-width: 901px) and (max-width: 1050px) {
    .hero .headera {
        margin-left: 1.25rem;
        margin-right: 1.25rem;
        margin-top: 1rem;
        height: calc(100% - 2rem);
    }
}

/* mobile : copy en glass card pendante */
@media (max-width: 900px) {
    .hero,
    .hero .headera {
        overflow: visible;
        margin-bottom: calc(max(155px, 25svh) + 1.5rem) !important;
    }
    /* cadre quasi plein écran : 4rem de marge latérale ne laissait
       qu'un ruban de ~60% de large sur mobile */
    .hero .headera {
        margin-left: 0.6rem;
        margin-right: 0.6rem;
        margin-top: 0.6rem;
        height: calc(100% - 1.2rem);
    }
    .hero-notch {
        --notch-r: 15px;
        width: 78px;
        height: 50px;
    }
    .logo {
        top: calc(0.6rem + 5px);
        left: calc(0.6rem + 18px);
    }
    .flexa {
        top: calc(0.6rem + 5px);
        right: calc(0.6rem + 19px);
    }
    .hero-fade { left: 0; right: 0; }
    .hero-copy__ledge,
    .hero-copy__ledge2,
    .hero-copy::before,
    .hero-copy::after {
        display: none;
    }
    .hero-copy {
        left: 12px;
        right: 12px;
        bottom: -22%;
        width: auto;
        max-width: none;
        padding: 1.25rem 1.2rem 1.3rem;
        background: linear-gradient(180deg,
            color-mix(in srgb, var(--rk-surface, #ffffff) 62%, transparent),
            color-mix(in srgb, var(--rk-surface, #ffffff) 82%, transparent));
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border: 1px solid var(--rk-border);
        border-radius: var(--rk-radius-md);
        box-shadow: 0 18px 50px rgba(10, 26, 38, 0.12);
    }
    .hero-eyebrow { margin-top: 0; margin-bottom: 0.8rem; font-size: 0.58rem; letter-spacing: 0.18em; }
    .hero-copy h1 { margin-top: 0; padding-right: 0; font-size: clamp(1.45rem, 6.6vw, 2.1rem); line-height: 1.05; white-space: normal; }
    .hero-copy h1::before { margin-bottom: 0.75rem; font-size: 0.58rem; letter-spacing: 0.18em; }
    .hero-copy h1 > span { margin-left: 0; }
    .hero-description { margin-top: 0.7rem; font-size: 0.95rem; line-height: 1.45; white-space: normal; }
    .hero--btn { margin-top: 1.05rem; }
}

@media (max-height: 620px) {
    .hero { min-height: 420px; }
    .headera { margin-top: 0.75rem; height: calc(100% - 1.5rem); }
    .hero-eyebrow { margin-bottom: 0.6rem; font-size: 0.58rem; letter-spacing: 0.18em; }
    .hero-copy h1 { font-size: clamp(1.5rem, calc(3svh + 1.6vw), 2.75rem); }
    .hero-description { margin-top: 0.75rem; font-size: 0.92rem; line-height: 1.45; }
    .hero--btn { margin-top: 0.9rem; }
    .hero-signal { display: none; }
}
@media (max-height: 620px) and (min-width: 901px) {
    .hero-copy { bottom: 0; padding: 0.5rem 1.5rem 1rem; }
}

/* ============================ MENU DRAWER ============================ */

/* bouton burger 3 barres asymétriques (ex .menu--right) */
.menu--right {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--rk-ink);
    background: color-mix(in srgb, var(--rk-surface) 80%, transparent);
    border: 0;
    border-radius: var(--rk-radius-sm);
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: box-shadow 0.2s ease, background 0.2s ease;
}
.menu--right:hover {
    box-shadow: 0 4px 14px rgba(10, 26, 38, 0.08);
}

.menu--right-lines,
.menu--right-lines::before,
.menu--right-lines::after {
    width: 19px;
    height: 2px;
    display: block;
    border-radius: var(--rk-radius-pill);
    background: currentColor;
    transition: transform 0.22s ease, width 0.22s ease;
}
.menu--right-lines { position: relative; }
.menu--right-lines::before,
.menu--right-lines::after {
    content: "";
    position: absolute;
    right: 0;
}
.menu--right-lines::before { top: -6px; width: 12px; }
.menu--right-lines::after { top: 6px; width: 15px; }
.menu--right:hover .menu--right-lines::before,
.menu--right:hover .menu--right-lines::after { width: 19px; }

/* morph en croix quand ouvert */
.menu--right.is-open .menu--right-lines { transform: rotate(45deg); }
.menu--right.is-open .menu--right-lines::before {
    transform: translateY(6px) rotate(-90deg);
    width: 19px;
}
.menu--right.is-open .menu--right-lines::after {
    transform: translateY(-6px) rotate(90deg);
    width: 19px;
}

/* panneau coulissant droit */
.hero--menu--2-col {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    justify-content: flex-end;
    visibility: hidden;
    pointer-events: none;
}
.hero--menu--2-col.show {
    visibility: visible;
    pointer-events: auto;
}
.menu-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    background: rgba(10, 26, 38, 0.18);
    opacity: 0;
    cursor: pointer;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: opacity 0.25s ease;
}
.hero--menu--2-col.show .menu-backdrop { opacity: 1; }

.menu-panel {
    position: relative;
    z-index: 1;
    width: min(360px, calc(100vw - 1rem));
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--rk-surface, #fff);
    border-left: 1px solid var(--rk-border);
    border-radius: var(--rk-radius-md) 0 0 var(--rk-radius-md);
    box-shadow: -24px 0 70px rgba(10, 26, 38, 0.12);
    transform: translateX(100%);
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero--menu--2-col.show .menu-panel { transform: translateX(0); }

.menu-panel__header {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem 0 1.15rem;
    border-bottom: 1px solid var(--rk-border);
}
.menu-panel__brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--rk-title);
    font-family: var(--rk-font-display);
    font-size: 0.92rem;
    font-weight: 800;
}
.menu-panel__brand-mark {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
}
.menu-panel__brand-mark img { width: 29px; height: auto; max-height: 29px; object-fit: contain; }

.menu-panel__close {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--rk-muted);
    background: transparent;
    border: 1px solid var(--rk-border);
    border-radius: var(--rk-radius-sm);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.menu-panel__close:hover {
    color: var(--rk-ink);
    background: var(--rk-accent-soft);
    border-color: var(--rk-accent);
}

.menu-panel__content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    scrollbar-width: thin;
}
.menu-panel__section-label {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--rk-muted);
    padding: 0.4rem 0.7rem 0.6rem;
}
.menu-panel__nav { display: grid; gap: 0.2rem; }

.menu-panel__item {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0 0.7rem;
    color: var(--rk-ink);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--rk-radius-sm);
    border-left: 2px solid transparent;
    font-family: var(--rk-font-body);
    font-size: 0.86rem;
    font-weight: 650;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    opacity: 1;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.menu-panel__item:hover,
.menu-panel__item.is-active {
    background: var(--rk-accent-soft);
    border-left-color: var(--rk-accent);
    color: var(--rk-ink);
}
.menu-panel__item:hover { transform: translateX(3px); }

/* actif (scroll-spy) ≠ survol : icône remplie accent, contour accent
   complet, label accentué — l'état persiste tant que la section est
   dans la bande centrale du viewport */
.menu-panel__item.is-active {
    border-color: color-mix(in srgb, var(--rk-accent) 30%, var(--rk-border));
    color: var(--rk-accent-hover);
    font-weight: 750;
}
.menu-panel__item.is-active .menu-panel__item-icon {
    color: #fff;
    background: var(--rk-accent);
    border-color: var(--rk-accent);
}
.menu-panel__item.is-active .menu-panel__item-arrow {
    color: var(--rk-accent-hover);
}

.menu-panel__item-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--rk-muted);
    background: var(--rk-shell);
    border: 1px solid var(--rk-border);
    border-radius: var(--rk-radius-sm);
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.menu-panel__item-icon svg { width: 15px; height: 15px; }
.menu-panel__item:hover .menu-panel__item-icon,
.menu-panel__item.is-active .menu-panel__item-icon {
    color: var(--rk-accent-hover);
    background: var(--rk-surface);
    border-color: color-mix(in srgb, var(--rk-accent) 35%, var(--rk-border));
}

.menu-panel__item-arrow {
    margin-left: auto;
    color: var(--rk-muted);
    font-size: 0.8rem;
    transition: transform 0.18s ease, color 0.18s ease;
}
.menu-panel__item:hover .menu-panel__item-arrow {
    transform: translate(2px, -2px);
    color: var(--rk-accent-hover);
}

.menu-panel__separator {
    height: 1px;
    margin: 0.9rem 0.35rem;
    background: var(--rk-border);
}

/* ============================ PORTFOLIO : SCROLL SECTION =============
   verbatim RECKLESS-CUP project-scroll.css — section 3D carrousel */

.scroll-section {
    position: relative;
    width: min(1440px, calc(100% - 3rem));
    height: min(82svh, 860px);
    min-height: 620px;
    margin: 0 auto 6rem;
    overflow: visible;
    background: var(--rk-bg);
    box-shadow: 0 0 80px 44px var(--rk-bg);
    isolation: isolate;
}

.scroll-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* meme recette que .home-services::before — grille technique fondue
   aux 4 contours */
.scroll-section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
    transition: opacity 0.5s ease;
    background-image:
        linear-gradient(var(--rk-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--rk-grid-line) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 90% 82% at 50% 46%, #000 48%, rgba(0, 0, 0, 0.55) 72%, transparent 96%);
    mask-image: radial-gradient(ellipse 90% 82% at 50% 46%, #000 48%, rgba(0, 0, 0, 0.55) 72%, transparent 96%);
}

.scroll-glow {
    position: absolute;
    inset: -20% -10% -8%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(0, 32%, 0) scale(0.55);
    transform-origin: 50% 100%;
    background: radial-gradient(ellipse 56% 52% at 50% 100%, rgba(63, 197, 255, 0.18), transparent 72%);
    background: radial-gradient(ellipse 56% 52% at 50% 100%, color-mix(in srgb, var(--rk-accent) 18%, transparent), transparent 72%);
    will-change: opacity, transform;
}

#webgl {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    -webkit-mask-image: radial-gradient(ellipse 105% 100% at 50% 47%, #000 60%, rgba(0, 0, 0, 0.72) 78%, transparent 100%);
    mask-image: radial-gradient(ellipse 105% 100% at 50% 47%, #000 60%, rgba(0, 0, 0, 0.72) 78%, transparent 100%);
    transition: -webkit-mask-image 0.35s ease, mask-image 0.35s ease;
}

.scroll-edges {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.scroll-edge {
    position: absolute;
    display: block;
    backdrop-filter: blur(18px) saturate(1.04);
    -webkit-backdrop-filter: blur(18px) saturate(1.04);
}
.scroll-edge--left,
.scroll-edge--right {
    top: 0;
    bottom: 0;
    width: clamp(76px, calc(11vw), 160px);
}
.scroll-edge--left {
    left: 0;
    background: linear-gradient(90deg, var(--rk-bg) 0%, rgba(255, 255, 255, 0.86) 28%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.84) 42%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.84) 42%, transparent 100%);
}
.scroll-edge--right {
    right: 0;
    background: linear-gradient(270deg, var(--rk-bg) 0%, rgba(255, 255, 255, 0.86) 28%, transparent 100%);
    -webkit-mask-image: linear-gradient(270deg, #000 0%, rgba(0, 0, 0, 0.84) 42%, transparent 100%);
    mask-image: linear-gradient(270deg, #000 0%, rgba(0, 0, 0, 0.84) 42%, transparent 100%);
}
.scroll-edge--top,
.scroll-edge--bottom {
    left: 0;
    right: 0;
    height: clamp(66px, 10vh, 108px);
}
.scroll-edge--top {
    top: 0;
    background: linear-gradient(180deg, var(--rk-bg) 0%, rgba(255, 255, 255, 0.8) 28%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.82) 44%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.82) 44%, transparent 100%);
}
.scroll-edge--bottom {
    bottom: 0;
    background: linear-gradient(0deg, var(--rk-bg) 0%, rgba(255, 255, 255, 0.88) 32%, transparent 100%);
    -webkit-mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.84) 46%, transparent 100%);
    mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.84) 46%, transparent 100%);
}

/* fade bas dans la couleur de page : assoit le halo de la caption —
   le preview reste clair comme le site */
.scroll-section::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    background:
        linear-gradient(
            to top,
            color-mix(in srgb, var(--rk-bg) 62%, transparent) 0%,
            transparent 34%
        );
}

.scroll-section.is-card-focus::after { opacity: 1; }
.scroll-section.is-card-focus::before { opacity: 0; }
.scroll-section.is-card-focus #webgl {
    -webkit-mask-image: none;
    mask-image: none;
}
.scroll-section.is-card-focus .scroll-edges { opacity: 0; }
.scroll-section.is-card-focus .scroll-outro { opacity: 0 !important; }

/* SCROLL OUTRO — message narratif de fin de pin (le reveal est piloté
   par progress dans updateCards) */
.scroll-outro {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(18px, 4.5vh, 48px);
    width: min(640px, calc(100% - 48px));
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    text-align: center;
    pointer-events: none;
    z-index: 2;
}
.scroll-outro__eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--rk-accent);
}
.scroll-outro__text {
    margin: 0;
    font-family: "League Spartan", sans-serif;
    font-size: clamp(1.05rem, calc(1.8vw), 1.4rem);
    font-weight: 600;
    line-height: 1.45;
    color: #1d4155;
    text-wrap: balance;
}
.scroll-outro__line {
    width: 64px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--rk-accent, #b82121), transparent);
}

/* HEADER masqué en mode focus — .flexa est notre équivalent fixe
   du .hero--header RECKLESS */
.flexa {
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
body.is-focus .flexa {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* CLOSE BUTTON (fixed : au-dessus de tout, sans bordure bleue) */
.focus-close {
    position: fixed;
    top: clamp(18px, 2.6vw, 28px);
    right: clamp(18px, 2.6vw, 28px);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(10, 26, 38, 0.08);
    border-radius: var(--rk-radius-round, 50%);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 28px rgba(10, 26, 38, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--rk-ink);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.86);
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.3s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
    z-index: 100001;
}
:root[data-theme='dark'] .focus-close {
    background: rgba(22, 32, 43, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
}
.focus-close.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1);
}
.focus-close:hover {
    background: var(--rk-surface);
    box-shadow: 0 14px 34px rgba(10, 26, 38, 0.18);
    transform: scale(1.06);
}
.focus-close:active { transform: scale(0.96); }
.focus-close svg { width: 18px; height: 18px; }

/* FOCUS CAPTION — carte narrative verre épurée (sans bordure bleue) */
.focus-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(18px, 3vh, 32px);
    width: min(92%, 720px);
    margin-inline: auto;
    display: grid;
    justify-items: start;
    gap: 8px;
    padding: clamp(18px, 2.2vw, 24px) clamp(22px, 3vw, 34px);
    text-align: left;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px) saturate(1.15);
    -webkit-backdrop-filter: blur(24px) saturate(1.15);
    border: 1px solid rgba(10, 26, 38, 0.07);
    border-radius: 20px;
    box-shadow:
        0 24px 60px rgba(10, 26, 38, 0.18),
        0 4px 14px rgba(10, 26, 38, 0.06);
    overflow: hidden;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(18px);
    transition:
        opacity 0.4s ease,
        visibility 0.4s ease,
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
:root[data-theme='dark'] .focus-caption {
    background: rgba(18, 27, 38, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
}
.focus-caption.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.focus-caption__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--rk-accent-hover);
}
.focus-caption__eyebrow::before {
    content: '';
    width: 24px;
    height: 2px;
    border-radius: 999px;
    background: var(--rk-accent);
}
.focus-caption strong {
    display: block;
    margin: 0;
    font-family: var(--rk-font-body);
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--rk-ink);
}
.focus-caption p {
    margin: 0;
    max-width: 68ch;
    font-family: var(--rk-font-body);
    font-size: clamp(0.92rem, 1.1vw, 1.02rem);
    line-height: 1.6;
    font-weight: 400;
    color: var(--rk-muted);
    text-wrap: pretty;
}

/* ============================ TITRES (tn-*, porté de RECKLESS) ======
======                                                                     eyebrow mono accent + display Orbitron 900 — remplace l'ancien
   .title/.titre générique */

.tn-head {
    display: grid;
    justify-items: center;
    text-align: center;
    /* l'ancien .titre impose width: fit-content — le titre se
       compressait à ~min-content (un mot par ligne) sur mobile */
    width: min(100%, 46rem);
    margin-inline: auto;
    margin-bottom: clamp(2rem, 5vw, 4rem);
    /* neutralise le line-height: 32px hérité de l'ancien .titre */
    line-height: 1.2;
}
.tn-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--rk-accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3em;
}
.tn-eyebrow::before {
    content: '';
    width: 42px;
    height: 2px;
    background: var(--rk-accent);
}
.tn-title {
    margin: 1.25rem 0 0;
    font-family: var(--rk-font-display);
    font-size: clamp(2rem, 8vw, 6rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.045em;
    color: var(--rk-title);
    /* neutralise l'ancien .title générique (padding-top: 5rem,
       padding-left: 10px en mobile ≤625px) */
    padding: 0;
    z-index: auto;
}
.tn-title::before { content: none; }

/* ============================ SCROLLTRIGGER PIN ======================
======                                                                     quand ST pin une section dans .container (grid), le pin-spacer hérite
   d'aucun grid-column : il doit respanner toute la grille */
.container .pin-spacer {
    grid-column: 1 / -1;
    width: 100%;
}

/* ============ ARE YOU READY — section CTA (porté de are-ready.css) ==
   fond raymarché WebGL, overlay centré, un seul CTA glass ============ */

.ready {
    position: relative;
    height: clamp(380px, 55svh, 520px);
    z-index: 2;
    isolation: isolate;
    grid-column: 1 / -1;
    margin: 4rem 0;
}

.ready__frame {
    position: relative;
    width: 100%;
    height: 100%;
    margin-inline: auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #04050a;
}
.ready__frame--no-gl {
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(37, 99, 235, 0.35), transparent 70%),
        #04050a;
}

@media (min-width: 1051px) {
    .ready {
        height: clamp(460px, 62svh, 640px);
        margin-top: 2rem;
        padding-inline: 2rem;
    }
    .ready__frame {
        border-radius: var(--rk-radius-md, 16px);
    }
}

/* canvas dimensionné sur le viewport et centré : le frame le clippe en
   s'élargissant — il ne se rescale jamais, aucun glitch de buffer */
.ready__canvas {
    position: absolute;
    top: 0;
    left: 50%;
    width: 100vw;
    height: 100%;
    transform: translateX(-50%);
    display: block;
}

.ready__content {
    position: relative;
    z-index: 2;
    display: grid;
    justify-items: center;
    gap: 1.4rem;
    text-align: center;
    padding: 2rem 1.25rem;
    pointer-events: none;
}

/* scrim radial : le texte reste lisible au-dessus du prisme */
.ready__content::before {
    content: '';
    position: absolute;
    inset: -18% -30%;
    z-index: -1;
    background: radial-gradient(ellipse at center,
        rgba(2, 4, 12, 0.62) 0%,
        rgba(2, 4, 12, 0.3) 45%,
        transparent 72%);
    filter: blur(6px);
    pointer-events: none;
}

.ready__tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    color: color-mix(in srgb, var(--rk-accent) 75%, #ffffff);
    text-shadow: 0 0 24px color-mix(in srgb, var(--rk-accent) 60%, transparent);
}

.ready__title {
    margin: 0;
    font-family: var(--rk-font-display);
    font-size: clamp(2.6rem, 10vw, 8rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.35))
            drop-shadow(0 0 90px color-mix(in srgb, var(--rk-accent) 45%, transparent));
    animation: readyGlow 3.5s ease-in-out infinite alternate;
}

.ready__word {
    display: inline-block;
    white-space: nowrap;
}
.ready__word + .ready__word {
    margin-left: 0.3em;
}

/* masques par lettre pour le reveal GSAP */
.ready__ch {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding-bottom: 0.08em;
    margin-bottom: -0.08em;
}
.ready__ch-in {
    display: inline-block;
    will-change: transform;
    background: linear-gradient(180deg, #ffffff 0%, #dfe6f2 55%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

@keyframes readyGlow {
    from {
        filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.35))
                drop-shadow(0 0 90px color-mix(in srgb, var(--rk-accent) 45%, transparent));
    }
    to {
        filter: drop-shadow(0 0 60px rgba(255, 255, 255, 0.55))
                drop-shadow(0 0 130px color-mix(in srgb, var(--rk-accent) 65%, transparent));
    }
}

.ready__tagline {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.75rem, calc(1.6vw), 1rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
}

/* message de fin de hold : révélé en scrub pendant le temps mort du
   pin, collé en bas interne du frame */
.ready__hint {
    position: absolute;
    bottom: clamp(0.7rem, 2.5vh, 1.2rem);
    inset-inline: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    text-shadow: 0 0 18px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}
.ready__hint-arrow {
    width: 0.85em;
    height: 0.85em;
    flex: none;
    animation: readyHintBob 1.8s ease-in-out infinite;
}
@keyframes readyHintBob {
    0%, 100% { transform: translateY(-1px); opacity: 0.45; }
    50% { transform: translateY(2px); opacity: 1; }
}

/* ---- bouton glass unique ---- */
.ready__btn {
    position: relative;
    margin-top: 1.2rem;
    padding: 16px 42px;
    font-family: var(--rk-font-body);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(9, 16, 24, 0.72); /* base opaque : si le backdrop-filter
            échoue (GPU faible → blur échantillonne le canvas en noir),
            le pill reste lisible */
    border: 1.5px solid transparent;
    border-radius: var(--rk-radius-pill, 999px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.5s;
    pointer-events: auto;
}

/* bordure conique animée */
.ready__btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--rk-radius-pill, 999px);
    padding: 1.5px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.4) 0%,
        color-mix(in srgb, var(--rk-accent) 55%, transparent) 30%,
        rgba(0, 191, 255, 0.4) 55%,
        rgba(255, 105, 180, 0.35) 80%,
        rgba(255, 255, 255, 0.4) 100%);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: readyBorderFlow 3s linear infinite;
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

@keyframes readyBorderFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* halo radial qui suit le curseur */
.ready__btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--rk-radius-pill, 999px);
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%),
        rgba(255, 255, 255, 0.2) 0%,
        transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.ready__btn:hover {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05)),
        rgba(9, 16, 24, 0.78);
    box-shadow:
        0 12px 48px color-mix(in srgb, var(--rk-accent) 40%, transparent),
        0 0 80px rgba(0, 191, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-3px) scale(1.02);
}
.ready__btn:hover::before { opacity: 1; animation-duration: 2s; }
.ready__btn:hover::after { opacity: 1; }
.ready__btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow:
        0 6px 24px color-mix(in srgb, var(--rk-accent) 30%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.ready__btn:focus-visible {
    outline: 2px solid var(--rk-accent);
    outline-offset: 4px;
}
.ready__btn span { position: relative; z-index: 1; }

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .ready__btn { backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); }
}

.ready__shimmer {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 45%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.1) 55%,
        transparent 100%);
    transform: rotate(30deg);
    animation: readyShimmer 3s infinite;
    pointer-events: none;
}

@keyframes readyShimmer {
    0% { transform: translateX(-100%) rotate(30deg); }
    100% { transform: translateX(100%) rotate(30deg); }
}

.ready__btn:hover .ready__shimmer { animation-duration: 1.5s; }

@media (max-width: 768px) {
    .ready__title { font-size: clamp(2.2rem, 12vw, 4rem); }
    .ready__tagline { letter-spacing: 0.2em; }
    .ready__btn { margin-top: 0.3rem; padding: 14px 32px; font-size: 0.95rem; }
    .ready__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ready__title,
    .ready__btn::before,
    .ready__hint-arrow,
    .ready__shimmer { animation: none; }
}

/* écrans courts (<= ~620px de haut) : la bande tient dans le viewport */
@media (max-height: 620px) {
    .ready { height: clamp(300px, 80svh, 460px); }
    .ready__content { gap: 0.85rem; padding: 1rem 1.25rem; }
    .ready__tag { font-size: 0.62rem; letter-spacing: 0.3em; }
    .ready__title { font-size: clamp(1.75rem, min(10vw, 12svh), 4.5rem); }
    .ready__tagline { letter-spacing: 0.22em; }
    .ready__btn { margin-top: 0.5rem; padding: 12px 30px; font-size: 0.9rem; }
    .ready__hint { display: none; }
}

/* ============================ SERVICES / SLIDE 3D ====================
======== */

.services {
    grid-column: 1 / -1;
    margin: 5rem 0;
    /* neutralise l'ancien grid 3x20rem de services.css */
    display: block;
    position: relative;
    width: 100%;
}

/* grille technique sur la section services (porté de Home.css) */
.home-services {
    isolation: isolate;
}
.home-services::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.55;
    background-image:
        linear-gradient(var(--rk-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--rk-grid-line) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 78%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 78%, transparent);
}

/* watermark titre au-dessus (ex RevealTitle) */
.titra {
    font-family: var(--rk-font-display);
    font-size: clamp(1.9rem, 6.5vw, 3.9rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: var(--rk-title);
    text-align: center;
}
.titre--rk {
    display: grid;
    justify-content: center;
    padding-bottom: 2rem;
    margin-bottom: 0;
    width: 100%;
}
/* reveal masque generique (porté de Home.css RECKLESS) : sans ces
   règles les .reveal-in ne sont ni clippés ni correctement cachés */
.reveal-mask {
    display: block;
    overflow: hidden;
}
.reveal-in {
    display: block;
    will-change: transform, opacity;
}

/* variante mot-à-mot : l'espace entre deux masques reste wrappable ;
   le padding bas préserve les descendants des glyphes pendant la montée */
.reveal-mask--w {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    padding-bottom: 0.14em;
    margin-bottom: -0.14em;
}
.reveal-mask--w .reveal-in {
    display: inline-block;
}

.titre--rk .reveal-mask {
    width: max-content;
    max-width: 320px;
    justify-self: center;
}
@media (min-width: 640px) {
    .titre--rk .reveal-mask { max-width: 100%; }
}

/* layout slide (ex Tailwind lg:grid-cols) */
.slide--xd {
    position: relative;
    display: grid;
    gap: 2.5rem;
    align-items: center;
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: 1.25rem;
    box-sizing: border-box;
}
@media (min-width: 1024px) {
    .slide--xd {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: clamp(3.5rem, 6vw, 6rem);
        row-gap: 2rem;
        padding-inline: 2.5rem;
    }
}

.slide__side {
    display: grid;
    gap: 1.35rem;
    justify-items: center;
    text-align: center;
}
@media (min-width: 1024px) {
    .slide__side {
        gap: 1.85rem;
        justify-items: start;
        text-align: left;
    }
}

.introo {
    display: grid;
    gap: 0.2rem;
}
.introo__text {
    font-family: var(--rk-font-display);
    font-size: clamp(1.5rem, 3.6vw, 2.35rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-align: center;
    color: var(--rk-title);
}
@media (min-width: 1024px) {
    .slide__side .introo__text { text-align: left; }
}
.introo__text--accent { color: var(--rk-accent); }

.texta {
    font-family: var(--rk-font-body);
    color: var(--rk-muted);
    font-size: clamp(1rem, 1.25vw, 1.12rem);
    line-height: 1.65;
}
.slide__body { max-width: 38ch; margin: 0; }

/* liste services : segmented control mobile -> cartes espacées desktop */
.slide__services {
    display: inline-flex;
    flex-wrap: nowrap;
    margin-inline: auto;
    margin-top: 0.35rem;
    overflow: hidden;
    border: 1px solid var(--rk-border);
    border-radius: 14px;
    background: var(--rk-surface);
    box-shadow: 0 2px 8px rgba(10, 26, 38, 0.05);
}
.slide__service {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    transition: background 0.25s ease;
}
.slide__service:focus-visible {
    outline: 2px solid var(--rk-accent);
    outline-offset: -2px;
}
.slide__service + .slide__service {
    border-left: 1px solid var(--rk-border);
}
.slide__service.is-active { background: var(--rk-accent-soft); }

.slide__service-icon {
    display: grid;
    place-items: center;
    color: var(--rk-muted);
}
.slide__service-icon svg { width: 19px; height: auto; }
.slide__service.is-active .slide__service-icon { color: var(--rk-accent-hover); }

/* mobile : icônes seules */
.slide__service-text { display: none; }
.slide__service-desc { display: none; }

@media (min-width: 1024px) {
    .slide__services {
        display: flex;
        gap: 2.75rem;
        width: 100%;
        padding: 0.35rem 0;
        margin-inline: 0;
        margin-top: 0.5rem;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .slide__service {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0;
        color: var(--rk-muted);
        transition: color 0.3s ease;
    }
    .slide__service + .slide__service { border-left: 0; }
    .slide__service:hover { color: var(--rk-title); }
    .slide__service.is-active {
        background: transparent;
        color: var(--rk-accent-hover);
        transform: none;
        box-shadow: none;
    }
    .slide__service-icon { color: inherit; }
    .slide__service-icon svg { width: 26px; }
    .slide__service.is-active .slide__service-icon { color: var(--rk-accent-hover); }
    .slide__service-text { display: grid; gap: 2px; text-align: left; }
    .slide__service-name {
        font-family: var(--rk-font-display);
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: inherit;
        white-space: nowrap;
    }
    /* dot sous l'icône : gris -> gradient accent quand actif */
    .slide__service::after {
        content: '';
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--rk-border);
        margin-top: -0.05rem;
        transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    }
    .slide__service.is-active::after {
        background: radial-gradient(circle at 35% 30%, var(--rk-accent), var(--rk-accent-hover));
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--rk-accent) 18%, transparent),
                    0 0 10px color-mix(in srgb, var(--rk-accent) 45%, transparent);
        transform: scale(1.15);
    }
}

/* colonne droite : visuel circulaire */
.slide__visual {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
}
@media (min-width: 1024px) {
    .slide__visual {
        grid-column: 2;
        grid-row: 1;
    }
}

.svg-wrap {
    position: relative;
    display: grid;
    justify-content: center;
    align-items: center;
    justify-self: center;
    width: 100%;
    height: min(330px, 78vw);
}
@media (min-width: 1024px) {
    .svg-wrap { width: 420px; height: 420px; }
}

/* slides webgl empilés */
.slide-view {
    position: absolute;
    inset: 0;
    margin: auto;
    width: min(310px, 72vw);
    height: min(310px, 72vw);
    display: grid;
    overflow: hidden;
    transform-origin: 0% 0%;
}
@media (min-width: 1024px) {
    .slide-view { width: 380px; height: 380px; }
}

.imgyy {
    width: min(310px, 72vw);
    height: min(310px, 72vw);
    border-radius: 50%;
    background-position: center;
    background-size: cover;
    background:
        radial-gradient(circle at 14% 82%, color-mix(in srgb, var(--rk-accent) 5%, transparent), transparent 18%),
        linear-gradient(135deg, transparent 56%, color-mix(in srgb, var(--rk-accent) 4%, transparent) 56.2%, transparent 72%),
        linear-gradient(45deg, transparent 68%, color-mix(in srgb, var(--rk-surface) 26%, transparent) 68.2%, transparent 82%),
        radial-gradient(circle at 50% 62%, color-mix(in srgb, var(--rk-accent) 9%, transparent), color-mix(in srgb, var(--rk-accent) 3%, transparent) 58%, transparent 72%);
}
@media (min-width: 1024px) {
    .imgyy { width: 380px; height: 380px; }
}
.imgyy canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* anneau SVG pointillé rotatif */
.slide-ring {
    position: absolute;
    inset: 0;
    margin: auto;
    width: min(330px, 76vw);
    height: min(330px, 76vw);
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    display: grid;
}
@media (min-width: 1024px) {
    .slide-ring { width: 420px; height: 420px; }
}
.slide-ring svg { width: 100%; height: 100%; }
.slide-ring .rk-ring-rect { fill: none; stroke: var(--rk-border); stroke-width: 1px; stroke-miterlimit: 10; }
.slide-ring .rk-ring-arc { fill: none; stroke: var(--rk-accent); stroke-width: 3px; stroke-miterlimit: 10; }
.slide-ring .rk-ring-g { opacity: 0.34; }

/* caption */
.slide-caption {
    z-index: 6;
    width: min(88%, 360px);
    min-height: 3.4rem;
    margin-inline: auto;
    padding: 0.35rem 1rem;
    text-align: center;
    pointer-events: none;
    justify-self: center;
    background: radial-gradient(ellipse 78% 105% at 50% 50%,
        color-mix(in srgb, var(--rk-bg, #ffffff) 94%, transparent) 0%,
        color-mix(in srgb, var(--rk-bg, #ffffff) 55%, transparent) 55%,
        transparent 80%);
}
.slide-caption__inner {
    display: grid;
    gap: 4px;
    animation: slide-caption-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.slide-caption strong {
    font-family: "Orbitron", sans-serif;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rk-accent-hover);
}
.slide-caption span {
    font-family: "League Spartan", sans-serif;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--rk-title);
}
@keyframes slide-caption-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .slide-caption__inner { animation: none; }
}
@media (min-width: 1024px) {
    .slide-caption {
        text-align: center;
        margin-inline: auto;
        padding: 0;
        background: none;
        width: 100%;
        max-width: 380px;
        grid-column: 2;
        grid-row: 2;
        align-self: start;
        justify-self: center;
    }
}

/* ============================ DARK OVERRIDES ============================ */

:root[data-theme='dark'] .menu-backdrop { background: rgba(2, 6, 10, 0.45); }
:root[data-theme='dark'] .hero-fade {
    background:
        radial-gradient(ellipse at 50% 100%,
            color-mix(in srgb, var(--rk-accent) 20%, transparent) 0%,
            color-mix(in srgb, var(--rk-accent) 9%, transparent) 28%,
            transparent 55%),
        linear-gradient(to bottom,
            transparent 0%,
            color-mix(in srgb, var(--rk-hero-bg2) 55%, transparent) 55%,
            var(--rk-hero-bg2) 100%);
}
:root[data-theme='dark'] .menu-panel,
:root[data-theme='dark'] .hero-signal { box-shadow: -24px 0 70px rgba(0, 0, 0, 0.5); }
:root[data-theme='dark'] .story__frame { box-shadow: 0 0 72px 26px rgba(6, 10, 16, 0.85); }
:root[data-theme='dark'] .story__img {
    filter: drop-shadow(0 0 16px rgba(10, 16, 24, 0.9)) drop-shadow(0 0 46px rgba(10, 16, 24, 0.7));
}

/* ============================ STORY ============================ */

.story {
    grid-column: 1 / -1;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(56px, 8svh, 80px) clamp(20px, 6vw, 96px) clamp(40px, 6svh, 72px);
    overflow: hidden;
    background:
        radial-gradient(circle at 25% 62%, color-mix(in srgb, var(--rk-accent) 8%, transparent), transparent 38%),
        var(--rk-bg);
}
.story::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.55;
    background-image:
        linear-gradient(var(--rk-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--rk-grid-line) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
}

.story__head {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}
.story__eyebrow,
.story__kicker,
.story__visual-label {
    font-family: var(--rk-font-display);
    text-transform: uppercase;
}
.story__eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--rk-muted);
}
.story__counter {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--rk-font-display);
    font-size: 0.8125rem;
    color: var(--rk-title);
}
.story__counter-mask {
    display: block;
    height: 1.2em;
    overflow: hidden;
}
.story__counter-col {
    display: flex;
    flex-direction: column;
    will-change: transform;
}
.story__counter-col i {
    height: 1.2em;
    font-style: normal;
    line-height: 1.2;
}
.story__counter em {
    color: var(--rk-muted);
    font-size: 0.6875rem;
    font-style: normal;
}

.story__stage {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}
.story__copy-stack {
    position: relative;
    flex: 0 0 auto;
    min-height: clamp(180px, 30svh, 260px);
}
.story__copy {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}
.story__overflow {
    display: block;
    overflow: hidden;
}
.story__reveal-in {
    display: block;
    will-change: transform, opacity;
}
.story__kicker {
    color: var(--rk-accent);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
}
.story__title {
    margin: 0;
    color: var(--rk-title);
    font-family: var(--rk-font-display);
    font-size: clamp(1.9rem, 6.5vw, 3.9rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.02em;
}
.story__body {
    margin: 0;
    max-width: 46ch;
    color: var(--rk-muted);
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    line-height: 1.7;
}
.story__visual-stack {
    position: relative;
    flex: 1;
    min-height: 0;
}
.story__visual-label { display: none; }

/* sprite inkmask : 49 frames, alpha porte la donnée */
.story__image-layer {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transform-origin: 50% 60%;
    -webkit-mask-image: url('assets/inkmask/inkmask_bottom2.png');
    -webkit-mask-position: 0% 0%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 4900% 100%;
    mask-image: url('assets/inkmask/inkmask_bottom2.png');
    mask-position: 0% 0%;
    mask-repeat: no-repeat;
    mask-size: 4900% 100%;
    will-change: transform, mask-position, -webkit-mask-position;
}
.story__frame {
    position: relative;
    display: block;
    height: 100%;
    max-height: 52svh;
    width: auto;
    aspect-ratio: 301 / 376.25;
    max-width: 86vw;
    background: var(--rk-bg);
    border-radius: 16px;
    box-shadow: 0 0 72px 26px rgba(255, 255, 255, 0.92);
}
.story__img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter:
        drop-shadow(0 0 16px rgba(255, 255, 255, 0.95))
        drop-shadow(0 0 46px rgba(255, 255, 255, 0.75));
}

@media (min-width: 1024px) and (not (pointer: coarse)) {
    .story {
        min-height: 100vh;
        padding-top: clamp(32px, 5vh, 52px);
        padding-bottom: clamp(32px, 5vh, 52px);
    }
    .story__stage {
        display: grid;
        grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
        grid-template-areas: 'visual copy';
        align-items: center;
        gap: clamp(56px, 7vw, 120px);
    }
    .story__copy-stack { grid-area: copy; min-height: 300px; }
    .story__visual-stack {
        grid-area: visual;
        display: grid;
        width: min(100%, 500px);
        aspect-ratio: 301 / 376.25;
        place-self: center;
    }
    .story__frame::after {
        content: '';
        position: absolute;
        z-index: 0;
        right: 4%;
        bottom: 3%;
        left: 4%;
        height: 20%;
        border-radius: 50%;
        background: color-mix(in srgb, var(--rk-accent) 22%, transparent);
        filter: blur(46px);
    }
    .story__visual-label {
        position: absolute;
        z-index: 10;
        top: 50%;
        left: -34px;
        display: block;
        color: color-mix(in srgb, var(--rk-muted) 65%, transparent);
        font-size: 0.5625rem;
        letter-spacing: 0.26em;
        transform: translate(-50%, -50%) rotate(-90deg);
    }
    .story__frame {
        width: 100%;
        max-width: none;
        height: auto;
        max-height: min(70vh, 650px);
    }
    .story__title { font-size: clamp(1.9rem, 4.3vw, 4.4rem); }
    .story__copy { gap: clamp(14px, 2vh, 22px); }
    .story__body { max-width: 48ch; }
}

@media (prefers-reduced-motion: reduce) {
    .story { min-height: 0; }
    .story__copy-stack { min-height: 0; }
    .story__copy { position: static; }
    .story__copy + .story__copy { margin-top: 2.5rem; }
    .story__visual-stack,
    .story__counter { display: none; }
    .story__image-layer {
        -webkit-mask-image: none;
        mask-image: none;
    }
}

.story__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 6px;
}
.story__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--rk-accent);
    font-family: var(--rk-font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    opacity: 1;
}
.story__cta::after {
    content: '→';
    font-weight: 400;
}
.story__cta:hover,
.story__cta:focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
}
