:root {
    --bg-base: #0d0d0f;
    --bg-elevated: #1a1a1d;
    --bg-card: rgba(255, 255, 255, 0.04);
    --border-soft: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.22);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.55);
    --accent: #667eea;
    --accent-2: #764ba2;
    --accent-link: #a7b5ff;
    --accent-warm: #e8a05c;
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
    --transition-fast: 180ms ease;
    --transition-base: 280ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', Arial, sans-serif;
}

h1, h2, h3, h4, .download-btn {
    font-family: 'Space Grotesk', 'Inter', Arial, sans-serif;
    letter-spacing: 0.01em;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    padding: 15px 30px;
    display: flex;
    justify-content: center;
    gap: 40px;
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.navbar a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.navbar a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.navbar a[aria-current="page"] {
    color: var(--accent);
    background: rgba(102, 126, 234, 0.10);
}

/* Sections */
.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* ensure content is not hidden behind the fixed navbar */
    padding-top: 80px;
}

/* Hero Section */
.hero-section {
    background-color: #000;
    background-image: url("chatelet.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
}

/* Focus-visible global pour accessibilité clavier */
.navbar a:focus-visible,
.download-btn:focus-visible,
.back-to-top:focus-visible,
.scroll-cue:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.9);
    outline-offset: 3px;
}

.overlay {
    min-height: 100vh;
    width: 100%;
    background:
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.88) 100%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/></svg>");
    background-blend-mode: normal, overlay;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 80px 20px 60px;
    position: relative;
}

.logo {
    width: 150px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

h1 {
    color: var(--text-primary);
    font-size: 3rem;
    text-align: center;
}

.hero-section h1 {
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.hero-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    text-align: center;
    margin-top: -8px;
}

@media (prefers-reduced-motion: no-preference) {
    .hero-section h1 {
        animation: title-flicker 9s ease-in-out infinite;
    }
}

@keyframes title-flicker {
    0%, 100%   { opacity: 1; }
    18%, 22%   { opacity: 1; }
    19%        { opacity: 0.78; }
    21%        { opacity: 0.92; }
    62%        { opacity: 1; }
    63%        { opacity: 0.85; }
    64%        { opacity: 1; }
}

.download-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    color: var(--text-primary);
    text-decoration: none;
    border: 2px solid var(--text-primary);
    border-radius: 8px;
    transition: background var(--transition-fast), color var(--transition-fast),
                border-color var(--transition-fast), transform var(--transition-base);
    margin-top: 30px;
    display: inline-block;
    background: rgba(0, 0, 0, 0.25);
}

.download-btn:hover {
    background: rgba(232, 160, 92, 0.08);
    color: var(--accent-warm);
    border-color: var(--accent-warm);
    transform: translateY(-2px);
}

.scroll-cue {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 1.6rem;
    text-decoration: none;
    line-height: 1;
    padding: 6px 12px;
    border-radius: 50%;
    transition: color var(--transition-fast);
}

.scroll-cue:hover {
    color: var(--text-primary);
}

@media (prefers-reduced-motion: no-preference) {
    .scroll-cue {
        animation: scroll-cue-bounce 2.4s ease-in-out infinite;
    }
}

@keyframes scroll-cue-bounce {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.55; }
    50%      { transform: translate(-50%, 8px); opacity: 0.95; }
}

/* About & Credits Sections */
.about-section,
.credits-section {
    background: linear-gradient(135deg, var(--bg-base) 0%, var(--bg-elevated) 100%);
    padding: 100px 20px;
}

.section-content {
    max-width: 900px;
    width: 100%;
    padding: 40px;
}

.section-content h2 {
    color: var(--text-primary);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-content h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    margin: 20px auto 0;
    border-radius: 2px;
}

.section-content h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.section-content .team-intro {
    font-size: 1.2rem;
    font-weight: normal;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: center;
}

/* About Game */
.about-game {
    margin-bottom: 50px;
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
}

.about-game p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: justify;
}

.about-game p + p {
    margin-top: 1em;
}

/* Team Section */
.about-team {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
}

.team-members {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.team-member {
    background: rgba(0, 0, 0, 0.3);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
    border: 1px solid var(--border-soft);
    transition: transform var(--transition-base), border-color var(--transition-fast),
                box-shadow var(--transition-base);
}

.team-member:hover {
    transform: translateY(-5px);
    border-color: var(--border-strong);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55),
                0 0 0 1px rgba(102, 126, 234, 0.25);
}

.member-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.team-member h4 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.member-role {
    color: var(--accent-link);
    font-size: 0.95rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.member-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Credits Section */
.credits-category {
    background: var(--bg-card);
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid var(--border-soft);
}

.credits-category ul {
    list-style: none;
    padding-left: 0;
}

.credits-category li {
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.credits-category li:last-child {
    border-bottom: none;
}

.credits-category li strong {
    color: var(--text-primary);
}

.credits-category a,
.credits-footer a {
    color: var(--accent-link);
    text-decoration: none;
    border-bottom: 1px solid rgba(167, 181, 255, 0.3);
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.credits-category a:hover,
.credits-footer a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.credits-footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-soft);
}

.credits-footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

/* Animations d'entrée (IntersectionObserver) */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    will-change: opacity, transform;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Bouton "retour en haut" */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.95);
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
    z-index: 1001;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    background: rgba(118, 75, 162, 0.95);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 15px;
        gap: 10px;
    }

    .navbar a {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .hero-section {
        /* background-attachment: fixed est instable sur iOS, on bascule en scroll */
        background-attachment: scroll;
    }

    h1 {
        font-size: 2rem;
        padding: 0 20px;
    }

    .section-content h2 {
        font-size: 2rem;
    }

    .section-content {
        padding: 20px;
    }

    .about-game,
    .about-team,
    .credits-category {
        padding: 20px;
    }

    .download-btn {
        padding: 12px 30px;
        font-size: 1rem;
        margin-top: 30px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
}

@media (max-width: 540px) {
    .navbar {
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px 10px;
    }

    .navbar a {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .section {
        padding-top: 110px;
    }

    .hero-tagline {
        font-size: 0.7rem;
        letter-spacing: 0.32em;
    }
}
