/* ==========================================================================
   EIT Events — styles communs (accueil, calendrier, pages simples, administration)
   Thèmes : clair, sombre ou automatique (préférence du système).
   Charte EIT Group : nuit, vert sapin, or, crème.
   ========================================================================== */

:root {
    --night: #0b1310;
    --night-2: #101c17;
    --fir: #0e5a3a;
    --gold: #d9b86a;
    --gold-deep: #c9a85c;
    --lime: #5ba932;
    --berry: #b53a2e;
    --cream: #f3eedf;

    --bg: #f3f5f1;
    --surface: #ffffff;
    --surface-2: #f7f9f5;
    --ink: #12211b;
    --ink-2: #33433b;
    --muted: #5f6e66;
    --line: #dfe5dd;
    --line-strong: #c7d1c7;
    --accent: #0e5a3a;
    --accent-hover: #0b4a30;
    --accent-ink: #ffffff;
    --accent-soft: #e4efe7;
    --gold-text: #87672a;
    --danger: #b53a2e;
    --danger-soft: #f8e7e4;
    --warn-soft: #fbf1d9;
    --warn-ink: #7a5a12;
    --focus: #c9a85c;
    --shadow: 0 1px 2px rgba(16, 32, 26, .05), 0 10px 30px -18px rgba(16, 32, 26, .28);
    --shadow-lg: 0 30px 60px -30px rgba(16, 32, 26, .45);

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 22px;
    --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --font-script: "Great Vibes", "Brush Script MT", cursive;
    --topbar-h: 64px;
    --tabbar-h: 0px;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b1310;
        --surface: #111d18;
        --surface-2: #15241d;
        --ink: #edf1ea;
        --ink-2: #cdd7cf;
        --muted: #93a39a;
        --line: #20322a;
        --line-strong: #2d4338;
        --accent: #7cc49a;
        --accent-hover: #93d3ad;
        --accent-ink: #08130e;
        --accent-soft: #163024;
        --gold-text: #dcbd73;
        --danger: #e47d70;
        --danger-soft: #3a1c18;
        --warn-soft: #33290f;
        --warn-ink: #ecd08a;
        --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -20px rgba(0, 0, 0, .7);
        --shadow-lg: 0 30px 60px -30px rgba(0, 0, 0, .8);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0b1310;
    --surface: #111d18;
    --surface-2: #15241d;
    --ink: #edf1ea;
    --ink-2: #cdd7cf;
    --muted: #93a39a;
    --line: #20322a;
    --line-strong: #2d4338;
    --accent: #7cc49a;
    --accent-hover: #93d3ad;
    --accent-ink: #08130e;
    --accent-soft: #163024;
    --gold-text: #dcbd73;
    --danger: #e47d70;
    --danger-soft: #3a1c18;
    --warn-soft: #33290f;
    --warn-ink: #ecd08a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -20px rgba(0, 0, 0, .7);
    --shadow-lg: 0 30px 60px -30px rgba(0, 0, 0, .8);
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 1rem/1.6 var(--font-ui);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    padding-bottom: var(--tabbar-h);
}
img, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(201, 168, 92, .35); }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr-only, .visually-hidden-input {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap; border: 0 !important;
}
.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px;
    background: var(--surface); color: var(--ink); border-radius: 8px; box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }
