/* ══════════════════════════════════════════════════════════════════════════════
   STYLE.CSS - Styles globaux du portfolio
   RANDRIANOME Mercia
   
   Ce fichier contient TOUS les styles partagés entre les pages :
   - Variables (couleurs, polices)
   - Reset CSS
   - Navigation
   - Boutons
   - Footer
   - Responsive
══════════════════════════════════════════════════════════════════════════════ */


/* ==============================================================================
   1. POLICES AUTO-HÉBERGÉES (woff2, éco-conception)
   ==============================================================================

   Deux familles, aucun appel réseau tiers :
   - Playfair Display : titres (serif éditorial, élégant)
   - Inter : corps de texte (sans-serif lisible)

   Ce sont des polices variables : un seul fichier couvre tous les poids.
   font-display: swap = le texte s'affiche tout de suite avec une police
   système, puis bascule sur la vraie police une fois chargée.
*/
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('../assets/fonts/playfair-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../assets/fonts/inter-latin.woff2') format('woff2');
}


/* ==============================================================================
   2. VARIABLES CSS (Personnalisation facile)
   ==============================================================================
   
   Les variables permettent de changer les couleurs/polices à UN SEUL endroit.
   Pour modifier une couleur sur tout le site, change juste la valeur ici.
   
   Utilisation : var(--nom-de-la-variable)
   Exemple : background-color: var(--noir-profond);
*/
:root {
    
    /* --- COULEURS PRINCIPALES --- */
    --noir-profond: #0a0a0a;      /* Fond principal (presque noir) */
    --noir-secondaire: #141414;    /* Fond des sections alternées */
    --gris-fonce: #1a1a1a;         /* Fond des cartes */
    --gris-bordure: #2a2a2a;       /* Couleur des bordures */
    
    /* --- COULEURS DE TEXTE --- */
    --blanc: #f5f5f5;              /* Texte principal */
    --blanc-pur: #ffffff;          /* Titres */
    --gris-texte: #888888;         /* Texte secondaire (paragraphes) */
    --gris-clair: #aaaaaa;         /* Texte léger */
    
    /* --- COULEUR D'ACCENT (OR) --- */
    --or: #c9a84c;                 /* Couleur principale d'accent */
    --or-clair: #dabb62;           /* Or au survol (hover) */
    --or-fonce: #a8893a;           /* Or foncé si besoin */
    
    /* --- POLICES --- */
    --font-titre: 'Playfair Display', Georgia, serif;
    --font-corps: 'Inter', system-ui, sans-serif;
    
    /* --- TRANSITIONS (animations fluides) --- */
    --transition-rapide: 0.3s ease;
    --transition-moyenne: 0.5s ease;
    
    /* --- OMBRES --- */
    --ombre-carte: 0 4px 20px rgba(0, 0, 0, 0.3);
    --ombre-or: 0 4px 20px rgba(212, 175, 55, 0.3);
    
    /* --- ESPACEMENTS --- */
    --padding-page: 5%;            /* Marge gauche/droite des pages */
}


/* ==============================================================================
   3. RESET CSS (Remise à zéro des styles par défaut)
   ==============================================================================
   
   Les navigateurs appliquent des styles par défaut (marges, padding...).
   Le reset permet de partir sur une base propre et identique partout.
*/

/* Applique box-sizing à tous les éléments */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;  /* Les padding/border sont inclus dans la largeur */
}

/* Défilement fluide quand on clique sur un lien ancre (#section) */
html {
    scroll-behavior: smooth;
}

/* Styles de base du body */
body {
    font-family: var(--font-corps);
    background-color: var(--noir-profond);
    color: var(--blanc);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Personnalisation de la sélection de texte */
::selection {
    background-color: var(--or);
    color: var(--noir-profond);
}


/* ==============================================================================
   4. ÉLÉMENTS DE BASE (liens, images, titres, paragraphes)
   ==============================================================================
*/

/* --- LIENS --- */
a {
    text-decoration: none;           /* Pas de soulignement */
    color: inherit;                  /* Hérite la couleur du parent */
    transition: var(--transition-rapide);
}

/* --- IMAGES --- */
img {
    max-width: 100%;                 /* Ne dépasse jamais son conteneur */
    height: auto;
    display: block;                  /* Évite l'espace sous les images */
}

/* --- TITRES --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-titre);
    font-weight: 700;
    line-height: 1.2;
    color: var(--blanc-pur);
}

.hero-note {
    font-size: 0.85em;
    opacity: 0.7;
}


/* Tailles des titres (responsive avec clamp) */
/* clamp(min, preferred, max) = taille minimum, idéale, maximum */
h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h1 span { display: block;
  font-size: 0.55em;
  line-height: 1.1; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }

/* --- PARAGRAPHES --- */
p {
    color: var(--gris-texte);
    font-size: 1rem;
    line-height: 1.8;
}


/* ==============================================================================
   5. NAVIGATION
   ==============================================================================
   
   La navigation est fixée en haut de l'écran (position: fixed).
   Elle reste visible quand on scroll.
*/

/* ── HEADER global (conteneur fixe à 2 niveaux) ── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gris-bordure);
}

/* ── Barre 1 : Logo + CTA + Burger ── */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem var(--padding-page);
}

