/* AKTION FUND — thème clair, identité solidaire */

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

:root {
    --color-brand: #1a1a2e;
    --color-brand-dark: #0f0f1a;
    --color-primary: #c1272d;
    --color-primary-hover: #a01f24;
    --color-primary-rgb: 193, 39, 45;
    --color-secondary: #2d6a4f;
    --color-accent: #f4a261;
    --color-hero-accent: #ffac00;
    --font-display: 'Caveat', cursive;
    --color-fr-blue: #0055A4;
    --color-fr-white: #ffffff;
    --color-fr-red: #EF4135;
    --color-text: #1a2e4a;
    --color-text-muted: #5a6f8a;
    --color-on-primary: #ffffff;
    --color-bg: #ffffff;
    --color-surface: #f4f7fb;
    --color-card: #ffffff;
    --color-card-hover: #f8fafc;
    --color-border: #dde4ee;
    --container-max: 1180px;
    --header-height: 112px;
    --nav-link-size: 15px;
    --nav-link-pad-y: 9px;
    --nav-link-pad-x: 12px;
    --nav-pill-pad: 7px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(26, 46, 74, 0.06);
    --shadow-md: 0 4px 20px rgba(26, 46, 74, 0.08);
    --shadow-glow: 0 4px 18px rgba(26, 61, 110, 0.12);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --page-gutter: clamp(14px, 4vw, 24px);
    --touch-min: 44px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--safe-top));
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.hero,
.section {
    scroll-margin-top: calc(var(--header-height) + var(--safe-top));
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    max-width: 100%;
}

img, video, svg, canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

iframe, embed, object {
    max-width: 100%;
}

a { color: var(--color-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary-hover); }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 9999;
    padding: 10px 20px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.skip-link:focus { top: 16px; }

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

/* Header + navbar Three.js */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: calc(var(--header-height) + var(--safe-top));
    padding-top: var(--safe-top);
    overflow: visible;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: border-color 0.35s, box-shadow 0.35s;
}

.site-header.is-scrolled {
    box-shadow: var(--shadow-md);
}

.nav-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none !important;
    touch-action: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.nav-canvas--ready {
    opacity: 0.48;
    transition: opacity 0.2s linear;
}

.site-header.is-scrolled .nav-canvas--ready {
    opacity: 0.38;
}

.nav-canvas--fallback {
    display: none;
}

.site-header::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: none;
    transition: background 0.4s, backdrop-filter 0.4s;
}

.site-header.is-scrolled::after {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav {
    position: relative;
    z-index: 5;
    display: flex;
    pointer-events: auto;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 clamp(12px, 2.5vw, 32px);
    height: 100%;
}

.nav__logo {
    display: flex;
    align-items: center;
    line-height: 0;
    flex-shrink: 0;
    margin-right: auto;
    background: transparent;
    transition: transform 0.3s;
}

.nav__logo:hover {
    opacity: 0.88;
}

.nav__logo-img {
    height: 96px;
    width: auto;
    max-width: 440px;
    object-fit: contain;
    background: transparent;
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav__center {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
    max-width: calc(100vw - 300px);
    padding: var(--nav-pill-pad);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(var(--color-primary-rgb), 0.1);
    border-radius: 999px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 4px 18px rgba(26, 46, 74, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.nav__center::-webkit-scrollbar {
    display: none;
}

.nav__indicator {
    position: absolute;
    top: var(--nav-pill-pad);
    left: var(--nav-pill-pad);
    height: calc(100% - (var(--nav-pill-pad) * 2));
    border-radius: 999px;
    background: var(--color-primary);
    box-shadow: 0 2px 10px rgba(var(--color-primary-rgb), 0.22);
    transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1), width 0.4s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.25s;
    pointer-events: none;
    z-index: 0;
}

.nav__links {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 3px;
    list-style: none;
}

.nav__link {
    position: relative;
    padding: var(--nav-link-pad-y) var(--nav-link-pad-x);
    font-size: var(--nav-link-size);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--color-text-muted);
    border-radius: 999px;
    transition: color 0.25s;
    white-space: nowrap;
}

/* Pas de hover rouge : le rouge est réservé à la section active (indicateur) */
.nav__link:hover {
    color: var(--color-text-muted);
}

.nav__link.is-active {
    color: var(--color-on-primary);
    font-weight: 700;
}

.nav__link--cta {
    margin-left: 2px;
    padding: var(--nav-link-pad-y) calc(var(--nav-link-pad-x) + 2px);
    font-size: var(--nav-link-size);
    font-weight: 600;
    color: var(--color-text-muted);
    background: transparent;
    box-shadow: none;
}

.nav__link--cta:hover {
    color: var(--color-text-muted);
    background: transparent;
}

.nav__link--cta.is-active {
    color: var(--color-on-primary);
    background: transparent;
    font-weight: 700;
}

.nav__link--modal,
.chapter-menu__link--modal,
.site-footer__link-btn {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
    text-align: inherit;
}

.nav__link--modal {
    position: relative;
    padding: var(--nav-link-pad-y) var(--nav-link-pad-x);
    font-size: var(--nav-link-size);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--color-text-muted);
    border-radius: 999px;
    transition: color 0.25s;
    white-space: nowrap;
}

.nav__link--modal:hover {
    color: var(--color-text-muted);
}

.chapter-menu__link--modal {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px 20px;
    color: inherit;
}

.site-footer__link-btn {
    color: var(--color-text-muted);
    padding: 0;
    transition: color 0.2s;
}

.site-footer__link-btn:hover {
    color: var(--color-primary);
}

.nav__toggle {
    display: none;
    position: relative;
    z-index: 6;
    flex-shrink: 0;
    margin-left: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(var(--color-primary-rgb), 0.1);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(26, 46, 74, 0.07);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav__toggle:hover {
    border-color: rgba(var(--color-primary-rgb), 0.28);
    background: #fff;
}

.nav__toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

[data-open-rejoindre-modal],
[data-open-soumettre-modal],
[data-open-contact-modal] {
    position: relative;
    z-index: 6;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
    border: 1px solid var(--color-primary);
}

.btn--primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--color-on-primary);
}

