/* Tour Aérien du Sénégal — thème clair, identité logo */

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

:root {
    --color-brand: #1a3d6e;
    --color-brand-dark: #0e2547;
    --color-primary: #1a3d6e;
    --color-primary-hover: #2d5a9e;
    --color-primary-rgb: 26, 61, 110;
    --color-secondary: #00853f;
    --color-accent: #e8b800;
    --color-senegal-green: #00853f;
    --color-senegal-red: #d41920;
    --color-senegal-yellow: #f0c020;
    --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: 100px;
    --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;
}

html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); }

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

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

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

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: var(--header-height);
    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.68);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    pointer-events: none;
    transition: background 0.4s, backdrop-filter 0.4s;
}

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

.nav {
    position: relative;
    z-index: 5;
    display: flex;
    pointer-events: auto;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 clamp(20px, 4vw, 56px);
    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: 88px;
    width: auto;
    max-width: 380px;
    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 - 220px);
    padding: 7px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(var(--color-primary-rgb), 0.08);
    border-radius: 999px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 4px 18px rgba(26, 46, 74, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    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: 7px;
    left: 7px;
    height: calc(100% - 14px);
    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: 4px;
    list-style: none;
}

.nav__link {
    position: relative;
    padding: 12px 20px;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: 0.015em;
    color: var(--color-text-muted);
    border-radius: 999px;
    transition: color 0.25s;
    white-space: nowrap;
}

.nav__link:hover {
    color: var(--color-primary);
}

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

.nav__link--cta {
    margin-left: 4px;
    padding: 12px 22px;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--color-on-primary);
    background: var(--color-primary);
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.22);
}

.nav__link--cta:hover {
    color: var(--color-on-primary);
    background: var(--color-primary-hover);
}

.nav__link--cta.is-active {
    color: var(--color-on-primary);
    background: var(--color-primary-hover);
}

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

.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-senegal-green); }
.site-footer__stripe span:nth-child(2) { flex: 1; background: var(--color-accent); }
.site-footer__stripe span:nth-child(3) { flex: 1; background: var(--color-senegal-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: 76px;
    width: auto;
    max-width: 300px;
    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 {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.site-footer__links a: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"] .partner-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;
    visibility: hidden;
    pointer-events: none;
}

.chapter-menu.is-open {
    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, 90vw);
    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) + 20px) 28px calc(28px + env(safe-area-inset-bottom, 0px));
    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: var(--color-on-primary);
    background: var(--color-primary);
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(var(--color-primary-rgb), 0.22);
}

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

.chapter-menu__link--cta:hover {
    color: var(--color-on-primary);
    background: var(--color-primary-hover);
    padding-left: 20px;
}

.chapter-menu__link--cta.is-active {
    color: var(--color-on-primary);
    background: var(--color-primary-hover);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2);
}

/* 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: 24px;
    right: 24px;
    z-index: 800;
    width: 44px;
    height: 44px;
    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;
}

.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: 1180px) {
    .nav { padding: 0 clamp(16px, 3vw, 32px); gap: 16px; }
    .nav__center { max-width: calc(100vw - 200px); }
    .nav__link { padding: 10px 14px; font-size: 0.9375rem; }
    .nav__link--cta { padding: 10px 18px; font-size: 0.9375rem; }
    .nav__logo-img { height: 76px; max-width: 280px; }
}

@media (min-width: 1181px) and (max-width: 1440px) {
    .nav__center { max-width: calc(100vw - 260px); }
    .nav__link { padding: 11px 16px; font-size: 1rem; }
    .nav__link--cta { padding: 11px 18px; font-size: 1rem; }
}

@media (max-width: 900px) {
    :root { --header-height: 80px; }
    .nav__actions { display: none; }
    .nav__toggle { display: flex; }
    .nav__logo-img { height: 60px; max-width: 220px; }
    .site-footer {
        width: calc(100% - 48px);
        margin-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 36px 20px 28px;
        text-align: center;
    }

    .site-footer__logo { margin: 0 auto; }

    .site-footer__links {
        grid-template-columns: 1fr;
        justify-items: center;
    }

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

    .site-footer__bottom {
        flex-direction: column;
        text-align: center;
        padding: 18px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    }
    .nav {
        padding: 0 16px;
        gap: 12px;
    }

    .nav__logo {
        margin-right: 0;
    }
}

@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) {
    .site-footer {
        width: calc(100% - 32px);
    }

    .site-footer__inner {
        padding: 32px 16px 24px;
        gap: 28px;
    }

    .site-footer__bottom {
        padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    }
}
