/* ==========================================================================
   Page d'accueil
   ========================================================================== */

body {
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--gutter);
    pointer-events: none;
}

.site-nav__contact {
    display: none;
    pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Ouverture (une fois par session)
   -------------------------------------------------------------------------- */
.intro {
    display: none;
}

.show-intro .intro {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: radial-gradient(120% 90% at 50% 45%, #1a1236 0%, #0e0a20 70%, #0b0819 100%);
    cursor: pointer;
    /* Sécurité : si le script ne se lance pas, le voile disparaît tout seul */
    animation: intro-failsafe 0.8s ease 6s forwards;
}

.show-intro .page-veil {
    display: none;
}

@keyframes intro-failsafe {
    to { opacity: 0; visibility: hidden; }
}

.intro__sky {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
}

.intro__name {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    margin: 0;
    padding: 0 var(--gutter);
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.05;
    text-align: center;
    opacity: 0;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 35rem;
    overflow: hidden;
    background: #1b1530;
}

.hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transform-origin: 50% 40%;
}

.hero__tint {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(24, 14, 56, 0.6) 0%, rgba(15, 7, 41, 0.8) 91%);
}

/* Étoiles discrètes à la base du hero, derrière la silhouette */
.hero__sky {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    max-width: none;
    pointer-events: none;
    transform-origin: 50% 100%;
    -webkit-mask-image: linear-gradient(to top, #000 0%, #000 22%, transparent 62%);
    mask-image: linear-gradient(to top, #000 0%, #000 22%, transparent 62%);
}

.hero__content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    padding: 0 var(--gutter);
    text-align: center;
}

.hero__title {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.05;
}

.hero__title .char {
    display: inline-block;
    will-change: transform, opacity, filter;
}

.hero__desc {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.hero__tagline {
    max-width: 30rem;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 300;
    line-height: 1.25;
}

.hero__buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.hero__silhouette {
    position: absolute;
    z-index: 4;
    bottom: -1.25rem;
    left: -27.5vw;
    height: 40vh;
    width: auto;
    max-width: none;
    pointer-events: none;
}

.hero__fade {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: linear-gradient(to bottom, rgba(12, 16, 20, 0) 45%, var(--c-night) 100%);
    opacity: 0;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Sidebar projets (desktop)
   -------------------------------------------------------------------------- */
.project-sidebar {
    position: fixed;
    left: var(--gutter);
    top: 50%;
    z-index: 40;
    width: 8.75rem;
    translate: 0 -50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    visibility: hidden;
    opacity: 0;
}

.sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-link {
    height: 1.875rem;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    border: 0;
    background: none;
    color: #fff;
    font-family: var(--f-body);
    font-size: max(14px, 0.875rem);
    white-space: nowrap;
    cursor: pointer;
    opacity: 0.45;
    transition:
        opacity var(--t-med) var(--ease-out),
        transform var(--t-med) var(--ease-out),
        text-shadow var(--t-med) var(--ease-out);
}

.sidebar-link:hover {
    opacity: 0.9;
}

.sidebar-link.is-active {
    opacity: 1;
    transform: scale(1.18);
    font-weight: 500;
    text-shadow: 0 0 0.75rem rgba(255, 255, 255, 0.5);
}

/* Ligne entre deux projets : un trait de base + un trait qui se remplit */
.sidebar-line {
    position: relative;
    width: 1px;
    height: 1.875rem;
    margin: 0.25rem 0;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.sidebar-line__fill {
    position: absolute;
    inset: 0;
    background: #fff;
    transform: scaleY(0);
    transform-origin: top;
}

.sidebar-contact {
    margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   Projets — scène épinglée
   -------------------------------------------------------------------------- */
.projects {
    position: relative;
}

.projects-scene {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, #1e1b2e 0%, #0a0a1a 100%);
}

.projects-scene::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 20;
    height: 45vh;
    background: linear-gradient(180deg, var(--c-night) 0%, rgba(12, 16, 20, 0) 100%);
    pointer-events: none;
    opacity: var(--seam, 0);
}

.decors {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.decor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
}

.decor.is-active {
    opacity: 1;
}

.decor__bg {
    position: absolute;
    inset: 0;
    background: center / cover no-repeat;
    filter: brightness(0.6);
}

/* Scène fixe 1920×1080, mise à l'échelle en JS pour couvrir l'écran */
.scene-stage {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1920px;
    height: 1080px;
    margin: -540px 0 0 -960px; /* centrage sans transform : GSAP gère échelle et parallaxe */
    pointer-events: none;
}

.floating-svg {
    position: absolute;
    max-width: none;
    will-change: transform;
}

.vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Cartes projets
   -------------------------------------------------------------------------- */
.project-card {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    width: 60vw;
    max-width: 56.25rem;
    height: 60vh;
    margin: -30vh 0 0 calc(-1 * min(30vw, 28.125rem));
    will-change: transform, opacity;
}

.project-card:nth-of-type(1) { z-index: 10; }
.project-card:nth-of-type(2) { z-index: 9; }
.project-card:nth-of-type(3) { z-index: 8; }
.project-card:nth-of-type(4) { z-index: 7; }
.project-card:nth-of-type(5) { z-index: 6; }

.card {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 2.5rem 5rem -1.875rem rgba(0, 0, 0, 0.8);
    transition: transform 0.7s var(--ease-out), box-shadow 0.7s var(--ease-out);
}

.card__media {
    position: absolute;
    inset: -4%;
    background: center / cover no-repeat;
    transition: transform 1.2s var(--ease-out);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.6) 100%);
    opacity: 0;
    transition: opacity var(--t-med) var(--ease-out);
}

.card__inner {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
}

.card__title {
    max-width: 23.75rem;
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 1.1;
    text-align: left;
}

.card__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.card__subtitle {
    max-width: 23.75rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: max(16px, 1rem);
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
}

.card__title,
.card__bottom {
    opacity: 0;
    transform: translateY(0.875rem);
    transition:
        opacity var(--t-med) var(--ease-out),
        transform 0.7s var(--ease-out);
}

.card__bottom {
    transition-delay: 0.06s;
}

/* État révélé : survol desktop ou carte centrée sur mobile */
.project-card.is-revealed .card::before,
.project-card.is-revealed .card__title,
.project-card.is-revealed .card__bottom {
    opacity: 1;
    transform: none;
}

.project-card.is-revealed .card {
    transform: scale(1.04) rotate(-2deg);
    box-shadow: 0 3.75rem 6.25rem -1.875rem rgba(0, 0, 0, 0.9);
}

.project-card.is-revealed .card__media {
    transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   Final : À propos → la nuit tombe → contact
   -------------------------------------------------------------------------- */
.finale {
    position: relative;
    z-index: 50;
    background:
        var(--grad-violet),
        url("../Content/papier.png") center / cover no-repeat fixed;
    background-blend-mode: multiply, normal;
    overflow: hidden;
}

/* Le ciel s'assombrit progressivement jusqu'à la nuit */
.finale::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(8, 9, 26, 0) 0%,
        rgba(8, 9, 26, 0) 38%,
        rgba(8, 9, 26, 0.75) 62%,
        #070817 82%,
        #070817 100%);
    pointer-events: none;
}

/* --- À propos ------------------------------------------------------------ */
.about {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8.75rem var(--gutter) 7.5rem;
}

.about__grid {
    width: 100%;
    max-width: 68.75rem;
    display: grid;
    grid-template-columns: minmax(0, 28.125rem) 1px minmax(0, 1fr);
    gap: 3rem;
    align-items: stretch;
}

.about__portrait {
    position: relative;
    align-self: center;
    margin: 0;
}

/* Cadre décalé, comme une photo posée sur le papier */
.about__portrait::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    transform: translate(1rem, 1rem);
    transition: transform 1s var(--ease-out);
}

.about__portrait:hover::before {
    transform: translate(0.5rem, 0.5rem);
}

.about__portrait-mask {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    background: #ddd;
}

.about__portrait img {
    width: 100%;
    height: 112%;
    object-fit: cover;
    will-change: transform;
}

.about__separator {
    width: 1px;
    background: rgba(255, 255, 255, 0.3);
    transform-origin: top;
}

.about__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--c-text-soft);
    font-family: var(--f-body);
    font-size: max(12px, 0.75rem);
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 1.5rem;
    height: 1px;
    background: currentColor;
}