.i { width: 1.15em; height: 1.15em; flex: none; }
.center { text-align: center; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
    font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-quiet { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-quiet:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-gold { background: var(--gold); color: #1d1606; }
.btn-gold:hover { background: #e6c77f; }
.btn-ghost-light { border-color: rgba(243, 238, 223, .35); color: var(--cream); }
.btn-ghost-light:hover { border-color: var(--gold); color: var(--gold); }
.btn-block { width: 100%; }
.btn .i { width: 18px; height: 18px; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid currentColor; border-color: var(--accent-ink) var(--accent-ink) transparent transparent;
    animation: spin .7s linear infinite;
}
.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid transparent; background: transparent; color: inherit; transition: background-color .15s, border-color .15s;
}
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.icon-btn .i { width: 20px; height: 20px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }


.field { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { display: block; margin-bottom: 6px; font-weight: 600; font-size: .9rem; color: var(--ink-2); padding: 0; }
.optional { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], input[type="search"], input[type="password"], input[type="file"], select, textarea {
    width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink);
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input[type="file"] { padding: 8px 10px; font-size: .9rem; }
textarea { resize: vertical; min-height: 44px; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent); background: var(--surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.is-invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent) !important; }
.hint { margin-top: 6px; font-size: .82rem; color: var(--muted); }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 18px; font-size: .9rem; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Fenêtres ---------- */
.dialog {
    width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0;
    border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
.dialog-sm { width: min(420px, calc(100vw - 24px)); }
.dialog > form { padding: 22px 24px 20px; }
.dialog::backdrop { background: rgba(4, 9, 7, .62); backdrop-filter: blur(3px); }
.dialog[open] { animation: dialog-in .2s ease-out; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dialog h3 { font: 600 1.4rem/1.2 var(--font-serif); }
.dialog-sm p { margin: 10px 0 4px; color: var(--ink-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- Notifications ---------- */
.toasts { position: fixed; right: 16px; bottom: calc(16px + var(--tabbar-h)); z-index: 90; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px;
    background: #13221b; color: #f1f4ef; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .6);
    border-left: 4px solid var(--lime); font-size: .93rem; animation: toast-in .25s ease-out;
}
.toast.error { border-left-color: #e2533f; }
.toast .i { width: 19px; height: 19px; margin-top: 1px; }
.toast.leaving { animation: toast-out .25s ease-in forwards; }

/* ---------- Animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes finale-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* ---------- Pages simples (désinscription) ---------- */
.simple-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.simple-card {
    width: min(480px, 100%); text-align: center; padding: 36px 28px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.simple-card img { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; }
.simple-card h1 { font: 600 1.8rem/1.2 var(--font-serif); margin-bottom: 14px; }
.simple-card p { color: var(--ink-2); margin: 10px 0; }
.simple-card form { margin: 20px 0 8px; }
.simple-msg { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink) !important; font-weight: 600; }

/* ==========================================================================
   EIT Events — accueil, calendrier, pages d'évènement
   ========================================================================== */
:root {
    --site-bg: #f6f3ea;
    --site-bg-2: #efe9da;
    --site-ink: #12211b;
    --hero-glow-1: rgba(201, 161, 74, .28);
    --hero-glow-2: rgba(14, 90, 58, .22);
    --card: rgba(255, 255, 255, .78);
    --card-line: rgba(18, 33, 27, .09);
    --gold-grad: linear-gradient(100deg, #9a7a2e 0%, #d9b86a 35%, #f3dfa7 50%, #c9a14a 65%, #8a6a25 100%);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --site-bg: #071410;
        --site-bg-2: #0b1c16;
        --site-ink: #edf1ea;
        --hero-glow-1: rgba(217, 184, 106, .20);
        --hero-glow-2: rgba(46, 140, 96, .22);
        --card: rgba(17, 29, 24, .78);
        --card-line: rgba(237, 241, 234, .08);
    }
}
:root[data-theme="dark"] {
    --site-bg: #071410;
    --site-bg-2: #0b1c16;
    --site-ink: #edf1ea;
    --hero-glow-1: rgba(217, 184, 106, .20);
    --hero-glow-2: rgba(46, 140, 96, .22);
    --card: rgba(17, 29, 24, .78);
    --card-line: rgba(237, 241, 234, .08);
}

body.site { background: var(--site-bg); color: var(--site-ink); }
body.site.is-loading { overflow: hidden; }

/* ---------- Chargement (toujours « de nuit ») ---------- */
.loader {
    position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
    background: radial-gradient(120% 90% at 50% 40%, #0f2a20 0%, #071410 55%, #030a07 100%);
    color: var(--cream); transition: opacity .6s ease, visibility .6s ease;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader-inner { display: grid; justify-items: center; gap: 18px; text-align: center; padding: 24px; }
.loader-mark { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.loader-mark img { width: 92px; height: 92px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(217, 184, 106, .25), 0 0 60px rgba(217, 184, 106, .25); animation: loader-pop .9s cubic-bezier(.2, .9, .3, 1.3) both; }
.loader-ring { position: absolute; inset: 0; width: 132px; height: 132px; transform: rotate(-90deg); }
.loader-ring circle { fill: none; stroke-width: 2; }
.loader-ring .track { stroke: rgba(217, 184, 106, .14); }
.loader-ring .arc { stroke: url(#loaderGold); stroke-linecap: round; stroke-dasharray: 390; stroke-dashoffset: 390; animation: loader-draw 1.5s .15s cubic-bezier(.65, 0, .35, 1) forwards; }
.loader-word { font: 600 clamp(2rem, 6vw, 2.8rem)/1 var(--font-serif); letter-spacing: .04em; display: flex; gap: .02em; }
.loader-word span { display: inline-block; opacity: 0; transform: translateY(14px); animation: loader-letter .6s cubic-bezier(.2, .8, .2, 1) forwards; background: var(--gold-grad); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.loader-word .gap { width: .3em; }
.loader-tag { font-size: .74rem; letter-spacing: .28em; text-transform: uppercase; opacity: 0; animation: fade-in .8s 1.1s forwards; color: rgba(243, 238, 223, .7); }
.loader-bar { width: 140px; height: 2px; border-radius: 2px; background: rgba(243, 238, 223, .12); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 40%; background: var(--gold); border-radius: 2px; animation: loader-bar 1.2s ease-in-out infinite; }
@keyframes loader-draw { to { stroke-dashoffset: 0; } }
@keyframes loader-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes loader-letter { to { opacity: 1; transform: none; } }
@keyframes loader-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes fade-in { to { opacity: 1; } }

/* ---------- Barre supérieure ---------- */
.site-top {
    position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
    background: color-mix(in srgb, var(--site-bg) 72%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--card-line);
}
.site-top-inner { height: 100%; display: flex; align-items: center; gap: 18px; }
.site-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.site-brand img { width: 38px; height: 38px; border-radius: 50%; }
.site-brand span { display: flex; flex-direction: column; line-height: 1.1; }
.site-brand strong { font: 700 1.02rem/1.1 var(--font-ui); letter-spacing: .01em; }
.site-brand small { font-size: .74rem; color: var(--muted); }
.site-nav { display: flex; gap: 2px; margin-left: auto; }
.site-nav a { color: inherit; text-decoration: none; font-weight: 600; font-size: .92rem; padding: 8px 12px; border-radius: 999px; opacity: .82; }
.site-nav a:hover, .site-nav a[aria-current="page"] { opacity: 1; background: color-mix(in srgb, currentColor 9%, transparent); }
.site-tools { display: flex; align-items: center; gap: 2px; }
.nav-toggle { display: none; }
.theme-icon { display: none; }
#themeToggle[data-mode="auto"] .theme-auto, #themeToggle[data-mode="light"] .theme-light, #themeToggle[data-mode="dark"] .theme-dark { display: block; }

/* ---------- Accueil ---------- */
.home-hero { position: relative; overflow: hidden; isolation: isolate; padding: clamp(40px, 8vw, 96px) 0 clamp(48px, 8vw, 88px); }
.home-hero::before, .home-hero::after { content: ""; position: absolute; z-index: -2; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.home-hero::before { width: 620px; height: 620px; left: -160px; top: -220px; background: var(--hero-glow-1); animation: drift 18s ease-in-out infinite alternate; }
.home-hero::after { width: 680px; height: 680px; right: -220px; bottom: -320px; background: var(--hero-glow-2); animation: drift 22s ease-in-out infinite alternate-reverse; }
#netCanvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; opacity: .7; pointer-events: none; }
.home-hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.home-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: .78rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-text); }
.home-kicker::before { content: ""; width: 34px; height: 1px; background: currentColor; }
.home-title { margin: 14px 0 0; font: 600 clamp(3.4rem, 10vw, 7.4rem)/.92 var(--font-serif); letter-spacing: -.01em; }
.home-title .gold { display: inline-block; background: var(--gold-grad); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 9s linear infinite; padding-right: .04em; }
.home-tagline { margin-top: 18px; font: italic 500 clamp(1.25rem, 2.6vw, 1.7rem)/1.3 var(--font-serif); color: var(--ink-2); }
.home-intro { margin-top: 14px; max-width: 52ch; color: var(--muted); font-size: 1.04rem; }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn-lg { min-height: 52px; padding: 13px 24px; font-size: 1rem; }
.home-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 30px; color: var(--muted); font-size: .9rem; }
.home-facts strong { display: block; font: 600 1.7rem/1 var(--font-serif); color: var(--site-ink); }
/* Apparitions : seulement si le script du site tourne (sinon tout reste visible). */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }

.next-card {
    position: relative; padding: 26px 26px 22px; border-radius: 26px; background: var(--card);
    border: 1px solid var(--card-line); box-shadow: var(--shadow-lg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.next-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, rgba(217, 184, 106, .7), transparent 40%, transparent 60%, rgba(14, 122, 79, .55)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.next-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.next-emoji { font-size: 2.6rem; line-height: 1; margin-top: 16px; }
.next-name { margin-top: 10px; font: 600 clamp(1.7rem, 3.2vw, 2.2rem)/1.1 var(--font-serif); }
.next-date { margin-top: 6px; color: var(--ink-2); font-weight: 600; }
.next-summary { margin-top: 10px; color: var(--muted); font-size: .94rem; }
.countdown-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.countdown-grid div { padding: 12px 6px 10px; border-radius: 14px; background: color-mix(in srgb, var(--site-ink) 5%, transparent); text-align: center; }
.countdown-grid strong { display: block; font: 600 clamp(1.6rem, 3.6vw, 2.2rem)/1 var(--font-ui); font-variant-numeric: tabular-nums; }
.countdown-grid span { display: block; margin-top: 4px; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.next-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent); color: color-mix(in srgb, var(--c, var(--accent)) 82%, var(--site-ink)); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--accent)); }
.chip-plain::before { display: none; }
.badge-soft { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--warn-soft); color: var(--warn-ink); }

.today-strip { margin-top: -18px; }
.today-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 18px; border-radius: 18px; background: var(--night); color: var(--cream); box-shadow: var(--shadow); }
.today-inner strong { color: var(--gold); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }
.today-inner a { color: var(--cream); font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); }
.today-inner a:hover { background: rgba(217, 184, 106, .18); }

.section { padding: clamp(44px, 7vw, 84px) 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 26px; }
.section-head h2 { font: 600 clamp(1.9rem, 4vw, 2.7rem)/1.05 var(--font-serif); }
.section-head p { color: var(--muted); margin-top: 6px; }
.section-alt { background: var(--site-bg-2); }

.upcoming-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.event-card {
    position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px;
    border-radius: 18px; background: var(--card); border: 1px solid var(--card-line); color: inherit; text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c, var(--accent)) 45%, var(--card-line)); }
.date-tile { display: grid; justify-items: center; align-content: center; height: 64px; border-radius: 14px; background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent); color: color-mix(in srgb, var(--c, var(--accent)) 85%, var(--site-ink)); }
.date-tile b { font: 700 1.6rem/1 var(--font-ui); font-variant-numeric: tabular-nums; }
.date-tile small { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.event-card h3 { font: 600 1.05rem/1.25 var(--font-ui); }
.event-card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: .84rem; color: var(--muted); }
.event-card .emoji { position: absolute; right: 14px; top: 12px; font-size: 1.35rem; opacity: .9; }

.apps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.app-card {
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; min-height: 260px; padding: 24px;
    border-radius: 24px; color: #fff; text-decoration: none; isolation: isolate;
    background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--c) 70%, #fff 0%) 0%, color-mix(in srgb, var(--c) 55%, #061b14) 55%, #061b14 100%);
    box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease;
}
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.app-card .big-emoji { font-size: 3rem; line-height: 1; }
.app-card h3 { font: 600 2rem/1.05 var(--font-serif); margin-top: auto; }
.app-card p { color: rgba(255, 255, 255, .82); font-size: .95rem; }
.app-card .go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--gold); }
.app-card .when { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.app-card::after { content: ""; position: absolute; z-index: -1; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 0 0 30px rgba(255, 255, 255, .03), 0 0 0 60px rgba(255, 255, 255, .02); }

.months-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.month-tile { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-line); color: inherit; text-decoration: none; transition: border-color .2s, transform .2s; }
.month-tile:hover { transform: translateY(-2px); border-color: var(--gold); }
.month-tile.is-current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.month-tile strong { font: 600 1.2rem/1 var(--font-serif); text-transform: capitalize; }
.month-tile small { color: var(--muted); font-size: .8rem; }
.dots { display: flex; flex-wrap: wrap; gap: 4px; min-height: 8px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); }

