/* ==========================================================================
   1. VARIABLES & BASE
   ========================================================================== */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-yellow: #eadd3a;
    --gray-light: #f4f4f4;
    --gray-medium: #888888;
    --font-main: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --nav-height: 80px;
    --maxw: 1400px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    /* Le scroll est géré par JavaScript */
}

a { text-decoration: none; color: inherit; }

/* ==========================================================================
   2. NAVIGATION GLOBALE
   ========================================================================== */
nav {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--nav-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 5%; z-index: 1000;
}

.logo { font-size: clamp(0.95rem, 3vw, 1.2rem); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }

.nav-links { display: flex; gap: clamp(1rem, 4vw, 2rem); }
.nav-links a { font-size: clamp(0.8rem, 2.5vw, 0.9rem); font-weight: 500; transition: color 0.3s ease; }
.nav-links a:hover { color: var(--gray-medium); }

/* ==========================================================================
   3. SYSTÈME DE PAGES (SPA)
   ========================================================================== */
.page {
    display: none;
    padding-top: var(--nav-height);
    min-height: 100vh;
    min-height: 100svh;
    animation: fadeIn 0.4s ease forwards;
}

.page.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   4. PAGE ACCUEIL : LE SOMMAIRE INTERACTIF
   ========================================================================== */
/* Le sommaire est désormais une composition photo unique (sommairesite-Caméra.png) :
   .scene-sommaire porte l'image de fond, .objet est en position absolue à toutes
   les tailles d'écran pour rester calé sur les socles de la photo. */
#accueil {
    position: relative;
    justify-content: center; align-items: center;
}

/* display porté par .active uniquement : sinon la spécificité de l'ID
   écrase `.page { display: none }` et l'accueil reste visible partout. */
#accueil.active { display: flex; }

