/* ============================================================
   MAIN.CSS — Global Styles
   Shared across ALL pages: reset, typography, logo, navigation,
   hamburger menu, buttons, card animations, footer, responsive.
   ============================================================ */

/* --- RESET & BASE --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-weight: 100;
    -webkit-text-size-adjust: 100%;
}

/* Thin weight everywhere — matches nav button style.
   Logo (.gras) and specific elements override as needed. */
h1, h2, h3, h4, h5, h6, p, span, div, li, a, button, input, textarea {
    font-weight: inherit;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}


/* --- FIXED LOGO --- */
.mainlogo {
    position: fixed;
    top: 0;
    left: 0;
    padding: 20px;
    z-index: 9999;
    will-change: transform;
}

.mainlogo span {
    font-size: 40px;
    color: #000;
}

.fin  { font-weight: 100; }
.gras { font-weight: 600; }


/* --- DESKTOP NAVIGATION --- */
.header {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    transition: background 0.3s;
    will-change: transform;
}

/* Fond individuel sur chaque bouton après le hero */
.header.scrolled .btnw,
.header.scrolled .btn {
    color: #000;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
}

.header.scrolled .btnw:hover,
.header.scrolled .btn:hover {
    background-color: #000;
    color: #fff;
}

nav.nav {
    display: flex;
    justify-content: space-between;
    width: fit-content;
    list-style: none;
    font-size: 15px;
}

.nav a {
    text-decoration: none;
}


/* --- HAMBURGER MENU (mobile) --- */
.nav-ham-menu,
.menubgd {
    visibility: hidden;
}

.menubgd {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 10001;        /* doit rester au-dessus du panneau ouvert */
    width: 60px;
    height: 60px;
    background-color: rgb(88, 88, 88);
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-ham-menu {
    display: flex;
}

.ham-menu {
    position: relative;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.ham-menu:active {
    opacity: 0.6;
}

.ham-menu span {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 2px;
    background-color: #fff;
    transition: 0.3s ease;
}

.ham-menu span:nth-child(1) { top: 25%; }
.ham-menu span:nth-child(2) { top: 75%; }

/* Hamburger → X animation */
.ham-menu.active span:nth-child(1) {
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.ham-menu.active span:nth-child(2) {
    opacity: 0;
}

.ham-menu.active span:nth-child(3) {
    top: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Off-screen slide-in panel */
.off-screen-menu {
    position: fixed;
    top: 0;
    right: -450px;
    z-index: 10000;        /* au-dessus du logo (9999) pour ne pas être bloqué */
    width: 100%;
    max-width: 150px;
    height: 100vh;
    background-color: rgb(44, 44, 44);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 3rem;
    transition: 0.3s ease;
}

.off-screen-menu.active {
    right: 0;
}

.off-screen-menu a {
    color: #fff;
}

.menunav {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 100px;
    background-color: rgb(71, 71, 71);
}

.menunav a {
    font-size: 20px;
    text-decoration: none;
}


/* --- BUTTONS (shared base + variants) --- */
.btn,
.btnw,
.btn2,
.btn3 {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    margin: 10px;
    background-color: transparent;
    transition: 0.5s;
}

/* Dark button (inner pages) */
.btn {
    width: 100px;
    height: 40px;
    color: #000;
}

.btn:hover {
    background-color: #000;
    color: #fff;
}

/* White button (homepage hero) */
.btnw {
    width: 100px;
    height: 40px;
    color: #fff;
}

.btnw:hover {
    background-color: rgba(255, 255, 255, 0.7);
    color: #000;
}

/* Small footer button */
.btn2 {
    height: 30px;
    padding: 0 12px;
    white-space: nowrap;
}

.btn2:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: #000;
}

/* Hamburger menu button */
.btn3 {
    width: 120px;
    height: 50px;
}

.btn3:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: #000;
}

.btn3:active {
    background-color: rgba(255, 255, 255, 0.7);
}

.langheader {
    color: #000;
}


/* --- CARD ANIMATION (Intersection Observer) --- */
.card {
    justify-items: center;
    transform: translateY(50px);
    opacity: 0;
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

/* Verrouille l'état affiché une fois la carte apparue (page projets).
   Empêche les autres observers de la faire disparaître si on remonte. */
.card.shown-once {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Page "tous les projets" : juste un fondu (pas de translation).
   La page de garde garde l'effet de slide depuis le bas. */
.startgrid:not([data-mode="featured"]) .card {
    transform: none;
    transition: opacity 1.2s ease-out;
}
.startgrid:not([data-mode="featured"]) .card.show,
.startgrid:not([data-mode="featured"]) .card.shown-once {
    transform: none !important;
}

.card.show {
    transform: translateY(0);
    opacity: 1;
}


/* --- TOP PAGE SPACER (inner pages) --- */
.top-page {
    height: 20vh;
    min-height: 100px;
    background-color: #fff;
}


/* --- SHARED TITLE LAYOUT --- */
.title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
    width: auto;
}

/* --- CONTENT BOX (about, contact, privacy) --- */
.boxt {
    display: flex;
    flex-direction: column;
    width: 900px;
    max-width: 95%;
    height: fit-content;
    margin-bottom: 100px;
}

@media (max-width: 480px) {
    .boxt { margin-bottom: 50px; }
}


/* --- FOOTER --- */
section.footer {
    background-color: rgba(0, 0, 0, 0.7);
    min-height: 30vh;
    display: flex;
    flex-direction: column;
    /* Override card animation */
    transform: none;
    opacity: 1;
    transition: none;
    margin-top: auto;
}

div.box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    height: fit-content;
    margin-top: 50px;
}

.footnav {
    display: flex;
    list-style: none;
    height: 10vh;
    width: fit-content;
    align-items: center;
    justify-content: center;
    z-index: 11;
    position: relative;
}

.footnav a {
    color: #fff;
    text-decoration: none;
}

.footer-logo {
    width: 200px;
    max-width: 80%;
}

.language {
    color: #fff;
    list-style: none;
    text-decoration: none;
}

.copyright {
    margin-top: 50px;
    font-weight: 100;
    font-size: 13px;
}

.copyr span {
    display: flex;
    align-items: center;
}


/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

@media (max-width: 1300px) {
    .header {
        right: 20px;
        max-width: calc(100% - 280px);
    }

    .nav {
        flex-direction: column;
        align-items: flex-end;
    }
}

/* Mobile: switch to hamburger */
@media (max-width: 768px) {
    .mainlogo span {
        font-size: 18px;
    }

    /* Cacher complètement la nav desktop (sinon elle reste au-dessus du
       hamburger à cause de son z-index: 9999 et bloque les clics). */
    .header,
    nav.nav {
        display: none;
    }

    .nav-ham-menu,
    .menubgd {
        visibility: visible;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .mainlogo {
        padding: 12px;
    }

    .mainlogo span {
        font-size: 15px;
    }

    .footnav {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
    }

    .footer-logo {
        width: 140px;
    }

    .copyright {
        margin-top: 20px;
        text-align: center;
    }

    section.footer {
        min-height: auto;
        padding-bottom: 20px;
    }
}