.site-footer { padding: 34px 0 40px; border-top: 1px solid var(--card-line); color: var(--muted); font-size: .9rem; }
.site-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.site-footer .brandline { display: flex; align-items: center; gap: 12px; }
.site-footer img { width: 44px; height: 44px; border-radius: 50%; }
.site-footer strong { display: block; color: var(--site-ink); font: 600 1.15rem/1.1 var(--font-serif); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-links a, .footer-links button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--card-line); color: inherit; background: transparent; text-decoration: none; font-size: .84rem; font-weight: 600; }
.footer-links a:hover, .footer-links button:hover { border-color: var(--gold); color: var(--site-ink); }
.footer-links .i { width: 16px; height: 16px; }

/* ---------- Calendrier ---------- */
.cal-head { padding: 34px 0 10px; }
.cal-head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.cal-title { display: flex; align-items: center; gap: 10px; }
.cal-title h1 { font: 600 clamp(2rem, 5vw, 3rem)/1 var(--font-serif); text-transform: capitalize; }
.cal-nav { display: inline-flex; gap: 4px; }
.cal-nav a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--card-line); color: inherit; background: var(--card); }
.cal-nav a:hover { border-color: var(--gold); }
.cal-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--card-line); }
.seg a { padding: 7px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .86rem; }
.seg a[aria-current="page"] { background: var(--site-ink); color: var(--site-bg); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.cal-legend button { border: 1px solid transparent; cursor: pointer; }
.cal-legend button[aria-pressed="false"] { opacity: .38; filter: grayscale(.7); }
.cal-legend .chip { padding: 5px 12px; font-size: .78rem; }

.year-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 18px 0 60px; }
.month-card { padding: 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--card-line); }
.month-card.is-current { border-color: color-mix(in srgb, var(--gold) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 50%, transparent) inset; }
.month-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.month-card h2 { font: 600 1.3rem/1 var(--font-serif); text-transform: capitalize; }
.month-card h2 a { color: inherit; text-decoration: none; }
.month-card h2 a:hover { color: var(--gold-text); }
.month-card header small { color: var(--muted); font-size: .76rem; }
.mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; font-size: .78rem; font-variant-numeric: tabular-nums; }
.mini-grid .wd { font-size: .66rem; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.mini-day { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: inherit; padding: 0; font: inherit; }
.mini-day.out { visibility: hidden; }
.mini-day.has-events { cursor: pointer; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); font-weight: 700; color: color-mix(in srgb, var(--c, var(--accent)) 75%, var(--site-ink)); }
.mini-day.has-events:hover { background: color-mix(in srgb, var(--c, var(--accent)) 30%, transparent); }
.mini-day.is-holiday { box-shadow: inset 0 -2px 0 #c0392b; }
.mini-day.is-today { outline: 2px solid var(--gold); outline-offset: -2px; }
.mini-day.is-weekend:not(.has-events) { color: var(--muted); }
.mini-day .multi { position: absolute; right: 3px; top: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--c2, var(--gold)); }
.month-events { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--card-line); display: grid; gap: 4px; font-size: .82rem; }
.month-events li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px; align-items: baseline; }
.month-events b { font-variant-numeric: tabular-nums; color: var(--muted); }
.month-events a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-events a:hover { color: var(--gold-text); }
.month-events .more { color: var(--muted); grid-column: 2; }

