/* ==========================================================================
   Joyeux Noël — EIT Group · feuille de style publique (v2)
   Thèmes : clair, sombre ou automatique (préférence du système).
   Le bandeau d'accueil reste « de nuit » quel que soit le thème, comme le visuel officiel.
   ========================================================================== */

: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; }

/* ---------- Barre supérieure ---------- */
.topbar {
    position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
    color: var(--cream); background: transparent;
    transition: background-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.topbar.is-solid {
    color: var(--ink);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    box-shadow: 0 1px 0 var(--line);
}
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-weight: 700; letter-spacing: .01em; }
.brand-text span { font-size: .82rem; opacity: .75; }
.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a {
    color: inherit; text-decoration: none; font-weight: 500; font-size: .93rem;
    padding: 8px 12px; border-radius: 999px; opacity: .85;
}
.topnav a:hover, .topnav a.is-current { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); }
.topbar-tools { display: flex; gap: 2px; }
.topnav + .topbar-tools { margin-left: 0; }
.theme-icon { display: none; }
#themeToggle[data-mode="auto"] .theme-auto,
#themeToggle[data-mode="light"] .theme-light,
#themeToggle[data-mode="dark"] .theme-dark { display: block; }
#fxToggle[aria-pressed="false"] { opacity: .55; }

