/* ─── Variables ─── */
:root {
    --accent:      #1a3a2a;
    --accent-dark: #0f2218;
    --bg:          #ffffff;
    --bg-alt:      #f5f2ef;
    --bg-card:     #ede9e4;
    --text:        #111111;
    --text-muted:  #555555;
    --border:      #d8d2ca;
    --nav-h:       68px;
    --max-w:       1080px;
}

/* ─── Reset ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    /* transition sur les couleurs pour le dark mode */
    transition: background-color 0.35s ease, color 0.35s ease;
}

/* ─── Nav ─── */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6%;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: background-color 0.35s ease, border-color 0.35s ease;
}

/* ─── Nav buttons: theme toggle + language toggle ─── */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(26, 58, 42, 0.08);
    box-shadow: 0 0 12px rgba(26, 58, 42, 0.2);
}

.toggle-icon {
    font-size: 1rem;
    line-height: 1;
}

.lang-toggle {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    transition: all 0.2s;
}

.lang-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.logo {
    height: 72px;
    width: 72px;
    object-fit: contain;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 36px;
}

nav ul li a {
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    transition: color 0.2s;
}

nav ul li a:hover {
    color: var(--accent);
}

/* ─── Sections ─── */
.section {
    min-height: 100svh;
    padding: calc(var(--nav-h) + 80px) 6% 80px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.section-alt {
    background: var(--bg-alt);
}

.section-inner {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
}

h2 {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 48px;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 36px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

code {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    background: rgba(26, 58, 42, 0.08);
    color: var(--accent-dark);
    padding: 1px 5px;
    border-radius: 3px;
}

/* ─── Hero ─── */
.hero {
    justify-content: space-between;
    gap: 40px;
    overflow: hidden;
}

.hero-content {
    max-width: 560px;
    z-index: 2;
}

.tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: rgba(26, 58, 42, 0.08);
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 22px;
}

.hero-content h1 {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
}

.accent {
    color: var(--accent);
}

.hero-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* ─── Buttons ─── */
.btn {
    display: inline-block;
    padding: 11px 24px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--accent-dark);
}

.btn-outline {
    display: inline-block;
    padding: 11px 24px;
    border: 2px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--accent);
    color: #fff;
}

.btn-outline-sm {
    display: inline-block;
    padding: 7px 16px;
    border: 1.5px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
    border-radius: 5px;
    transition: all 0.2s;
    margin-top: 14px;
}

.btn-outline-sm:hover {
    background: var(--accent);
    color: #fff;
}