.btn--ghost {
    border: 1px solid var(--color-border);
    color: var(--color-text);
    background: #ffffff;
}

.btn--ghost:hover {
    border-color: var(--color-primary);
    background: var(--color-surface);
    color: var(--color-primary);
}

.btn--sm {
    padding: 10px 20px;
    font-size: 0.875rem;
}

/* Footer */
.site-footer {
    width: calc(100% - clamp(24px, 4vw, 48px));
    max-width: none;
    margin: 0 auto clamp(12px, 2vw, 20px);
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.site-footer__stripe {
    display: flex;
    height: 3px;
}

.site-footer__stripe span:nth-child(1) { flex: 1; background: var(--color-fr-blue); }
.site-footer__stripe span:nth-child(2) { flex: 1; background: var(--color-fr-white); }
.site-footer__stripe span:nth-child(3) { flex: 1; background: var(--color-fr-red); }

.site-footer__inner {
    width: 100%;
    max-width: none;
    margin: 0;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 48px;
    padding: 48px 24px 36px;
}

.site-footer__logo {
    display: inline-block;
    line-height: 0;
}

.site-footer__logo:hover { opacity: 0.88; }

.site-footer__brand img {
    height: 96px;
    width: auto;
    max-width: 440px;
    object-fit: contain;
    background: transparent;
}

.site-footer__tagline {
    margin-top: 14px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-brand);
}

.site-footer__event {
    margin-top: 6px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

.site-footer__nav-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-brand);
    margin-bottom: 14px;
}