/* ---------- Accueil (toujours de nuit) ---------- */
.hero {
    position: relative; isolation: isolate; overflow: hidden;
    margin-top: calc(-1 * var(--topbar-h));
    padding: calc(var(--topbar-h) + 84px) 0 80px;
    color: var(--cream);
    background:
        radial-gradient(900px 480px at 78% 18%, rgba(217, 184, 106, .16), transparent 62%),
        radial-gradient(700px 420px at 4% 96%, rgba(14, 90, 58, .45), transparent 64%),
        linear-gradient(180deg, #08100d 0%, var(--night) 55%, #0d1a14 100%);
}
.garland { position: absolute; left: 0; right: 0; top: var(--topbar-h); height: 50px; z-index: -1; pointer-events: none; }
.garland-wire { position: absolute; inset: 0; width: 100%; height: 50px; overflow: visible; }
.garland-wire path { fill: none; stroke: #3d4b43; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.bulb {
    --c: #f2c86b;
    position: absolute; width: 10px; height: 15px; margin-left: -5px; margin-top: -1px;
    border-radius: 50% 50% 48% 48% / 42% 42% 58% 58%;
    background: var(--c); opacity: .22; filter: saturate(.4);
    animation: power-on .5s ease-out forwards, twinkle 3.6s ease-in-out infinite;
    animation-delay: calc(400ms + var(--d, 0ms)), calc(1600ms + var(--d, 0ms) * 3);
}
.bulb::before {
    content: ""; position: absolute; left: 2px; top: -4px; width: 6px; height: 5px;
    border-radius: 2px 2px 1px 1px; background: #26302b;
}
.bulb-gold { --c: #f2c86b; }
.bulb-berry { --c: #e2533f; }
.bulb-lime { --c: #95d65a; }
.bulb-snow { --c: #fff4d6; }
@keyframes power-on {
    to { opacity: 1; filter: none; box-shadow: 0 0 12px 3px color-mix(in srgb, var(--c) 70%, transparent), 0 0 30px 6px color-mix(in srgb, var(--c) 25%, transparent); }
}
@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: .62; }
}

.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero-kicker { font: italic 500 clamp(1.15rem, 2vw, 1.4rem)/1.35 var(--font-serif); color: rgba(243, 238, 223, .82); max-width: 32ch; }
.hero-title { margin: 6px 0 10px; font-weight: 400; line-height: .9; }
.hero-title .script {
    display: block; font-family: var(--font-script); font-size: clamp(4.2rem, 10vw, 8rem);
    color: var(--gold); text-shadow: 0 0 40px rgba(217, 184, 106, .25);
    margin-left: -.04em; padding: .08em 0;
}
.hero-year {
    display: block; margin-top: 4px; font: 600 clamp(1.1rem, 2vw, 1.35rem)/1 var(--font-serif);
    letter-spacing: .5em; color: rgba(243, 238, 223, .7);
}
.hero-sub { max-width: 46ch; font-size: 1.05rem; color: rgba(243, 238, 223, .78); }

.countdown {
    margin: 30px 0 30px; padding: 18px 20px 16px; max-width: 520px;
    border: 1px solid rgba(217, 184, 106, .32); border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
}
.countdown-label { font-size: .92rem; color: rgba(243, 238, 223, .75); margin-bottom: 8px; }
.countdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.cd-unit { display: flex; flex-direction: column; align-items: flex-start; padding: 0 14px; border-left: 1px solid rgba(217, 184, 106, .2); }
.cd-unit:first-child { padding-left: 0; border-left: 0; }
.cd-val { font: 600 clamp(1.9rem, 4vw, 2.7rem)/1.05 var(--font-ui); font-variant-numeric: tabular-nums; color: #fff8e6; letter-spacing: -.01em; }
.cd-name { font-size: .78rem; color: rgba(243, 238, 223, .6); }
.countdown[data-phase="today"] { border-color: var(--gold); }
.countdown[data-phase="today"] .countdown-grid { display: none; }
.countdown[data-phase="today"] .countdown-label { font: italic 600 1.35rem/1.3 var(--font-serif); color: var(--gold); margin: 0; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-visual { margin: 0; }
.hero-visual img {
    width: 100%; border-radius: 18px; border: 1px solid rgba(217, 184, 106, .3);
    box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9), 0 0 0 8px rgba(255, 255, 255, .02);
}
.hero-visual figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: .88rem; color: rgba(243, 238, 223, .62); }
.link-light { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); text-decoration: none; font-weight: 600; }
.link-light:hover { text-decoration: underline; }
.link-light .i { width: 16px; height: 16px; }

/* ---------- Chiffres ---------- */
.pulse { background: var(--surface); border-bottom: 1px solid var(--line); }
.pulse-inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 32px; padding: 18px 0; }
.pulse-item { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: .95rem; }
.pulse-item strong { font: 600 1.75rem/1 var(--font-serif); color: var(--ink); font-variant-numeric: lining-nums; }
.pulse-edition { margin-left: auto; color: var(--muted); font-size: .9rem; }

/* ---------- Sections ---------- */
.section-head { max-width: 680px; margin-bottom: 32px; }
.section-head h2 { font: 600 clamp(2rem, 4vw, 2.75rem)/1.1 var(--font-serif); letter-spacing: -.005em; }
.section-head p { margin-top: 10px; color: var(--muted); font-size: 1.04rem; }

/* ---------- Lettre de la Direction ---------- */
.letter-section { padding: clamp(56px, 8vw, 96px) 0; }
.letter {
    position: relative; max-width: 780px; margin: 0 auto;
    padding: clamp(26px, 6vw, 64px);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.letter::before {
    content: ""; position: absolute; left: clamp(26px, 6vw, 64px); right: clamp(26px, 6vw, 64px); top: 0; height: 3px;
    background: linear-gradient(90deg, var(--gold-deep), transparent); border-radius: 0 0 3px 3px;
}
.letter-head { display: flex; align-items: center; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.letter-head img { width: 52px; height: 52px; border-radius: 50%; }
.letter-head h2 { font: 600 1.35rem/1.2 var(--font-serif); }
.letter-head p { color: var(--muted); font-size: .9rem; }
.letter-greeting { margin: 28px 0 12px; font: 400 clamp(2.1rem, 5vw, 2.8rem)/1.2 var(--font-script); color: var(--gold-text); }
.letter-body p { font: 500 clamp(1.1rem, 1.6vw, 1.24rem)/1.75 var(--font-serif); color: var(--ink-2); max-width: 64ch; }
.letter-body p + p { margin-top: 1em; }
.letter-sign { margin-top: 28px; text-align: right; font: italic 600 1.2rem/1.4 var(--font-serif); color: var(--accent); }
.letter-actions { margin-top: 28px; display: flex; justify-content: flex-end; }

/* ---------- Mur des vœux ---------- */
.wall { padding: clamp(56px, 8vw, 96px) 0; background: linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--surface-2) 60%, var(--bg))); border-top: 1px solid var(--line); }
.wall-grid { display: grid; grid-template-columns: minmax(300px, 370px) minmax(0, 1fr); gap: 32px; align-items: start; }

.composer {
    position: sticky; top: calc(var(--topbar-h) + 16px);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 24px; box-shadow: var(--shadow);
}
.composer h3 { font: 600 1.45rem/1.2 var(--font-serif); margin-bottom: 16px; }
.composer-closed { text-align: center; padding: 18px 6px; color: var(--muted); }
.composer-closed .i { width: 34px; height: 34px; margin: 0 auto 10px; color: var(--gold-text); }
.composer-closed h3 { color: var(--ink); margin-bottom: 8px; }