.about__title {
    font-size: 3rem;
    font-weight: 400;
    line-height: 1;
}

.about__bio {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about__bio p {
    max-width: 37.5rem;
    color: rgba(255, 255, 255, 0.82);
    font-family: var(--f-body);
    font-size: max(14px, 0.875rem);
    line-height: 1.7;
}

.about__cta {
    align-self: flex-start;
    margin-top: 1rem;
}

/* --- La nuit / contact --------------------------------------------------- */
.night {
    position: relative;
    z-index: 1;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8.75rem var(--gutter) 30vh;
    text-align: center;
}

.night__sky {
    position: absolute;
    inset: -30vh 0 0 0;
    width: 100%;
    height: calc(100% + 30vh);
    max-width: none;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 40%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 40%);
}

.night__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.night__title {
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1.15;
    text-wrap: balance;
}

.mail {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.mail__link {
    position: relative;
    padding-bottom: 0.25rem;
    font-size: 1.375rem;
    letter-spacing: 0.01em;
}

.mail__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: currentColor;
    opacity: 0.35;
    transform-origin: left;
    transition: opacity var(--t-med) var(--ease-out);
}

.mail__link:hover::after,
.mail__link:focus-visible::after {
    opacity: 1;
}

.mail__copy {
    position: relative;
    width: 2.125rem;
    height: 2.125rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #fff;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity var(--t-fast) ease, background-color var(--t-fast) ease;
}

