/* =========================================
   VARIABLES & RESET
========================================= */
:root {
    --green: #2e7d32;
    --green-light: #81c784;
    --blue: #8ab4c8;
    --concrete: #1a1a18;
    --concrete-mid: #242420;
    --concrete-light: #2e2e2a;
    --stone: #3d3d38;
    --dust: #8a8a82;
    --paper: #f0ede6;
    --off-white: #e8e4dc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important;
}

html { scroll-behavior: smooth; }

body {
    font-family: "Inter", sans-serif;
    background-color: var(--concrete);
    color: var(--off-white);
    overflow-x: hidden;
    cursor: none;
}

/* Texture Grain */
body::before {
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 1000; opacity: 0.6;
}

/* =========================================
   TYPOGRAPHIE & UTILITAIRES
========================================= */
.font-display { font-family: "Alfa Slab One", serif; }
.font-mono { font-family: "JetBrains Mono", monospace; }

.text-green { color: var(--green); }
.text-off-white { color: var(--off-white); }
.text-dust { color: var(--dust); }
.text-stone { color: var(--stone); }

.bg-concrete { background: var(--concrete); }
.bg-concrete-mid { background: var(--concrete-mid); }
.bg-paper { background: var(--paper); color: #1a1a18; }

.uppercase { text-transform: uppercase; }
.font-bold { font-weight: bold; }
.italic { font-style: italic; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.tracking-widest { letter-spacing: 0.1em; }
.leading-loose { line-height: 2; }

/* =========================================
   LAYOUT STANDARD (Mobile First)
========================================= */
.container {
    max-width: 80rem;
    margin: 0 auto;
    width: 100%;
    padding: 0 1.5rem;
}
.section-padding { padding: 6rem 0; }
.relative-container { position: relative; }
.grid { display: grid; gap: 2.5rem; }

/* =========================================
   COMPOSANTS COMMUNS
========================================= */
/* Cursor */
.cursor {
    width: 12px; height: 12px; background: var(--green);
    border-radius: 50%; position: fixed; top: 0; left: 0;
    pointer-events: none; z-index: 9999;
    transition: transform 0.15s ease, width 0.3s, height 0.3s;
    transform: translate(-50%, -50%);
}
.cursor.grow {
    width: 40px; height: 40px; background: transparent;
    border: 1px solid var(--green);
}

/* Navigation avec fond et flou */
.navbar { 
    position: fixed; 
    top: 0; 
    left: 0;
    width: 100%; 
    z-index: 50; 
    padding: 1rem 0; 
    background: rgba(26, 26, 24, 0.85); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
    border-bottom: 1px solid var(--stone); 
}
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.brand-link { font-size: 0.75rem; text-decoration: none; }
.nav-links { display: none; gap: 2.5rem; }
.nav-link { position: relative; font-size: 0.7rem; letter-spacing: 0.15em; color: var(--dust); text-decoration: none; transition: color 0.3s ease; }
.nav-link::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 1px; background: var(--green); transition: width 0.3s ease; }
.nav-link:hover { color: var(--off-white); }
.nav-link:hover::after { width: 100%; }

/* Badges */
.section-num { font-size: 0.65rem; letter-spacing: 0.2em; color: var(--dust); margin-bottom: 3rem; }
.tag-badge { font-size: 0.65rem; letter-spacing: 0.15em; padding: 4px 12px; border: 1px solid; display: inline-block;}
.tag-dev-web { color: var(--green); border-color: var(--green); }
.tag-design { color: var(--blue); border-color: var(--blue); }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.reveal { animation: fadeUp 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; }
.reveal-delay-1 { animation-delay: 0.1s; }
.reveal-delay-2 { animation-delay: 0.25s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   INDEX : SPECIFIC (Mobile First)
========================================= */
/* Hero */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; padding: 7rem 0 4rem 0; }
.ghost-number { position: absolute; right: 1rem; top: 3rem; opacity: 0.06; pointer-events: none; user-select: none; font-size: clamp(5rem, 20vw, 16rem); line-height: 0.9; -webkit-text-stroke: 1px var(--stone); color: transparent; }
.hero-title { font-size: clamp(3rem, 13vw, 10rem); line-height: 0.92; letter-spacing: -0.02em; margin-top: 2rem; }
.hero-subtitle { font-size: clamp(1.2rem, 6vw, 7rem); }
.hero-content { margin-top: 3rem; display: flex; flex-direction: column; gap: 2rem; }
.hero-desc { font-size: 0.85rem; max-width: 28rem; }
.hero-btn { display: inline-flex; align-items: center; justify-content: center; gap: 1rem; font-size: 0.875rem; border: 1px solid var(--stone); padding: 1rem 2rem; color: var(--off-white); text-decoration: none; transition: all 0.3s; }
.hero-btn:hover { background: var(--green); border-color: var(--green); }
.arch-divider { margin-top: 4rem; display: flex; align-items: center; gap: 0.5rem; color: var(--stone); }
.divider-line-green { width: 40px; height: 1px; background: var(--green); }
.divider-line-stone { flex: 1; height: 1px; background: var(--stone); }

/* About & Avatar Sizing */
.avatar-container { 
    position: relative; 
    aspect-ratio: 3/4; 
    overflow: hidden; 
    border: 1px solid var(--stone); 
    background: linear-gradient(160deg, var(--concrete-light) 0%, #0e0e0c 100%); 
    max-width: 240px; 
    margin: 0 auto; 
}
.avatar-canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.avatar-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.avatar-spinner { width: 32px; height: 32px; border: 1px solid var(--stone); border-top-color: var(--green); border-radius: 50%; animation: spin 0.9s linear infinite; }
.avatar-hint { position: absolute; bottom: 12px; right: 12px; opacity: 0; transition: opacity 0.4s; }
.about-text-container { padding-top: 1rem; }
.green-line::before { content: ''; display: block; width: 40px; height: 2px; background: var(--green); margin-bottom: 2rem; }
.about-title { font-size: clamp(2.2rem, 8vw, 4rem); line-height: 1.05; }
.vertical-divider { width: 2px; height: 60px; background: linear-gradient(to bottom, var(--green), transparent); margin: 2rem 0; }
.about-desc { font-size: 0.85rem; display: block; }
.about-desc a { 
    color: var(--off-white); /* Force le texte en blanc cassé */
    text-decoration: underline; 
    text-decoration-color: var(--green); 
    text-underline-offset: 4px; 
    transition: color 0.3s ease;
}

/* Petit bonus : le texte passe en vert quand on passe la souris dessus */
.about-desc a:hover {
    color: var(--green);
}
/* Stats Grid Mobile */
.stats-grid { display: flex; flex-direction: column; gap: 2rem; margin-top: 3rem; border-top: 1px solid var(--stone); padding-top: 2rem; text-align: center; }
.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-border-r { border-bottom: 1px solid var(--stone); padding-bottom: 2rem; }
.stat-pad-x { padding: 0; border-bottom: 1px solid var(--stone); padding-bottom: 2rem; }
.stat-pad-l { padding-left: 0; }
.stat-number { font-size: 2.5rem; }
.stat-label { font-size: 0.75rem; margin-top: 0.5rem; }

/* Projects Grid (Stable, pas de tressautement au survol) */
.projects-header { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; margin-bottom: 2rem; }
.projects-title { font-size: clamp(2.5rem, 10vw, 6rem); line-height: 0.95; }
.filters { display: flex; gap: 0.75rem; margin-bottom: 3rem; flex-wrap: wrap; }
.filtre-btn { font-family: "Inter", sans-serif; font-size: 0.75rem; padding: 0.5rem 1rem; border: 1px solid var(--stone); color: var(--dust); background: transparent; transition: all 0.2s; }
.filtre-btn.active { border-color: var(--green); color: var(--green); }
.projects-list { display: flex; flex-direction: column; gap: 0; }

.project-card { 
    position: relative; 
    padding: 3rem 0; 
    border-top: 1px solid var(--stone); 
    background: transparent; 
    transition: background 0.4s ease; 
}
.project-card::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--green); transition: width 0.4s ease; }
.project-card:hover { background: var(--concrete-mid); }
.project-card:hover::after { width: 100%; }

