/* ==========================================================================
   AquaLitre — feuille de style (direction « ludique & colorée »)
   Thème clair par défaut, sombre automatique (préférence système)
   ou forcé via <html data-theme="light|dark">.
   ========================================================================== */

:root {
    color-scheme: light;

    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

    --bg: #F6F5FF;
    --surface: #FFFFFF;
    --surface-2: #F8F7FF;
    --surface-3: #EFEDFF;
    --line: #E7E4FA;
    --line-strong: #D3CEF2;
    --ink: #15123B;
    --ink-2: #48446F;
    --ink-3: #7C789F;
    --on-bright: #15123B;
    --on-bright-2: #3B3763;

    --water: #2F6BFF;
    --water-hover: #1F57EA;
    --water-strong: #1D4ED8;
    --water-soft: #E8EEFF;
    --water-ring: rgba(47, 107, 255, 0.28);
    --cyan: #12C8F5;
    --violet: #8B5CFF;
    --pink: #FF4FA3;
    --yellow: #FFC531;
    --mint: #22D49B;
    --orange: #FF7A2F;

    --grad-water: linear-gradient(135deg, #12C8F5 0%, #2F6BFF 52%, #8B5CFF 100%);
    --grad-title: linear-gradient(110deg, #12C8F5 0%, #2F6BFF 35%, #8B5CFF 60%, #FF4FA3 85%, #12C8F5 100%);
    --grad-fun: linear-gradient(120deg, #FF4FA3 0%, #FF7A2F 52%, #FFC531 100%);
    --grad-ai: linear-gradient(135deg, #FF4FA3 0%, #8B5CFF 100%);
    --grad-uranium: linear-gradient(145deg, #FFF27A 0%, #FFC531 52%, #FF9F2F 100%);
    --grad-wind: linear-gradient(145deg, #9BF8CF 0%, #34E0B2 52%, #12C3CF 100%);
    --grad-solar: linear-gradient(145deg, #FFC27A 0%, #FF8A55 50%, #FF5C8E 100%);
    --grad-human: linear-gradient(145deg, #E0D2FF 0%, #B596FF 50%, #8664FF 100%);

    --ai: #A62EEA;
    --ai-soft: #F5E8FF;
    --good: #0EA66E;
    --good-soft: #DDF8EC;
    --bad: #E8335A;
    --bad-soft: #FFE5EB;
    --note-bg: #FFF3C4;
    --note-ink: #4A3A00;

    --cat-home: #FF6A1F;      --cat-home-soft: #FFECDF;
    --cat-transport: #2F6BFF; --cat-transport-soft: #E6EDFF;
    --cat-digital: #A23CF0;   --cat-digital-soft: #F4E6FF;
    --cat-food: #0FA765;      --cat-food-soft: #DCF6E8;
    --cat-industry: #D99100;  --cat-industry-soft: #FFF2CC;
    --cat-other: #F0397E;     --cat-other-soft: #FFE5EF;
    --cat-calc: #0AA7CC;      --cat-calc-soft: #DBF6FC;

    --co2-a: #10B27A;
    --co2-b: #7DC23E;
    --co2-c: #F39A1E;
    --co2-d: #F04E3E;
    --co2-e: #C21E5A;

    /* Scène du barrage — version « jour » */
    --sky-1: #6FD0FF;
    --sky-2: #E3F7FF;
    --mtn-far: #B7C3FF;
    --mtn-near: #57CF96;
    --snow: #FFFFFF;
    --tree: #1E9E68;
    --lake-1: #3FD0FF;
    --lake-2: #1F6BE8;
    --dam-1: #F1F3FA;
    --dam-2: #B3BCD6;
    --pipe: #FF5A6E;
    --ground: #2FA36B;
    --ground-2: #6BDC8F;
    --building: #FFFFFF;
    --building-line: #9AA4C2;
    --roof: #FF5A6E;
    --wire: #6E7899;
    --spark: #FFC531;
    --cloud: #FFFFFF;

    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --shadow-xs: 0 1px 2px rgba(42, 30, 120, 0.06);
    --shadow-sm: 0 2px 6px rgba(42, 30, 120, 0.08);
    --shadow-md: 0 18px 40px -20px rgba(64, 44, 190, 0.32), 0 2px 8px rgba(42, 30, 120, 0.05);
    --shadow-lg: 0 34px 70px -30px rgba(47, 80, 255, 0.45), 0 10px 24px -12px rgba(42, 30, 120, 0.12);
    --shadow-pop: 0 14px 0 -6px rgba(21, 18, 59, 0.08);

    --container: 1200px;
    --gutter: 24px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --grad-title: linear-gradient(110deg, #6FE6FF 0%, #93B4FF 35%, #C9A8FF 60%, #FF9ED0 85%, #6FE6FF 100%);
        --bg: #0E0B2E;
        --surface: #18143F;
        --surface-2: #1D1849;
        --surface-3: #262059;
        --line: #2E2866;
        --line-strong: #3E3782;
        --ink: #F4F2FF;
        --ink-2: #C6C1EE;
        --ink-3: #9089C4;
        --water: #5E8EFF;
        --water-hover: #7DA4FF;
        --water-strong: #A9C2FF;
        --water-soft: rgba(94, 142, 255, 0.16);
        --water-ring: rgba(94, 142, 255, 0.36);
        --ai: #E58BFF;
        --ai-soft: rgba(229, 139, 255, 0.14);
        --good: #3EE6A4;
        --good-soft: rgba(62, 230, 164, 0.14);
        --bad: #FF7D98;
        --bad-soft: rgba(255, 125, 152, 0.15);
        --note-bg: #3B3212;
        --note-ink: #FFE9A3;
        --cat-home-soft: rgba(255, 106, 31, 0.18);
        --cat-transport-soft: rgba(47, 107, 255, 0.22);
        --cat-digital-soft: rgba(162, 60, 240, 0.24);
        --cat-food-soft: rgba(15, 167, 101, 0.22);
        --cat-industry-soft: rgba(217, 145, 0, 0.22);
        --cat-other-soft: rgba(240, 57, 126, 0.2);
        --cat-calc-soft: rgba(10, 167, 204, 0.22);
        --cat-home: #FF9A5C;
        --cat-transport: #7DA4FF;
        --cat-digital: #D08BFF;
        --cat-food: #4BE3A1;
        --cat-industry: #FFCB4D;
        --cat-other: #FF7EAE;
        --cat-calc: #4DD9F5;
        --co2-a: #35E09C;
        --co2-b: #A6E35F;
        --co2-c: #FFB13D;
        --co2-d: #FF6E5E;
        --co2-e: #FF4D8A;
        --sky-1: #1A1450;
        --sky-2: #3C2C92;
        --mtn-far: #3A3488;
        --mtn-near: #1E6B78;
        --snow: #C9C6FF;
        --tree: #12505A;
        --lake-1: #3C86FF;
        --lake-2: #1C2E9E;
        --dam-1: #8C93C2;
        --dam-2: #4A4F86;
        --pipe: #FF5C86;
        --ground: #133E48;
        --ground-2: #1D5A60;
        --building: #2A2466;
        --building-line: #5B54A8;
        --roof: #FF5C86;
        --wire: #7A74C2;
        --spark: #FFD84D;
        --cloud: rgba(255, 255, 255, 0.16);
        --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
        --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 18px 40px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.02);
        --shadow-lg: 0 34px 70px -28px rgba(30, 20, 120, 0.85), 0 0 60px -30px rgba(94, 142, 255, 0.45);
        --shadow-pop: 0 14px 0 -6px rgba(0, 0, 0, 0.25);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --grad-title: linear-gradient(110deg, #6FE6FF 0%, #93B4FF 35%, #C9A8FF 60%, #FF9ED0 85%, #6FE6FF 100%);
    --bg: #0E0B2E;
    --surface: #18143F;
    --surface-2: #1D1849;
    --surface-3: #262059;
    --line: #2E2866;
    --line-strong: #3E3782;
    --ink: #F4F2FF;
    --ink-2: #C6C1EE;
    --ink-3: #9089C4;
    --water: #5E8EFF;
    --water-hover: #7DA4FF;
    --water-strong: #A9C2FF;
    --water-soft: rgba(94, 142, 255, 0.16);
    --water-ring: rgba(94, 142, 255, 0.36);
    --ai: #E58BFF;
    --ai-soft: rgba(229, 139, 255, 0.14);
    --good: #3EE6A4;
    --good-soft: rgba(62, 230, 164, 0.14);
    --bad: #FF7D98;
    --bad-soft: rgba(255, 125, 152, 0.15);
    --note-bg: #3B3212;
    --note-ink: #FFE9A3;
    --cat-home-soft: rgba(255, 106, 31, 0.18);
    --cat-transport-soft: rgba(47, 107, 255, 0.22);
    --cat-digital-soft: rgba(162, 60, 240, 0.24);
    --cat-food-soft: rgba(15, 167, 101, 0.22);
    --cat-industry-soft: rgba(217, 145, 0, 0.22);
    --cat-other-soft: rgba(240, 57, 126, 0.2);
    --cat-calc-soft: rgba(10, 167, 204, 0.22);
    --cat-home: #FF9A5C;
    --cat-transport: #7DA4FF;
    --cat-digital: #D08BFF;
    --cat-food: #4BE3A1;
    --cat-industry: #FFCB4D;
    --cat-other: #FF7EAE;
    --cat-calc: #4DD9F5;
    --co2-a: #35E09C;
    --co2-b: #A6E35F;
    --co2-c: #FFB13D;
    --co2-d: #FF6E5E;
    --co2-e: #FF4D8A;
    --sky-1: #1A1450;
    --sky-2: #3C2C92;
    --mtn-far: #3A3488;
    --mtn-near: #1E6B78;
    --snow: #C9C6FF;
    --tree: #12505A;
    --lake-1: #3C86FF;
    --lake-2: #1C2E9E;
    --dam-1: #8C93C2;
    --dam-2: #4A4F86;
    --pipe: #FF5C86;
    --ground: #133E48;
    --ground-2: #1D5A60;
    --building: #2A2466;
    --building-line: #5B54A8;
    --roof: #FF5C86;
    --wire: #7A74C2;
    --spark: #FFD84D;
    --cloud: rgba(255, 255, 255, 0.16);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 18px 40px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.02);
    --shadow-lg: 0 34px 70px -28px rgba(30, 20, 120, 0.85), 0 0 60px -30px rgba(94, 142, 255, 0.45);
    --shadow-pop: 0 14px 0 -6px rgba(0, 0, 0, 0.25);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 100px;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--water); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--water-hover); }
code { font-family: var(--font-mono); font-size: 0.86em; }
strong { font-weight: 700; }
[hidden] { display: none !important; }

:focus-visible {
    outline: 3px solid var(--water-ring);
    outline-offset: 2px;
    border-radius: 8px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 200;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--ink);
    color: var(--bg);
    font-weight: 700;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus { top: 12px; color: var(--bg); }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.icon {
    width: 18px;
    height: 18px;
    flex: none;
    display: inline-block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px 5px 9px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--water-strong);
}
.eyebrow .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--grad-water);
    box-shadow: 0 0 0 3px var(--water-soft);
    animation: pulseDot 2.4s ease-in-out infinite;
}
.eyebrow .dot-ai { background: var(--grad-ai); box-shadow: 0 0 0 3px var(--ai-soft); }

.tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 999px;
    line-height: 1.5;
}
.tag-ai { background: var(--grad-ai); color: #fff; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--cat-soft, var(--surface-3));
    color: var(--cat, var(--ink-2));
}

/* Couleurs par catégorie */
[data-cat="home"] { --cat: var(--cat-home); --cat-soft: var(--cat-home-soft); }
[data-cat="transport"] { --cat: var(--cat-transport); --cat-soft: var(--cat-transport-soft); }
[data-cat="digital"] { --cat: var(--cat-digital); --cat-soft: var(--cat-digital-soft); }
[data-cat="food"] { --cat: var(--cat-food); --cat-soft: var(--cat-food-soft); }
[data-cat="industry"] { --cat: var(--cat-industry); --cat-soft: var(--cat-industry-soft); }
[data-cat="other"] { --cat: var(--cat-other); --cat-soft: var(--cat-other-soft); }
[data-cat="calc"] { --cat: var(--cat-calc); --cat-soft: var(--cat-calc-soft); }

/* --------------------------------------------------------------------------
   Boutons & contrôles
   -------------------------------------------------------------------------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    font-weight: 700;
    font-size: 0.94rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    isolation: isolate;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.2s, transform 0.2s var(--spring), color 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn[disabled] { opacity: 0.75; cursor: progress; transform: none; }

.btn-primary {
    background: var(--grad-water);
    color: #fff;
    box-shadow: 0 12px 24px -10px rgba(47, 107, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:hover { color: #fff; box-shadow: 0 16px 30px -10px rgba(47, 107, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }

.btn-fun {
    background: var(--grad-fun);
    color: #fff;
    box-shadow: 0 10px 22px -10px rgba(255, 79, 163, 0.75);
}
.btn-fun:hover { color: #fff; }

.btn-ghost {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink);
}
.btn-ghost:hover { border-color: var(--water); color: var(--water-strong); }

.btn-lg { height: 56px; padding: 0 26px; font-size: 1.02rem; }
.btn-sm { height: 38px; padding: 0 15px; font-size: 0.86rem; }
.btn-xs { height: 32px; padding: 0 12px; font-size: 0.8rem; gap: 6px; }
.btn-xs .icon, .btn-sm .icon { width: 16px; height: 16px; }

.icon-btn {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    transition: border-color 0.15s, color 0.15s, transform 0.25s var(--spring);
}
.icon-btn:hover { border-color: var(--water); color: var(--water-strong); transform: rotate(-12deg) scale(1.05); }

.spinner {
    width: 16px;
    height: 16px;
    flex: none;
    border-radius: 50%;
    border: 2.5px solid currentColor;
    border-right-color: transparent;
    animation: spin 0.7s linear infinite;
}

/* Contrôle segmenté */
.seg {
    display: flex;
    gap: 4px;
    padding: 5px;
    background: var(--surface-3);
    border-radius: 999px;
}
.seg-item {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s var(--spring);
}
.seg-item:hover { color: var(--ink); }
.seg-item.is-active {
    background: var(--grad-water);
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(47, 107, 255, 0.75);
}
.seg-item.is-active .tag-ai { background: rgba(255, 255, 255, 0.25); }
.seg-sm .seg-item { height: 34px; font-size: 0.82rem; padding: 0 14px; }

/* --------------------------------------------------------------------------
   Barre supérieure
   -------------------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    -webkit-backdrop-filter: saturate(1.8) blur(16px);
    backdrop-filter: saturate(1.8) blur(16px);
    border-bottom: 1px solid var(--line);
}
.topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--grad-water);
    opacity: 0.6;
}
.topbar-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    flex: none;
}
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 38px;
    height: 38px;
    display: block;
    filter: drop-shadow(0 6px 12px rgba(47, 107, 255, 0.4));
    transition: transform 0.4s var(--spring);
}
.brand:hover .brand-mark { transform: rotate(-10deg) scale(1.08); }
.brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.42rem;
    letter-spacing: -0.03em;
}
.brand-name span {
    background: var(--grad-water);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.mainnav {
    display: flex;
    gap: 4px;
    padding: 5px;
    margin-inline: auto;
    background: var(--surface);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}
.mainnav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
    font-weight: 700;
    font-size: 0.9rem;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.mainnav-item:hover { color: var(--ink); background: var(--surface-3); }
.mainnav-item.is-active {
    background: var(--grad-water);
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(47, 107, 255, 0.75);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.btn-random .icon { transition: transform 0.6s var(--spring); }
.btn-random.is-rolling .icon { transform: rotate(540deg) scale(1.2); }

.lang-switch {
    display: inline-flex;
    padding: 4px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.lang-opt {
    display: inline-grid;
    place-items: center;
    min-width: 36px;
    height: 30px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--ink-3);
    text-decoration: none;
    transition: color 0.15s, background-color 0.15s;
}
.lang-opt:hover { color: var(--ink); }
.lang-opt.is-active { background: var(--ink); color: var(--bg); }
.lang-opt.is-active:hover { color: var(--bg); }

.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; color: var(--yellow); }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: inline-block; color: var(--yellow); }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* Rappel du sujet courant quand le résultat sort de l'écran */
.sticky-summary {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.8) blur(16px);
    backdrop-filter: saturate(1.8) blur(16px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s var(--ease);
}
.sticky-inner { display: flex; align-items: center; gap: 10px; height: 48px; font-size: 0.9rem; }
.sticky-emoji { font-size: 1.2rem; }
.sticky-title { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sticky-value {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--grad-water);
    color: #fff;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Hero & saisie
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    padding: 70px 0 64px;
    isolation: isolate;
    overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    animation: blobFloat 22s ease-in-out infinite alternate;
}
.blob-1 { width: 520px; height: 520px; left: -140px; top: -180px; background: #3FD8FF; }
.blob-2 { width: 460px; height: 460px; right: -120px; top: -140px; background: #A87BFF; animation-duration: 26s; animation-delay: -6s; }
.blob-3 { width: 380px; height: 380px; left: 38%; bottom: -220px; background: #FF7AC0; animation-duration: 19s; animation-delay: -3s; opacity: 0.42; }
.blob-4 { width: 300px; height: 300px; right: 18%; bottom: -120px; background: #FFD66B; animation-duration: 24s; animation-delay: -10s; opacity: 0.45; }

.hero-bubble {
    position: absolute;
    bottom: -40px;
    left: var(--x);
    width: var(--s);
    height: var(--s);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.25) 40%, rgba(47, 107, 255, 0.18));
    border: 1.5px solid rgba(47, 107, 255, 0.28);
    animation: bubbleRise var(--t, 10s) linear infinite;
    animation-delay: var(--d, 0s);
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 56px;
    align-items: center;
}
.hero-copy { position: relative; }
.hero-title {
    margin-top: 18px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.3rem, 4.4vw, 3.9rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    max-width: 14ch;
    text-wrap: balance;
}
.hero-title em {
    position: relative;
    display: inline-block;
    font-style: normal;
    white-space: nowrap;
    background: var(--grad-title);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 7s linear infinite;
}
.hero-title em::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.1em;
    height: 0.2em;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 10'%3E%3Cpath d='M0 5 Q5 0 10 5 T20 5 T30 5 T40 5' fill='none' stroke='%2312C8F5' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
    background-size: 0.8em 100%;
    animation: underlineWave 1.6s linear infinite;
}
.hero-lead {
    margin-top: 20px;
    max-width: 52ch;
    font-size: 1.1rem;
    color: var(--ink-2);
    text-wrap: pretty;
}
/* Exemples du hero : « activité → litres d'eau », compris d'un coup d'œil */
.hero-examples {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
    max-width: 600px;
}
.hero-ex {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    padding: 9px 14px 9px 9px;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    transition: transform 0.3s var(--spring), box-shadow 0.2s;
}
.hero-ex:hover { transform: translateY(-3px) rotate(-0.6deg); box-shadow: var(--shadow-md); }
.hero-ex:focus-visible { outline: 3px solid var(--water); outline-offset: 2px; }
.hero-ex-emoji {
    display: grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--water-soft);
    font-size: 19px;
}
.hero-ex-text { display: grid; gap: 1px; min-width: 0; }
.lbl-short { display: none; }
.hero-ex-label { font-size: 0.8rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-ex-water {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    white-space: nowrap;
    color: var(--water-strong);
}
.hero-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; font-size: 0.88rem; }
.formula-chip, .rate-chip {
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
}
.formula-chip { color: var(--water-strong); font-size: 0.82rem; }
.rate-chip { color: var(--ink-2); }

.sticker {
    position: absolute;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    font-size: 28px;
    animation: stickerFloat 5s ease-in-out infinite;
    pointer-events: none;
}
.sticker-1 { top: 20px; right: 2%; --r: 10deg; }
.sticker-2 { top: 46%; right: -4%; --r: -8deg; animation-delay: -1.6s; width: 48px; height: 48px; font-size: 24px; }
.sticker-3 { top: -44px; left: 56%; --r: 6deg; animation-delay: -3.2s; width: 44px; height: 44px; font-size: 22px; }

.ask-wrap { position: relative; padding-top: 44px; }
.mascot {
    position: absolute;
    top: -52px;
    right: 34px;
    z-index: 0;
    width: 112px;
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 12px 18px rgba(47, 107, 255, 0.35));
}
.m-body { transform-box: fill-box; transform-origin: 50% 100%; animation: mascotBob 3.2s ease-in-out infinite; }
.m-shadow { fill: rgba(21, 18, 59, 0.12); transform-box: fill-box; transform-origin: center; animation: mascotShadow 3.2s ease-in-out infinite; }
.m-eyes { transform-box: fill-box; transform-origin: center; animation: blink 5.5s infinite; }
.m-pupil { transition: transform 0.3s var(--ease); }
.mascot.is-thinking .m-body { animation: mascotThink 0.5s ease-in-out infinite alternate; }
.mascot.is-thinking .m-pupil { transform: translate(-2px, -4px); }
.mascot.is-happy .m-body { animation: mascotJump 0.8s var(--spring); }
.mascot.is-sad .m-mouth { transform: translateY(6px) scaleY(-1); transform-box: fill-box; transform-origin: center; }

.ask-card {
    position: relative;
    z-index: 1;
    padding: 16px;
    border-radius: var(--radius-xl);
    border: 2px solid transparent;
    background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad-water) border-box;
    box-shadow: var(--shadow-lg);
}

