/* === Bapnor — Shared Site Styles === */
html { scroll-behavior: smooth; font-size: 17px; }
@media (max-width: 600px) { html { font-size: 15px; } }
@media (max-width: 400px) { html { font-size: 14px; } }

:root {
    --bg: #1a1f2e;
    --surface: #222840;
    --border: #2d3554;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-subtle: rgba(99,102,241,0.08);
    --accent-ring: rgba(99,102,241,0.1);
    --accent-border-tag: rgba(99,102,241,0.15);
    --input-bg: #28304a;
    --text: #f4f4f8;
    --text-secondary: #a0a7ba;
    --text-tertiary: #717892;
    --btn-text: #fff;
    --overlay-subtle: rgba(255,255,255,0.06);
}
[data-theme="light"] {
    --bg: #f5f7fa; --surface: #ffffff; --border: #dfe4ed;
    --accent: #6366f1; --accent-hover: #4f46e5;
    --accent-subtle: rgba(99,102,241,0.06); --accent-ring: rgba(99,102,241,0.2);
    --accent-border-tag: rgba(99,102,241,0.2); --input-bg: #f0f2f5;
    --text: #111827; --text-secondary: #4b5563; --text-tertiary: #6b7280;
    --btn-text: #fff; --overlay-subtle: rgba(0,0,0,0.06);
}

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

body {
    font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text);
    -webkit-font-smoothing: antialiased; position: relative; min-height: 100vh;
    display: flex; flex-direction: column;
}

canvas#gridCanvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

#glow {
    position: fixed; inset: 0;
    background: radial-gradient(circle 50vmax at center,
        rgba(99,102,241,0.12) 0%, rgba(99,102,241,0.08) 30%,
        rgba(99,102,241,0.04) 55%, rgba(99,102,241,0.01) 80%, transparent 100%);
    pointer-events: none; z-index: 0;
}
[data-theme="light"] #glow {
    background: radial-gradient(circle 50vmax at center,
        rgba(99,102,241,0.14) 0%, rgba(99,102,241,0.09) 30%,
        rgba(99,102,241,0.04) 55%, rgba(99,102,241,0.01) 80%, transparent 100%);
}

/* Header */
header {
    position: sticky; top: 0; z-index: 10;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 0 28px; height: 56px;
    display: flex; align-items: center;
}
.logo { font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; flex-shrink: 0; }
.logo a { text-decoration: none; color: inherit; }
.logo a span { color: var(--accent); }
nav { display: flex; gap: 24px; align-items: center; flex: 1; justify-content: center; }
nav a { font-size: 0.8rem; color: var(--text-secondary); text-decoration: none; font-weight: 500; transition: color 0.1s; }
nav a:hover, nav a.active { color: var(--text); }
nav a.active { color: var(--accent); }
nav a.member-link {
    font-weight: 600; color: var(--accent);
    background: var(--accent-subtle);
    border-radius: 4px; padding: 1px 10px;
    margin: 0; font-size: 0.78rem;
    transition: background 0.12s, color 0.12s;
}
nav a.member-link:hover {
    background: var(--accent); color: var(--btn-text);
}
.theme-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; line-height: 1; display: inline-flex; align-items: center;
    padding: 4px; color: var(--text-secondary); transition: color 0.1s;
}
.theme-btn:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