.project-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 2rem; }
.project-info { display: flex; flex-direction: column; gap: 1rem; }
.project-details { flex: 1; }
.project-visual { width: 100%; height: 14rem; overflow: hidden; background: var(--concrete-light); border: 1px solid var(--stone); }

/* Images et Vidéos d'aperçu des projets */
.project-visual img,
.project-visual video { 
    width: 100%; height: 100%; object-fit: cover; 
    transition: filter 0.6s ease; 
    filter: grayscale(90%) contrast(1.1); 
    display: block;
}
.project-visual .placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); color: var(--stone);
}

/* Colorisation pure au survol, sans zoom ni décalage structural */
.project-card:hover .project-visual img,
.project-card:hover .project-visual video { 
    filter: grayscale(0%) contrast(1); 
}

/* Skills */
.skill-grid-inner { display: grid; grid-template-columns: 1fr; gap: 1px; background: #c8c5be; }
.skill-tile { padding: 1.2rem; font-size: 1rem; font-weight: bold; position: relative; overflow: hidden; border: 1px solid transparent; transition: all 0.3s ease; text-align: center; }
.skill-tile::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: var(--green); transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); z-index: 0; }
.skill-tile:hover::before { left: 0; }
.skill-tile:hover { color: white !important; border-color: var(--green); }
.skill-tile span { position: relative; z-index: 1; }
.bars-grid { display: flex; flex-direction: column; gap: 2rem; margin-top: 4rem; }

