@font-face {
    font-family: 'Parisienne';
    src: url('./Parisienne.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8e44ad;
    --primary-dark: #5e2177;
    --bg-cream: #f0e6d9;
    --bg-light: rgba(255, 255, 255, 0.95);
    --text-dark: #333;
    --text-light: #444;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.15);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    font-family: 'Parisienne', Georgia, serif;
    background-color: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.8;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

/* ============================================
   LOADER / ÉCRAN DE CHARGEMENT
============================================ */
.loader-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-title {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

.loader-text {
    font-size: 1.4rem;
    opacity: 0.95;
    margin-bottom: 0.5rem;
}

.loader-subtext {
    font-size: 1rem;
    opacity: 0.7;
}

/* ============================================
   MODAL D'INFORMATION
============================================ */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.info-modal.active {
    opacity: 1;
    visibility: visible;
}

.info-modal-content {
    background: var(--bg-light);
    padding: 3rem;
    border-radius: 20px;
    max-width: 600px;
    text-align: center;
    transform: scale(0.9);
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-medium);
}

.info-modal.active .info-modal-content {
    transform: scale(1);
}

.info-modal h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.info-modal p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* ============================================
   HEADER / NAVIGATION
============================================ */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.95), rgba(94, 33, 119, 0.95));
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

header.scrolled {
    height: 65px;
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.98), rgba(94, 33, 119, 0.98));
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.munch-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-image: url(./textures/munch.png);
    background-size: cover;
    background-position: center;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
}

.munch-avatar:hover {
    transform: scale(1.1);
    border-color: white;
}

.site-title {
    font-size: 1.8rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: var(--transition-smooth);
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: white;
    transition: var(--transition-smooth);
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 80%;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: var(--transition-smooth);
}

/* ============================================
   HERO SECTION
============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px 2rem 4rem;
    background: linear-gradient(180deg, var(--bg-cream) 0%, #e8dcd0 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./textures/skybox2.png') center/cover;
    opacity: 0.1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
}

.hero-title {
    font-size: 4.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-subtitle {
    font-size: 1.8rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.4s both;
}

.hero-description {
    font-size: 1.3rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 3rem;
    animation: fadeInUp 1s ease 0.6s both;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.8s both;
}

.btn {
    padding: 1rem 2.5rem;
    font-size: 1.3rem;
    font-family: 'Parisienne', serif;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 20px rgba(142, 68, 173, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(142, 68, 173, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator span {
    display: block;
    width: 30px;
    height: 50px;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    position: relative;
}

.scroll-indicator span::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translateX(-50%);
    animation: scrollDown 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes scrollDown {
    0% { opacity: 1; top: 8px; }
    100% { opacity: 0; top: 30px; }
}

/* ============================================
   SECTION COMMUNE
============================================ */
section {
    padding: 5rem 2rem;
}

.section-title {
    font-size: 3rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.3rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* ============================================
   SECTION 3D VIEWER
============================================ */
.viewer-section {
    background: linear-gradient(180deg, #e8dcd0 0%, var(--bg-cream) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 100px;
}

.viewer-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.viewer-header {
    text-align: center;
    margin-bottom: 2rem;
}

.webgl-wrapper {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

#webGL {
    width: 100%;
    height: 100%;
}

#webGL canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none;
}

/* Panneau de contrôle GUI */
#guiContainer {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
}

#guiContainer .dg.main {
    font-family: 'Parisienne', Georgia, serif !important;
}

.viewer-controls-hint {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    background: var(--bg-light);
    border-radius: 15px;
    box-shadow: var(--shadow-soft);
}

.viewer-controls-hint p {
    font-size: 1.1rem;
    color: var(--text-light);
}

.viewer-controls-hint span {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--primary-color);
    color: white;
    border-radius: 5px;
    margin: 0 0.3rem;
    font-size: 0.9rem;
}

