* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }

    @view-transition {
        navigation: auto;
    }
}

@font-face {
    font-family: 'Arial Rounded MT';
    src: url('../fonts/ArialRoundedMT-Regular.woff2') format('woff2'),
         url('../fonts/ArialRoundedMT-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Arial Rounded MT';
    src: url('../fonts/ArialRoundedMT-Bold.woff2') format('woff2'),
         url('../fonts/ArialRoundedMT-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-bg: #0a0e27;
    --text-white: #ffffff;
    --text-gray: #b8c1db;
    --font-family: 'Arial Rounded MT', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --gradient-blue: linear-gradient(135deg, #2b3a87 0%, #4a6fa5 100%);
    --gradient-blue-hover: linear-gradient(135deg, #3545a0 0%, #5a80c5 100%);
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

body {
    font-family: var(--font-family);
    background-color: var(--primary-bg);
    background-image: radial-gradient(ellipse 80% 40% at 50% -5%, #0f1a40 0%, rgba(15, 26, 64, 0.35) 45%, transparent 75%);
    background-attachment: fixed;
    color: var(--text-white);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    animation: pageIn 0.25s ease-out;
}

/* Neige */
#snow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    display: block;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.6rem 1.2rem;
    background: var(--gradient-blue);
    color: #fff;
    border-radius: 0 0 8px 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 0;
}

/* Navbar */
.navbar {
    background: transparent;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: none;
    border-bottom: 1px solid transparent;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled,
.navbar:has(.nav-menu.active) {
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    border-bottom-color: rgba(184, 193, 219, 0.08);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}

.nav-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.nav-logo-beta {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgba(114, 164, 242, 0.95);
    background: rgba(114, 164, 242, 0.12);
    border: 1px solid rgba(114, 164, 242, 0.3);
    border-radius: 8px;
    padding: 0.15rem 0.4rem;
}

.nav-logo img {
    width: 40px;
    height: 40px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu > li:last-child {
    margin-left: 1.5rem;
}

.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 1001;
}

.nav-burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-white, #e8eaf6);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.active span:nth-child(2) { opacity: 0; }
.nav-burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero Accueil */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    padding: 0 4rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-content {
    flex: 1;
}

.hero-title-wrap {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.hero-title {
    font-size: clamp(2.5rem, 4vw, 5.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-title-beta {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgba(114, 164, 242, 0.95);
    background: rgba(114, 164, 242, 0.12);
    border: 1px solid rgba(114, 164, 242, 0.3);
    border-radius: 10px;
    padding: 0.3rem 0.65rem;
    margin-top: 0.9rem;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 1.6vw, 1.8rem);
    font-weight: 400;
    color: var(--text-gray);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    perspective: 1000px;
}

/* Aiko-chan */
.hero-image img {
    max-width: min(500px, 30vw);
    max-height: 60vh;
    width: auto;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(74, 111, 165, 0.3));
    animation: float 3s ease-in-out infinite;
    transition: transform 0.1s ease-out;
    will-change: transform;
    cursor: pointer;
    transform-style: preserve-3d;
}

@keyframes float {
    0%, 100% {
        transform: translateY(-15px);
    }
    50% {
        transform: translateY(15px);
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem 2rem;
    color: var(--text-gray);
    font-size: 0.95rem;
    font-weight: 400;
    position: relative;
    z-index: 2;
    margin-top: auto;
    opacity: 0.65;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.footer-sep {
    opacity: 0.4;
}

footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--text-white);
}

/* Badge Website Carbon */
#wcb.carbonbadge {
    font-size: 11.5px;
    text-align: center;
    line-height: 1.15;
    margin: 0.75rem auto 0;
    width: fit-content;
}

#wcb.carbonbadge sub {
    vertical-align: middle;
    position: relative;
    top: 0.3em;
    font-size: 0.7em;
}

#wcb #wcb_p {
    display: flex;
    justify-content: center;
}

#wcb #wcb_2, #wcb #wcb_a, #wcb #wcb_g {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1em;
    line-height: 1.15;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.05em;
    text-decoration: none;
    margin: 0.2em 0;
}

#wcb #wcb_a, #wcb #wcb_g {
    padding: 0.5em 0.8em;
    border: 1px solid rgba(184, 193, 219, 0.2);
    transition: color 0.25s ease, border-color 0.25s ease;
}

#wcb #wcb_g {
    border-radius: 999px 0 0 999px;
    background: transparent;
    border-right: 0;
    color: var(--text-gray);
    min-width: 8.2em;
}

#wcb #wcb_a {
    border-radius: 0 999px 999px 0;
    border-left: 0;
    background: transparent;
    color: var(--text-gray);
    font-weight: 600;
}

#wcb:hover #wcb_a,
#wcb:hover #wcb_g {
    color: rgba(114, 164, 242, 0.95);
    border-color: rgba(114, 164, 242, 0.5);
}

#wcb #wcb_2 {
    display: block;
    color: var(--text-gray);
    font-size: 0.85em;
    margin-top: 0.6em;
    opacity: 0.55;
    transition: opacity 0.25s ease;
}