.site-footer__links {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.site-footer__links a,
.site-footer__link-btn {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.site-footer__links a:hover,
.site-footer__link-btn:hover {
    color: var(--color-primary);
}

.site-footer__reach-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.site-footer__reach-list a {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    word-break: break-word;
}

.site-footer__reach-list a:hover { color: var(--color-primary); }

.site-footer__reach-meta {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.site-footer__bottom {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 18px 24px 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Animations — GSAP gère l'état initial ; fallback CSS si indisponible */
.animate-on-scroll:not(.is-visible) {
    opacity: 0;
    transform: translateY(24px);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: none;
}

body[data-gsap-scroll="ready"] .animate-on-scroll {
    transition: none;
}

body[data-gsap-scroll="ready"] .site-footer__stripe span {
    display: block;
    transform: scaleX(0);
    transform-origin: left center;
}

body[data-gsap-scroll="ready"] .btn,
body[data-gsap-scroll="ready"] .programme-card,
body[data-gsap-scroll="ready"] .objectifs-card,
body[data-gsap-scroll="ready"] .hommage-card,
body[data-gsap-scroll="ready"] .documents__doc,
body[data-gsap-scroll="ready"] .story-card,
body[data-gsap-scroll="ready"] .gallery__item {
    will-change: transform;
}

/* Menu mobile — drawer latéral */
.chapter-menu {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}

.chapter-menu.is-open {
    display: block;
    visibility: visible;
    pointer-events: auto;
}

body.is-menu-open {
    overflow: hidden;
}

.chapter-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.32s ease;
}

.chapter-menu.is-open .chapter-menu__backdrop {
    opacity: 1;
}

.chapter-menu__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(360px, 100vw);
    height: 100%;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: rgba(255, 255, 255, 0.97);
    border-left: 1px solid rgba(var(--color-primary-rgb), 0.08);
    box-shadow: -12px 0 48px rgba(26, 46, 74, 0.12);
    padding:
        calc(var(--header-height) + var(--safe-top) + 20px)
        max(28px, var(--safe-right))
        calc(28px + var(--safe-bottom))
        max(28px, var(--safe-left));
    transform: translateX(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
}

.chapter-menu.is-open .chapter-menu__panel {
    transform: translateX(0);
}

.chapter-menu__head {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.chapter-menu__eyebrow {
    margin: 0 0 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.chapter-menu__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-primary);
}

.chapter-menu__list {
    list-style: none;
}

.chapter-menu__item + .chapter-menu__item {
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.06);
}

.chapter-menu__link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    transition: color 0.2s, padding-left 0.25s;
}

.chapter-menu__link:hover {
    color: var(--color-primary);
    padding-left: 8px;
}

.chapter-menu__index {
    flex-shrink: 0;
    min-width: 1.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: rgba(var(--color-primary-rgb), 0.35);
    transition: color 0.2s;
}

.chapter-menu__link:hover .chapter-menu__index,
.chapter-menu__link.is-active .chapter-menu__index {
    color: var(--color-primary);
}

.chapter-menu__link.is-active {
    color: var(--color-primary);
    font-weight: 700;
}

.chapter-menu__link.is-active .chapter-menu__label {
    position: relative;
}

.chapter-menu__link.is-active .chapter-menu__label::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
    opacity: 0.35;
}

.chapter-menu__link--cta {
    justify-content: center;
    margin-top: 24px;
    padding: 14px 20px;
    color: inherit;
    background: transparent;
    border-radius: 999px;
    box-shadow: none;
}

.chapter-menu__link--cta .chapter-menu__index {
    display: none;
}

.chapter-menu__link--cta:hover {
    color: inherit;
    background: transparent;
    padding-left: 20px;
}

.chapter-menu__link--cta.is-active {
    color: var(--color-primary);
    background: transparent;
    box-shadow: none;
}

