/* --- 1. CONFIGURATION & VARIABLES --- */
:root {
    /* Brand Colors (Constant) - Utilisées pour les gradients */
    --apps: #cf52bc;
    --auto: #3a96dd;
    --dataverse: #14B258;
    --bi: #FFA500;
    --sp: #29B4A7;
    

    /* LIGHT THEME */
    --bg-main: #f8fafc;
    --bg-secondary: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --card-hover: #f1f5f9;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --shadow: rgba(0, 0, 0, 0.1);
    --gradient-overlay: radial-gradient(circle at 15% 50%, rgba(160, 85, 245, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(60, 151, 232, 0.08), transparent 25%);

    --container-max: 1200px;
    --container-pad: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Offset pour la nav fixe */
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    background-image: var(--gradient-overlay);
    /* scroll au lieu de fixed : évite les repaints à chaque frame et le scroll saccadé */
    background-attachment: scroll;
    transition: background-color 0.3s, color 0.3s;
}

/* Masquer la page d'accueil lors du chargement direct d'un article (évite le flash) */
/* Le script preload.js ajoute un style inline qui masque ces éléments */

#about,
#technos,
#blog,
#references,
#contact{
  max-width: var(--container-max) !important;
  width: 100%;
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* --- 2. NAVIGATION --- */
.nav-wrapper {
    position: fixed;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1000;
    /* Réduit les repaints au scroll (backdrop-filter coûteux) */
    will-change: transform;
    transform: translateZ(0);
}

nav {
    background: var(--nav-bg);
    backdrop-filter: none;
    padding: 8px 25px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 20px;
    align-items: center;
    box-shadow: 0 10px 30px var(--shadow);
    transition: 0.3s;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.3s;
    position: relative;
}

nav a:hover,
nav a.active {
    color: var(--text-main);
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--apps);
    border-radius: 50%;
}

.cta-nav {
    background: var(--apps);
    color: var(--bg-main);
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 700;
}

nav a.cta-nav {
    color: var(--bg-main);
}

/* Navigation au clavier améliorée */
nav a:focus-visible {
    outline: 2px solid var(--apps);
    outline-offset: 4px;
    border-radius: 4px;
}

/* --- 3. HERO & BRANDING --- */
header {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 100px;
    position: relative;
    gap: 0; /* Reset for unspecified gap by default */
}

/* Harmonisation de l'espacement vertical dans le header principal */
header#home {
    gap: 26px; /* Harmonisé entre chaque bloc du header (brand-subtitle, h1, .by-line, .subtitle, .hero-badges-container) */
}

.brand-subtitle {
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0 !important;  /* For uniform vertical harmony. Replaced by header gap. */
    font-weight: 700;
}

h1 {
    font-size: 5rem;
    line-height: 1;
    letter-spacing: -2px;
    font-weight: 900;
    margin-bottom: 0 !important; /* Harmonise spacing via gap on parent. */
    color: var(--text-main);
}

h1 span,
.brand-dot {
    background: var(--apps);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.by-line {
    display: inline-block;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0 !important; /* Gap harmonisation. */
    margin-top: 0 !important;
}

.by-line strong {
    color: var(--text-main);
}

.subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto !important; /* Remove bottom margin, using gap instead */
    line-height: 1.6;
}

.hero-badges-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Badges du hero (générés en JS) — styles centralisés pour éviter les inline styles */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid var(--hero-badge-border, var(--border-color));
    background-color: var(--hero-badge-bg, rgba(255, 255, 255, 0.06));
    color: var(--hero-badge-color, var(--text-muted));
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.3s;
}

.hero-badge-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.hero-badge-text {
    display: inline-block;
}

.about-cred {
    margin-top: 25px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cred-badge-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cred-badge-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.cred-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
}

.cred-badge-item:hover .cred-icon {
    transform: scale(1.05);
}

.cred-certification .cred-icon {
    background: linear-gradient(135deg, rgba(58, 150, 221, 0.1), rgba(58, 150, 221, 0.05));
    border-color: rgba(58, 150, 221, 0.3);
    color: #3a96dd;
}

.cred-certification:hover .cred-icon {
    border-color: #3a96dd;
}

