/*
 * ORI-C — Stylesheet commun
 * ──────────────────────────────────────────────────
 * Ce fichier contient TOUS les styles partagés entre les pages :
 *   - Variables CSS (couleurs, typo)
 *   - Reset / base
 *   - Navigation (desktop + mobile)
 *   - Footer
 *   - Responsive breakpoints communs
 *
 * USAGE: Ajoutez dans le <head> de chaque page :
 *   <link rel="stylesheet" href="ori-c-common.css">
 *
 * Puis gardez en <style> inline SEULEMENT les styles
 * spécifiques à cette page (sections, cartes, etc.)
 *
 * Les variables page-spécifiques (ex: --accent-observation)
 * peuvent être redéfinies dans le <style> inline de la page.
 */

/* ── Variables globales ─────────────────────────────── */
:root {
    --bg-deep: #0a0b0d;
    --bg-surface: #111214;
    --bg-elevated: #181a1d;
    --text-primary: #f0eeea;
    --text-muted: #a0a098;
    --text-subtle: #6a6862;
    --accent-flow: #3d5a4c;
    --accent-pulse: #8b6b4a;
    --accent-tension: #6b4a5a;
    --accent-emergence: #4a5a6b;
    --grain-opacity: 0.03;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
}

/* Film grain overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: var(--grain-opacity);
    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='0.5'/%3E%3C/svg%3E");
}

/* ── Navigation ─────────────────────────────────────── */
nav:not(.module-nav) {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    background: rgba(10, 11, 13, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(240, 238, 234, 0.05);
}

.nav-logo {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 0.3rem;
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links li {
    list-style: none;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.05rem;
    opacity: 0.7;
    transition: opacity 0.3s, color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
    color: var(--accent-flow);
}

/* ── Language switcher ──────────────────────────────── */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.lang-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    transition: all 0.3s;
    opacity: 0.6;
}

.lang-btn:hover {
    opacity: 0.8;
}

.lang-btn.active {
    opacity: 1;
    border-color: var(--accent-flow);
    color: var(--text-primary);
}

/* ── Hamburger menu (mobile) ────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 11, 13, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.1rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.mobile-menu a:hover {
    opacity: 1;
}

/* ── Footer ─────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 6rem 2rem 3rem;
    border-top: 1px solid rgba(240, 238, 234, 0.05);
}

.footer-tagline {
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: 0.1rem;
    margin-bottom: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.05rem;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
}

.footer-link:hover {
    color: var(--text-primary);
    border-color: var(--accent-flow);
}

.footer-sep {
    color: var(--text-subtle);
}

.footer-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-subtle);
    letter-spacing: 0.05rem;
}

/* ── Mono text (code, badges, IDs) ──────────────────── */
.mono, code, .badge {
    font-family: 'JetBrains Mono', monospace;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
    nav:not(.module-nav) {
        padding: 1.2rem 2rem;
    }

    .nav-links {
        gap: 1.2rem;
    }

    .nav-links a {
        font-size: 0.78rem;
    }
}

@media (max-width: 768px) {
    nav:not(.module-nav) {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .lang-switcher {
        margin-right: 1rem;
    }

    footer {
        padding: 4rem 1.5rem 2rem;
    }

    .footer-tagline {
        font-size: 1.3rem;
    }

    .footer-links {
        gap: 1rem;
    }
}

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--text-subtle);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ── Selection ──────────────────────────────────────── */
::selection {
    background: var(--accent-flow);
    color: var(--text-primary);
}

/* ── Accessibilité : mouvement réduit ───────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