.scene-sommaire {
    position: relative;
    width: 100%;
    /* Ratio réel du fichier sommairesite-Caméra.png (2662 x 1872px) : aucune
       déformation, à ajuster si le fichier change. */
    aspect-ratio: 2662 / 1872;
    background-image: url("../assets/sommaire-projet/sommairesite-Caméra.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.objet {
    position: absolute; z-index: 10;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.objet:hover {
    transform: scale(1.08) translateY(-15px);
    z-index: 999 !important; /* Force le passage au tout premier plan au survol */
}

.objet img { width: 100%; height: auto; transition: filter 0.3s ease; }
.objet:hover img { filter: drop-shadow(0px 20px 25px rgba(0,0,0,0.15)); }

.titre-hover {
    position: absolute; top: -40px; background-color: var(--text-color);
    color: var(--bg-color); padding: 5px 12px; font-size: 0.8rem; border-radius: 4px;
    white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.objet:hover .titre-hover { opacity: 1; }

.placeholder {
    background-color: var(--gray-light); border: 1px dashed #ccc; width: 100%;
    aspect-ratio: 1/1; display: flex; justify-content: center; align-items: center;
    font-size: clamp(1rem, 4vw, 1.5rem); color: var(--gray-medium);
}

/* Coordonnées des 8 objets, sur 3 plans de profondeur (perspective), calées sur
   les socles de la photo. Réglages fins à faire au pourcentage près dans l'inspecteur.
   - plan arrière  (bottom ~45-50%, width ~6-10%) : 01, 02, 04, 05, 06
   - plan milieu   (bottom ~28%,    width ~11%)   : 03
   - plan avant    (bottom ~4-5%,   width ~20-22%): 07, 08 */
.obj-01 { position: absolute; z-index: 50; width: 20.1%; left: 4.9%; bottom: 30%; }
.obj-01 img { width: 100%; height: auto; }
.obj-02 { position: absolute; z-index: 50; width: 15%; left: 25.2%; bottom: 31%; }
.obj-02 img { width: 100%; height: auto; }
.obj-03 { position: absolute; z-index: 60; width: 19%; left: 22%; bottom: 12.6%; }
.obj-03 img { width: 100%; height: auto; }
.obj-04 { position: absolute; z-index: 50; width: 20.1%; left: 40.8%; bottom: 26.4%; }
.obj-04 img { width: 100%; height: auto; }
.obj-05 { position: absolute; z-index: 50; width: 20.1%; left: 57%; bottom: 27.7%; }
.obj-05 img { width: 100%; height: auto; }
.obj-06 { position: absolute; z-index: 50; width: 15.2%; left: 75.6%; bottom: 30.3%; }
.obj-06 img { width: 100%; height: auto; }
.obj-07 { position: absolute; z-index: 50; width: 29%; left: 72%; bottom: 10%; }
.obj-07 img { width: 100%; height: auto; }
.obj-08 { position: absolute; z-index: 50; width: 38%; left: 55%; bottom: -1%; }
.obj-08 img { width: 100%; height: auto; }


/* ==========================================================================
   5. PAGES PROJETS DÉTAILLÉES
   ========================================================================== */
.projet-detail { max-width: 1000px; margin: 0 auto; padding: clamp(2rem, 6vw, 4rem) 5%; }

.btn-retour {
    display: inline-block; margin-bottom: clamp(1.5rem, 5vw, 3rem); font-weight: 500;
    color: var(--gray-medium); transition: color 0.3s ease;
}
.btn-retour:hover { color: var(--text-color); }

.projet-header {
    display: flex; gap: clamp(1.5rem, 4vw, 3rem);
    margin-bottom: clamp(2rem, 6vw, 4rem); align-items: flex-start;
}
.projet-titre-bloc h1 { font-size: clamp(1.8rem, 6vw, 3rem); font-weight: 300; margin-bottom: 1rem; overflow-wrap: break-word; }
.projet-titre-bloc .num { font-size: clamp(1.1rem, 3vw, 1.5rem); color: var(--gray-medium); }
.projet-description { flex: 1; font-size: clamp(1rem, 2.5vw, 1.1rem); color: var(--gray-medium); }

.projet-images { display: flex; flex-direction: column; gap: 2rem; }
.image-projet-placeholder {
    width: 100%; height: clamp(200px, 45vw, 500px); background-color: var(--gray-light);
    display: flex; justify-content: center; align-items: center; color: var(--gray-medium);
    text-align: center; padding: 1rem;
}

/* ==========================================================================
   6. PAGE À PROPOS
   ========================================================================== */
.section-apropos {
    padding: clamp(3rem, 8vw, 100px) 5%; max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; gap: clamp(2rem, 5vw, 4rem);
}

.apropos-image {
    flex: 1; width: 100%; max-width: 420px; aspect-ratio: 3/4;
    background-color: var(--gray-light);
}

.apropos-image img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 4px;
}

.apropos-texte { flex: 1; }
.apropos-texte h2 { font-size: clamp(1.8rem, 5vw, 2.5rem); font-weight: 300; margin-bottom: 1.5rem; }
.apropos-texte p { color: var(--gray-medium); margin-bottom: 2rem; font-size: clamp(1rem, 2.5vw, 1.1rem); }

.btn-cv {
    display: inline-block; padding: 12px 24px; background-color: var(--text-color);
    color: var(--bg-color); font-weight: 500; transition: background-color 0.3s ease;
}
.btn-cv:hover { background-color: var(--gray-medium); }

/* ==========================================================================
   7. FOOTER GLOBAL
   ========================================================================== */
footer {
    padding: 60px 20px;
    background-color: #ffffff;
    text-align: center;
    color: #000000;
}

footer p {
    color: #000000;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.footer-links {
    display: flex; justify-content: center; gap: 1.5rem;
}

.footer-links a {
    color: #000000;
    font-size: 0.8rem; font-weight: 500;
    transition: color 0.3s ease;
}

.footer-links a:hover { color: #000000; }

/* ==========================================================================
   8. RESPONSIVE MOBILE
   ========================================================================== */
/* Tablette et en dessous : les blocs en deux colonnes passent en pile.
   .scene-sommaire garde son aspect-ratio et .objet reste en position:absolute
   à toutes les tailles (voir section 4), donc rien à réinitialiser ici pour
   le sommaire : il rétrécit en bloc avec le conteneur. */
@media (max-width: 900px) {
    .projet-header { flex-direction: column; }
    .section-apropos { flex-direction: column; align-items: flex-start; }
    .apropos-image { margin: 0 auto; }
}

/* Téléphone : navigation plus compacte, marges réduites */
@media (max-width: 600px) {
    :root { --nav-height: 64px; }
    nav { padding: 0 1.25rem; }
    .projet-detail { padding: 2rem 1.25rem; }
    .section-apropos { padding: 2.5rem 1.25rem; }
    footer { padding: 1rem 1.25rem; }
}

/* Écrans tactiles : pas d'état :hover, on neutralise le décalage et on garde
   les titres visibles en permanence (sinon ils ne s'affichent jamais au doigt) */
@media (hover: none) {
    .objet:hover { transform: none; }
    .titre-hover { opacity: 1; }
}

/* Respect des préférences d'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.page-projet {
    position: relative;
    padding: 40px 0;
    font-family: sans-serif;
}
.bouton-retour {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 100;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    font-size: 1.2rem;
}
.bouton-retour:hover { text-decoration: underline; }
.image-croquis {
    display: block;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

.footer-projet {
    text-align: center;
    padding: 100px 20px 40px 20px;
    font-size: 1rem;
    color: #555;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.image-longue {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    height: auto;
}