/* ─── Pyramid ─── */
/*
    --s contrôle toute la taille de la pyramide.
    Changer --s suffit pour redimensionner sans toucher au reste.
    border = --s/2 (demi-base du triangle CSS)
    transform-origin = --s/2 (axe de rotation des faces)
    translateY base = --s * 0.365 (empirique pour fermer le fond)
*/
.pyramid-wrap {
    width: 320px;
    height: 320px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pyramid {
    --s: 200px;
    width: var(--s);
    height: var(--s);
    position: relative;
    transform-style: preserve-3d;
    animation: Rotate 25s linear infinite;
}

.base {
    width: 100%;
    height: 100%;
    position: absolute;
    transform: translateY(calc(var(--s) * 0.365)) rotateX(90deg);
    background: #724916;
    opacity: 0.5;
}

.triangle {
    width: 0;
    height: 0;
    opacity: 0.8;
    border: calc(var(--s) / 2) solid transparent;
    border-bottom: var(--s) solid #e8d5b0;
    border-top: 0;
    position: absolute;
}

.one {
    transform: rotateX(30deg);
    transform-origin: 0 0;
    border-bottom-color: #e8e1cf;
}

.two {
    transform-origin: calc(var(--s) / 2) 0;
    transform: rotateY(90deg) rotateX(-30deg);
    border-bottom-color: #466f50;
}

.three {
    transform-origin: calc(var(--s) / 2) 0;
    transform: rotateY(270deg) rotateX(-30deg);
    border-bottom-color: #801515;
}

.four {
    transform-origin: calc(var(--s) / 2) 0;
    transform: rotateY(0) rotateX(-30deg);
    border-bottom-color: #d0e8ff;
}

@keyframes Rotate {
    from { transform: rotateY(0)      rotateX(30deg) rotateZ(30deg); }
    to   { transform: rotateY(360deg) rotateX(30deg) rotateZ(30deg); }
}

/* pyramide décorative — copie exacte, juste repositionnée en arrière-plan */
.pyramid-deco {
    position: absolute;
    pointer-events: none;
    opacity: 0.3;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Cube wireframe ─── */
/*
    même technique que la pyramide : preserve-3d + Rotate
    --cs contrôle la taille, translateZ(--cs/2) place chaque face
    wireframe : fond transparent, juste les bordures vertes
*/
.cube {
    --cs: 60px;
    width: var(--cs);
    height: var(--cs);
    position: relative;
    transform-style: preserve-3d;
    animation: Rotate 20s linear infinite;
}

.face {
    position: absolute;
    width: var(--cs);
    height: var(--cs);
    border: 1.5px solid var(--accent);
    background: rgba(26, 58, 42, 0.04);
}

.face.front  { transform: translateZ(calc(var(--cs) / 2)); }
.face.back   { transform: rotateY(180deg)  translateZ(calc(var(--cs) / 2)); }
.face.left   { transform: rotateY(-90deg)  translateZ(calc(var(--cs) / 2)); }
.face.right  { transform: rotateY(90deg)   translateZ(calc(var(--cs) / 2)); }
.face.top    { transform: rotateX(90deg)   translateZ(calc(var(--cs) / 2)); }
.face.bottom { transform: rotateX(-90deg)  translateZ(calc(var(--cs) / 2)); }

/* même classe deco que pyramid-deco, réutilisée */
.cube-deco {
    position: absolute;
    pointer-events: none;
    opacity: 0.28;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Autres formes géométriques ─── */
/*
    Même principe : animation Rotate sur des formes 2D/3D
    - ring   : cercle vu de face qui tourne en 3D, donne une ellipse qui se compresse/étire
    - diamond: carré orienté 45deg qui tourne en 3D
    - triangle: triangle plat (border trick) qui tourne comme une face de pyramide
    Toutes ces formes réutilisent @keyframes Rotate déjà défini.
*/

.geo-deco {
    position: absolute;
    pointer-events: none;
}

/* ring */
.geo-ring {
    --gs: 60px;
    width: var(--gs);
    height: var(--gs);
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    background: transparent;
    animation: Rotate linear infinite;
}

/* diamond : keyframe séparé pour inclure le rotate(45deg) initial */
.geo-diamond {
    --gs: 50px;
    width: var(--gs);
    height: var(--gs);
    border: 1.5px solid var(--accent);
    background: rgba(26, 58, 42, 0.04);
    animation: RotateDiamond linear infinite;
}

@keyframes RotateDiamond {
    from { transform: rotateZ(45deg) rotateY(0)      rotateX(30deg); }
    to   { transform: rotateZ(45deg) rotateY(360deg) rotateX(30deg); }
}

/* triangle plat : border trick comme les faces de pyramide */
.geo-triangle {
    --gs: 40px;
    width: 0;
    height: 0;
    border-left: calc(var(--gs) / 2) solid transparent;
    border-right: calc(var(--gs) / 2) solid transparent;
    border-bottom: var(--gs) solid rgba(26, 58, 42, 0.4);
    animation: Rotate linear infinite;
}

/* ─── About ─── */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 14px;
    font-size: 0.93rem;
}

.about-target {
    color: var(--text) !important;
    font-weight: 500;
    margin-top: 4px;
}

.skill-group {
    margin-bottom: 22px;
}

.skill-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-chips span {
    font-size: 0.76rem;
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}

/* ─── Experience / Timeline ─── */
.timeline {
    position: relative;
    padding-left: 28px;
}

/* ligne verticale */
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 48px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

/* point sur la ligne */
.timeline-dot {
    position: absolute;
    left: -34px;
    top: 7px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 2px var(--accent);
    transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.timeline-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.timeline-company {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
}

.timeline-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    padding-top: 3px;
}

.timeline-details {
    list-style: none;
}

.timeline-details li {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 3px 0 3px 16px;
    position: relative;
    line-height: 1.6;
}

.timeline-details li::before {
    content: '-';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.timeline-details strong {
    color: var(--text);
    font-weight: 600;
}

/* glow sur le dot en dark mode */
body.dark .timeline-dot {
    box-shadow: 0 0 0 2px var(--accent), 0 0 10px rgba(92, 184, 64, 0.6);
}

body.dark .timeline::before {
    background: var(--border);
}

/* ─── Projects ─── */
.project-featured {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 32px 36px;
    margin-bottom: 24px;
}

.project-featured h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 12px 0 12px;
}

.project-featured > p {
    color: var(--text-muted);
    font-size: 0.92rem;
    max-width: 680px;
    margin-bottom: 18px;
}

.project-bullets {
    list-style: none;
    margin-bottom: 24px;
}

.project-bullets li {
    font-size: 0.86rem;
    color: var(--text-muted);
    padding: 3px 0 3px 18px;
    position: relative;
}

.project-bullets li::before {
    content: '-';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* image bleeds to card edges, sits above the padding area */
.project-img {
    width: calc(100% + 48px);
    margin: -24px -24px 18px -24px;
    height: 160px;
    object-fit: cover;
    object-position: center;
    border-bottom: 1px solid var(--border);
}

.project-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 10px 0 10px;
}

.project-card p {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.project-detail {
    font-size: 0.78rem !important;
    color: var(--text-muted);
    margin-top: 6px;
    opacity: 0.8;
}

.project-card-security {
    border-left: 3px solid var(--accent);
}

.project-repos {
    font-size: 0.74rem !important;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--accent) !important;
    margin-top: 10px;
}

.project-wip {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    padding: 3px 10px;
    border-radius: 4px;
}

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

.project-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    background: rgba(26, 58, 42, 0.1);
    color: var(--accent);
    border-radius: 4px;
}

.project-concepts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.concept-tag {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 7px;
    border: 1px solid rgba(26, 58, 42, 0.35);
    color: var(--text-muted);
    border-radius: 4px;
}

/* ─── Contact ─── */
.contact-inner {
    text-align: center;
    width: 100%;
}

.contact-inner h2 {
    display: inline-block;
}

.contact-inner h2::after {
    left: 50%;
    transform: translateX(-50%);
}

.contact-inner > p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 28px 0 36px;
}