.month-view { padding: 18px 0 30px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-radius: 20px; overflow: hidden; border: 1px solid var(--card-line); background: var(--card-line); gap: 1px; }
.month-grid .wd { padding: 10px 8px; background: var(--card); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; }
.day-cell { min-height: 118px; padding: 8px; background: var(--card); display: flex; flex-direction: column; gap: 4px; text-align: left; border: 0; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.day-cell:hover { background: color-mix(in srgb, var(--card) 80%, var(--gold) 6%); }
.day-cell.out { background: color-mix(in srgb, var(--card) 60%, transparent); color: var(--muted); }
.day-cell .num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; }
.day-cell.is-today .num { background: var(--gold); color: #1d1606; }
.day-cell.is-holiday .num { color: #c0392b; }
.day-cell.is-today.is-holiday .num { color: #1d1606; }
.day-chip { display: block; padding: 3px 7px; border-radius: 7px; font-size: .76rem; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: color-mix(in srgb, var(--c, var(--accent)) 15%, transparent); border-left: 3px solid var(--c, var(--accent)); color: color-mix(in srgb, var(--c, var(--accent)) 70%, var(--site-ink)); }
.day-more { font-size: .74rem; color: var(--muted); font-weight: 600; }
.agenda { margin: 26px 0 60px; }
.agenda h2 { font: 600 1.6rem/1.1 var(--font-serif); margin-bottom: 14px; }
.agenda-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.agenda-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-line); color: inherit; text-decoration: none; }
.agenda-item:hover { border-color: color-mix(in srgb, var(--c, var(--accent)) 50%, var(--card-line)); }
.agenda-item h3 { font: 600 1rem/1.25 var(--font-ui); }
.agenda-item p { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.agenda-item .arrow { color: var(--muted); }

.day-dialog .day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.day-dialog .day-list li { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); border-left: 4px solid var(--c, var(--accent)); }
.day-dialog .day-list .e { font-size: 1.6rem; line-height: 1.2; text-align: center; }
.day-dialog .day-list h4 { font: 600 1.02rem/1.3 var(--font-ui); margin: 0; }
.day-dialog .day-list p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.day-dialog .day-list .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.is-filtered { display: none !important; }

/* ---------- Page d'un évènement ---------- */
.event-hero { position: relative; overflow: hidden; isolation: isolate; padding: clamp(40px, 7vw, 80px) 0; }
.event-hero::before { content: ""; position: absolute; z-index: -1; inset: -40% -10% auto auto; width: 70vw; height: 70vw; max-width: 760px; max-height: 760px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c, var(--accent)) 30%, transparent), transparent 65%); }
.event-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 5vw, 56px); align-items: center; }
.event-emoji { font-size: clamp(3.2rem, 8vw, 5rem); line-height: 1; }
.event-hero h1 { margin-top: 14px; font: 600 clamp(2.4rem, 6vw, 4.2rem)/1 var(--font-serif); }
.event-when { margin-top: 12px; font-size: 1.15rem; font-weight: 600; color: var(--ink-2); }
.event-summary { margin-top: 14px; max-width: 58ch; color: var(--muted); font-size: 1.04rem; }
.event-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.event-years { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; }
.event-years li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--site-ink) 4%, transparent); font-variant-numeric: tabular-nums; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.back-link:hover { color: var(--site-ink); }