.mail__copy:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.mail__copy svg {
    width: 1rem;
    height: 1rem;
}

.mail__copy-feedback {
    position: absolute;
    top: calc(100% + 0.375rem);
    left: 50%;
    translate: -50% 0;
    color: var(--c-text-soft);
    font-family: var(--f-body);
    font-size: max(12px, 0.75rem);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--t-fast) ease;
    pointer-events: none;
}

.mail__copy.is-copied .mail__copy-feedback {
    opacity: 1;
}

.night__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 2rem;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
    font-family: var(--f-body);
    font-size: max(14px, 0.875rem);
}

.night__links a {
    opacity: 0.6;
    transition: opacity var(--t-fast) ease;
}

.night__links a:hover {
    opacity: 1;
}

/* --- Sol et silhouette allongée ----------------------------------------- */
.ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    height: 24vh;
    pointer-events: none;
}

.ground__silhouette {
    position: absolute;
    left: 50%;
    bottom: -14vh;
    height: 38vh;
    width: auto;
    max-width: none;
    translate: -50% 0;
}

.site-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0 var(--gutter) 1.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--f-body);
    font-size: max(12px, 0.75rem);
}

.site-footer a {
    transition: color var(--t-fast) ease;
}

.site-footer a:hover {
    color: #fff;
}

/* --------------------------------------------------------------------------
   Desktop / mobile
   -------------------------------------------------------------------------- */
@media (min-width: 769px) {
    @media (hover: hover) and (pointer: fine) {
        .project-card:hover .card::before,
        .project-card:hover .card__title,
        .project-card:hover .card__bottom {
            opacity: 1;
            transform: none;
        }

        .project-card:hover .card {
            transform: scale(1.04) rotate(-2deg);
            box-shadow: 0 3.75rem 6.25rem -1.875rem rgba(0, 0, 0, 0.9);
        }

        .project-card:hover .card__media {
            transform: scale(1.04);
        }
    }
}

@media (max-width: 900px) {
    .about {
        min-height: auto;
        padding: 7.5rem var(--gutter) 5rem;
    }

    .about__grid {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 2.5rem;
    }

    .about__portrait {
        width: min(18.75rem, 80vw);
    }

    .about__separator {
        width: 6.25rem;
        height: 1px;
        transform-origin: left;
    }

    .about__title {
        font-size: 2.25rem;
    }
}

@media (max-width: 768px) {
    .site-nav {
        padding: 1.25rem;
    }

    .site-nav__contact {
        display: inline-flex;
        padding: 0.625rem 1.25rem;
    }

    .nav-logo img {
        width: 2rem;
        height: 2rem;
    }

    .project-sidebar {
        display: none;
    }

    .hero__silhouette {
        height: 30vh;
        left: -65%;
    }

    /* Cartes empilées, fond collant qui change avec la carte centrée */
    .projects-scene {
        height: auto;
        overflow: clip;
        padding: 1px 0;
    }

    .decors {
        position: sticky;
        top: 0;
        height: 100vh;
        margin-bottom: -100vh;
    }

    .decor {
        transition: opacity 0.7s ease;
    }

    .scene-stage {
        display: none;
    }

    .project-card {
        position: relative;
        top: auto;
        left: auto;
        width: 90vw;
        height: 44vh;
        margin: 28vh auto;
    }

    .card__inner {
        padding: 1rem;
    }

    .card__title {
        font-size: 1.5rem;
    }

    .card__subtitle {
        max-width: 12.5rem;
        font-size: max(14px, 0.875rem);
    }

    .night {
        padding-top: 7.5rem;
        padding-bottom: 30vh;
    }

    .night__title {
        font-size: 1.875rem;
    }

    .mail__link {
        font-size: 1.125rem;
    }

    .ground {
        height: 22vh;
    }

    .ground__silhouette {
        height: 32vh;
        bottom: -10vh;
    }

    .site-footer {
        flex-direction: column-reverse;
        gap: 0.5rem;
        padding-bottom: 1.25rem;
        text-align: center;
    }
}

@media (max-width: 512px) {
    .hero__silhouette {
        left: -155%;
        height: 30vh;
    }

    .ground__silhouette {
        left: 57%;
        bottom: -6vh;
        height: 26vh;
    }
}
