/* =========================================================
   GLOBAL STYLES — Portfolio & Jeux
   Used by landing pages (root, sections) AND injected into
   internal pages via the .site-bar scoped block at the end.
   ========================================================= */

:root {
    --primary: #1f2937;       /* slate-800, plus profond et moderne que l'ancien */
    --primary-dark: #0f172a;  /* slate-900 */
    --accent: #3b82f6;        /* blue-500 */
    --accent-soft: #60a5fa;   /* blue-400 */
    --bg: #f8fafc;            /* slate-50 */
    --bg-soft: #eef2f7;
    --text: #1e293b;          /* slate-800 */
    --text-muted: #64748b;    /* slate-500 */
    --white: #ffffff;
    --border: #e2e8f0;        /* slate-200 */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 14px 28px -8px rgba(15, 23, 42, 0.18);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
}

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

/* --- LOADER --- */
#loader-wrapper {
    position: fixed;
    inset: 0;
    background: var(--primary-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}
.loader {
    border: 4px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    border-top: 4px solid var(--white);
    width: 44px;
    height: 44px;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loaded #loader-wrapper { opacity: 0; pointer-events: none; }

/* =========================================================
   HEADER — landing pages (uses native <header> element)
   ========================================================= */
header {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 0.9rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}

header .logo {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--white);
    text-decoration: none;
    text-transform: uppercase;
}

header .nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

header .nav-links a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: color var(--transition);
    padding: 0.4rem 0;
    position: relative;
}

header .nav-links a:hover {
    color: var(--white);
}

header .nav-links a.nav-cta {
    background: var(--accent);
    color: var(--white);
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    transition: background var(--transition);
}

header .nav-links a.nav-cta:hover {
    background: var(--accent-soft);
    color: var(--white);
}

header .nav-sep {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
}

.lang-switch {
    display: flex;
    gap: 0.4rem;
    margin-left: 0.5rem;
}

.lang-switch button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    padding: 0.25rem 0.55rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all var(--transition);
}

.lang-switch button:hover { color: var(--white); border-color: rgba(255, 255, 255, 0.4); }
.lang-switch button.active { border-color: var(--accent-soft); color: var(--white); font-weight: 600; }

/* =========================================================
   MAIN CONTENT (landing pages)
   ========================================================= */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 2rem;
    text-align: center;
    width: 100%;
}

main > h1 {
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

/* --- CARDS MENU --- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    width: 100%;
    max-width: 960px;
}

.card {
    background: var(--white);
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 4px solid transparent;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 0.4rem;
    min-height: 130px;
}

.card:hover {
    transform: translateY(-4px);
    border-left-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.card h3 {
    color: var(--primary-dark);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
}

/* --- MOBILE --- */
@media (max-width: 700px) {
    header { flex-direction: column; gap: 0.75rem; padding: 0.9rem 1rem; }
    header .nav-links { justify-content: center; }
    main { padding: 2rem 1rem; }
    .menu-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   SCOPED SITE BAR — for internal pages with their own styles
   Uses unique class names (.site-bar*) so it never collides
   with the host page's existing CSS.
   ========================================================= */
.site-bar {
    position: sticky;
    top: 0;
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1.25rem;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    width: 100%;
}

.site-bar a { text-decoration: none; }

.site-bar__logo {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #ffffff;
    text-transform: uppercase;
}

.site-bar__nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-bar__nav a {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.3rem 0;
}

.site-bar__nav a:hover { color: #ffffff; }

.site-bar__nav a.site-bar__back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.site-bar__nav a.site-bar__back:hover {
    background: rgba(255, 255, 255, 0.14);
}

@media (max-width: 640px) {
    .site-bar { flex-direction: column; gap: 0.5rem; padding: 0.6rem 1rem; }
    .site-bar__nav { gap: 0.75rem; }
    .site-bar__nav a { font-size: 0.82rem; }
}

/* =========================================================
   FLOATING BACK BUTTON — for fullscreen pages (BMC, awaniko)
   where a top bar would break the layout (position: fixed,
   overflow: hidden, canvas, etc.).
   ========================================================= */
.site-floatback {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 99999;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font: 600 0.82rem/1 'Inter', 'Segoe UI', Tahoma, sans-serif;
    text-decoration: none;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: background 0.2s ease, transform 0.2s ease;
}

.site-floatback:hover {
    background: rgba(15, 23, 42, 0.98);
    transform: translateY(-1px);
    color: #ffffff;
}