/* Influences (Ligne verte animée type menu) */
.influence-row { border-top: 1px solid var(--stone); padding: 1.5rem 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; text-decoration: none; color: inherit; }
.influence-row:last-child { border-bottom: 1px solid var(--stone); }
.influence-word { position: relative; display: inline-block; font-family: 'DM Serif Display', serif; color: var(--stone); transition: color 0.3s ease; line-height: 1; font-size: clamp(2rem, 8vw, 3rem); }
.influence-word::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: var(--green); transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.influence-row:hover .influence-word::after { width: 100%; }
.influence-row:hover .influence-word { color: var(--off-white); }
.influence-row:hover .influence-word.accent { color: var(--green); }
.influence-meta { opacity: 0.7; transition: opacity 0.3s; font-size: 0.75rem; color: var(--dust); }

/* Contact (Police Inter forcée pour formulaires clairs) */
.glass-card { background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.07); padding: 1.5rem; margin-top: 2rem; }
.form-input { background: transparent; border: none; border-bottom: 1px solid var(--stone); color: var(--off-white); outline: none; transition: border-color 0.3s ease; padding: 1rem 0; width: 100%; font-size: 1rem; font-family: "Inter", sans-serif; }
.form-input:focus { border-bottom-color: var(--green); }
.submit-btn { width: 100%; padding: 1.25rem; font-weight: bold; text-transform: uppercase; letter-spacing: 0.1em; background: var(--green); color: white; border: none; transition: all 0.3s; margin-top: 1rem; }
.social-link { font-size: 1.25rem; font-weight: bold; color: var(--off-white); text-decoration: none; transition: color 0.3s; }
.social-link:hover { color: var(--green); }

/* =========================================
   FOOTER MINIMALISTE
========================================= */
.site-footer { padding: 6rem 0 2rem 0; background-color: var(--concrete); }
.footer-layout { display: flex; flex-direction: column; gap: 3rem; margin-bottom: 6rem; }
.footer-block { display: flex; flex-direction: column; }
.footer-link { color: var(--off-white); text-decoration: none; transition: all 0.3s ease; display: inline-block; }
.footer-link:hover { color: var(--green); }
.footer-social-list { display: flex; flex-direction: column; gap: 1rem; }
.footer-bottom-line { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding-top: 2rem; border-top: 1px solid var(--stone); }
/* =========================================
   PROJET INTERNE : SPECIFIC
========================================= */
.project-hero { padding-top: 8rem; padding-bottom: 4rem; border-bottom: 1px solid var(--stone); }
.carousel-wrap { position: relative; overflow: hidden; background: var(--concrete-light); aspect-ratio: 4/3; }
.carousel-track {
    display: flex;
    align-items: stretch; /* Empêche Safari d'écraser la hauteur */
}

.carousel-slide {
    flex: 0 0 100%; /* Règle d'or pour iOS : interdiction de rétrécir */
    width: 100%;
    min-width: 100%;
}

.carousel-slide img {
    width: 100%;
    height: auto; /* Ou 100% selon ton design */
    max-height: 70vh; /* Sécurité pour ne pas déborder de l'écran mobile */
    object-fit: contain; /* Garde les proportions de ton image intactes */
    display: block;
}
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(26,26,24,0.7); border: 1px solid var(--stone); color: var(--dust); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; z-index: 10; }
#btn-prev { left: 8px; } #btn-next { right: 8px; }
.carousel-counter { position: absolute; bottom: 8px; right: 8px; font-size: 0.6rem; padding: 4px 8px; background: rgba(26,26,24,0.6); color: var(--dust); }
.thumbs { display: flex; gap: 4px; margin-top: 4px; overflow-x: auto; scrollbar-width: none; }
.thumb { flex-shrink: 0; width: 70px; height: 50px; overflow: hidden; border: 1px solid transparent; background: var(--concrete-light); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--green); }

/* Navigation Inter-Projets */
.nav-projects-container { min-height: 120px; grid-template-columns: 1fr; }
.nav-project-card { display: flex; flex-direction: column; justify-content: center; padding: 2rem 1.5rem; text-decoration: none; transition: background 0.3s; border-bottom: 1px solid var(--stone); }
.nav-next { align-items: flex-start; border-bottom: none; }

