/* ==========================================================================
   STYLES SPÉCIFIQUES - PAGE D'ACCUEIL (index.css)
   ========================================================================== */

body {
    background-color: #000000;
    overflow: hidden;
}

/* Lueur d'ambiance qui suit le curseur */
.spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle 450px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0) 100%);
    transition: background 0.1s ease-out;
}

/* Effet d'inversion au survol pour le bouton CTA */
.hover-invert:hover {
    background-color: #ffffff;
    color: #000000;
}

/* Légère translation de la flèche du bouton */
.arrow-hover:hover span {
    transform: translateX(4px);
    transition: transform 0.3s ease;
}

/* Révélation du texte par effet de masque */
.mask-reveal {
    overflow: hidden;
}

.mask-reveal span:not(.stardust-easter-egg) {
    display: inline-block;
    transform: translateY(100%);
    animation: slideUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.2s;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

/* Canvas des particules en arrière-plan */
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* ---- Conteneur principal ---- */
.main-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    z-index: 10;
    position: relative;
    padding-top: 120px;
    padding-bottom: 48px;
}

/* ---- Section Hero ---- */
.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    width: 100%;
    max-width: 80rem;
    position: relative;
    text-align: center;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Halo sombre derrière le texte : les particules restent visibles autour mais ne gênent plus la lecture */
.hero-section::before {
    content: "";
    position: absolute;
    inset: -2rem 0;
    z-index: -1;
    background: radial-gradient(ellipse 55% 50% at 50% 50%, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

.hero-title {
    font-size: 42px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #E0E0E0;
    font-weight: 300;
    font-family: 'Instrument Serif', serif;
}

@media (min-width: 480px) {
    .hero-title {
        font-size: 64px;
    }
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 120px;
    }
}

.hero-subtitle {
    font-size: 18px;
    font-style: italic;
    max-width: 65ch;
    color: #E0E0E0;
    font-weight: 300;
    font-family: 'Newsreader', serif;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 24px;
    }
}

/* ---- Disponibilité (stage) ---- */
.hero-availability-wrap {
    position: absolute;
    top: 7rem;
    right: 1.5rem;
    left: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    z-index: 5;   /* au-dessus du bloc central, sinon le survol ne l'atteint pas */
}

@media (min-width: 768px) {
    .hero-availability-wrap {
        right: auto;
        left: 48px;   /* aligné sur le logo de la barre de navigation (marge de la barre : 48 px) */
        max-width: 24rem;
        align-items: flex-start;
    }
}

/* Bouton « Télécharger mon CV » sous la disponibilité : visible au survol (ou au clavier) sur ordinateur,
   toujours visible sur écran tactile (pas de survol) */
.availability-cv {
    margin-left: calc(8px + 0.75rem);   /* aligné sur le texte, après le point vert */
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #E0E0E0;
    text-decoration: none;
    border: 1px solid rgba(224, 224, 224, 0.6);
    background: rgba(0, 0, 0, 0.6);
    padding: 0.55rem 1rem;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.availability-cv:hover,
.availability-cv:focus-visible {
    background: #ffffff;
    color: #000000;
}

@media (hover: hover) {
    .availability-cv {
        opacity: 0;
        transform: translateY(-6px);
        pointer-events: none;
    }

    .hero-availability-wrap:hover .availability-cv,
    .hero-availability-wrap:focus-within .availability-cv {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

@media (max-width: 767px) {
    .availability-cv {
        margin-left: 0;
    }
}

.hero-availability {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.6;
    color: #E0E0E0;
    text-align: left;
    text-shadow: 0 0 6px #000, 0 0 12px #000, 0 0 18px rgba(0, 0, 0, 0.9);
}

.hero-availability-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    animation: availability-pulse 2.4s ease-out infinite;
}

@keyframes availability-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero-desc-wrap {
    max-width: 50ch;
    margin-left: auto;
    margin-right: auto;
    margin-top: 1rem;
}

.hero-desc {
    font-size: 18px;
    color: #B8B8B8;
    line-height: 1.75;
    font-weight: 300;
    font-family: 'Newsreader', serif;
}

/* ---- Bouton CTA ---- */
.cta-btn {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    color: #E0E0E0;
    border: 1px solid #E0E0E0;
    padding: 1rem 2rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-decoration: none;
    letter-spacing: 0.05em;
}

.cta-btn:hover {
    background-color: #ffffff;
    color: #000000;
}

/* ---- Actions du Hero (CTA) ---- */
.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .hero-actions {
        flex-direction: row;
        gap: 2rem;
    }
}


/* ==========================================================================
   MOBILE (< 768 px) : composition en affiche, dans le flux (plus rien ne se superpose)
   - en haut : disponibilité et bouton du CV, alignés sur la marge du logo ;
   - en bas de l'écran : nom, accroche, description et bouton pleine largeur (à portée de pouce) ;
   - le ciel étoilé respire entre les deux. L'ensemble tient dans la hauteur de l'écran (iPhone SE compris).
   ========================================================================== */
@media (max-width: 767px) {
    .main-content {
        align-items: stretch;
        justify-content: flex-start;
        min-height: 100vh;
        min-height: 100svh;
        padding-top: calc(var(--nav-h, 77px) + 1.75rem);
        padding-bottom: 2.5rem;
    }

    .hero-availability-wrap {
        position: static;
        align-items: flex-start;
        gap: 1rem;
        padding: 0 1.5rem;
    }

    .hero-availability {
        align-items: flex-start;
        font-size: 11px;
        letter-spacing: 0.08em;
    }

    .hero-availability-dot {
        margin-top: 0.4em;
    }

    .availability-cv {
        margin-left: calc(8px + 0.75rem);   /* aligné sur le texte, après le point vert */
        padding: 0.6rem 0.9rem;
    }

    .hero-section {
        flex-grow: 1;
        justify-content: flex-end;
        align-items: flex-start;
        min-height: 0;
        padding-top: 2.5rem;
        text-align: left;
    }

    /* Le halo suit le bloc de texte, en bas à gauche */
    .hero-section::before {
        inset: 0;
        background: radial-gradient(ellipse 110% 60% at 20% 72%, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0) 100%);
    }

    /* Le nom occupe toute la largeur utile, sur une seule ligne */
    .hero-title {
        font-size: clamp(36px, calc((100vw - 3rem) / 5.9), 64px);
        line-height: 1;
    }

    .hero-section .mt-6 {
        margin-top: 0.9rem;
    }

    .hero-desc-wrap {
        margin: 1rem 0 0;
        max-width: 34ch;
    }

    .hero-desc {
        font-size: 17px;
        line-height: 1.6;
    }

    .hero-section .mt-12 {
        margin-top: 2rem;
    }

    .hero-actions {
        width: 100%;
        align-items: stretch;
    }

    .cta-btn {
        justify-content: space-between;
        padding: 1.1rem 1.25rem;
    }
}