.cred-diploma .cred-icon {
    background: linear-gradient(135deg, rgba(160, 85, 245, 0.1), rgba(160, 85, 245, 0.05));
    border-color: rgba(160, 85, 245, 0.3);
    color: #A055F5;
}

.cred-diploma:hover .cred-icon {
    border-color: #A055F5;
}

.cred-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cred-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.cred-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-main);
    font-weight: 500;
}


/* Responsive improvements for header#home spacing */
@media (max-width: 900px) {
    header#home {
        gap: 18px;
    }
}
@media (max-width: 768px) {
    header#home {
        gap: 14px;
    }
}
@media (max-width: 480px) {
    header#home {
        gap: 10px;
    }
}

.section-title-accent {
    color: var(--apps);
}


.blog-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    color: var(--text-main);
}

.blog-subtitle {
    color: var(--text-muted);
}

.contact-title {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 20px;
    color: var(--text-main);
}

.contact-description {
    color: var(--text-muted);
    margin-bottom: 40px;
}

.contact-email {
    margin-bottom: 20px;
}

.contact-label {
    display: block;
    color: var(--text-main);
}

.contact-link {
    color: var(--apps);
    text-decoration: none;
    transition: 0.3s;
}

.contact-link:hover {
    opacity: 0.8;
}

.footer-content {
    text-align: center;
    padding: 40px 20px;
}

.footer-copyright {
    margin-bottom: 15px;
    color: var(--text-muted);
}

.footer-links {
    font-size: 0.85rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.3s;
}

.footer-link:hover {
    color: var(--apps);
}

/* --- 4. ABOUT & CV --- */
#about {
    padding: 80px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.about-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    padding: 50px;
    border-radius: 40px;
    backdrop-filter: none;
    /* Couche de composition pour un scroll fluide avec backdrop-filter */
    transform: translateZ(0);
}

.about-image .img-box {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 30px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px;
}

.exp-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: var(--text-main);
    color: var(--bg-main);
    padding: 15px 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px var(--shadow);
}

.exp-badge span {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.about-text h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
}

.cv-download {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    border-radius: 20px;
    font-weight: 700;
    transition: 0.3s;
    text-decoration: none;
    border: 1px solid;
    /* Les couleurs sont appliquées via JavaScript depuis tagConfig */
    /* Forcer le fond coloré */
    background-color: rgba(160, 85, 245, 0.15) !important;
    border-color: #A055F5 !important;
    color: #A055F5 !important;
}

.cv-download:hover {
    opacity: 0.9;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* --- 5. BENTO TECHNO --- */
#technos {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

#technos .bento-grid {
    width: 100%;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-align: center;
    font-weight: 900;
    color: var(--text-main);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    width: 100%;
    position: relative;
    align-items: stretch;
}


.bento-cell {
    background: var(--bg-secondary);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    padding: 40px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: none;
    height: 100%;
    min-height: 100%;
    /* Couche de composition : animations + backdrop-filter sans saccades au scroll */
    transform: translateZ(0);
}

/* Power Apps - Harmonisé avec les filtres */
.cell-apps {
    background: rgba(160, 85, 245, 0.15);
    border: 1px solid rgba(160, 85, 245, 0.3);
    position: relative;
}

.cell-apps::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(160, 85, 245, 0.08), transparent);
    animation: slideRight 6s ease-in-out infinite;
    pointer-events: none;
}

.cell-apps::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at top left, rgba(160, 85, 245, 0.06), transparent 60%);
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* Power Automate - Harmonisé avec les filtres */
.cell-auto {
    background: rgba(60, 151, 232, 0.15);
    border: 1px solid rgba(60, 151, 232, 0.3);
    position: relative;
}

.cell-auto::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(60, 151, 232, 0.08), transparent);
    animation: slideLeft 7s ease-in-out infinite;
    pointer-events: none;
}

.cell-auto::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at bottom right, rgba(60, 151, 232, 0.06), transparent 60%);
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* Dataverse - Harmonisé avec les filtres */
.cell-dataverse {
    background: rgba(20, 178, 88, 0.15);
    border: 1px solid rgba(20, 178, 88, 0.3);
    position: relative;
}