#wcb:hover #wcb_2 {
    opacity: 1;
}

/* Hero CTAs */
.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0.85rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.hero-btn-primary {
    background: var(--gradient-blue);
    color: #ffffff;
    border: none;
}

.hero-btn-primary:hover {
    background: var(--gradient-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 111, 165, 0.4);
}

.hero-btn-secondary {
    background: transparent;
    color: var(--text-white);
    border: 2px solid rgba(184, 193, 219, 0.4);
}

.hero-btn-secondary:hover {
    background: rgba(184, 193, 219, 0.1);
    border-color: rgba(184, 193, 219, 0.7);
    transform: translateY(-2px);
}

.theme-toggle {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-icon {
    width: 22px;
    height: 22px;
    opacity: 0.6;
    filter: invert(1);
    transition: opacity 0.2s ease;
}

.theme-toggle:hover .theme-icon {
    opacity: 1;
}

.theme-icon-moon { display: none; }
.theme-icon-sun  { display: block; }

.hidden {
    display: none !important;
}

.login-error {
    margin-top: 1rem;
    color: #f28b8b;
    font-size: 0.9rem;
}

.login-gate {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    /* .login-gate.hero occupe tout l'espace de 0 à juste avant le footer, mais
       la navbar (position: fixed) recouvre visuellement le haut de cette zone
       sans la pousser. Sans compenser, le centrage vertical se fait sur toute
       la boîte (y compris la partie cachée sous la navbar), donc le contenu
       paraît collé en haut. --navbar-h (posé dynamiquement par
       updateNavbarHeight() dans loadElements.js) rend le centrage réellement
       équilibré. */
    padding-top: var(--navbar-h, 70px);
}

.login-gate .hero-image {
    flex: none;
    justify-content: center;
}

.login-gate .hero-image img {
    max-width: min(220px, 45vw);
}

.login-gate .hero-content {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-gate .hero-actions {
    justify-content: center;
}

.hero-btn-discord {
    background: #5865f2;
    color: #ffffff;
    border: none;
    gap: 0.6rem;
}

.hero-btn-discord:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(88, 101, 242, 0.45);
}

.discord-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.hub-teaser {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hub-teaser-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-gray);
    margin-bottom: 1.1rem;
}

.hub-teaser-icons {
    display: flex;
    gap: 1.1rem;
}

.hub-teaser-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.hub-teaser-item img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid rgba(184, 193, 219, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.hub-teaser-item span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-gray);
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.hub-teaser-item:hover img {
    transform: translateY(-6px) scale(1.1);
    border-color: rgba(114, 164, 242, 0.75);
    box-shadow: 0 12px 26px rgba(74, 111, 165, 0.5);
}

.hub-teaser-item:hover span {
    opacity: 1;
    transform: translateY(0);
    color: var(--text-white);
}

@media (max-width: 480px) {
    .hub-teaser-icons img {
        width: 42px;
        height: 42px;
        border-radius: 11px;
    }
}

.nav-user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
}

.nav-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-user-name {
    font-size: 0.9rem;
    color: #e8eaf6;
}

.nav-user-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.nav-user-link:hover {
    opacity: 0.8;
}

.nav-donor-badge {
    font-size: 0.85rem;
    cursor: default;
}

.nav-staff-badge {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #14182f;
    background: linear-gradient(135deg, #f7c560, #f2a93b);
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    cursor: default;
}

.nav-mobile-label,
.nav-mobile-chevron {
    display: none;
}

.nav-logout-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #b8c1db;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.nav-logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Le bouton direct dans le header est retiré au profit du modal profil ;
   il reste affiché dans le menu burger mobile (voir @media max-width:980px). */
#nav-logout-btn {
    display: none;
}