.identity-summary {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 12px; margin-bottom: 14px; border-radius: var(--radius-sm);
    background: var(--accent-soft); font-size: .92rem;
}
.identity-summary .link-btn { margin-left: auto; font-size: .88rem; }

.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); }
.counter { margin-top: 4px; text-align: right; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.is-near { color: var(--danger); }

.dropzone {
    display: flex !important; align-items: center; gap: 12px; cursor: pointer;
    padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm);
    color: var(--ink-2); transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .i { width: 24px; height: 24px; color: var(--accent); }
.dropzone span { display: flex; flex-direction: column; line-height: 1.3; }
.dropzone small { font-weight: 400; color: var(--muted); }
.visually-hidden-input:focus-visible + .thumbs, .field:focus-within .dropzone { border-color: var(--accent); }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button {
    position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; border: 0; background: rgba(10, 16, 13, .75); color: #fff;
}
.thumb button .i { width: 14px; height: 14px; }

.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; }

/* Barre d'outils du fil */
.feed { min-width: 0; }
.feed-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.editions { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.edition-tab {
    border: 0; background: transparent; padding: 7px 14px; border-radius: 999px;
    font-weight: 600; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
.edition-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.feed-tools { display: flex; gap: 8px; flex: 1 1 320px; justify-content: flex-end; }
.search { position: relative; flex: 1 1 200px; max-width: 300px; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px; border-radius: 999px; background: var(--surface); min-height: 42px; }
.sort select { border-radius: 999px; background: var(--surface); min-height: 42px; padding-right: 30px; }

.feed-list { display: grid; gap: 16px; }
.feed-more { display: flex; justify-content: center; margin-top: 22px; }
.feed-skeleton { display: grid; gap: 16px; }
.feed-skeleton span { height: 150px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; border: 1px solid var(--line); animation: shimmer 1.4s ease-in-out infinite; }
.feed-empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--muted); }
.feed-empty > .i { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--gold-text); }
.feed-empty .btn { margin: 16px 4px 0; }
.feed-empty h3 { font: 600 1.4rem/1.2 var(--font-serif); color: var(--ink); margin-bottom: 6px; }