/* ── Barre 2 : Liens de navigation ── */
.nav-sub {
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: center;
    padding: 0.55rem var(--padding-page);
}

/* --- LOGO --- */
.nav-logo {
    font-family: var(--font-titre);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--blanc-pur);
}

/* Le point après "MERCIA" est en or */
.nav-logo span {
    color: var(--or);
}

/* --- LIENS DE NAVIGATION --- */
.nav-liens {
    display: flex;
    gap: 2.5rem;                     /* Espace entre les liens */
    list-style: none;                /* Pas de puces */
}

.nav-liens a {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--gris-texte);
    position: relative;              /* Pour l'animation du soulignement */
    padding: 0.5rem 0;
}

/* Soulignement animé au survol */
.nav-liens a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;                        /* Invisible par défaut */
    height: 2px;
    background-color: var(--or);
    transition: var(--transition-rapide);
}

/* Au survol : texte blanc + soulignement visible */
.nav-liens a:hover {
    color: var(--blanc-pur);
}

.nav-liens a:hover::after {
    width: 100%;                     /* Le soulignement apparaît */
}

/* Lien de la page actuelle (classe "actif") */
.nav-liens a.actif {
    color: var(--or);
}

.nav-liens a.actif::after {
    width: 100%;
}

/* --- BOUTON "ME CONTACTER" --- */
.nav-cta {
    background-color: var(--or);
    color: var(--noir-profond);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;             /* Bouton arrondi */
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-cta:hover {
    background-color: var(--or-clair);
    box-shadow: var(--ombre-or);
    transform: translateY(-2px);     /* Légère élévation */
}

/* --- MENU BURGER (mobile) --- */
/* Caché par défaut, visible uniquement sur mobile */
.nav-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.nav-burger span {
    width: 25px;
    height: 2px;
    background-color: var(--blanc);
    transition: var(--transition-rapide);
}


/* ==============================================================================
   6. BOUTONS RÉUTILISABLES
   ==============================================================================
   
   Classes à combiner : .btn + .btn-principal OU .btn + .btn-secondaire
   Exemple : <a href="#" class="btn btn-principal">Cliquez ici</a>
*/

/* Style de base pour tous les boutons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;                     /* Espace entre texte et icône */
    padding: 1rem 2rem;
    border-radius: 50px;
    font-family: var(--font-corps);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-rapide);
}

/* Bouton principal (fond or) */
.btn-principal {
    background-color: var(--or);
    color: var(--noir-profond);
}

.btn-principal:hover {
    background-color: var(--or-clair);
    box-shadow: var(--ombre-or);
    transform: translateY(-3px);
}

/* Bouton secondaire (contour) */
.btn-secondaire {
    background-color: transparent;
    color: var(--blanc);
    border: 1px solid var(--gris-bordure);
}

.btn-secondaire:hover {
    border-color: var(--or);
    color: var(--or);
}


/* ==============================================================================
   7. SECTIONS (styles communs)
   ==============================================================================
*/

section {
    padding: clamp(3.75rem, 8vw, 6.25rem) var(--padding-page);
}

/* Titre de section avec mot en or */
.section-titre {
    margin-bottom: 1rem;
}

.section-titre span {
    color: var(--or);
}

/* Sous-titre de section */
.section-soustitre {
    color: var(--gris-texte);
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 3rem;
}

/* Conteneur pour centrer le contenu */
.conteneur {
    max-width: 1400px;
    margin: 0 auto;
}


/* ==============================================================================
   8. FOOTER (pied de page)
   ==============================================================================
*/

.footer {
    background-color: var(--noir-secondaire);
    border-top: 1px solid var(--gris-bordure);
    padding: clamp(2rem, 4vw, 3.75rem) var(--padding-page);
}

.footer-contenu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;                 /* Passe en colonne si pas assez de place */
    gap: 2rem;
}

/* Logo du footer */
.footer-logo {
    font-family: var(--font-titre);
    font-size: 1.3rem;
    font-weight: 800;
}

.footer-logo span {
    color: var(--or);
}