.cell-dataverse::before {
    content: '';
    position: absolute;
    top: -100%;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(20, 178, 88, 0.06), transparent);
    animation: slideDown 5s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* SharePoint - Harmonisé avec les filtres */
.cell-sp {
    background: rgba(41, 180, 167, 0.15);
    border: 1px solid rgba(41, 180, 167, 0.3);
    position: relative;
}

.cell-sp::before {
    content: '';
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(41, 180, 167, 0.06), transparent);
    animation: slideUp 6s ease-in-out infinite 2s;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

@keyframes slideRight {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes slideLeft {
    0% {
        right: -100%;
    }
    50% {
        right: 100%;
    }
    100% {
        right: 100%;
    }
}

@keyframes slideDown {
    0% {
        top: -100%;
    }
    50% {
        top: 100%;
    }
    100% {
        top: 100%;
    }
}

@keyframes slideUp {
    0% {
        bottom: -100%;
    }
    50% {
        bottom: 100%;
    }
    100% {
        bottom: 100%;
    }
}

.bento-cell:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* Hover basé sur les couleurs - effet moderne */
.cell-apps:hover {
    background: rgba(160, 85, 245, 0.25);
    border-color: #A055F5;
    box-shadow: 0 12px 24px rgba(160, 85, 245, 0.2);
}

.cell-apps:hover::after {
    background: radial-gradient(circle at top left, rgba(160, 85, 245, 0.15), transparent 60%);
    opacity: 1;
}

.cell-auto:hover {
    background: rgba(60, 151, 232, 0.25);
    border-color: #3C97E8;
    box-shadow: 0 12px 24px rgba(60, 151, 232, 0.2);
}

.cell-auto:hover::after {
    background: radial-gradient(circle at bottom right, rgba(60, 151, 232, 0.15), transparent 60%);
    opacity: 1;
}

.cell-dataverse:hover {
    background: rgba(20, 178, 88, 0.25);
    border-color: #14B258;
    box-shadow: 0 12px 24px rgba(20, 178, 88, 0.2);
}

.cell-dataverse:hover::before {
    background: linear-gradient(180deg, transparent, rgba(20, 178, 88, 0.12), transparent);
    opacity: 1;
}

.cell-sp:hover {
    background: rgba(41, 180, 167, 0.25);
    border-color: #29B4A7;
    box-shadow: 0 12px 24px rgba(41, 180, 167, 0.2);
}

.cell-sp:hover::before {
    background: linear-gradient(180deg, transparent, rgba(41, 180, 167, 0.12), transparent);
    opacity: 1;
}

.bento-cell h3 {
    font-size: 1.6rem;
    z-index: 3;
    color: var(--text-main);
    font-weight: 800;
    margin-bottom: 12px;
    position: relative;
    letter-spacing: -0.5px;
}

.bento-cell p {
    color: var(--text-muted);
    z-index: 3;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
}

.real-icon,
.tech-icon {
    width: 45px;
    height: 45px;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: contain;
}

.bento-cell:hover .real-icon,
.bento-cell:hover .tech-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Grid layout for bento cells */
/* Ligne 1 : Power Apps (2/3 = span 2) | Dataverse (1/3 = span 1) */
.cell-apps {
    grid-column: 1 / span 2;
    grid-row: 1;
}

.cell-dataverse {
    grid-column: 3;
    grid-row: 1;
}

/* Ligne 2 : SharePoint (1/3 = span 1) | Power Automate (2/3 = span 2) */
.cell-sp {
    grid-column: 1;
    grid-row: 2;
}

.cell-auto {
    grid-column: 2 / span 2;
    grid-row: 2;
}

/* Text styles are defined in .bento-cell h3 and .bento-cell p above */

/* --- 6. BLOG SECTION --- */
#blog {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.blog-header-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
}

.blog-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 350px;
}

.blog-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: 0.3s;
}

.blog-search-input:focus {
    border-color: var(--apps);
    box-shadow: 0 0 0 3px rgba(160, 85, 245, 0.1);
}

.blog-search-input::placeholder {
    color: var(--text-muted);
}

.blog-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.blog-search-input:focus + .blog-search-icon {
    color: var(--apps);
}

.blog-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    letter-spacing: 0.3px;
    outline: none;
}

.filter-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    filter: brightness(1.1);
}