.lang-switcher {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.lang-toggle {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.globe-icon {
    width: 22px;
    height: 22px;
    opacity: 0.6;
    filter: invert(1);
    transition: opacity 0.2s ease;
}

.lang-toggle:hover .globe-icon {
    opacity: 1;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: rgba(20, 25, 50, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 140px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1002;
}

.lang-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-gray);
    font-size: 0.9rem;
    font-family: var(--font-family);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.lang-btn.active {
    background: rgba(74, 111, 165, 0.3);
    color: var(--text-white);
}

.flag-icon {
    width: 22px;
    height: 16px;
    border-radius: 2px;
    object-fit: cover;
}

@media (max-width: 1200px) {
    .hero-image img { max-width: min(380px, 30vw); }
}

@media (max-width: 980px) {
    .nav-container { justify-content: space-between; }
    .nav-logo { position: static; left: auto; transform: none; }

    .nav-burger { display: flex; }

    .nav-menu {
        position: fixed;
        top: var(--navbar-h, 64px);
        left: 0;
        right: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0 1rem;
        background: #0a0e27;
        border-bottom: 0 solid rgba(184, 193, 219, 0.1);
        max-height: 0;
        overflow: hidden;
        visibility: hidden;
        transition: max-height 0.3s ease, border-bottom-width 0.3s ease, padding 0.3s ease, visibility 0s linear 0.3s;
    }

    .nav-menu.active {
        padding: 1rem;
        border-bottom-width: 1px;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
        visibility: visible;
        transition: max-height 0.3s ease, border-bottom-width 0.3s ease, padding 0.3s ease;
        max-height: 80vh;
        overflow-y: auto;
    }

    /* Chaque <li> devient une carte à coins arrondis, comme les cartes du
       reste du site (donateurs, modal profil...), plutôt que des bandes
       plein-large collées les unes aux autres. */
    .nav-menu > li {
        margin-left: 0 !important;
        background: rgba(20, 26, 55, 0.6);
        border: 1px solid rgba(184, 193, 219, 0.1);
        border-radius: 14px;
        overflow: hidden;
    }

    /* Bloc profil : avatar/pseudo/badge, séparateur doux, puis déconnexion */
    .nav-user-badge {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
    }

    .nav-user-link {
        gap: 0.75rem;
        padding: 1rem 1.1rem;
    }

    .nav-user-avatar {
        width: 40px;
        height: 40px;
    }

    .nav-user-name {
        font-size: 1rem;
        font-weight: 600;
    }

    #nav-logout-btn {
        display: block;
        width: calc(100% - 2.2rem);
        margin: 0 1.1rem 1rem;
        padding: 0.6rem;
        border-radius: 10px;
    }

    .lang-switcher {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .theme-toggle,
    .lang-toggle {
        display: flex;
        align-items: center;
        gap: 0.9rem;
        width: 100%;
        min-height: 52px;
        padding: 0 1.1rem;
        border-radius: 0;
        background: none;
        color: var(--text-white, #e8eaf6);
        font-size: 0.95rem;
        transition: background 0.15s ease;
    }

    .lang-switcher > .lang-toggle {
        border-top: 1px solid rgba(184, 193, 219, 0.08);
    }

    .theme-toggle:active,
    .lang-toggle:active {
        background: rgba(255, 255, 255, 0.05);
    }

    .theme-icon,
    .globe-icon {
        width: 20px;
        height: 20px;
    }

    .nav-mobile-label {
        display: block;
        flex: 1;
        text-align: left;
    }

    .nav-mobile-chevron {
        display: block;
        width: 18px;
        height: 18px;
        color: var(--text-gray, #b8c1db);
        transition: transform 0.2s ease;
    }

    .lang-switcher.open .lang-toggle .nav-mobile-chevron {
        transform: rotate(180deg);
    }

    .lang-dropdown {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.03);
        border-top: 1px solid rgba(184, 193, 219, 0.08);
        border-radius: 0;
        padding: 0.4rem;
        margin: 0;
        min-width: 0;
        display: none;
    }

    .lang-switcher.open .lang-dropdown {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
        width: 100%;
    }

    .lang-btn {
        min-height: 46px;
        padding: 0 0.9rem;
        border-radius: 9px;
    }

    .lang-btn:hover,
    .lang-btn:active {
        background: rgba(255, 255, 255, 0.06);
    }

    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding: 6rem 2rem 2rem;
        justify-content: center;
        align-items: center;
        gap: 1rem;
    }

    .login-gate { flex-direction: column; }

    .hero-title { font-size: 3.5rem; margin-bottom: 0.5rem; }
    .hero-subtitle { font-size: 1.5rem; }
    .hero-image { margin: 0; justify-content: center; }
    .hero-image img { max-width: 280px; }
    .hero-actions { justify-content: center; }

    .login-gate.hero { padding-top: 5.5rem; gap: 0.5rem; }
    .login-gate .hero-image img { max-width: 160px; }
    .login-gate .hero-actions { margin-top: 1.25rem; }
    .login-gate .hub-teaser { margin-top: 1.5rem; }
}

/* Focus visible — navigation clavier */
:focus-visible {
    outline: 2px solid rgba(74, 111, 165, 0.85);
    outline-offset: 3px;
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    body {
        animation: none !important;
    }

    .hero-image img,
    .about-image img,
    .artist-image img {
        animation: none !important;
    }
}


@media (max-width: 480px) {
    .navbar {
        padding: 1rem;
    }

    .nav-logo {
        font-size: 1.2rem;
    }

    .nav-logo img {
        width: 35px;
        height: 35px;
    }

    .hero {
        gap: 1rem;
        padding: 5rem 1.5rem 1.5rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-image img {
        max-width: 230px;
    }

    footer {
        font-size: 0.75rem;
        padding: 1.5rem 1rem;
    }

    .login-gate.hero { padding-top: 4.5rem; padding-bottom: 1rem; }
    .login-gate .hero-title { font-size: 2.1rem; }
    .login-gate .hero-title-beta { font-size: 0.7rem; padding: 0.2rem 0.5rem; margin-top: 0.4rem; }
    .login-gate .hero-image img { max-width: 130px; }
    .login-gate .hero-actions { margin-top: 1rem; }
    .login-gate .hub-teaser { margin-top: 1.1rem; }
    .login-gate .hub-teaser-label { margin-bottom: 0.6rem; }
}