.ask-row { display: flex; gap: 10px; margin-top: 16px; }
.ask-input-wrap { position: relative; flex: 1; min-width: 0; }
.ask-input {
    width: 100%;
    height: 56px;
    padding: 0 18px 0 48px;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 1rem;
    font-weight: 500;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.ask-input::placeholder { color: var(--ink-3); }
.ask-input:focus { outline: none; border-color: var(--water); background: var(--surface); box-shadow: 0 0 0 5px var(--water-ring); }
.ask-input-icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--ai); pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.chips-label { font-size: 0.82rem; font-weight: 600; color: var(--ink-3); margin-right: 2px; }
.chip {
    --chip: var(--cat-transport-soft);
    height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    border: 0;
    background: var(--chip);
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 600;
    transition: transform 0.25s var(--spring), box-shadow 0.2s;
}
.chip:nth-of-type(2) { --chip: var(--cat-digital-soft); }
.chip:nth-of-type(3) { --chip: var(--cat-home-soft); }
.chip:nth-of-type(4) { --chip: var(--cat-other-soft); }
.chip:nth-of-type(5) { --chip: var(--cat-food-soft); }
.chip:nth-of-type(6) { --chip: var(--cat-industry-soft); }
.chip:hover { transform: translateY(-3px) rotate(-2deg); box-shadow: var(--shadow-sm); }