.filter-btn:active {
    transform: translateY(0);
}

.filter-btn:focus-visible {
    outline: 2px solid var(--apps);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Classes pour les états des filtres (remplace les styles inline JS) */
.filter-btn.filter-active:not([data-filter="all"]) {
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.filter-btn.filter-inactive:not([data-filter="all"]) {
    font-weight: 600;
}

/* Les couleurs de fond et bordure sont appliquées via les data attributes dans le JS */
.filter-btn:not([data-filter="all"]) {
    background-color: var(--filter-bg-color, var(--bg-secondary));
    border-color: var(--filter-border-color, var(--border-color));
    color: var(--filter-text-color, var(--text-muted));
}

.filter-btn.active:not([data-filter="all"]) {
    background-color: var(--filter-active-color);
    border-color: var(--filter-active-color);
    color: #ffffff;
}

/* Classes pour les animations des cartes blog (remplace les styles inline JS) */
.blog-card.card-hidden {
    opacity: 0;
    transform: scale(0.95);
    display: none !important;
}

.blog-card.card-visible {
    opacity: 1;
    transform: scale(1);
    display: flex !important;
}

.blog-card.card-fade-in {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Filtres colorés : fond plein et texte blanc quand actif ou focus */
.filter-btn.active:not([data-filter="all"]),
.filter-btn:focus:not([data-filter="all"]) {
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.filter-btn[data-filter="all"] {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-muted);
}

.filter-btn[data-filter="all"]:hover {
    background: var(--card-hover);
}

.filter-btn[data-filter="all"].active {
    background: var(--text-main);
    color: var(--bg-main);
    border-color: var(--text-main);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.blog-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.blog-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 1;
    transform: scale(1);
}

.blog-card:hover {
    border-color: var(--auto);
    background: var(--card-hover);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.blog-card:focus-visible {
    outline: 2px solid var(--apps);
    outline-offset: 4px;
    border-radius: 4px;
}

.blog-tag {
    font-size: 0.85rem;
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 8px 18px;
    border-radius: 20px;
    width: fit-content;
    border: 1px solid;
    transition: 0.3s;
    /* Même design que les filtres */
}

/* Les couleurs des tags sont maintenant définies dans tagConfig (articles-data.js) */
/* et appliquées via inline styles pour centralisation */
.tag-apps,
.tag-auto,
.tag-data,
.tag-bi,
.tag-sp {
    border: 1px solid;
    transition: 0.3s;
}

.blog-tag:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    filter: brightness(1.1);
}

.blog-card h4 {
    font-size: 1.4rem;
    line-height: 1.3;
    color: var(--text-main);
}

.blog-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.blog-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.blog-no-results {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.blog-no-results svg {
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 20px;
}

.blog-no-results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
}

.blog-no-results-text {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 400px;
}

/* --- ANIMATIONS AU SCROLL --- */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-card {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.fade-in-card.fade-in-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}


.read-more {
    color: var(--auto);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- 7. ARTICLE DETAIL VIEW (OVERLAY) --- */
#article-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    z-index: 2000;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.86, 0, 0.07, 1);
    display: flex;
    justify-content: center;
}

#article-view.active {
    transform: translateY(0);
}

/* Désactiver l'animation pour les liens directs */
#article-view.no-animation {
    transform: translateY(0);
    transition: none;
}

/* Masquer la vue principale lors du chargement direct d'un article */
#main-view.hidden-on-load {
    display: none !important;
}

.article-content-wrapper {
    max-width: 800px;
    padding: 100px 20px;
    width: 100%;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 30px;
    transition: 0.2s;
}

.back-btn:hover {
    color: var(--text-main);
    transform: translateX(-5px);
}

.article-category {
    display: inline-block;
    margin-bottom: 15px;
}