/* Carte de vœu */
.wish {
    position: relative; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 20px 22px 14px; scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.wish.is-pinned { border-color: color-mix(in srgb, var(--gold-deep) 60%, var(--line)); box-shadow: inset 3px 0 0 var(--gold-deep); }
.wish.is-pending { border-style: dashed; }
.wish.is-focus { animation: focus-ring 2.4s ease-out; }
.wish-head { display: flex; align-items: flex-start; gap: 12px; }
.wish-meta { flex: 1; min-width: 0; }
.wish-author { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.wish-date { font-size: .84rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.wish-owner { display: flex; gap: 2px; margin: -6px -8px 0 0; color: var(--muted); }
.wish-owner .icon-btn { width: 36px; height: 36px; }
.wish-owner .icon-btn .i { width: 18px; height: 18px; }
.wish-owner .icon-btn:hover { color: var(--ink); }
.wish-owner .icon-btn.is-danger:hover { color: var(--danger); }
.wish-text { margin: 14px 0 0; font-size: 1.02rem; line-height: 1.68; white-space: pre-line; overflow-wrap: anywhere; max-width: 70ch; }
.wish-text.is-clamped { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { margin-top: 6px; font-size: .9rem; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tag .i { width: 13px; height: 13px; }
.tag-gold { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); color: var(--gold-text); border-color: transparent; }
.tag-warn { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }

.avatar {
    --tone: #0e5a3a;
    flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    background: var(--tone); color: #fff; font-weight: 700; font-size: .9rem; letter-spacing: .02em;
}
.avatar-sm { width: 30px; height: 30px; font-size: .74rem; }
.avatar[data-tone="1"] { --tone: #8a6a25; }
.avatar[data-tone="2"] { --tone: #9b3b31; }
.avatar[data-tone="3"] { --tone: #2f5d73; }
.avatar[data-tone="4"] { --tone: #4c7a2a; }
.avatar[data-tone="5"] { --tone: #5c4a7a; }

.photos { display: grid; gap: 6px; margin-top: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 640px; }
.photos.n1 { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
.photos.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1; cursor: zoom-in; }
.photos.n1 .photo { aspect-ratio: auto; max-height: 440px; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.photos.n1 .photo img { height: auto; max-height: 440px; }
.photo:hover img { transform: scale(1.03); }

.wish-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.reactions { display: flex; flex-wrap: wrap; gap: 6px; }
.react {
    display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 11px;
    border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: .88rem;
    font-variant-numeric: tabular-nums; color: var(--ink-2); transition: background-color .15s, border-color .15s, transform .15s;
}
.react:hover { border-color: var(--line-strong); background: var(--surface-2); }
.react[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.react .emoji { font-size: 1.05rem; line-height: 1; }
.react .count:empty { display: none; }
.react.pop .emoji { animation: pop .35s ease; }
.foot-spacer { flex: 1; }
.foot-btn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 10px; border-radius: 999px;
    border: 0; background: transparent; color: var(--muted); font-size: .88rem; font-weight: 600;
}
.foot-btn:hover { color: var(--ink); background: var(--surface-2); }
.foot-btn .i { width: 17px; height: 17px; }
.foot-btn[aria-expanded="true"] { color: var(--accent); }

/* Commentaires */
.comments { margin-top: 12px; padding-top: 4px; }
.comment { display: flex; gap: 10px; margin-top: 10px; }
.comment-bubble { flex: 1; min-width: 0; background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 9px 13px; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: .82rem; color: var(--muted); }
.comment-meta strong { color: var(--ink); font-size: .88rem; }
.comment-meta .link-btn { font-size: .8rem; color: var(--muted); margin-left: auto; text-decoration: none; }
.comment-meta .link-btn:hover { color: var(--danger); }
.comment-text { margin-top: 2px; font-size: .95rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.comment .photos { margin-top: 8px; max-width: 360px; }
.comment-form { margin-top: 12px; }
.comment-ident { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.comment-row { display: flex; gap: 6px; align-items: flex-end; }
.comment-row textarea { min-height: 42px; height: 42px; border-radius: 21px; padding: 10px 16px; resize: none; overflow: hidden; }
.comment-row .icon-btn { flex: none; color: var(--muted); border: 1px solid var(--line-strong); width: 42px; height: 42px; }
.comment-row .icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.comment-row .send { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.comment-row .send:hover { background: var(--accent-hover); color: var(--accent-ink); }
.comment-form .thumbs { margin-top: 8px; }
.comment-form .thumb { width: 56px; height: 56px; }
.comments-closed { font-size: .88rem; color: var(--muted); margin-top: 10px; }

/* ---------- Atelier visuel ---------- */
.studio { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.studio-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.studio-controls { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.studio-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.studio-preview { display: flex; justify-content: center; position: sticky; top: calc(var(--topbar-h) + 16px); }
.studio-preview canvas { width: 100%; max-width: 620px; height: auto; border-radius: 18px; box-shadow: var(--shadow-lg); background: var(--night); }
.studio-preview canvas.is-story { max-width: min(380px, 100%); max-height: 78vh; width: auto; }

.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px; height: 100%;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: .84rem; font-weight: 600; color: var(--ink-2);
}
.swatch span::before { content: ""; width: 100%; height: 30px; border-radius: 6px; }
.swatch-fir span::before { background: linear-gradient(135deg, #0a5c36, #061b14 70%); box-shadow: inset 0 -4px 0 #d9b86a; }
.swatch-night span::before { background: radial-gradient(circle at 30% 30%, #2a2416, #050505 70%); box-shadow: inset 0 -4px 0 #d9b86a; }
.swatch-snow span::before { background: linear-gradient(135deg, #ffffff, #eef3ee); border: 1px solid #dfe5dd; box-shadow: inset 0 -4px 0 #0e5a3a; }
.swatch input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); color: var(--ink); }
.swatch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 999px; width: fit-content; max-width: 100%; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 7px 14px; border-radius: 999px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.segmented input:checked + span { background: var(--accent); color: var(--accent-ink); }
.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--night); color: rgba(243, 238, 223, .8); padding: 40px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.footer-inner img { width: 56px; height: 56px; border-radius: 50%; }
.footer-org { font: 600 1.4rem/1.1 var(--font-serif); color: var(--cream); }
.footer-tagline { font-size: .86rem; opacity: .7; }
.footer-note { margin-left: auto; text-align: right; font-size: .9rem; max-width: 46ch; }
.footer-note small { display: block; margin-top: 4px; opacity: .6; font-size: .78rem; }

/* ---------- Barre d'onglets mobile ---------- */
.tabbar { display: none; }

/* ---------- 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; }

.lightbox {
    width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; padding: 0; border: 0;
    background: transparent; color: #fff; display: none; align-items: center; justify-content: center;
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: rgba(3, 6, 5, .92); }
.lightbox figure { margin: 0; max-width: calc(100vw - 32px); display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 120px); border-radius: 10px; object-fit: contain; }
.lightbox figcaption { display: flex; gap: 16px; align-items: center; justify-content: space-between; width: 100%; margin-top: 12px; font-size: .9rem; color: rgba(255, 255, 255, .75); }
.lightbox figcaption a { display: inline-flex; gap: 6px; align-items: center; color: var(--gold); font-weight: 600; text-decoration: none; }
.lightbox figcaption .i { width: 16px; height: 16px; }
.lb-btn { position: fixed; z-index: 2; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .4); color: #fff; }
.lb-btn:hover { background: rgba(255, 255, 255, .15); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }

/* ---------- 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; }

/* ---------- Feux d'artifice ---------- */
#fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 30; opacity: .55; transition: opacity .5s; }
#fx-canvas.finale { z-index: 95; opacity: .95; }
.finale-card {
    position: fixed; left: 50%; top: 50%; z-index: 96; transform: translate(-50%, -50%);
    padding: 34px 48px; border-radius: 26px; text-align: center; pointer-events: none;
    background: rgba(11, 19, 16, .86); border: 1px solid rgba(217, 184, 106, .5); color: var(--cream);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9); animation: finale-in 1s ease forwards;
    max-width: calc(100vw - 32px);
}
.finale-card .script { display: block; font: 400 clamp(3rem, 9vw, 5.5rem)/1 var(--font-script); color: var(--gold); }
.finale-card span:last-child { display: block; margin-top: 10px; letter-spacing: .3em; font-weight: 600; opacity: .8; }

/* ---------- 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%); } }
@keyframes focus-ring { 0%, 30% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .topnav { display: none; }
    .topbar-tools { margin-left: auto; }
}
@media (max-width: 960px) {
    .hero { padding: calc(var(--topbar-h) + 64px) 0 56px; }
    .hero-inner { grid-template-columns: 1fr; }
    .hero-visual { max-width: 640px; }
    .wall-grid { grid-template-columns: 1fr; }
    .composer { position: static; }
    .studio-grid { grid-template-columns: 1fr; }
    .studio-preview { position: static; order: -1; }
    .studio-preview canvas { max-width: 520px; }
}
@media (max-width: 760px) {
    :root { --topbar-h: 58px; --tabbar-h: calc(62px + env(safe-area-inset-bottom)); }
    .brand-text span { display: none; }
    .tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(4, 1fr);
        height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom);
        background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--line);
    }
    .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
    .tabbar a .i { width: 22px; height: 22px; }
    .tabbar a.is-current { color: var(--accent); }
    .bulb:nth-of-type(even) { display: none; }
    .countdown { padding: 14px 14px 12px; }
    .cd-unit { padding: 0 8px; }
    .pulse-inner { gap: 4px 20px; }
    .pulse-item strong { font-size: 1.45rem; }
    .pulse-edition { margin-left: 0; width: 100%; }
    .wish { padding: 16px 16px 12px; }
    .feed-tools { flex-basis: 100%; }
    .search { max-width: none; }
    .comment-ident { grid-template-columns: 1fr; }
    .footer-note { margin-left: 0; text-align: left; }
    .letter-actions { justify-content: stretch; }
    .letter-actions .btn { width: 100%; white-space: normal; }
    .lb-prev, .lb-next { top: auto; bottom: 18px; transform: none; }
}
@media (max-width: 420px) {
    .hero-actions .btn { flex: 1 1 100%; }
    .swatches { grid-template-columns: 1fr 1fr 1fr; }
    .swatch span { font-size: .76rem; padding: 8px; }
    .composer, .studio-controls { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .bulb { animation: power-on .001ms forwards; animation-delay: 0ms; }
}

@media print {
    .topbar, .tabbar, #fx-canvas, .hero-actions, .composer, .feed-toolbar, .studio, .toasts { display: none !important; }
    .hero { margin: 0; padding: 24px 0; }
    body { background: #fff; color: #000; }
}

/* ---------- 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; }