.ask-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--surface-2);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-2);
    animation: fadeUp 0.3s var(--ease);
}
.ask-status .icon, .ask-status .spinner { margin-top: 2px; }
.ask-status.is-loading { color: var(--ai); background: var(--ai-soft); }
.ask-status.is-success { color: var(--good); background: var(--good-soft); }
.ask-status.is-error { color: var(--bad); background: var(--bad-soft); }

.calc-row { display: flex; align-items: flex-end; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 170px; min-width: 0; }
.field label { font-size: 0.8rem; font-weight: 700; color: var(--ink-2); }
.input-combo {
    display: flex;
    height: 56px;
    border: 2px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: var(--surface-2);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input-combo:focus-within { border-color: var(--water); box-shadow: 0 0 0 5px var(--water-ring); }
.input-combo input {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 0 14px;
    background: transparent;
    font-size: 1.15rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
    appearance: textfield;
}
.input-combo input::-webkit-outer-spin-button,
.input-combo input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-combo input:focus { outline: none; }
.input-combo select,
.select {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B5CFF' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}
.input-combo select {
    border: 0;
    border-left: 2px solid var(--line);
    padding: 0 32px 0 12px;
    font-weight: 700;
    font-size: 0.9rem;
}
.input-combo select:focus { outline: none; }
.calc-op {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 56px;
    background: var(--grad-fun);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.calc-result {
    height: 56px;
    display: inline-flex;
    align-items: center;
    padding: 0 20px;
    border-radius: 18px;
    background: var(--grad-water);
    color: #fff;
    font-weight: 800;
    font-size: 1.12rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    box-shadow: 0 12px 24px -12px rgba(47, 107, 255, 0.7);
}
.calc-hint { margin-top: 12px; font-size: 0.82rem; color: var(--ink-3); }

/* --------------------------------------------------------------------------
   Résultat
   -------------------------------------------------------------------------- */
.result {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.result.is-loading .result-main,
.result.is-loading .result-details { opacity: 0.5; filter: saturate(0.5); transition: opacity 0.2s; }

.result-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.result-main { padding: 32px 34px 30px; min-width: 0; }
.result-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    background: var(--surface-2);
    min-width: 0;
}

.subject { display: flex; gap: 16px; align-items: flex-start; }
.subject-emoji {
    width: 64px;
    height: 64px;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 34px;
    border-radius: 22px;
    background: var(--cat-soft, var(--water-soft));
    box-shadow: inset 0 -4px 0 rgba(21, 18, 59, 0.06);
}
.subject-emoji.is-pop { animation: pop 0.6s var(--spring); }
.subject-text { min-width: 0; }
.subject-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.subject-title {
    margin-top: 8px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
    text-wrap: balance;
}
.subject-formula {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--surface-3);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--ink-2);
}
.subject-formula:empty { display: none; }

/* Panneau « eau » avec vagues */
.answer-panel {
    position: relative;
    margin-top: 24px;
    padding: 26px 28px 74px;
    border-radius: var(--radius-lg);
    background: var(--grad-water);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 24px 40px -24px rgba(47, 107, 255, 0.9);
}
.answer-panel::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto auto;
    width: 60%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 65%);
    z-index: -1;
}
.answer-label {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.answer-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 12px; }
.answer-num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3.6rem, 8.4vw, 6.6rem);
    line-height: 0.9;
    letter-spacing: -0.05em;
    font-variant-numeric: lining-nums;
    text-shadow: 0 6px 24px rgba(10, 30, 120, 0.35);
}
.answer-num.is-bump { animation: bump 0.55s var(--spring); }
.answer-unit {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.3rem);
    letter-spacing: -0.02em;
    opacity: 0.92;
}
.answer-sub { margin-top: 12px; max-width: 46ch; font-size: 1rem; color: rgba(255, 255, 255, 0.92); }
.answer-sub strong { color: #fff; }

.answer-waves { position: absolute; left: 0; bottom: 0; width: 100%; height: 58px; z-index: -1; overflow: hidden; }
.wave { animation: waveSlide 9s linear infinite; }
.wave-back { fill: rgba(255, 255, 255, 0.14); animation-duration: 13s; animation-direction: reverse; }
.wave-front { fill: rgba(255, 255, 255, 0.24); }
.panel-bubble {
    position: absolute;
    bottom: -12px;
    left: var(--x);
    z-index: -1;
    width: var(--s);
    height: var(--s);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    animation: panelBubble 4.5s ease-in infinite;
    animation-delay: var(--d);
}

/* Pictogrammes qui se remplissent d'eau */
.isotype { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 22px; min-height: 38px; }
.iso { width: 38px; height: 38px; display: block; overflow: visible; filter: drop-shadow(0 3px 4px rgba(10, 30, 120, 0.25)); }
.iso-empty { fill: rgba(255, 255, 255, 0.2); }
.iso-water {
    fill: #9FF3FF;
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: isoRise 0.8s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 40ms);
}
.isotype.no-anim .iso-water { animation: none; }
.iso-line { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.iso-times {
    margin-left: 6px;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.isotype-caption { margin-top: 10px; font-size: 0.95rem; color: rgba(255, 255, 255, 0.92); }
.isotype-caption strong { color: #fff; }

.callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding: 14px 14px 14px 18px;
    border-radius: 20px;
    background: var(--good-soft);
    font-size: 0.9rem;
    color: var(--ink-2);
    animation: fadeUp 0.35s var(--ease);
}
.callout.is-alt { background: var(--water-soft); }
.callout-text { flex: 1 1 260px; }
.callout-kicker {
    display: block;
    margin-bottom: 2px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--good);
}
.callout.is-alt .callout-kicker { color: var(--water-strong); }
.callout strong { color: var(--ink); }

.energy-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.energy-strip > div { padding: 12px 15px; border-radius: 18px; min-width: 0; background: var(--cat-transport-soft); }
.energy-strip > div:nth-child(2) { background: var(--cat-other-soft); }
.energy-strip > div:nth-child(3) { background: var(--cat-industry-soft); }
.energy-strip dt { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.energy-strip dd {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Schéma du barrage */
.dam-figure { border-radius: 22px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-md); }
.dam-svg { display: block; width: 100%; height: auto; }
.dam-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding: 11px 15px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-2);
}
.dam-legend > span { display: inline-flex; align-items: center; gap: 8px; }
.lg { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.lg-water { background: var(--grad-water); }
.lg-energy { background: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 197, 49, 0.25); }