/* Back to top */
/* Three.js — scroll waypoints (GSAP) */
.scroll-waypoints-canvas {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: 72px;
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    z-index: 900;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.scroll-waypoints-canvas--ready {
    opacity: 0.58;
}

body.tas-scroll-waypoints .back-top {
    right: 88px;
}

@media (max-width: 1199px) {
    .scroll-waypoints-canvas {
        display: none;
    }
}

.back-top {
    position: fixed;
    bottom: calc(24px + var(--safe-bottom));
    right: calc(24px + var(--safe-right));
    z-index: 800;
    width: var(--touch-min);
    height: var(--touch-min);
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: var(--color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.back-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (min-width: 901px) {
    .nav__center { display: flex; }
    .nav__toggle { display: none; }
}

@media (min-width: 901px) and (max-width: 1280px) {
    :root {
        --nav-link-size: 14px;
        --nav-link-pad-y: 8px;
        --nav-link-pad-x: 11px;
        --nav-pill-pad: 6px;
    }

    .nav { padding: 0 clamp(8px, 1.5vw, 16px); gap: 8px; }
    .nav__center { max-width: calc(100vw - 230px); }
    .nav__logo-img { height: 76px; max-width: 340px; }
}

@media (min-width: 1281px) and (max-width: 1440px) {
    :root {
        --nav-link-size: 14.5px;
        --nav-link-pad-x: 11px;
    }

    .nav__center { max-width: calc(100vw - 280px); }
    .nav__logo-img { height: 88px; max-width: 400px; }
}

@media (min-width: 1441px) {
    .nav__center { max-width: calc(100vw - 320px); }
}

@media (max-width: 900px) {
    :root { --header-height: 76px; }
    .nav__actions { display: none; }
    .nav__toggle {
        display: flex;
        width: var(--touch-min);
        height: var(--touch-min);
        min-width: var(--touch-min);
        min-height: var(--touch-min);
    }
    .nav__logo-img { height: 58px; max-width: min(240px, 58vw); }
    .site-footer {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-top: 1px solid var(--color-border);
        border-radius: 0;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 32px max(16px, var(--safe-left)) 24px max(16px, var(--safe-right));
        text-align: center;
        justify-items: center;
    }

    .site-footer__brand {
        width: 100%;
        max-width: 28rem;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .site-footer__logo { margin: 0 auto; }

    .site-footer__brand img {
        height: 64px;
        max-width: min(220px, 70vw);
    }

    .site-footer__tagline {
        margin-top: 12px;
        font-size: 0.875rem;
        line-height: 1.45;
        max-width: 22rem;
    }

    .site-footer__event {
        margin-top: 8px;
        font-size: 0.8125rem;
        line-height: 1.55;
        max-width: 24rem;
    }

    .site-footer__nav,
    .site-footer__reach {
        width: 100%;
        max-width: 28rem;
    }

    .site-footer__nav-title {
        margin-bottom: 12px;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        font-size: 0.75rem;
    }

    .site-footer__links {
        grid-template-columns: 1fr 1fr;
        gap: 6px 12px;
        justify-items: stretch;
        text-align: center;
        max-width: 100%;
    }

    .site-footer__links a,
    .site-footer__link-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 6px 8px;
        font-size: 0.8125rem;
        line-height: 1.3;
        border-radius: 8px;
        -webkit-tap-highlight-color: transparent;
    }

    .site-footer__reach-list {
        align-items: center;
        gap: 8px;
    }

    .site-footer__reach-list a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 4px 8px;
        font-size: 0.875rem;
    }

    .site-footer__reach-meta {
        max-width: 18rem;
        margin-inline: auto;
        font-size: 0.75rem;
        line-height: 1.5;
    }

    .site-footer__bottom {
        flex-direction: column;
        align-items: center;
        gap: 6px;
        text-align: center;
        padding: 14px max(16px, var(--safe-left)) calc(18px + var(--safe-bottom)) max(16px, var(--safe-right));
        font-size: 0.75rem;
        line-height: 1.45;
    }

    .site-footer__bottom p:last-child {
        max-width: 20rem;
        color: var(--color-text-muted);
        opacity: 0.9;
    }
    .nav {
        padding: 0 max(12px, var(--safe-left)) 0 max(12px, var(--safe-right));
        gap: 12px;
    }

    .nav__logo {
        margin-right: 0;
    }

    .chapter-menu__panel {
        width: min(100vw, 400px);
        padding-top: calc(var(--header-height) + var(--safe-top) + 16px);
        padding-left: max(20px, var(--safe-left));
        padding-right: max(20px, var(--safe-right));
    }

    .chapter-menu__link,
    .chapter-menu__link--modal {
        min-height: var(--touch-min);
        padding-top: 14px;
        padding-bottom: 14px;
        -webkit-tap-highlight-color: transparent;
    }

    .btn {
        min-height: var(--touch-min);
        padding-top: 12px;
        padding-bottom: 12px;
        -webkit-tap-highlight-color: transparent;
    }

    .back-top {
        bottom: calc(16px + var(--safe-bottom));
        right: calc(16px + var(--safe-right));
    }

    body.tas-scroll-waypoints .back-top {
        right: calc(16px + var(--safe-right));
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .animate-on-scroll { opacity: 1; transform: none; transition: none; }
    .chapter-menu__panel,
    .chapter-menu__backdrop { transition: none; }
    .nav-canvas--ready { opacity: 0.35; }
}

@media (max-width: 900px) {
    .nav-canvas--ready { opacity: 0.38; }
}

@media (max-width: 480px) {
    :root { --header-height: 68px; }

    .nav__logo-img { height: 48px; max-width: min(200px, 55vw); }

    .site-footer__inner {
        padding: 28px 14px 20px;
        gap: 24px;
    }

    .site-footer__brand img {
        height: 56px;
        max-width: min(180px, 62vw);
    }

    .site-footer__links {
        grid-template-columns: 1fr 1fr;
        gap: 4px 10px;
        max-width: 100%;
        margin-inline: auto;
    }

    .site-footer__links a,
    .site-footer__link-btn {
        min-height: 38px;
        font-size: 0.75rem;
        padding: 6px 4px;
        line-height: 1.25;
        text-align: center;
    }

    .site-footer__bottom {
        padding: 12px 14px calc(16px + var(--safe-bottom));
        font-size: 0.6875rem;
    }

    /* Évite le doublon tagline déjà présente dans le bloc brand */
    .site-footer__bottom p:last-child {
        display: none;
    }
}

/* Très petits écrans + encoches */
@media (max-width: 360px) {
    .nav__logo-img { height: 44px; max-width: 160px; }
    .chapter-menu__panel { width: 100vw; }
}

/* Paysage téléphone : header compact */
@media (max-height: 500px) and (orientation: landscape) {
    :root { --header-height: 56px; }
    .nav__logo-img { height: 40px; max-width: 180px; }
    .nav__toggle { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
}