/* ============================================
   SECTION PRÉSENTATION
============================================ */
.presentation-section {
    background: var(--bg-light);
}

.presentation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

.presentation-image {
    position: relative;
}

.presentation-image img {
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    box-shadow: var(--shadow-medium);
    transition: var(--transition-smooth);
}

.presentation-image img:hover {
    transform: scale(1.02) rotate(-2deg);
}

.presentation-image::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100%;
    height: 100%;
    border: 3px solid var(--primary-color);
    border-radius: 20px;
    z-index: -1;
}

.presentation-content h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.presentation-content p {
    font-size: 1.2rem;
    color: var(--text-light);
    line-height: 2;
    margin-bottom: 1rem;
}

.presentation-content strong {
    color: var(--primary-dark);
}

/* ============================================
   SECTION FONCTIONNALITÉS (CHECKLIST)
============================================ */
.features-section {
    background: linear-gradient(180deg, var(--bg-cream) 0%, #e8dcd0 100%);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-smooth);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.feature-icon.checked {
    background: linear-gradient(135deg, #27ae60, #1e8449);
}

.feature-icon.unchecked {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.feature-content h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
}

.feature-content p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ============================================
   SECTION TECHNIQUE
============================================ */
.technical-section {
    background: var(--bg-light);
}

.technical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.technical-card {
    background: var(--bg-cream);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.technical-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.technical-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.technical-card h3::before {
    content: '';
    width: 4px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
}

.technical-card p {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.9;
}

/* ============================================
   SECTION PROCESSUS CRÉATIF
============================================ */
.process-section {
    background: linear-gradient(180deg, #e8dcd0 0%, var(--bg-cream) 100%);
}

.process-timeline {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.process-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    transform: translateX(-50%);
    border-radius: 2px;
}

.process-item {
    display: flex;
    margin-bottom: 3rem;
    position: relative;
}

.process-item:nth-child(odd) {
    flex-direction: row-reverse;
    text-align: right;
}

.process-item:nth-child(odd) .process-content {
    padding-right: 3rem;
    padding-left: 0;
}

.process-item:nth-child(even) .process-content {
    padding-left: 3rem;
}

.process-number {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 1;
    box-shadow: var(--shadow-soft);
}

.process-content {
    width: calc(50% - 25px);
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-soft);
}

.process-content h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.process-content p {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* ============================================
   FOOTER
============================================ */
footer {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

footer h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

footer p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.footer-credits {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1rem;
    opacity: 0.8;
}

/* Rendre le lien de crédit (byMehd) bien visible en blanc */
.footer-credits a {
    color: white;
    text-decoration: underline;
}

.footer-credits a:hover {
    color: #ffffff;
    opacity: 0.95;
    text-decoration: none;
}

/* ============================================
   RESPONSIVE DESIGN
============================================ */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .presentation-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .presentation-image {
        order: -1;
        display: flex;
        justify-content: center;
    }

    .presentation-image::before {
        display: none;
    }

    .process-timeline::before {
        left: 25px;
    }

    .process-item,
    .process-item:nth-child(odd) {
        flex-direction: column;
        text-align: left;
    }

    .process-number {
        left: 25px;
        transform: translateX(-50%);
    }

    .process-content,
    .process-item:nth-child(odd) .process-content {
        width: calc(100% - 60px);
        margin-left: 60px;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0 1rem;
    }

    .site-title {
        font-size: 1.4rem;
    }

    nav ul {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        padding: 1rem;
        gap: 0.5rem;
        transform: translateY(-100%);
        opacity: 0;
        transition: var(--transition-smooth);
        pointer-events: none;
    }

    nav ul.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    nav a {
        display: block;
        padding: 1rem;
        text-align: center;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.4rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .webgl-wrapper {
        height: 50vh;
        min-height: 350px;
        border-radius: 10px;
    }

    .technical-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }

    .info-modal-content {
        margin: 1rem;
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
}
