/* --- VARIABLES & BASE --- */
:root {
    --bg: #f2f4f2;
    --text: #10161c;
    --muted: #5c6864;
    --border: rgba(16, 22, 28, 0.14);
    --card: #e9ece9;
    --accent: #1f8f63;
    --accent-strong: #146848;

    --font-serif: "IBM Plex Serif", Georgia, serif;
    --font-sans: "IBM Plex Sans", -apple-system, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1216;
        --text: #eef1ee;
        --muted: #8fa199;
        --border: rgba(238, 241, 238, 0.16);
        --card: #161d22;
        --accent: #34c48a;
        --accent-strong: #5fe0a8;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: min(980px, 92%);
    margin: auto;
}

/* --- SUPPRESSION DU BLEU PAR DEFAUT --- */
a,
a:visited,
a:hover,
a:active {
    text-decoration: none !important;
    color: inherit !important;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- NAVIGATION --- */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 0;
}

.logo {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 1rem;
    color: var(--muted);
}

.nav-links {
    display: flex;
    gap: 12px;
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--border) !important;
    background: transparent;
    color: var(--muted) !important;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-pill:hover {
    border-color: var(--accent) !important;
    color: var(--accent-strong) !important;
    background: var(--card);
}

/* --- HERO --- */
.hero {
    margin-top: 60px;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 22px 22px;
    background-position: -8px -8px;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 0.02em;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    margin-bottom: 24px;
}

.status-tag .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
    .status-tag .dot {
        animation: pulse 2.4s ease-in-out infinite;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 600;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 550px;
    margin-bottom: 35px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Boutons Circulaires (GitHub, LinkedIn) */
.btn-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50% !important;
    border: 1px solid var(--border) !important;
    background: var(--bg) !important;
    color: var(--text) !important;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--card) !important;
    border-color: var(--accent) !important;
    transform: translateY(-2px);
}

/* Bouton CV - Etat normal, visite et actif */
.btn-primary-pill,
.btn-primary-pill:visited,
.btn-primary-pill:active {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px;
    padding: 0 24px;
    height: 48px;
    background: var(--accent) !important;
    color: #ffffff !important;
    border-radius: 999px !important;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn-primary-pill i,
.btn-primary-pill:visited i {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

.btn-primary-pill:hover {
    background: var(--accent-strong) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(31, 143, 99, 0.25);
    color: #ffffff !important;
}

/* SECTIONS */
.section {
    margin-top: 100px;
}

h2 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 25px;
}

/* Schema (About) : cle/valeur, comme une definition de table */
.schema {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.schema-row {
    display: flex;
    gap: 24px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.schema-row:last-child {
    border-bottom: none;
}

.schema-row .key {
    flex: 0 0 100px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-strong);
}

.schema-row .val {
    color: var(--text);
}

/* La Carte du Projet */
.project-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    transition: box-shadow 0.3s ease;
}

.project-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.project-card.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.project-card.reveal.in-view {
    opacity: 1;
    transform: none;
}

.pipeline-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
}

.pipeline-flow span:not(:last-child)::after {
    content: "→";
    margin-left: 6px;
    color: var(--border);
}

.pipeline-flow .ok {
    color: var(--accent-strong);
    font-weight: 500;
}

.project-card h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.project-card h3 .tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: var(--muted);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 10px;
}

.project-links {
    display: flex;
    gap: 12px;
    margin: 16px 0 20px;
}

/* Container de la Viz pour le Responsive */
.dashboard-wrapper {
    position: relative;
    width: 100%;
    /* Ratio pour desktop (Hauteur de 600px environ) */
    padding-top: 55%;
    margin-top: 20px;
}

.dashboard-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
}

/* --- FOOTER --- */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 100px;
    padding: 30px 0 60px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* --- RESPONSIVE NAVIGATION --- */
@media (max-width: 600px) {
    .nav {
        flex-direction: column;
        /* On empile le logo et les liens */
        gap: 20px;
        padding: 20px 0;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        /* On centre les boutons */
        flex-wrap: wrap;
        /* Si trop de boutons, ils passent a la ligne */
        gap: 8px;
    }

    .nav-links .btn-pill {
        padding: 6px 14px;
        /* On reduit un peu la taille sur mobile */
        font-size: 0.85rem;
        height: 36px;
    }

    /* Optionnel : Ajustement du Hero sur mobile */
    .hero h1 {
        font-size: 1.8rem;
        /* Titre plus petit pour mobile */
        text-align: center;
    }

    .hero .subtitle {
        text-align: center;
        margin: 0 auto 30px auto;
    }

    .status-tag {
        margin-left: auto;
        margin-right: auto;
    }

    .hero {
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
        /* Centre les icones et le bouton CV */
        flex-wrap: wrap;
    }

    .schema-row {
        flex-direction: column;
        gap: 4px;
    }

    .schema-row .key {
        flex: none;
    }

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

    /* --- AJOUT POUR LES PROJETS SUR MOBILE --- */
    .project-card {
        padding: 16px;
        /* On reduit le padding interne pour gagner de la place */
        margin: 0 -15px 20px -15px;
        /* On fait deborder un peu la carte pour un look "full width" */
        border-radius: 8px;
        /* On adoucit les angles */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        /* Ombre plus legere sur mobile */
    }

    .dashboard-wrapper {
        /* Tres important : On augmente la hauteur de la viz sur mobile */
        /* Sans ca, Looker Studio sera illisible car trop ecrase */
        padding-top: 150% !important;
        width: 100% !important;
    }

    .dashboard-wrapper iframe {
        border-radius: 4px;
    }

    .project-links {
        display: flex;
        flex-direction: column;
        /* On empile les boutons GitHub/Docs sur mobile */
        gap: 10px;
    }

    .project-links .btn-pill {
        width: 100%;
        /* Les boutons prennent toute la largeur */
        text-align: center;
    }

    svg[data-lucide],
    i[data-lucide] {
        width: 24px !important;
        height: 24px !important;
        display: inline-block !important;
        stroke-width: 2;
    }
}