.article-header h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.meta-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.article-technologies {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.tech-label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.tech-tag {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: 0.3s;
}

.tech-tag:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.article-body h2 {
    color: var(--text-main);
    margin-top: 40px;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.article-body p {
    margin-bottom: 20px;
}

.article-body code {
    background: var(--bg-secondary);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid var(--border-color);
    font-size: 0.9em;
    word-break: break-all;
}

.article-body pre {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin: 20px 0;
}

.article-body pre code {
    background: transparent;
    padding: 0;
    border: none;
    display: block;
    white-space: pre;
    word-break: normal;
}

.article-body em {
    font-style: italic;
    color: var(--text-main);
}

.article-body strong {
    font-weight: 700;
    color: var(--text-main);
}

.article-body ul,
.article-body ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-body li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.article-body blockquote {
    border-left: 4px solid var(--auto);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--text-muted);
}

.article-body a {
    color: var(--auto);
    text-decoration: underline;
    transition: 0.3s;
}

.article-body a:hover {
    color: var(--apps);
}

.share-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.share-btn:hover {
    background: var(--border-color);
}

/* Share Notification */
.share-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow);
    z-index: 3000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.share-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- REFERENCES SECTION --- */
#references { padding: 100px 20px; max-width: 1200px; margin: 0 auto; }

.references-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.ref-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 35px;
    transition: all 0.3s ease;
}

.ref-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

/* Nouveau style pour l'icône image */
.company-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden; /* Empêche le débordement de l'image */
}

.company-icon img {
    max-width: 80%;
    max-height: 80%;
    width: auto;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.1));
    object-fit: contain; /* Préserve le ratio sans déformation */
}

/* Style élégant pour EDF / Assystem */
.client-split {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.client-split .separator {
    color: var(--text-muted);
    font-weight: 300;
    opacity: 0.5;
}

.client-split small {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

h3 small {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.ref-role {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0;
}

.project-list li {
    display: flex;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.project-list li svg {
    min-width: 18px;
    width: 18px;
    margin-top: 3px;
}

.project-highlight {
    color: var(--apps);
    display: inline-block;
    margin-top: 6px;
}

/* --- 8. CONTACT FORM --- */
#contact {
    padding: 100px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.contact-container {
    background: var(--bg-secondary);
    border-radius: 40px;
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

.contact-info {
    padding: 60px;
    background: linear-gradient(135deg, rgba(60, 151, 232, 0.1), rgba(160, 85, 245, 0.1));
}

.contact-form-wrapper {
    padding: 60px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

/* Messages d'erreur du formulaire (styles centralisés, remplace les inline styles HTML) */
.form-error {
    display: none;
    color: #cf4444;
    font-size: 0.92em;
    margin-top: 4px;
}

/* Floating label fix, textarea special handling to avoid overlap when scrolled */
.form-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border-color);
    padding: 15px 0;
    color: var(--text-main);
    font-size: 1.1rem;
    outline: none;
    transition: 0.3s;
    resize: none; /* Optionally can be removed if resizing is wanted. See below. */
}

/* On "focus", la bordure change */
.form-input:focus {
    border-color: var(--apps);
}

/* --- Floating label behavior --- */
.form-label {
    position: absolute;
    top: 15px;
    left: 0;
    color: var(--text-muted);
    pointer-events: none;
    transition: 0.3s;
    z-index: 2;
    background: transparent;
    /* To avoid overlap in textarea scroll, apply a small background overlay */
    padding-right: 8px;
    max-width: calc(100% - 8px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* For textarea, background under the floating label when floating */
textarea.form-input ~ .form-label {
    background: var(--bg-secondary);
    /* Fix so label isn't cut when scrolled */
    padding-left: 2px;
}

/* Floating position for all input/textarea */
.form-input:not(:placeholder-shown) ~ .form-label,
.form-input:focus ~ .form-label {
    top: -10px;
    font-size: 0.8rem;
    color: var(--apps);
    background: var(--bg-secondary);
    padding-left: 2px;
    padding-right: 8px;
    max-width: calc(100% - 8px);
}

/* When textarea is scrolled, label stays visible above */
textarea.form-input:focus ~ .form-label,
textarea.form-input:not(:placeholder-shown) ~ .form-label {
    position: absolute;
    top: -10px;
    left: 0;
    background: var(--bg-secondary);
    padding-left: 2px;
    padding-right: 8px;
    max-width: calc(100% - 8px);
    pointer-events: none;
}

/* Initial label state */
.form-input:placeholder-shown ~ .form-label {
    top: 15px;
    font-size: 1rem;
    color: var(--text-muted);
    background: transparent;
    padding-left: 0;
    padding-right: 8px;
}

/* Hide real placeholder text */
.form-input::placeholder {
    color: transparent;
    opacity: 0;
}

/* Option: allow vertical resizing only for textarea. Comment out to prevent resize. */
textarea.form-input {
    resize: vertical;
    min-height: 90px;
    max-height: 260px;
    box-sizing: border-box;
    overflow: auto;
}

/* Ensure the label does not affect textarea scroll area ("inset" approach) */
.form-group {
    /* Ensure enough padding-top for textarea label floating */
    padding-top: 10px;
}


/* Pour garantir la compatibilité avec les navigateurs qui ne supportent pas :placeholder-shown (très rare aujourd'hui), 
 * on pourrait choisir d'utiliser JS pour ajouter une classe 'has-content' sur .form-input quand il y a du texte.
 * Mais ici le support CSS est suffisant sur tous les navigateurs principaux.
 */

button[type="submit"] {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    background: var(--apps);
    color: var(--bg-main);
    cursor: pointer;
    transition: 0.3s;
}

button[type="submit"]:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}


#success-msg {
    display: none;
    text-align: center;
    color: #14B258;
    font-weight: bold;
    margin-top: 15px;
}

footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: 80px;
}

footer p {
    margin-bottom: 15px;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.3s;
}

footer a:hover {
    color: var(--apps);
}

/* --- MENTIONS LÉGALES --- */
.mentions-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 120px 20px 80px;
    width: 100%;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 40px;
    transition: 0.3s;
    font-size: 0.95rem;
}

.back-link:hover {
    color: var(--text-main);
    transform: translateX(-5px);
}

.back-link svg {
    transition: transform 0.3s;
}

.back-link:hover svg {
    transform: translateX(-3px);
}

.mentions-header {
    margin-bottom: 50px;
}

.mentions-header h1 {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 15px;
    line-height: 1.2;
}

.mentions-header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0;
}

.mentions-section {
    margin-bottom: 50px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 35px;
    transition: 0.3s;
}

.mentions-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.mentions-section h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.mentions-section h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 25px;
    margin-bottom: 15px;
}

