/* ============================================================
   1. TOKENS & VARIABLES CSS
   ============================================================ */
:root {
    /* Palette — Light theme */
    --color-bg: #f7f5f0;
    --color-surface: #ffffff;
    --color-ink: #111010;
    --color-ink-muted: #6b6860;
    --color-accent: #c8a96e;
    --color-accent-2: #2d4a3e;
    --color-border: rgba(17, 16, 16, 0.12);

    /* Typographie */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Rayons de bordure */
    --radius-sm: 6px;
    --radius-md: 14px;
    --radius-lg: 28px;

    /* Courbes d'animation */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    /* Dimensions */
    --header-h: 72px;

    /* Ombres */
    --shadow-soft: 0 4px 32px rgba(17, 16, 16, 0.06), 0 1px 4px rgba(17, 16, 16, 0.04);
    --shadow-float: 0 20px 60px rgba(17, 16, 16, 0.14), 0 4px 16px rgba(17, 16, 16, 0.08);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-bg);
    color: var(--color-ink);
    font-family: var(--font-body);
    line-height: 1.65;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Texture grain subtile */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    opacity: 0.022;
}

/* Blob décoratif */
body::after {
    content: '';
    position: fixed;
    top: -30vh;
    right: -20vw;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(ellipse at center,
            rgba(200, 169, 110, 0.12) 0%,
            rgba(45, 74, 62, 0.06) 45%,
            transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: blobDrift 18s ease-in-out infinite alternate;
}

@keyframes blobDrift {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(-4vw, 6vh) scale(1.08);
    }
}

/* ============================================================
   3. PAGE TRANSITION
   ============================================================ */
.page-wrapper {
    position: relative;
    z-index: 1;
    animation: pageFadeIn 0.6s var(--ease-out-expo) both;
}

/* ============================================================
   10. CONTENU PRINCIPAL
   ============================================================ */
.main {
    position: relative;
    z-index: 1;
    min-height: calc(100dvh - var(--header-h));
}

/* ============================================================
   11. FOOTER
   ============================================================ */
.site-footer {
    position: relative;
    z-index: 1;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 4rem) 2rem;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 3rem 2rem;
}

.footer-brand .footer-logo {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-ink);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.875rem;
    color: var(--color-ink-muted);
    max-width: 26ch;
    line-height: 1.6;
}

.footer-col h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-ink-muted);
    margin-bottom: 1.2rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li+li {
    margin-top: 0.6rem;
}

.footer-col ul a {
    font-size: 0.875rem;
    color: var(--color-ink-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col ul a:hover {
    color: var(--color-ink);
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--color-ink-muted);
}

/* ============================================================
   12. SCROLL REVEAL
   ============================================================ */
/* Optimisation du délai pour éviter l'effet "bloqué à 0" si l'animation est trop lente */
[data-reveal] {
    opacity: 0;
    transform: translateY(15px);
    transition:
        opacity 0.5s var(--ease-out-expo),
        transform 0.5s var(--ease-out-expo);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   13. BOUTON RETOUR EN HAUT
   ============================================================ */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 90;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-ink);
    color: var(--color-bg);
    border: none;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-float);
    opacity: 0;
    transform: translateY(12px) scale(0.9);
    pointer-events: none;
    transition:
        opacity 0.3s,
        transform 0.3s var(--ease-out-expo),
        background 0.2s;
    font-size: 1.1rem;
    font-weight: 700;
}

.scroll-top.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.scroll-top:hover {
    background: var(--color-accent);
}

/* ============================================================
   14. NOTIFICATIONS FLASH
   ============================================================ */
.flash-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    pointer-events: none;
}

/* ============================================================
   15. RESPONSIVE
   ============================================================ */
@media (max-width: 560px) {
    :root {
        --header-h: 64px;
    }

    .header-logo {
        font-size: 1.4rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

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

    .scroll-top {
        bottom: 1.25rem;
        right: 1.25rem;
    }
}