.contact-tags {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 16px 0 28px;
}

.contact-links {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Responsive ─── */

/* tablette large */
@media (max-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* tablette */
@media (max-width: 860px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-content h1 {
        font-size: 3rem;
    }
}

/* mobile */
@media (max-width: 640px) {
    .section {
        padding: calc(var(--nav-h) + 40px) 5% 56px;
        align-items: flex-start;
    }

    nav {
        padding: 0 5%;
    }

    /* hide nav links on mobile, keep logo + dark mode toggle */
    nav ul {
        display: none;
    }

    /* shrink logo so it fits inside the nav bar */
    .logo {
        height: 48px;
        width: 48px;
    }

    .hero {
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 32px;
    }

    .hero-content {
        max-width: 100%;
    }

    .pyramid-wrap {
        align-self: center;
        width: 160px;
        height: 160px;
    }

    .pyramid-wrap .pyramid {
        --s: 130px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .hero-actions .btn,
    .hero-actions .btn-outline {
        text-align: center;
    }

    /* hide decorative shapes on mobile */
    .geo-deco,
    .pyramid-deco,
    .cube-deco {
        display: none;
    }

    h2 {
        font-size: 1.4rem;
        margin-bottom: 32px;
    }

    /* project grid: 1 column on mobile */
    .project-grid {
        grid-template-columns: 1fr;
    }

    .project-featured {
        padding: 18px 16px;
    }

    .project-featured h3 {
        font-size: 1.2rem;
    }

    /* timeline list: slightly smaller text on narrow screens */
    .timeline-details li {
        font-size: 0.82rem;
    }

    /* contact */
    .contact-tags {
        justify-content: flex-start;
    }

    .contact-links {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .contact-links .btn,
    .contact-links .btn-outline {
        width: 100%;
        text-align: center;
    }
}

/* petit mobile */
@media (max-width: 400px) {
    .section {
        padding: calc(var(--nav-h) + 28px) 4% 40px;
    }

    .skill-chips span {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .project-tag,
    .concept-tag {
        font-size: 0.62rem;
    }

    .hero-sub {
        font-size: 0.88rem;
    }

    .timeline-header h3 {
        font-size: 0.95rem;
    }
}

/* ─── Dark mode ─── */
body.dark {
    --accent:      #5cb840;
    --accent-dark: #40a025;
    --bg:          #070d07;
    --bg-alt:      #0b110b;
    --bg-card:     #101810;
    --text:        #ddeedd;
    --text-muted:  #7aaa7a;
    --border:      #1c2e1c;
}

/* transitions sur les éléments qui changent de couleur */
nav, .section, .section-alt, .project-card, .project-featured,
.skill-chips span, .btn, .btn-outline, .btn-outline-sm,
.theme-toggle, h2, h3, p, .tag, code {
    transition: background-color 0.35s ease, border-color 0.35s ease,
                color 0.35s ease, box-shadow 0.35s ease;
}

/*
    Glow en dark mode.
    - .pyramid-deco / .pyramid-wrap : filter drop-shadow sur le wrapper
      (aplatit le preserve-3d mais l'effet de lueur prime ici)
    - .face (cube) : box-shadow sur chaque face, sans toucher au preserve-3d parent
    - .geo-ring / .geo-diamond : box-shadow sur la forme plate
    - .geo-triangle : filter drop-shadow (forme plate, pas de preserve-3d)
*/

body.dark .pyramid-deco {
    opacity: 0.8;
    filter: drop-shadow(0 0 14px rgba(92, 184, 64, 0.65));
}

body.dark .pyramid-wrap {
    filter: drop-shadow(0 0 22px rgba(92, 184, 64, 0.45));
}

body.dark .cube-deco {
    opacity: 0.75;
}

body.dark .face {
    border-color: #5cb840;
    box-shadow: 0 0 10px rgba(92, 184, 64, 0.7),
                inset 0 0 6px rgba(92, 184, 64, 0.1);
    background: rgba(92, 184, 64, 0.03);
}

body.dark .geo-deco {
    opacity: 0.75;
}

body.dark .geo-ring {
    border-color: #5cb840;
    box-shadow: 0 0 14px rgba(92, 184, 64, 0.8),
                0 0 28px rgba(92, 184, 64, 0.35);
}

body.dark .geo-diamond {
    border-color: #5cb840;
    box-shadow: 0 0 12px rgba(92, 184, 64, 0.75),
                0 0 24px rgba(92, 184, 64, 0.3);
    background: rgba(92, 184, 64, 0.04);
}

body.dark .geo-triangle {
    border-bottom-color: rgba(92, 184, 64, 0.7);
    filter: drop-shadow(0 0 8px rgba(92, 184, 64, 0.9));
}

/* le bouton brille un peu en dark mode */
body.dark .theme-toggle:hover {
    box-shadow: 0 0 16px rgba(92, 184, 64, 0.45);
}

/* logo : fond vert foncé, pas besoin de filtre en dark mode */