.d-sky-1 { stop-color: var(--sky-1); }
.d-sky-2 { stop-color: var(--sky-2); }
.d-lake-1 { stop-color: var(--lake-1); }
.d-lake-2 { stop-color: var(--lake-2); }
.d-dam-1 { stop-color: var(--dam-1); }
.d-dam-2 { stop-color: var(--dam-2); }
.d-mtn-far { fill: var(--mtn-far); }
.d-snow { fill: var(--snow); }
.d-mtn-near { fill: var(--mtn-near); }
.d-trees { fill: var(--tree); }
.d-lake { fill: url(#dam-lake); }
.d-dam { fill: url(#dam-wall); }
.d-ground { fill: var(--ground); }
.d-ground-2 { fill: var(--ground-2); }
.d-river { fill: var(--lake-1); }
.d-sun { fill: #FFD43B; filter: drop-shadow(0 0 10px rgba(255, 212, 59, 0.8)); }
.d-sun-rays { stroke: #FFC531; stroke-width: 4; stroke-linecap: round; transform-box: fill-box; transform-origin: center; animation: spin 18s linear infinite; }
.d-moon { fill: #FFF2B8; filter: drop-shadow(0 0 8px rgba(255, 242, 184, 0.7)); }
.d-star { fill: #fff; animation: twinkle 2.6s ease-in-out infinite; }
.d-star-2 { animation-delay: -0.9s; }
.d-star-3 { animation-delay: -1.7s; }
.d-night { display: none; }
:root[data-theme="dark"] .d-night { display: inline; }
:root[data-theme="dark"] .d-day { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .d-night { display: inline; }
    :root:not([data-theme="light"]) .d-day { display: none; }
}
.d-cloud { fill: var(--cloud); animation: cloudDrift 38s linear infinite; }
.d-cloud-2 { animation-duration: 52s; animation-delay: -20s; }
.d-ripple { stroke: rgba(255, 255, 255, 0.7); stroke-width: 2.5; stroke-linecap: round; animation: ripple 4.5s ease-in-out infinite; }
.d-ripple-2 { animation-delay: -1.5s; }
.d-ripple-3 { animation-delay: -3s; }
.d-pipe { fill: none; stroke: var(--pipe); stroke-width: 14; stroke-linecap: round; }
.d-pipe-inner { fill: none; stroke: var(--lake-2); stroke-width: 7; stroke-linecap: round; }
.d-flow {
    fill: none;
    stroke: #D6F4FF;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-dasharray: 5 13;
    animation: flow var(--flow-dur, 1s) linear infinite;
}
.d-river-flow {
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 14 18;
    animation: flowRiver var(--flow-dur, 1s) linear infinite;
}
.d-river-flow-2 { animation-duration: calc(var(--flow-dur, 1s) * 1.4); opacity: 0.7; }
.d-roof { fill: var(--roof); }
.d-house { fill: var(--building); stroke: var(--building-line); stroke-width: 2; }
.d-window { fill: var(--sky-2); stroke: var(--building-line); stroke-width: 2; }
.d-turbine {
    transform-box: fill-box;
    transform-origin: center;
    animation: spin var(--spin-dur, 2s) linear infinite;
}
.d-blade { fill: none; stroke: var(--water); stroke-width: 3.5; stroke-linecap: round; }
.d-hub { fill: var(--yellow); }
.d-pylon { fill: none; stroke: var(--wire); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.d-wire { fill: none; stroke: var(--wire); stroke-width: 1.6; }
.d-spark {
    fill: none;
    stroke: var(--spark);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 3 27;
    filter: drop-shadow(0 0 4px rgba(255, 197, 49, 0.9));
    animation: flowSpark calc(var(--flow-dur, 1s) * 0.9) linear infinite;
}
.d-dim { stroke: var(--on-bright); stroke-width: 1.8; }
.d-arrowhead { fill: var(--on-bright); }
.d-dim-guide { stroke: var(--on-bright-2); stroke-width: 1.2; stroke-dasharray: 3 4; opacity: 0.7; }
.d-dim-label {
    font: 800 17px var(--font-sans);
    fill: var(--on-bright);
    paint-order: stroke;
    stroke: #fff;
    stroke-width: 6px;
    stroke-linejoin: round;
}
.d-label {
    font: 700 12.5px var(--font-sans);
    fill: #fff;
    paint-order: stroke;
    stroke: rgba(21, 18, 59, 0.25);
    stroke-width: 3px;
}
.dam-svg.is-paused * { animation-play-state: paused !important; }

.dam-controls { display: flex; flex-direction: column; gap: 14px; }
.control-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: -4px; }
.preset {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    text-align: left;
    border-radius: 18px;
    border: 2px solid var(--line);
    background: var(--surface);
    transition: border-color 0.15s, background-color 0.15s, transform 0.25s var(--spring), box-shadow 0.2s;
}
.preset:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.preset-emoji {
    width: 34px;
    height: 34px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface-3);
    font-size: 18px;
}
.preset-text { min-width: 0; }
.preset strong { display: block; font-size: 0.85rem; font-weight: 800; line-height: 1.25; }
.preset-text span { display: block; font-size: 0.74rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.preset.is-active {
    border-color: transparent;
    background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad-water) border-box;
    box-shadow: 0 10px 20px -12px rgba(47, 107, 255, 0.7);
}
.preset.is-active .preset-emoji { background: var(--grad-water); }
.preset.is-active .preset-text span { color: var(--water-strong); }

.slider-field { display: flex; flex-direction: column; gap: 4px; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.86rem; }
.slider-head label { font-weight: 700; color: var(--ink-2); }
.slider-head output {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--water-soft);
    font-weight: 800;
    color: var(--water-strong);
    font-variant-numeric: tabular-nums;
}

input[type="range"] {
    --pct: 50%;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 10px;
    border-radius: 999px;
    background:
        linear-gradient(90deg, #12C8F5, #2F6BFF 60%, #8B5CFF) 0 0 / var(--pct) 100% no-repeat,
        var(--surface-3);
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -7px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--water);
    box-shadow: 0 4px 10px rgba(47, 107, 255, 0.45);
    transition: transform 0.2s var(--spring);
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.25); }
input[type="range"]::-moz-range-track { height: 10px; border-radius: 999px; background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 10px; border-radius: 999px; background: linear-gradient(90deg, #12C8F5, #2F6BFF 60%, #8B5CFF); }
input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--water);
    box-shadow: 0 4px 10px rgba(47, 107, 255, 0.45);
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px var(--water-ring); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 6px var(--water-ring); }

.dam-note { font-size: 0.8rem; color: var(--ink-3); line-height: 1.5; }
.dam-note a { color: var(--water-strong); font-weight: 600; }

/* Détails du résultat */
.result-details {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    padding: 30px 34px 32px;
    border-top: 2px dashed var(--line);
}
.kicker {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.takeaway {
    position: relative;
    align-self: start;
    padding: 20px 22px;
    border-radius: 6px 22px 22px 22px;
    background: var(--note-bg);
    color: var(--note-ink);
    transform: rotate(-1deg);
    box-shadow: var(--shadow-pop);
    transition: transform 0.3s var(--spring);
}
.takeaway:hover { transform: rotate(0deg) scale(1.01); }
.takeaway .kicker { color: var(--note-ink); opacity: 0.8; }
.takeaway-text {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.12rem;
    line-height: 1.42;
    letter-spacing: -0.01em;
    text-wrap: pretty;
}
.takeaway-note { margin-top: 10px; font-size: 0.78rem; opacity: 0.75; }
.detail-block p { font-size: 0.9rem; color: var(--ink-2); }
.hypotheses { margin-top: 10px; }
.hypotheses strong { color: var(--ink); }

.source-list { display: grid; gap: 10px; }
.source-list li {
    padding: 11px 13px;
    border-radius: 16px;
    background: var(--surface-2);
    border: 1.5px solid var(--line);
    transition: border-color 0.15s, transform 0.2s var(--spring);
}
.source-list li:hover { border-color: var(--water); transform: translateX(3px); }
.source-list a, .source-name { font-size: 0.9rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.source-list a:hover { color: var(--water-strong); text-decoration: underline; }
.source-domain {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--water-soft);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--water-strong);
}
.source-list p { margin-top: 5px; font-size: 0.82rem; color: var(--ink-3); }

.ai-cost {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 18px;
    background: var(--ai-soft);
    font-size: 0.88rem;
    color: var(--ink-2);
}
.ai-cost .icon { color: var(--ai); margin-top: 2px; }
.ai-cost strong { color: var(--ink); }

.result-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 34px;
    background: var(--surface-2);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { margin-top: 88px; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 18px 24px;
    margin-bottom: 26px;
}
.section-title {
    margin-top: 14px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.9rem, 3.6vw, 2.9rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.section-lead { margin-top: 10px; max-width: 60ch; color: var(--ink-2); text-wrap: pretty; }
.section-lead strong { color: var(--ink); }

/* Apparition au défilement (seulement si le JS tourne) */
.js .reveal { opacity: 0; transform: translateY(28px); }
.js .reveal.is-in {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s var(--ease) var(--delay, 0ms), transform 0.7s var(--ease) var(--delay, 0ms);
}

/* Cartes d'équivalence colorées */
.eq-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.eq-card {
    --grad: var(--grad-water);
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 22px 20px 18px;
    border-radius: 28px;
    background: var(--grad);
    color: var(--on-bright);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.35s var(--spring), box-shadow 0.25s;
}
.eq-card:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: var(--shadow-lg); }
.eq-card:nth-child(even):hover { transform: translateY(-6px) rotate(1deg); }
.eq-card::after {
    content: "";
    position: absolute;
    right: -30%;
    bottom: -35%;
    z-index: -1;
    width: 80%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
}
.eq-card[data-tone="uranium"] { --grad: var(--grad-uranium); }
.eq-card[data-tone="wind"] { --grad: var(--grad-wind); }
.eq-card[data-tone="solar"] { --grad: var(--grad-solar); }
.eq-card[data-tone="human"] { --grad: var(--grad-human); }

.eq-sticker {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 30px;
    transform: rotate(12deg);
    transition: transform 0.4s var(--spring);
}
.eq-card:hover .eq-sticker { transform: rotate(-8deg) scale(1.25); }
.eq-head { display: flex; align-items: center; gap: 11px; padding-right: 36px; }
.eq-head h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.eq-head p { font-size: 0.76rem; font-weight: 600; color: var(--on-bright-2); }
.eq-icon {
    width: 42px;
    height: 42px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.75);
    color: var(--on-bright);
    box-shadow: 0 4px 10px rgba(21, 18, 59, 0.1);
}
.eq-icon .icon { width: 22px; height: 22px; }
.eq-value {
    margin-top: 22px;
    font-family: var(--font-display);
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: lining-nums;
    overflow-wrap: anywhere;
}
.eq-caption { margin-top: 8px; font-size: 0.86rem; font-weight: 500; color: var(--on-bright-2); min-height: 2.8em; }

.gauge {
    position: relative;
    margin-top: 16px;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(21, 18, 59, 0.12);
}
.gauge i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--on-bright);
    transition: width 0.8s var(--spring);
}
.gauge.is-over i {
    background-image: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(255, 255, 255, 0.3) 6px 12px);
    background-size: 34px 34px;
    animation: stripes 1s linear infinite;
}
.gauge-label { margin-top: 7px; font-size: 0.78rem; font-weight: 600; color: var(--on-bright-2); }

.eq-stats {
    display: grid;
    gap: 7px;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.45);
}
.eq-stats div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.82rem; }
.eq-stats dt { color: var(--on-bright-2); font-weight: 500; }
.eq-stats dd { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.eq-source { margin-top: auto; padding-top: 14px; font-size: 0.74rem; font-weight: 600; color: var(--on-bright-2); }
.eq-source a { color: var(--on-bright); }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.panel {
    padding: 26px;
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}
.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}
.panel-lead { margin-top: 4px; font-size: 0.92rem; color: var(--ink-2); }