@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(60px, 40px) scale(1.12); } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .months-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .home-hero-grid, .event-hero-grid { grid-template-columns: minmax(0, 1fr); }
    .nav-toggle { display: inline-grid; }
    .site-nav {
        display: none; position: absolute; top: calc(var(--topbar-h) - 4px); left: 12px; right: 12px; flex-direction: column; gap: 2px;
        padding: 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--card-line); box-shadow: var(--shadow-lg);
    }
    .site-nav.is-open { display: flex; animation: fade-in .18s ease both; }
    .site-nav a { padding: 12px 14px; border-radius: 12px; font-size: 1rem; }
    .site-top-inner { position: relative; }
    .site-tools { margin-left: auto; }
    .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .day-cell { min-height: 58px; padding: 4px; align-items: center; }
    .day-cell .num { width: 26px; height: 26px; font-size: .84rem; }
    .day-chip { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; font-size: 0; background: var(--c, var(--accent)); display: inline-block; }
    .day-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
    .day-more { display: none; }
    .month-grid .wd { padding: 8px 2px; font-size: .66rem; letter-spacing: 0; }
    .months-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .agenda-item { grid-template-columns: 56px minmax(0, 1fr); }
    .agenda-item .arrow { display: none; }
    .site-brand small { display: none; }
}
@media (max-width: 560px) {
    .year-grid { grid-template-columns: minmax(0, 1fr); }
    .countdown-grid strong { font-size: 1.5rem; }
    .next-card { padding: 20px 18px; }
    .home-facts { gap: 8px 16px; }
    .site-top-inner { gap: 10px; }
}
@media (max-width: 380px) {
    .site-brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
}
@media print {
    .site-top, .loader, #netCanvas, .site-footer, .cal-tools, .cal-legend { display: none !important; }
    body.site { background: #fff; color: #000; }
}
.event-card h3 { padding-right: 28px; }