.mentions-section p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 15px;
    font-size: 1rem;
}

.mentions-section p:last-child {
    margin-bottom: 0;
}

.mentions-section ul {
    margin: 20px 0;
    padding-left: 30px;
    list-style-type: disc;
}

.mentions-section li {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
    font-size: 1rem;
}

.mentions-section strong {
    color: var(--text-main);
    font-weight: 700;
}

.mentions-section a {
    color: var(--apps);
    text-decoration: none;
    transition: 0.3s;
}

.mentions-section a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* --- 404 PAGE --- */
.error-404-container {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
}

.error-404-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.error-404-title {
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 20px;
    background: linear-gradient(45deg, var(--apps), var(--auto));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.error-404-subtitle {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
}

.error-404-description {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    line-height: 1.6;
}

.error-404-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-404-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 20px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.3s;
    font-size: 1rem;
}

.error-404-btn-primary {
    background: var(--text-main);
    color: var(--bg-main);
    border: 1px solid var(--text-main);
}

.error-404-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.error-404-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.error-404-btn-secondary:hover {
    background: var(--card-hover);
    border-color: var(--apps);
    color: var(--apps);
    transform: translateY(-2px);
}

.error-404-btn svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 600px) {
    .error-404-title {
        font-size: 5rem;
    }

    .error-404-subtitle {
        font-size: 2rem;
    }

    .error-404-actions {
        flex-direction: column;
    }

    .error-404-btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- RESPONSIVE --- */

/* Tablette (768px - 900px) */
@media (max-width: 900px) {
    h1 {
        font-size: 4rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .about-wrapper {
        grid-template-columns: 1fr;
        padding: 40px;
        gap: 40px;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .cell-apps,
    .cell-auto,
    .cell-dataverse,
    .cell-sp {
        grid-column: 1;
        grid-row: auto;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }

    .article-content-wrapper {
        padding: 80px 20px;
    }

    .blog-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .blog-header-controls {
        width: 100%;
        align-items: stretch;
    }

    .blog-search-wrapper {
        max-width: 100%;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* Navigation */
    .nav-wrapper {
        top: 10px;
        padding: 0 10px;
    }

    nav {
        padding: 6px 15px;
        gap: 12px;
        font-size: 0.85rem;
    }

    nav a {
        font-size: 0.8rem;
    }

    .cta-nav {
        padding: 6px 15px;
    }

    /* Hero */
    header {
        padding-top: 80px;
        min-height: 80vh;
    }

    h1 {
        font-size: 3rem;
        letter-spacing: -1px;
    }

    .brand-subtitle {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }

    .subtitle {
        font-size: 1rem;
        padding: 0 20px;
    }

    .by-line {
        font-size: 0.85rem;
        padding: 4px 12px;
    }

    /* Sections */
    #about,
    #technos,
    #blog,
    #contact {
        padding: 60px 15px;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    /* About */
    .about-wrapper {
        padding: 30px 20px;
        gap: 30px;
    }

    .about-text h2 {
        font-size: 1.8rem;
    }

    .about-text p {
        font-size: 0.95rem;
    }

    .exp-badge {
        bottom: -15px;
        right: -15px;
        padding: 12px 20px;
    }

    .exp-badge span {
        font-size: 1.5rem;
    }

    /* Bento Grid */
    .bento-cell {
        padding: 30px 20px;
    }

    .bento-cell h3 {
        font-size: 1.4rem;
    }

    .bento-cell p {
        font-size: 0.9rem;
    }

    /* Blog */
    .blog-title {
        font-size: 2rem;
    }

    .blog-subtitle {
        font-size: 0.9rem;
    }

    .blog-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .blog-card {
        padding: 25px 20px;
    }

    .blog-card h4 {
        font-size: 1.2rem;
    }

    .about-cred {
        margin-top: 20px;
        gap: 10px;
    }

    .cred-badge-item {
        padding: 14px 16px;
        gap: 10px;
    }

    .cred-icon {
        width: 36px;
        height: 36px;
    }

    .cred-icon svg {
        width: 16px;
        height: 16px;
    }

    .cred-label {
        font-size: 0.7rem;
    }

    .cred-text {
        font-size: 0.9rem;
    }

    /* Contact */
    .contact-container {
        border-radius: 30px;
    }

    .contact-info,
    .contact-form-wrapper {
        padding: 40px 25px;
    }

    .contact-title {
        font-size: 1.8rem;
    }

    /* Article */
    .article-content-wrapper {
        padding: 60px 15px;
    }

    .article-header h1 {
        font-size: 2.2rem;
    }

    .article-body {
        font-size: 1rem;
    }

    .article-body h2 {
        font-size: 1.5rem;
    }
}

/* Très petits écrans (max-width: 480px) */
@media (max-width: 480px) {
    /* Navigation */
    nav {
        padding: 5px 10px;
        gap: 8px;
    }

    nav a {
        font-size: 0.75rem;
    }

    .cta-nav {
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    /* Hero */
    h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    /* Sections */
    #about,
    #technos,
    #blog,
    #contact {
        padding: 40px 10px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    /* About */
    .about-wrapper {
        padding: 20px 15px;
        border-radius: 30px;
    }

    .about-text h2 {
        font-size: 1.6rem;
    }

    /* Credentials */
    .about-cred {
        margin-top: 18px;
        gap: 8px;
    }

    .cred-badge-item {
        padding: 12px 14px;
        gap: 8px;
    }

    .cred-icon {
        width: 32px;
        height: 32px;
    }

    .cred-icon svg {
        width: 14px;
        height: 14px;
    }

    .cred-label {
        font-size: 0.65rem;
    }

    .cred-text {
        font-size: 0.85rem;
    }

    /* Bento */
    .bento-cell {
        padding: 25px 15px;
        border-radius: 20px;
    }

    .bento-cell h3 {
        font-size: 1.3rem;
    }

    /* Blog */
    .blog-title {
        font-size: 1.8rem;
    }

    .blog-card {
        padding: 20px 15px;
        border-radius: 24px;
    }

    /* Contact */
    .contact-container {
        border-radius: 24px;
    }

    .contact-info,
    .contact-form-wrapper {
        padding: 30px 20px;
    }

    /* Article */
    .article-header h1 {
        font-size: 1.8rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}