.bars { display: grid; gap: 14px; margin-top: 20px; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 0.88rem; }
.bar-head span { color: var(--ink-2); font-weight: 600; }
.bar-head em { font-style: normal; color: var(--ink-3); font-weight: 500; }
.bar-head strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-track { margin-top: 6px; height: 14px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8FE6FF, #8AA8FF);
    transition: width 0.7s var(--spring);
}
.bar-row.is-active .bar-fill { background: var(--grad-water); box-shadow: 0 0 14px rgba(47, 107, 255, 0.55); }
.bar-row.is-active .bar-head span { color: var(--ink); font-weight: 800; }

.note {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--cat-industry-soft);
    font-size: 0.86rem;
    color: var(--ink-2);
}
.note strong { color: var(--ink); }

.fun-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.fun-tile {
    --tile: var(--cat-transport-soft);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 18px;
    background: var(--tile);
    min-width: 0;
    transition: transform 0.3s var(--spring);
}
.fun-tile:nth-child(8n + 2) { --tile: var(--cat-calc-soft); }
.fun-tile:nth-child(8n + 3) { --tile: var(--cat-industry-soft); }
.fun-tile:nth-child(8n + 4) { --tile: var(--cat-digital-soft); }
.fun-tile:nth-child(8n + 5) { --tile: var(--cat-home-soft); }
.fun-tile:nth-child(8n + 6) { --tile: var(--cat-food-soft); }
.fun-tile:nth-child(8n + 7) { --tile: var(--cat-other-soft); }
.fun-tile:nth-child(8n + 8) { --tile: var(--surface-3); }
.fun-tile:hover { transform: translateY(-3px) scale(1.02); }
.fun-tile:hover .fun-emoji { animation: wiggle 0.6s ease; }
.fun-emoji {
    width: 42px;
    height: 42px;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 22px;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.fun-val { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fun-lbl { margin-top: 2px; font-size: 0.76rem; line-height: 1.3; color: var(--ink-2); }

/* Comparatif */
.table-card { border-radius: 28px; background: var(--surface); box-shadow: var(--shadow-md); overflow: hidden; }
.comp-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.comp-table th {
    padding: 14px 16px;
    text-align: left;
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
    background: var(--surface-2);
}
.comp-table td { padding: 16px; border-top: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.comp-table tbody tr { transition: background-color 0.15s; }
.comp-table tbody tr:hover { background: var(--surface-2); }
.comp-table tr.is-hydro { background: var(--water-soft); box-shadow: inset 5px 0 0 var(--water); }
.comp-table tr.is-hydro:hover { background: var(--water-soft); }
.filiere { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.filiere-icon {
    width: 44px;
    height: 44px;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 22px;
    border-radius: 15px;
    background: var(--row-soft, var(--surface-3));
    transition: transform 0.3s var(--spring);
}
.comp-table tr:hover .filiere-icon { transform: rotate(-10deg) scale(1.1); }
[data-row="hydro"] { --row-soft: var(--cat-transport-soft); }
[data-row="nuclear"] { --row-soft: var(--cat-industry-soft); }
[data-row="wind"] { --row-soft: var(--cat-food-soft); }
[data-row="solar"] { --row-soft: var(--cat-home-soft); }
[data-row="oil"] { --row-soft: var(--surface-3); }
[data-row="gas"] { --row-soft: var(--cat-other-soft); }
[data-row="coal"] { --row-soft: var(--surface-3); }
[data-row="human"] { --row-soft: var(--cat-digital-soft); }
.filiere-name { font-weight: 800; color: var(--ink); }
.filiere-type { font-size: 0.76rem; color: var(--ink-3); }
.qty { font-weight: 800; color: var(--ink); }
.row-note { margin-top: 4px; font-size: 0.78rem; color: var(--ink-3); max-width: 32ch; }
.co2 { min-width: 140px; }
.co2-val { font-weight: 800; color: var(--co2, var(--ink)); }
.co2-rate { font-size: 0.74rem; color: var(--ink-3); }
.co2-bar {
    position: relative;
    margin-top: 7px;
    height: 8px;
    width: 120px;
    max-width: 100%;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}
.co2-bar i { display: block; height: 100%; border-radius: inherit; background: var(--co2); transition: width 0.7s var(--spring); }
.co2-bar.is-over i { background-image: repeating-linear-gradient(-45deg, transparent 0 4px, rgba(255, 255, 255, 0.45) 4px 8px); }
.co2-over { margin-top: 4px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--co2); }
.co2-a { --co2: var(--co2-a); }
.co2-b { --co2: var(--co2-b); }
.co2-c { --co2: var(--co2-c); }
.co2-d { --co2: var(--co2-d); }
.co2-e { --co2: var(--co2-e); }
.pilot { display: flex; gap: 4px; margin-top: 4px; }
.pilot i { width: 15px; height: 8px; border-radius: 4px; background: var(--surface-3); }
.pilot i.on { background: var(--grad-water); }
.pilot-label { margin-top: 7px; font-size: 0.76rem; color: var(--ink-3); max-width: 22ch; }

/* Bandeau « ordres de grandeur » + bandeau défilant */
.facts-band {
    position: relative;
    margin-top: 96px;
    padding: 0 0 84px;
    color: #EEF0FF;
    background:
        radial-gradient(50% 70% at 90% 10%, rgba(255, 79, 163, 0.35), transparent 70%),
        radial-gradient(45% 60% at 5% 100%, rgba(18, 200, 245, 0.35), transparent 70%),
        linear-gradient(135deg, #1B1464 0%, #3A2FD0 50%, #0B8FE0 100%);
    overflow: hidden;
}
.ticker {
    position: relative;
    margin: 0 -2% 64px;
    padding: 14px 0;
    background: var(--yellow);
    color: #15123B;
    transform: rotate(-1.6deg);
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    top: 26px;
}
.ticker-track { display: flex; width: max-content; animation: ticker 48s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 0 30px;
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.ticker-item::after { content: "✦"; margin-left: 60px; color: #FF4FA3; }
.facts-band .section-title { color: #fff; }
.eyebrow-light { background: rgba(255, 255, 255, 0.14); color: #fff; box-shadow: none; }
.eyebrow-light .dot { background: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 197, 49, 0.3); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 34px; }
.fact {
    padding: 24px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: transform 0.35s var(--spring), background-color 0.2s;
}
.fact:hover { transform: translateY(-6px) rotate(-1deg); background: rgba(255, 255, 255, 0.16); }
.fact .fact-num {
    margin: 0;
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    background: linear-gradient(110deg, #FFE36B, #FF8FC8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.fact-title { margin-top: 14px; font-size: 1rem; font-weight: 800; color: #fff; }
.fact p { margin-top: 6px; font-size: 0.88rem; color: #D5D8FF; }

/* Catalogue & historique */
.search { position: relative; width: min(320px, 100%); }
.search input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 42px;
    border-radius: 999px;
    border: 2px solid var(--line);
    background: var(--surface);
    font-size: 0.92rem;
    font-weight: 500;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search input:focus { outline: none; border-color: var(--water); box-shadow: 0 0 0 5px var(--water-ring); }
.search .icon { position: absolute; left: 15px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--violet); pointer-events: none; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 15px;
    border-radius: 999px;
    border: 0;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--ink-2);
    font-size: 0.86rem;
    font-weight: 700;
    transition: transform 0.25s var(--spring), background-color 0.15s, color 0.15s;
}
.filter:hover { transform: translateY(-2px); color: var(--ink); }
.filter-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cat, var(--violet)); }
.filter[data-cat="all"] .filter-dot { background: var(--grad-fun); }
.filter .count {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--surface-3);
    font-size: 0.72rem;
    color: var(--ink-3);
}
.filter.is-active { background: var(--cat, var(--ink)); color: #fff; }
.filter[data-cat="all"].is-active { background: var(--grad-fun); }
.filter.is-active .filter-dot { background: #fff; }
.filter.is-active .count { background: rgba(255, 255, 255, 0.25); color: #fff; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    padding: 16px;
    text-align: left;
    border-radius: 24px;
    border: 2px solid transparent;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.3s var(--spring), box-shadow 0.25s, border-color 0.2s;
}
.item::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: var(--cat, var(--water));
    opacity: 0.85;
}
.item:hover { transform: translateY(-5px) rotate(-0.6deg); box-shadow: var(--shadow-md); }
.item:hover .item-emoji { animation: wiggle 0.6s ease; }
.item.is-active { border-color: var(--water); box-shadow: 0 0 0 4px var(--water-ring), var(--shadow-md); }
.item-top { display: flex; gap: 12px; align-items: flex-start; }
.item-emoji {
    width: 48px;
    height: 48px;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 25px;
    border-radius: 16px;
    background: var(--cat-soft, var(--surface-3));
}
.item-text { display: flex; flex-direction: column; min-width: 0; }
.item-cat { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 800; color: var(--cat, var(--ink-3)); }
.item-title {
    margin-top: 3px;
    font-weight: 700;
    font-size: 0.96rem;
    line-height: 1.32;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.item-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 10px 12px;
    border-radius: 16px;
    background: var(--surface-2);
}
.item-water {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--water-strong);
    font-variant-numeric: tabular-nums;
}
.item-water .icon { width: 16px; height: 16px; color: var(--water); fill: var(--water-soft); }
.item-energy { font-size: 0.82rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.empty {
    grid-column: 1 / -1;
    padding: 30px;
    text-align: center;
    font-weight: 600;
    color: var(--ink-3);
    border: 2px dashed var(--line-strong);
    border-radius: 24px;
}

/* --------------------------------------------------------------------------
   Pages secondaires : duel, quiz, méthode
   -------------------------------------------------------------------------- */
.page-head { padding: 56px 0 30px; }
.page-head-center { text-align: center; }
.page-head-center .page-lead { margin-inline: auto; }
.page-title {
    margin-top: 14px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.3rem, 5vw, 3.8rem);
    line-height: 1;
    letter-spacing: -0.04em;
    text-wrap: balance;
}
.page-lead { margin-top: 14px; max-width: 60ch; font-size: 1.06rem; color: var(--ink-2); text-wrap: pretty; }

.duel-pickers {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 14px;
    padding: 20px;
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}
.picker label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.side-dot { width: 12px; height: 12px; border-radius: 50%; }
.side-a { background: var(--grad-water); }
.side-b { background: var(--grad-solar); }
.select {
    width: 100%;
    height: 54px;
    padding: 0 42px 0 16px;
    border-radius: 18px;
    border: 2px solid var(--line);
    background-color: var(--surface-2);
    background-position: right 16px center;
    font-weight: 700;
    font-size: 0.94rem;
    text-overflow: ellipsis;
}
.picker-a .select:focus { outline: none; border-color: var(--water); box-shadow: 0 0 0 5px var(--water-ring); }
.picker-b .select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 5px rgba(255, 122, 47, 0.25); }
.duel-swap { width: 48px; height: 48px; margin-bottom: 3px; border-radius: 50%; }

.duel-stage {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    margin-top: 18px;
    padding: 40px 32px 34px;
    border-radius: 32px;
    background:
        radial-gradient(40% 70% at 0% 100%, rgba(47, 107, 255, 0.16), transparent 70%),
        radial-gradient(40% 70% at 100% 100%, rgba(255, 92, 142, 0.16), transparent 70%),
        var(--surface);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.duel-side { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; min-width: 0; }
.duel-drop-wrap { height: 210px; display: flex; align-items: flex-end; justify-content: center; }
.duel-drop { display: block; overflow: visible; transition: width 0.6s var(--spring), height 0.6s var(--spring); filter: drop-shadow(0 12px 18px rgba(47, 107, 255, 0.35)); }
.side-b-col .duel-drop { filter: drop-shadow(0 12px 18px rgba(255, 92, 142, 0.35)); }
.duel-emoji { font-size: 1.8rem; }
.duel-name { font-weight: 700; line-height: 1.3; max-width: 30ch; }
.duel-val {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--water-strong);
}
.side-b-col .duel-val { color: var(--cat-home); }
.duel-ratio { text-align: center; max-width: 290px; }
.vs-badge {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--grad-fun);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    box-shadow: 0 10px 20px -8px rgba(255, 79, 163, 0.7);
    animation: vsPulse 2.2s ease-in-out infinite;
}
.duel-ratio .duel-x {
    margin-top: 12px;
    font-family: var(--font-display);
    font-size: clamp(3rem, 6.5vw, 4.8rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
    background: var(--grad-fun);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.duel-x.is-bump { animation: bump 0.55s var(--spring); }
.duel-ratio p { margin-top: 10px; font-size: 0.94rem; color: var(--ink-2); }
.duel-ratio strong { color: var(--ink); }
.duel-ratio .duel-scale { margin-top: 12px; font-size: 0.76rem; color: var(--ink-3); }
.duel-table-card { margin-top: 18px; }
.duel-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.duel-table th, .duel-table td { padding: 14px 20px; text-align: left; }
.duel-table tbody th, .duel-table tbody td { border-top: 1px solid var(--line); }
.duel-table thead th { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); }
.duel-table tbody th { font-weight: 600; color: var(--ink-2); }
.duel-table td { font-weight: 800; font-variant-numeric: tabular-nums; }
.duel-table .col-a { color: var(--water-strong); }
.duel-table .col-b { color: var(--cat-home); }

.quiz {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    padding: 32px;
    border-radius: 32px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.86rem; font-weight: 700; color: var(--ink-3); }
.quiz-score {
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--grad-fun);
    color: #fff;
    font-weight: 800;
}
.quiz-score.is-bump { animation: bump 0.5s var(--spring); }
.progress { margin-top: 12px; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--grad-water); transition: width 0.5s var(--spring); }
.quiz-q {
    margin-top: 24px;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.8vw, 1.85rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-wrap: pretty;
}
.quiz-options { display: grid; gap: 10px; margin-top: 22px; }
.quiz-opt {
    --opt: var(--water);
    --opt-soft: var(--cat-transport-soft);
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 16px 12px 12px;
    text-align: left;
    border-radius: 20px;
    border: 2px solid var(--line);
    background: var(--surface);
    font-size: 0.98rem;
    font-weight: 600;
    transition: border-color 0.15s, background-color 0.15s, transform 0.25s var(--spring);
}
.quiz-opt:nth-child(2) { --opt: var(--pink); --opt-soft: var(--cat-other-soft); }
.quiz-opt:nth-child(3) { --opt: #F2A900; --opt-soft: var(--cat-industry-soft); }
.quiz-opt:nth-child(4) { --opt: var(--mint); --opt-soft: var(--cat-food-soft); }
.quiz-opt:hover:not(:disabled) { border-color: var(--opt); background: var(--opt-soft); transform: translateX(4px); }
.quiz-opt:disabled { cursor: default; }
.opt-letter {
    width: 36px;
    height: 36px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--opt);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
}
.opt-mark { margin-left: auto; }
.quiz-opt.is-correct { border-color: var(--good); background: var(--good-soft); animation: pop 0.5s var(--spring); }
.quiz-opt.is-correct .opt-letter { background: var(--good); }
.quiz-opt.is-correct .opt-mark { color: var(--good); }
.quiz-opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); animation: shake 0.45s ease; }
.quiz-opt.is-wrong .opt-letter { background: var(--bad); }
.quiz-opt.is-wrong .opt-mark { color: var(--bad); }
.quiz-opt.is-dim { opacity: 0.5; }
.quiz-feedback {
    margin-top: 18px;
    padding: 20px 22px;
    border-radius: 22px;
    background: var(--surface-2);
    animation: fadeUp 0.35s var(--ease);
}
.quiz-verdict { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; }
.quiz-verdict.is-correct { color: var(--good); }
.quiz-verdict.is-wrong { color: var(--bad); }
.quiz-feedback p { margin-top: 8px; color: var(--ink-2); font-size: 0.95rem; }
.quiz-source { font-size: 0.8rem !important; color: var(--ink-3) !important; }
.quiz-feedback .btn { margin-top: 16px; }
.quiz-end { padding: 10px 0; text-align: center; }
.score-ring { width: 170px; height: 170px; margin: 0 auto; display: block; }
.score-ring .track { fill: none; stroke: var(--surface-3); stroke-width: 12; }
.score-ring .value { fill: none; stroke: url(#score-grad); stroke-width: 12; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1s var(--ease); }
.score-ring text { font-family: var(--font-display); font-size: 32px; font-weight: 800; fill: var(--ink); }
.quiz-trophy { display: block; font-size: 2.6rem; margin-top: 10px; animation: mascotJump 0.9s var(--spring); }
.quiz-end h2 { margin-top: 8px; font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; letter-spacing: -0.03em; }
.quiz-end p { margin-top: 8px; color: var(--ink-2); }
.quiz-end .btn { margin-top: 22px; }

.article { max-width: 840px; padding-bottom: 20px; }
.method-section {
    --tone: var(--grad-water);
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 20px;
    padding: 28px;
    margin-bottom: 16px;
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.method-section[data-tone="uranium"] { --tone: var(--grad-uranium); }
.method-section[data-tone="wind"] { --tone: var(--grad-wind); }
.method-section[data-tone="solar"] { --tone: var(--grad-solar); }
.method-section[data-tone="human"] { --tone: var(--grad-human); }
.method-section[data-tone="neutral"] { --tone: linear-gradient(145deg, #E7E4FA, #C9C3F0); }
.method-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--tone);
    color: var(--on-bright);
    box-shadow: var(--shadow-sm);
}
.method-icon .icon { width: 26px; height: 26px; }
.method-body h2 { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; letter-spacing: -0.025em; }
.method-body p { margin-top: 10px; color: var(--ink-2); }
.method-body p strong { color: var(--ink); }
.method-body code { padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: var(--ink); }
.formula {
    margin-top: 14px;
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--surface-2);
    border-left: 5px solid transparent;
    border-image: var(--tone) 1;
    font-family: var(--font-mono);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink);
    overflow-x: auto;
}
.table-scroll { margin-top: 14px; overflow-x: auto; border-radius: 16px; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; background: var(--surface-2); }
.ref-table th, .ref-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.ref-table th { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-3); white-space: nowrap; }
.ref-table tbody tr:last-child td { border-bottom: 0; }
.ref-table td:not(:first-child) { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.method-sources { font-size: 0.82rem; color: var(--ink-3) !important; }
.method-sources a { color: var(--water-strong); font-weight: 600; }

/* --------------------------------------------------------------------------
   Pied de page, toast, particules
   -------------------------------------------------------------------------- */
.site-footer {
    position: relative;
    margin-top: 100px;
    padding: 44px 0 52px;
    background: var(--surface);
}
.site-footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, #12C8F5, #2F6BFF, #8B5CFF, #FF4FA3, #FF7A2F, #FFC531);
}
.footer-inner { display: flex; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; }
.footer-brand p { margin-top: 6px; color: var(--ink-2); font-size: 0.92rem; }
.footer-meta { max-width: 560px; font-size: 0.84rem; color: var(--ink-3); }
.footer-meta p + p { margin-top: 8px; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 120;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translate(-50%, 16px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.3s var(--spring);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }

.burst { position: fixed; z-index: 150; width: 0; height: 0; pointer-events: none; }
.burst i {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--size, 9px);
    height: var(--size, 9px);
    margin: calc(var(--size, 9px) / -2) 0 0 calc(var(--size, 9px) / -2);
    border-radius: var(--radius-p, 3px);
    background: var(--c);
    font-style: normal;
    font-size: var(--size, 9px);
    line-height: 1;
    animation: burstFly var(--dur, 1000ms) cubic-bezier(0.15, 0.7, 0.35, 1) forwards;
}

