/* ==========================================================================
   1. RESET GLOBAL & BASES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scrollbar-gutter: stable;
}

body {
    background-color: #0a0b10;
    color: #ffffff;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* ==========================================================================
   ANIMATIONS DE TRANSITION (Ciblent uniquement le contenu)
   ========================================================================== */
body .container {
    opacity: 0;
    transform: translateY(15px) scale(0.98);
    transition: opacity 0.25s ease-out, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.page-loaded .container {
    opacity: 1;
    transform: translateY(0) scale(1);
}

body.page-exiting .container {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    transition: opacity 0.20s ease-in, transform 0.20s ease-in;
}

/* ==========================================================================
   2. AMBIANCE & BACKGROUND GLOW
   ========================================================================== */
.background-glow {
    position: fixed; /* Fixe les halos pour éviter les espaces vides en bas */
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    filter: blur(80px);
    opacity: 0.15;
}

.bg-glow-1 {
    background: radial-gradient(circle, #6366f1 0%, rgba(0,0,0,0) 70%);
    top: -10%;
    left: -10%;
}

.bg-glow-2 {
    background: radial-gradient(circle, #a855f7 0%, rgba(0,0,0,0) 70%);
    bottom: -10%;
    right: -10%;
}

/* ==========================================================================
   3. STRUCTURE & LAYOUT PRINCIPAL
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    min-height: 100vh; /* Pousse le footer vers le bas */
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 80px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo span {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-bar {
    display: flex;
    gap: 30px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 30px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.nav-link {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #ffffff; 
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover::after {
    width: 100%;
}

/* ==========================================================================
   4. HERO SECTION & ACCUEIL
   ========================================================================== */
main {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    flex-grow: 1; /* Le main absorbe l'espace vide pour le sticky footer */
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ffffff 40%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.hero-subtitle {
    color: #9ca3af;
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 50px;
}

.home-section {
    margin-top: 60px;
    text-align: left;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

/* Grille de statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-box:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    transform: translateY(-5px);
}

.stat-value {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: #a855f7;
    margin-bottom: 5px;
}

.stat-value .unit {
    font-size: 1rem;
    color: #9ca3af;
}

.stat-label {
    font-size: 0.9rem;
    color: #9ca3af;
    font-weight: 500;
}

/* Tags de la stack technique */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tech-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    color: #ffffff;
    transform: translateY(-2px);
}

/* ==========================================================================
   5. GRILLE DE LIENS (CARTES ACCUEIL)
   ========================================================================== */
.grid-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px;
    text-align: left;
    text-decoration: none;
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 15px;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.card p {
    color: #9ca3af;
    font-size: 0.95rem;
    line-height: 1.5;
}

.card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
    border-color: #6366f1;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

.card:hover h3 {
    color: #a855f7;
}

/* ==========================================================================
   6. GRILLE ASYMÉTRIQUE / MASONRY (PAGE LABO)
   ========================================================================== */
.grid-services {
    column-count: 2;
    column-gap: 30px;
    width: 100%;
    margin-bottom: 60px;
}

.service-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    break-inside: avoid; 
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.service-image {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.service-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: left;
}

.service-content h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: #ffffff;
    transition: color 0.3s ease;
}

.service-content p {
    color: #9ca3af;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1;
}

.btn-service {
    display: block;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.server-ip-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #9ca3af;
    text-align: center;
    margin-bottom: 20px;
}

.server-ip-box code {
    color: #a855f7;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: #6366f1;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.12);
}

.service-card:hover h3 {
    color: #a855f7;
}

.service-card:hover .btn-service {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* ==========================================================================
   7. FOOTER PREMIUM
   ========================================================================== */
.modern-footer {
    margin-top: auto;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-left .logo {
    font-size: 1.3rem;
    margin-bottom: 8px;
    display: block;
}

.footer-desc {
    color: #6b7280;
    font-size: 0.85rem;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.footer-right {
    display: flex;
    gap: 20px;
}

.social-link {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: #ffffff;
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    color: #4b5563;
    font-size: 0.8rem;
}

/* ==========================================================================
   8. MEDIA QUERIES (RESPONSIVE)
   ========================================================================== */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    header { margin-bottom: 40px; }
    
    .grid-services {
        column-count: 1;
        column-gap: 0;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}