/* Lightbox */
#lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.98); z-index: 2000; display: none; align-items: center; justify-content: center; }
#lightbox.open { display: flex; }
#lightbox img { max-width: 100vw; max-height: 90vh; object-fit: contain; }
#lightbox-close { position: absolute; top: 16px; right: 16px; color: var(--off-white); font-size: 2rem; background: none; border: none; }
.lb-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); border: none; color: var(--off-white); padding: 12px; font-size: 1.5rem; }
#lb-prev { left: 0; } #lb-next { right: 0; }

/* =========================================
   MEDIA QUERIES (Desktop / Tablettes)
========================================= */
@media (min-width: 768px) {
    .container { padding: 0 2rem; }
    .section-padding { padding: 10rem 0; }
    .hero { padding: 8rem 0 6rem 0; }
    .navbar { padding: 1.5rem 0; }
    
    .nav-links { display: flex; }
    .hero-content { flex-direction: row; align-items: flex-end; justify-content: space-between; }
    
    .about-grid { grid-template-columns: 5fr 7fr; gap: 4rem; }
    .vertical-divider { height: 80px; margin: 2.5rem 0; }
    
    /* Stats Desktop */
    .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); text-align: left; margin-top: 4rem; }
    .stat-item { align-items: flex-start; }
    .stat-border-r { border-right: 1px solid var(--stone); border-bottom: none; padding-right: 2rem; padding-bottom: 0; }
    .stat-pad-x { padding: 0 2rem; border-bottom: none; }
    .stat-pad-l { padding-left: 2rem; }
    
    /* Projects Desktop Layout 2 Colonnes Stable */
    .projects-header { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 0; margin-bottom: 3rem; }
    .project-card { padding: 3rem 0; }
    .project-card:hover { background: var(--concrete-mid); }
    .project-card:hover .project-visual img,
    .project-card:hover .project-visual video { filter: grayscale(0%) contrast(1); }
    
    .project-link { flex-direction: row; align-items: center; justify-content: space-between; gap: 4rem; }
    .project-info { flex-direction: row; flex: 1; max-width: 50%; gap: 1.5rem; }
    .project-visual { width: 45%; height: 22rem; }
    
    /* Skills Desktop */
    .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 4rem; }
    .skill-grid-inner { grid-template-columns: repeat(2, 1fr); }
    .skill-tile { text-align: left; }
    .bars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; }
    
    /* Influences Desktop */
    .influences-grid { grid-template-columns: repeat(2, 1fr); gap: 4rem; }
    .influence-row { flex-direction: row; align-items: center; padding: 2rem 0; }
    .influence-meta { opacity: 0; }
    
    /* Contact Desktop */
    .contact-grid { grid-template-columns: repeat(2, 1fr); gap: 6rem; }
    .glass-card { padding: 2.5rem; margin-top: 0; }
    
    /* Footer Desktop */
    .footer-layout { flex-direction: row; justify-content: space-between; gap: 2rem; margin-bottom: 8rem; }
    .social-block { align-items: flex-end; text-align: right; }
    .footer-bottom-line { flex-direction: row; justify-content: space-between; }
    
    /* Pages Projet Desktop */
    .project-hero { padding-top: 10rem; padding-bottom: 5rem; }
    .project-hero-grid { grid-template-columns: 8fr 4fr; gap: 4rem; }
    .project-desc-grid { grid-template-columns: repeat(12, 1fr); }
    .project-desc-content { grid-column: 2 / span 7; }
    
    .carousel-wrap { aspect-ratio: 16/9; }
    .carousel-btn { width: 44px; height: 44px; }
    #btn-prev { left: 16px; } #btn-next { right: 16px; }
    .carousel-counter { bottom: 12px; right: 16px; font-size: 0.65rem; padding: 4px 10px; }
    
    .nav-projects-container { grid-template-columns: repeat(2, 1fr); min-height: 140px; }
    .nav-project-card { border-bottom: none; padding: 2.5rem 2rem; }
    .nav-prev { border-right: 1px solid var(--stone); }
    .nav-next { align-items: flex-end; text-align: right; }
    
    .lb-btn { padding: 12px 18px; font-size: 1.3rem; border: 1px solid var(--stone); }
    #lb-prev { left: 24px; } #lb-next { right: 24px; }
    #lightbox-close { top: 24px; right: 32px; }
    
    /* L'avatar reprend sa taille normale sur ordinateur */
    .avatar-container { max-width: 100%; margin: 0; }
}