.noscript { padding: 16px; text-align: center; background: var(--bad-soft); color: var(--bad); }

/* --------------------------------------------------------------------------
   Anti-robots, votes, CO₂ en direct, pied de page
   -------------------------------------------------------------------------- */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.btn-vote .vote-count {
    min-width: 24px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--surface-3);
    font-size: 0.78rem;
    font-weight: 800;
}
.btn-vote.is-voted { border-color: transparent; background: var(--grad-fun); color: #fff; }
.btn-vote.is-voted .vote-count { background: rgba(255, 255, 255, 0.25); color: #fff; }
.item-votes { font-size: 0.74rem; font-weight: 800; color: var(--cat-home); white-space: nowrap; }

.live-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--cat-food-soft);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-2);
}
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.live-chip.is-live .live-dot { background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: livePulse 1.8s ease-out infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(16, 178, 122, 0.55); } 100% { box-shadow: 0 0 0 10px rgba(16, 178, 122, 0); } }

.footer-install { margin-top: 14px; }
.footer-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px dashed var(--line-strong);
}
.footer-examples .kicker { width: 100%; margin-bottom: 4px; }
.footer-examples a {
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-2);
    text-decoration: none;
}
.footer-examples a:hover { background: var(--water-soft); color: var(--water-strong); }