/* Skip link */
.skip-link {
    position: fixed; top: -100px; left: 12px; z-index: 200;
    background: var(--accent); color: var(--btn-text);
    padding: 8px 16px; border-radius: 6px; font-size: 0.82rem;
    font-weight: 600; text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus { top: 8px; }
.skip-target { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Hamburger */
.hamburger { display: none; }
@media (max-width: 768px) {
    .hamburger {
        display: flex; flex-direction: column; gap: 5px;
        background: none; border: none; cursor: pointer; padding: 4px;
        z-index: 20;
    }
    .hamburger span {
        display: block; width: 22px; height: 2px;
        background: var(--text-secondary); border-radius: 2px;
        transition: transform 0.2s, opacity 0.2s;
    }
    .hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    nav {
        position: fixed; top: 56px; left: 0; right: 0; bottom: 0;
        background: var(--bg); flex-direction: column; align-items: center;
        justify-content: flex-start; padding: 32px 16px; gap: 20px;
        transform: translateX(100%); transition: transform 0.25s ease;
        z-index: 15; overflow-y: auto;
    }
    nav.open { transform: translateX(0); }
    nav a { font-size: 1rem; }
    nav a.member-link {
        background: var(--accent); color: var(--btn-text) !important;
        border-radius: 6px; padding: 8px 16px; font-weight: 600; font-size: 0.9rem;
    }
}

/* Main */
main {
    position: relative; z-index: 1; flex: 1;
}

/* ── Scroll Snap (accueil) ─────────────────────────────────── */
main.snap-container {
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    height: calc(100dvh - 56px - 40px);
    flex: none;
}
.snap-section {
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}
.snap-section .section-inner {
    width: 100%;
    padding: 2rem;
    margin-top: auto;
    margin-bottom: auto;
}

/* ── Scroll dots ───────────────────────────────────────────── */
.scroll-dots {
    position: fixed; right: 20px; top: 50%; transform: translateY(-50%);
    z-index: 20; display: flex; flex-direction: column; gap: 10px;
}
.scroll-dots .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: transparent; border: 1.5px solid var(--text-tertiary);
    transition: background 0.25s, transform 0.25s, border-color 0.25s;
    display: block; cursor: pointer; text-decoration: none;
}
.scroll-dots .dot.active {
    background: var(--accent); border-color: var(--accent);
    transform: scale(1.5);
}
@media (max-width: 768px) { .scroll-dots { display: none; } }

/* ── Modale détail ─────────────────────────────────────────── */
#detail-modal {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    transition: opacity 0.2s ease;
}
.modal-inner {
    background: var(--surface);
    border: 1px solid var(--accent-border-tag);
    border-radius: 16px;
    padding: 36px 32px 32px;
    max-width: 620px; width: 100%;
    max-height: 82dvh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none; cursor: pointer;
    font-size: 1.15rem; color: var(--text-secondary);
    transition: color 0.15s; line-height: 1; padding: 4px;
}
.modal-close:hover { color: var(--text); }

/* ── Animations entrée sections ────────────────────────────── */
.snap-section .section-inner > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s ease 0.08s, transform 0.45s ease 0.08s;
}
.snap-section.visible .section-inner > * {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .snap-section .section-inner > * { transition: none; }
    #detail-modal { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Shared components */
.section-label {
    font-size: 0.72rem; font-weight: 500; color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.page .section-label { color: var(--accent); }

.btn {
    display: inline-block; padding: 10px 24px;
    background: var(--accent); color: var(--btn-text);
    border-radius: 8px; font-weight: 600; font-size: 0.85rem;
    text-decoration: none; border: none; cursor: pointer;
    font-family: inherit; transition: background 0.12s, transform 0.1s;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-outline {
    display: inline-block; padding: 10px 24px;
    background: transparent; color: var(--text-secondary);
    border: 1px solid var(--border); border-radius: 8px;
    font-weight: 500; font-size: 0.8rem; cursor: pointer; text-decoration: none;
    text-align: center; font-family: inherit;
    transition: all 0.12s;
}
.btn-outline:hover { background: var(--accent-subtle); color: var(--text); border-color: var(--accent-border-tag); }

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 24px;
    transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent-border-tag); transform: translateY(-2px); }

/* Footer */
footer {
    position: sticky; bottom: 0; z-index: 10;
    background: var(--bg); border-top: 1px solid var(--border);
    height: 40px; padding: 0 24px;
    display: flex; align-items: center; justify-content: center;
    gap: 20px; flex-wrap: wrap;
}
footer span,
footer a {
    font-size: 0.68rem; color: var(--text-tertiary);
    text-decoration: none; transition: color 0.1s;
}
footer a:hover { color: var(--accent); }
footer .footer-links { display: flex; gap: 16px; }

/* Form elements */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 0.72rem; font-weight: 500;
    color: var(--text-tertiary); margin-bottom: 5px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.form-group input, .form-group textarea {
    width: 100%; padding: 10px 14px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text);
    font-family: 'Inter', sans-serif; font-size: 0.85rem;
    outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus, .form-group textarea:focus {
    border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring);
}
.form-group textarea { resize: vertical; min-height: 100px; }

/* Common responsive */
@media (max-width: 768px) {
    header { padding: 0 16px; }
    footer { padding: 0 16px; gap: 12px; }
    footer .footer-links { gap: 8px; }
}