/* Liens du footer */
.footer-liens {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.footer-liens a {
    color: var(--gris-texte);
    font-size: 0.9rem;
}

.footer-liens a:hover {
    color: var(--or);
}

/* Icônes réseaux sociaux */
.footer-reseaux {
    display: flex;
    gap: 1rem;
}

.footer-reseaux a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gris-fonce);
    border-radius: 50%;
    color: var(--gris-texte);
}

.footer-reseaux a:hover {
    background-color: var(--or);
    color: var(--noir-profond);
}

/* Copyright */
.footer-copyright {
    width: 100%;
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--gris-bordure);
    color: var(--gris-texte);
    font-size: 0.85rem;
}


/* ==============================================================================
   9. ANIMATIONS
   ==============================================================================
*/

/* Animation d'apparition (utilisée pour le hero) */
@keyframes apparition {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation de pulsation (pour les points décoratifs) */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


/* ==============================================================================
   10. RESPONSIVE (adaptation mobile/tablette)
   ==============================================================================
   
   @media permet d'appliquer des styles selon la taille d'écran.
   max-width: 768px = écrans de 768px de large ou moins (mobiles)
*/

/* --- TABLETTE (1024px et moins) --- */
@media screen and (max-width: 1024px) {
    :root {
        --padding-page: 4%;
    }
    
    .nav-liens {
        gap: 1.5rem;
    }
}

/* --- MOBILE (768px et moins) --- */
@media screen and (max-width: 768px) {
    :root {
        --padding-page: 20px;
    }

    /* Burger visible */
    .nav-burger {
        display: flex;
        position: relative;
        z-index: 1002;
    }

    /* Animation burger → X */
    .nav-burger.actif span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .nav-burger.actif span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .nav-burger.actif span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    /* Barre 2 — liens compacts toujours visibles */
    .nav-sub {
        padding: 0.5rem var(--padding-page);
    }

    .nav-liens {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.45rem 1.1rem;
    }

    .nav-liens a {
        font-size: 0.68rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        font-weight: 600;
    }

    /* Overlay plein écran quand burger actif */
    .nav-liens.actif {
        position: fixed;
        inset: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.1rem;
        background-color: rgba(13, 13, 13, 0.97);
        backdrop-filter: blur(16px);
        z-index: 1001;
    }

    .nav-liens.actif a {
        font-size: 1.1rem;
        font-family: var(--font-titre);
        font-weight: 700;
        color: var(--blanc-pur);
        text-transform: none;
        letter-spacing: 0;
    }

    .nav-liens.actif a.actif,
    .nav-liens.actif a:hover { color: var(--or); }

    /* Cache CTA sur mobile */
    .nav-cta { display: none; }

    .footer-contenu { flex-direction: column; text-align: center; }
    .footer-liens { flex-wrap: wrap; justify-content: center; }
}

/* --- TRÈS PETITS MOBILES (380px et moins) --- */
@media screen and (max-width: 380px) {
    :root {
        --padding-page: 14px;
    }
}


/* ==============================================================================
   11. ACCESSIBILITÉ
   ==============================================================================
*/

/* --- CONTENU RÉSERVÉ AUX LECTEURS D'ÉCRAN --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- LIEN D'ÉVITEMENT (skip-link) --- */
/* Premier élément focusable de la page : permet de sauter la nav au clavier. */
.skip-link {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -120%);
    z-index: 2000;
    background-color: var(--or);
    color: var(--noir-profond);
    font-family: var(--font-corps);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 6px 6px;
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translate(-50%, 0);
    outline: 2px solid var(--noir-profond);
    outline-offset: 2px;
}

/* --- FOCUS VISIBLE (jamais supprimé) --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--or);
    outline-offset: 3px;
    border-radius: 2px;
}

/* --- MOUVEMENT RÉDUIT --- */
/* Respecte le réglage système : coupe toutes les animations et transitions. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}


/* ==============================================================================
   12. BOUTON WHATSAPP FLOTTANT
   ==============================================================================
   Remplace l'ancien chatbot. Contact direct, une seule requête (SVG inline).
*/

.wa-float {
    position: fixed;
    right: clamp(16px, 3vw, 28px);
    bottom: clamp(16px, 3vw, 28px);
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.1rem 0.7rem 0.85rem;
    background-color: #1f8a4c;
    color: #ffffff;
    font-family: var(--font-corps);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wa-float:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(31, 138, 76, 0.45);
    color: #ffffff;
}

.wa-float svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Sur mobile : bouton rond, sans libellé */
@media screen and (max-width: 560px) {
    .wa-float {
        padding: 0.85rem;
        gap: 0;
    }
    .wa-float .wa-label {
        display: none;
    }
}