/* --------------------------------------------------------------------------
   Ma journée en litres
   -------------------------------------------------------------------------- */
.day-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.day-list-card { padding: 20px; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow-md); }
.day-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.day-list { display: grid; gap: 8px; }
.day-group { margin: 14px 0 4px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cat, var(--ink-3)); }
.day-group:first-child { margin-top: 0; }
.day-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 8px 8px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 2px solid transparent;
    transition: border-color 0.2s, background-color 0.2s;
}
.day-row.is-on { border-color: var(--cat, var(--water)); background: var(--cat-soft, var(--water-soft)); }
.day-row .item-emoji { width: 44px; height: 44px; font-size: 22px; border-radius: 14px; background: var(--surface); }
.day-row-title { font-weight: 700; font-size: 0.9rem; line-height: 1.25; }
.day-row-meta { font-size: 0.76rem; color: var(--ink-3); }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-xs); }
.stepper button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--ink);
    transition: transform 0.2s var(--spring), background-color 0.15s;
}
.stepper button:hover { transform: scale(1.1); }
.stepper button[data-step="1"] { background: var(--grad-water); color: #fff; }
.stepper button:disabled { opacity: 0.35; cursor: default; transform: none; }
.stepper output { min-width: 26px; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.day-total { position: sticky; top: 92px; display: grid; gap: 14px; }
.day-panel { margin-top: 0; }
.day-milestones { display: grid; gap: 10px; padding: 18px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-sm); }
.milestone-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.84rem; font-weight: 600; color: var(--ink-2); }
.milestone-head strong { color: var(--ink); white-space: nowrap; }
.milestone .bar-track { height: 12px; }
.milestone.is-done .bar-fill { background: var(--grad-fun); }
.day-top { padding: 16px 18px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-sm); }
.day-top:empty { display: none; }
.day-top li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line-strong); font-size: 0.86rem; }
.day-top li:first-of-type { border-top: 0; }
.day-top li strong { white-space: nowrap; color: var(--water-strong); }
.day-share { width: 100%; }

/* --------------------------------------------------------------------------
   Quiz : modes et défi chrono
   -------------------------------------------------------------------------- */
.quiz-modes { max-width: 460px; margin: 0 auto 18px; }
.challenge-hud { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.challenge-lives { font-size: 1.2rem; letter-spacing: 2px; }
.challenge-lives .lost { filter: grayscale(1); opacity: 0.3; }
.challenge-streak { font-size: 0.84rem; font-weight: 800; color: var(--cat-home); }
.timer { margin-top: 14px; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.timer i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #FF4FA3, #FFC531, #22D49B);
    transform-origin: left;
    animation: timerShrink var(--time, 12s) linear forwards;
}
.timer.is-stopped i { animation-play-state: paused; }
@keyframes timerShrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.challenge-intro { text-align: center; padding: 10px 0; }
.challenge-intro .quiz-trophy { font-size: 3rem; }
.challenge-intro h2 { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; }
.challenge-intro p { margin: 8px auto 20px; max-width: 46ch; color: var(--ink-2); }
.challenge-best { margin-top: 10px; font-size: 0.86rem; font-weight: 700; color: var(--ink-3); }
.quiz-end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.quiz-end-actions .btn { margin-top: 0 !important; }
.bump { animation: bump 0.55s var(--spring); }
.mascot { cursor: pointer; }
.view.is-entering { animation: fadeUp 0.4s var(--ease); }

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes isoRise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes flow { to { stroke-dashoffset: -36; } }
@keyframes flowRiver { to { stroke-dashoffset: -64; } }
@keyframes flowSpark { to { stroke-dashoffset: -60; } }
@keyframes waveSlide { to { transform: translateX(-1200px); } }
@keyframes ripple {
    0%, 100% { transform: translateX(0); opacity: 0.3; }
    50% { transform: translateX(12px); opacity: 1; }
}
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes cloudDrift { from { transform: translateX(-160px); } to { transform: translateX(700px); } }
@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, 30px) scale(1.12); }
    100% { transform: translate(-30px, 50px) scale(0.95); }
}
@keyframes bubbleRise {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translateY(-340px) translateX(14px); }
    90% { opacity: 0.8; }
    100% { transform: translateY(-680px) translateX(-10px); opacity: 0; }
}
@keyframes panelBubble {
    0% { transform: translateY(0); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(-240px); opacity: 0; }
}
@keyframes gradientShift { to { background-position: 220% center; } }
@keyframes underlineWave { to { background-position-x: 0.8em; } }
@keyframes stickerFloat {
    0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
    50% { transform: translateY(-10px) rotate(calc(var(--r, 0deg) * -1)); }
}
@keyframes mascotBob {
    0%, 100% { transform: translateY(0) scale(1, 1); }
    50% { transform: translateY(-8px) scale(0.98, 1.02); }
}
@keyframes mascotShadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(0.8); opacity: 0.6; } }
@keyframes mascotThink { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-6px) rotate(4deg); } }
@keyframes mascotJump {
    0% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-26px) scale(0.92, 1.1); }
    55% { transform: translateY(0) scale(1.12, 0.88); }
    75% { transform: translateY(-6px) scale(0.98, 1.02); }
    100% { transform: translateY(0) scale(1); }
}
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes pulseDot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }
@keyframes pop { 0% { transform: scale(0.8); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.08) rotate(-1deg); } 100% { transform: scale(1); } }
@keyframes wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-12deg) scale(1.1); }
    50% { transform: rotate(10deg) scale(1.1); }
    75% { transform: rotate(-6deg); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(3px); }
}
@keyframes vsPulse { 0%, 100% { transform: scale(1) rotate(-6deg); } 50% { transform: scale(1.1) rotate(6deg); } }
@keyframes stripes { to { background-position: 34px 0; } }
@keyframes ticker { to { transform: translateX(-50%); } }
@keyframes burstFly {
    0% { transform: translate(0, 0) rotate(0) scale(0.6); opacity: 1; }
    70% { opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .hero-bubble, .panel-bubble, .burst { display: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
/* Tablette paysage / petit portable : l'en-tête reste sur une ligne */
@media (max-width: 1200px) {
    .btn-random span { display: none; }
    .btn-random { width: 40px; padding: 0; }
    .mainnav-item { padding-inline: 12px; }
}

@media (max-width: 1100px) {
    .eq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .result-details { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .takeaway { grid-column: 1 / -1; }
}

@media (max-width: 1000px) {
    .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .hero { padding-top: 48px; }
    .hero-title { max-width: 14ch; }
    .result-grid { grid-template-columns: minmax(0, 1fr); }
    .split { grid-template-columns: minmax(0, 1fr); }
    .day-layout { grid-template-columns: minmax(0, 1fr); }
    .day-total { position: static; order: -1; }
}

@media (max-width: 980px) {
    .topbar-inner { flex-wrap: wrap; row-gap: 10px; padding-block: 10px; }
    .mainnav { order: 3; width: 100%; margin: 0; }
    .mainnav-item { flex: 1; justify-content: center; padding: 0 8px; }
    .topbar-actions { margin-left: auto; }
}

@media (max-width: 860px) {

    .comp-table thead { display: none; }
    .comp-table, .comp-table tbody, .comp-table tr, .comp-table td { display: block; width: 100%; }
    .comp-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 14px 16px;
        padding: 18px 16px;
        border-top: 1px solid var(--line);
    }
    .comp-table tbody tr:first-child { border-top: 0; }
    .comp-table td { padding: 0; border: 0; min-width: 0; }
    .comp-table td:first-child { grid-column: 1 / -1; }
    .comp-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        font-size: 0.66rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--ink-3);
    }
    .filiere { min-width: 0; }
    .co2 { min-width: 0; }

    .duel-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 28px 18px; }
    .duel-ratio { grid-column: 1 / -1; grid-row: 1; max-width: none; }
    .duel-drop-wrap { height: 150px; }
}

@media (max-width: 640px) {
    :root { --gutter: 16px; }
    .btn-random span { display: none; }
    .btn-random { width: 40px; padding: 0; }
    .brand-name { font-size: 1.22rem; }
    .brand-mark { width: 34px; height: 34px; }
    .mainnav { padding: 4px; gap: 2px; }
    .mainnav-item { flex: 1 1 auto; gap: 6px; font-size: 0.76rem; padding: 0 6px; height: 34px; white-space: nowrap; }
    .mainnav-item .icon { display: none; }
    .day-list-card { padding: 14px; border-radius: 24px; }
    .day-row { grid-template-columns: 40px minmax(0, 1fr); }
    .day-row .stepper { grid-column: 2; justify-self: start; }

    .hero { padding: 34px 0 40px; }
    .hero-lead { font-size: 1rem; }
    .sticker { display: none; }
    .ask-wrap { padding-top: 38px; }
    .mascot { width: 86px; right: 18px; top: -40px; }
    .ask-card { padding: 12px; border-radius: 26px; }
    .seg-modes .seg-item { padding: 0 8px; font-size: 0.8rem; gap: 5px; }
    .seg-modes .seg-item .icon, .seg-modes .tag { display: none; }
    .seg-modes .seg-item { flex: 1 1 auto; justify-content: center; }
    .lbl-long { display: none; }
    .lbl-short { display: inline; }
    .eyebrow { font-size: 0.66rem; }
    .hero-examples { gap: 8px; margin-top: 22px; }
    .hero-ex { padding: 8px 10px 8px 8px; gap: 8px; align-items: center; }
    .hero-ex-emoji { width: 32px; height: 32px; font-size: 17px; border-radius: 10px; }
    .hero-ex-label { white-space: normal; font-size: 0.76rem; line-height: 1.15; }
    .hero-ex-water { font-size: 1.02rem; }
    .ask-row { flex-direction: column; }
    .ask-row .btn { width: 100%; }
    .calc-op { display: none; }
    .calc-result { width: 100%; justify-content: center; }

    .result { border-radius: 26px; }
    .result-main { padding: 22px 16px; }
    .result-side { padding: 14px; }
    .answer-panel { padding: 22px 20px 66px; }
    .result-details { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px 16px; }
    .result-actions { padding: 12px 16px; }
    .result-actions .btn { flex: 1 1 auto; }
    .subject-emoji { width: 52px; height: 52px; font-size: 27px; border-radius: 18px; }
    .iso { width: 32px; height: 32px; }
    .energy-strip { gap: 6px; }
    .energy-strip > div { padding: 10px; border-radius: 14px; }
    .energy-strip dd { font-size: 0.95rem; }
    .d-label { display: none; }

    .section { margin-top: 64px; }
    .eq-grid { grid-template-columns: minmax(0, 1fr); }
    .eq-caption { min-height: 0; }
    .panel { padding: 20px 16px; }
    .fun-grid { grid-template-columns: minmax(0, 1fr); }
    .comp-table tr { gap: 12px; padding: 16px 14px; }
    .comp-table td, .row-note { font-size: 0.82rem; }
    .facts { grid-template-columns: minmax(0, 1fr); }
    .facts-band { padding-bottom: 60px; }
    .ticker { margin-bottom: 48px; }
    .search { width: 100%; }
    .cards { grid-template-columns: minmax(0, 1fr); }

    .duel-pickers { grid-template-columns: minmax(0, 1fr); }
    .duel-swap { justify-self: center; transform: rotate(90deg); margin: 0; }
    .duel-swap:hover { transform: rotate(90deg) scale(1.05); }
    .duel-table th, .duel-table td { padding: 11px 12px; font-size: 0.86rem; }
    .quiz { padding: 22px 16px; border-radius: 26px; }
    .method-section { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 22px 18px; }
    .page-head { padding: 36px 0 22px; }
}

/* Très petits écrans (iPhone SE, Galaxy compacts) : les cinq onglets tiennent sur une ligne */
@media (max-width: 400px) {
    .mainnav { overflow-x: auto; scrollbar-width: none; }
    .mainnav::-webkit-scrollbar { display: none; }
    .mainnav { gap: 0; }
    .mainnav-item { flex: 1 0 auto; font-size: 0.68rem; padding: 0 4px; }
    .brand-name { font-size: 1.1rem; }
    .brand-mark { width: 30px; height: 30px; }
}
