/* ===================================================================
   AXPERIA STUDIO — Cinematic Sci-Fi Gaming Portfolio
   Direction: Dark cinematic, wireframe geometry, red accents
   =================================================================== */

/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Space+Mono:wght@400;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ===== VARIABLES ===== */
:root {
    --black:        #0a0a0a;
    --dark:         #111111;
    --dark-surface: #161616;
    --dark-red:     #2a0a0a;
    --accent:       #e01020;
    --accent-glow:  #ff2040;
    --accent-warm:  #ff6030;
    --text:         #f0f0f0;
    --text-muted:   #888888;
    --text-dim:     #444444;
    --border:       #222222;

    --font-display: 'Orbitron', sans-serif;
    --font-mono:    'Space Mono', monospace;
    --font-body:    'Outfit', sans-serif;

    --z-bg:         0;
    --z-grain:      1;
    --z-content:    10;
    --z-nav:        50;
    --z-cursor:     100;
    --z-preloader:  200;

    --nav-height:   70px;
    --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out:  cubic-bezier(0.76, 0, 0.24, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: auto; /* Lenis handles smooth scroll */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--black);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Lenis smooth scroll */
html.lenis, html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

::selection {
    background: var(--accent);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ===== PRELOADER ===== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    z-index: var(--z-preloader);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.preloader__logo {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 12px;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0;
}

.preloader__logo span {
    display: inline-block;
}

.preloader__bar {
    width: 200px;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    overflow: hidden;
}

.preloader__bar-fill {
    width: 0%;
    height: 100%;
    background: var(--accent);
    border-radius: 1px;
}

/* ===== WEBGL CANVAS ===== */
#gl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--z-bg);
    pointer-events: none;
}

/* Grain overlay */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-grain);
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
    animation: grainShift 0.5s steps(10) infinite;
}

@keyframes grainShift {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-2%, -2%); }
    30% { transform: translate(1%, -3%); }
    50% { transform: translate(-3%, 1%); }
    70% { transform: translate(3%, 2%); }
    90% { transform: translate(2%, -1%); }
}

/* WebGL fallback */
.webgl-fallback {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-bg);
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(224, 16, 32, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 96, 48, 0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(224, 16, 32, 0.04) 0%, transparent 50%),
        var(--black);
}

/* ===== 3D MODEL LABELS ===== */
#model-labels {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.model-label {
    position: absolute;
    pointer-events: auto;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(10, 10, 10, 0.7);
    border: 1px solid rgba(224, 16, 32, 0.3);
    border-radius: 2px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transform: translate(-50%, -100%);
    transition: border-color 0.3s, background 0.3s;
    white-space: nowrap;
    opacity: 0;
}

.model-label:hover {
    border-color: var(--accent);
    background: rgba(224, 16, 32, 0.15);
}

.model-label__dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
}

.model-label__name {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text);
}

/* ===== CUSTOM CURSOR ===== */
.cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    transform: translate(-50%, -50%);
    transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), border-color 0.3s;
    mix-blend-mode: difference;
}

.cursor--hover {
    width: 50px;
    height: 50px;
    border-color: var(--accent-glow);
}

.cursor-dot {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    transform: translate(-50%, -50%);
}

/* ===== NAVIGATION ===== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 40px;
    z-index: var(--z-nav);
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.4s var(--ease-out);
}

nav.nav--hidden {
    transform: translateY(-100%);
}

nav .nav__logo {
    height: 36px;
    margin-right: auto;
}

nav a {
    position: relative;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 16px;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--text);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 16px;
    right: 16px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease-out);
}

nav a:hover::after,
nav a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ===== MAIN CONTENT WRAPPER ===== */
.main-content {
    position: relative;
    z-index: var(--z-content);
    padding-top: var(--nav-height);
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0 40px;
    text-align: center;
    overflow: hidden;
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(48px, 8vw, 120px);
    font-weight: 900;
    letter-spacing: 10px;
    text-transform: uppercase;
    line-height: 1;
    color: var(--text);
    margin-bottom: 20px;
}

.hero__title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(80px) rotateX(40deg);
}

.hero__subtitle {
    font-family: var(--font-mono);
    font-size: clamp(12px, 1.5vw, 16px);
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(20px);
}

.hero__cta {
    display: flex;
    gap: 20px;
    opacity: 0;
    transform: translateY(20px);
}

/* Marquee */
.hero__marquee {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(224, 16, 32, 0.08);
    border-top: 1px solid rgba(224, 16, 32, 0.2);
    border-bottom: 1px solid rgba(224, 16, 32, 0.2);
    overflow: hidden;
    padding: 12px 0;
}

.hero__marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.hero__marquee-item {
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-dim);
    white-space: nowrap;
    padding: 0 30px;
}

.hero__marquee-item .separator {
    color: var(--accent);
    margin: 0 20px;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===== SECTION COMMON ===== */
section {
    position: relative;
    padding: 120px 40px;
}

.section__label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.section__title {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 60px);
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 40px;
}

.section__title .stroke {
    color: transparent;
    -webkit-text-stroke: 1px var(--text);
}

/* Decorative rotating square */
.section__square {
    display: inline-block;
    width: 80px;
    height: 80px;
    border: 1px solid var(--text-dim);
    position: absolute;
    z-index: -1;
}

/* ===== ABOUT SECTION ===== */
.about {
    max-width: 1200px;
    margin: 0 auto;
}

.about__content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about__text p {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.about__text p strong {
    color: var(--text);
}

/* ===== TEAM SECTION ===== */
.team {
    max-width: 1200px;
    margin: 0 auto;
}

.team__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.team__member {
    background: var(--dark-surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 30px 20px;
    text-align: center;
    transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.team__member:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.team__role {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.team__name {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

/* ===== GAMES SECTION ===== */
.games {
    max-width: 1200px;
    margin: 0 auto;
}

.game-card {
    background: var(--dark-surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    padding: 40px;
    transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.game-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.game-card__title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.game-card__desc {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.game-card__status {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: var(--accent);
    color: var(--text);
    padding: 6px 16px;
    border-radius: 2px;
}

/* ===== SOCIALS SECTION ===== */
.socials {
    max-width: 1200px;
    margin: 0 auto;
}

.socials__grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--dark-surface);
    border: 1px solid var(--border);
    padding: 16px 28px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--text-muted);
    transition: border-color 0.3s, color 0.3s, transform 0.3s var(--ease-out);
}

.social-link:hover {
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-2px);
}

.social-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ===== CONTACT SECTION ===== */
.contact {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact__email {
    font-family: var(--font-display);
    font-size: clamp(18px, 2.5vw, 28px);
    letter-spacing: 2px;
    color: var(--text);
    transition: color 0.3s;
}

.contact__email:hover {
    color: var(--accent);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 16px 36px;
    border-radius: 2px;
    transition: all 0.3s var(--ease-out);
    cursor: pointer;
    border: none;
}

.btn--primary {
    background: var(--accent);
    color: var(--text);
}

.btn--primary:hover {
    background: var(--accent-glow);
    box-shadow: 0 0 30px rgba(224, 16, 32, 0.3);
}

.btn--outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn--outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== NAVIGATION LINKS (bottom of index) ===== */
.nav-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

/* ===== GALERIE — PROJETS ===== */
.projets-header {
    text-align: center;
    padding: 120px 40px 60px;
}

.projets-header h1 {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 80px);
    font-weight: 900;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: var(--text);
    text-shadow: 0 0 40px rgba(224, 16, 32, 0.4);
}

.projets-header h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 2px;
    background: var(--accent);
    margin: 20px auto 0;
}

.projets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 120px;
}

.projet-card {
    position: relative;
    background: var(--dark-surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.4s var(--ease-out), border-color 0.3s;
    cursor: pointer;
}

.projet-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
}

.projet-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.projet-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

.projet-card:hover .projet-image img {
    transform: scale(1.08);
}

/* Overlay on hover */
.projet-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.8) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
}

.projet-card:hover .projet-image::after {
    opacity: 1;
}

.projet-info {
    padding: 24px;
}

.projet-categorie {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
    font-weight: 700;
}

.projet-info h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 12px;
    color: var(--text);
}

.projet-description {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
}

/* ===== SERVICES ===== */
.services-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 120px 40px 80px;
}

.services-container h1 {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    letter-spacing: 6px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 60px;
    color: var(--text);
}

.services-container h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 2px;
    background: var(--accent);
    margin: 20px auto 0;
}

.service-card {
    background: var(--dark-surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 50px;
    margin-bottom: 40px;
    transition: border-color 0.3s;
}

.service-card:hover {
    border-color: var(--accent);
}

.service-card h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 16px;
}

.service-card > p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 24px;
}

.service-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.service-card ul li {
    color: var(--text-muted);
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}

.service-card ul li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 1px;
    margin-right: 14px;
    vertical-align: middle;
}

.pdf-notice {
    font-style: italic;
    font-size: 13px !important;
    color: var(--text-dim) !important;
}

/* Contact CTA */
.contact-cta {
    text-align: center;
    background: var(--dark-surface);
    border: 1px solid var(--border);
    padding: 50px 40px;
    border-radius: 4px;
    margin-top: 40px;
}

.contact-cta h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text);
    margin-bottom: 12px;
}

.contact-cta p {
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ===== BUTTON RETOUR EN HAUT ===== */
#btnHaut {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    font-size: 18px;
    background: var(--dark-surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 2px;
    cursor: pointer;
    z-index: 40;
    transition: all 0.3s;
    font-family: var(--font-mono);
}

#btnHaut:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text);
}

/* ===== FOOTER ===== */
footer {
    position: relative;
    background: var(--black);
    border-top: 1px solid var(--border);
    padding: 40px;
    text-align: center;
    z-index: var(--z-content);
}

footer p {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ===== MAILTO LINKS ===== */
a[href^="mailto"] {
    color: var(--text);
    transition: color 0.3s;
}

a[href^="mailto"]:hover {
    color: var(--accent);
}

/* ===== FOCUS STYLES (A11Y) ===== */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Skip to content */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--accent);
    color: var(--text);
    padding: 12px 20px;
    z-index: 999;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1px;
}

.skip-link:focus {
    top: 16px;
}

/* ===== 404 ===== */
.page-404 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 40px;
}

.page-404__code {
    font-family: var(--font-display);
    font-size: clamp(100px, 20vw, 200px);
    font-weight: 900;
    letter-spacing: 10px;
    color: var(--text);
    text-shadow: 0 0 60px rgba(224, 16, 32, 0.4);
    line-height: 1;
}

.page-404__text {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 20px 0 40px;
}

/* ===== TUNNEL PORTAL ===== */
.tunnel-portal {
    position: relative;
    /* Height driven by GSAP pin spacer — needs enough scroll distance */
    overflow: visible;
    padding: 0;
}

.tunnel-pin {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tunnel-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.tunnel-overlay {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    padding: 40px;
    pointer-events: none;
}

.tunnel-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent);
}

.tunnel-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 72px);
    font-weight: 800;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1.1;
}

.tunnel-hint {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
    animation: tunnelHintPulse 2s ease-in-out infinite;
}

@keyframes tunnelHintPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Door shape — opens from center with inset() */
.tunnel-door {
    position: absolute;
    inset: 0;
    z-index: 4;
    clip-path: inset(50% 50% 50% 50%);
    pointer-events: none;
    border: 0;
}

.tunnel-door__frame {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Glowing door border (inner edge) */
.tunnel-door__frame::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    box-shadow: inset 0 0 80px rgba(224, 16, 32, 0.3), inset 0 0 200px rgba(224, 16, 32, 0.1);
    pointer-events: none;
}

.tunnel-door__text {
    position: absolute;
    z-index: 3;
    font-family: var(--font-display);
    font-size: clamp(48px, 10vw, 140px);
    font-weight: 900;
    letter-spacing: 20px;
    text-transform: uppercase;
    color: var(--text);
    text-shadow: 0 0 60px rgba(224, 16, 32, 0.5);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

/* Iframe — the actual galerie.html page behind the door */
.tunnel-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 1;
    background: var(--black);
    opacity: 0;
    transition: opacity 0.3s;
}


/* ===== SCROLLTELLING ENHANCEMENTS ===== */

/* Line-by-line reveal */
.reveal-line {
    opacity: 0;
    transform: translateY(40px);
}

/* Scale-on-scroll title */
.scroll-scale {
    will-change: transform;
}

/* Deep parallax container */
.parallax-deep {
    will-change: transform;
    overflow: hidden;
}

.parallax-deep img {
    will-change: transform;
}

/* Horizontal wipe text reveal */
.text-wipe {
    clip-path: inset(0 100% 0 0);
}

/* Hero parallax layers */
.parallax-layer {
    will-change: transform;
}

/* Pinned section indicator line */
.scrolltell::before {
    content: '';
    position: absolute;
    left: 40px;
    top: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent) 20%, var(--accent) 80%, transparent);
    opacity: 0.15;
}

/* ===== PAGE TRANSITIONS (Barba.js) ===== */
.transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transition-overlay__warp {
    position: absolute;
    inset: 0;
    background: var(--black);
    transform: scaleY(0);
    transform-origin: bottom;
}

.transition-overlay__label {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 56px);
    font-weight: 900;
    letter-spacing: 16px;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0;
    text-shadow: 0 0 40px rgba(224, 16, 32, 0.5);
}

/* Barba transition: hide old container while transitioning */
.barba-leave-active,
.barba-enter-active {
    transition: none;
}

/* ===== GLITCH TEXT EFFECT ===== */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.glitch::before {
    color: inherit;
    animation: glitch-1 4s infinite linear alternate-reverse;
    clip-path: inset(0 0 65% 0);
    text-shadow: -2px 0 rgba(224, 16, 32, 0.7);
}

.glitch::after {
    color: inherit;
    animation: glitch-2 3.5s infinite linear alternate-reverse;
    clip-path: inset(65% 0 0 0);
    text-shadow: 2px 0 rgba(255, 96, 48, 0.7);
}

@keyframes glitch-1 {
    0%, 85% { transform: translate(0); }
    86% { transform: translate(-3px, -1px); }
    88% { transform: translate(2px, 1px); }
    90% { transform: translate(-1px, 2px); }
    92% { transform: translate(3px, -2px); }
    94% { transform: translate(-2px, 1px); }
    96% { transform: translate(1px, -1px); }
    98% { transform: translate(-3px, 2px); }
    100% { transform: translate(0); }
}

@keyframes glitch-2 {
    0%, 80% { transform: translate(0); }
    82% { transform: translate(2px, 1px); }
    84% { transform: translate(-3px, -1px); }
    87% { transform: translate(1px, -2px); }
    90% { transform: translate(-1px, 2px); }
    93% { transform: translate(3px, 1px); }
    96% { transform: translate(-2px, -1px); }
    100% { transform: translate(0); }
}

/* ===== SCAN LINE OVERLAY ===== */
.scan-line {
    position: relative;
    overflow: hidden;
}

.scan-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.25;
    animation: scanSweep 4s linear infinite;
    pointer-events: none;
    z-index: 5;
}

@keyframes scanSweep {
    0% { top: -2px; }
    100% { top: 100%; }
}

/* ===== HUD BORDERS (Sci-Fi Frame) ===== */
.hud-border {
    position: relative;
}

.hud-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
    pointer-events: none;
}

.hud-border::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.2;
    pointer-events: none;
}

/* ===== SHIMMER WAVE ON CARDS ===== */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(224, 16, 32, 0.06),
        transparent
    );
    transform: skewX(-15deg);
    animation: shimmerWave 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes shimmerWave {
    0% { left: -100%; }
    50% { left: 200%; }
    100% { left: 200%; }
}

/* ===== NEON GLOW BUTTON ===== */
.btn--primary {
    position: relative;
    overflow: hidden;
}

.btn--primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

.btn--primary:hover::before {
    left: 100%;
}

.btn--primary:hover {
    box-shadow: 0 0 20px rgba(224, 16, 32, 0.4), 0 0 60px rgba(224, 16, 32, 0.15);
}

/* ===== ENERGY ORBS (floating background accents) ===== */
.energy-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.12;
    pointer-events: none;
    animation: orbFloat 8s ease-in-out infinite;
}

.energy-orb--red {
    background: radial-gradient(circle, var(--accent), transparent 70%);
}

.energy-orb--warm {
    background: radial-gradient(circle, var(--accent-warm), transparent 70%);
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.1); }
}

/* ===== PULSE DOT (status indicator) ===== */
.pulse-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 0.4; box-shadow: 0 0 0 0 rgba(224, 16, 32, 0.4); }
    50% { opacity: 1; box-shadow: 0 0 8px 4px rgba(224, 16, 32, 0.2); }
}

/* ===== DATA STREAM PARTICLES ===== */
.data-stream {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.data-stream__particle {
    position: absolute;
    width: 1px;
    height: 1px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: dataStreamFloat var(--duration, 4s) linear infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes dataStreamFloat {
    0% { opacity: 0; transform: translate(0, 100vh); }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { opacity: 0; transform: translate(40px, -10vh); }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero__marquee-track {
        animation: none;
    }

    .bg-overlay {
        animation: none;
    }

    .glitch::before, .glitch::after { display: none; }
    .scan-line::after { display: none; }
    .shimmer::before { display: none; }
    .energy-orb { display: none; }
    .data-stream { display: none; }
}

/* ===== HAMBURGER MENU (MOBILE) ===== */
.nav__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 48px;
    height: 48px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 2px;
    cursor: pointer;
    padding: 10px;
    z-index: 60;
    position: relative;
}

.nav__burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

/* Burger → X animation */
.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);
}

/* Fullscreen mobile menu overlay */
.nav__mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out);
}

.nav__mobile-menu.open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.nav__mobile-menu a {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 20px 40px;
    transition: color 0.3s, transform 0.3s var(--ease-out);
    position: relative;
}

.nav__mobile-menu a:hover,
.nav__mobile-menu a.active {
    color: var(--text);
    transform: translateX(8px);
}

.nav__mobile-menu a.active::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.nav__mobile-menu .nav__mobile-footer {
    position: absolute;
    bottom: 40px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    section {
        padding: 80px 40px;
    }

    .about__content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .projets-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 30px;
    }
}

@media (max-width: 900px) {
    nav > a {
        display: none;
    }

    .nav__burger {
        display: flex;
    }

    nav a::after {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 60px;
    }

    .preloader__logo {
        font-size: 32px;
        letter-spacing: 8px;
    }

    /* === NAV MOBILE: hamburger === */
    nav {
        flex-wrap: nowrap;
        justify-content: space-between;
        padding: 0 16px;
        height: var(--nav-height);
    }

    nav .nav__logo {
        height: 28px;
        width: auto;
        margin-right: 0;
        object-fit: contain;
    }

    /* Hide desktop links */
    nav > a {
        display: none;
    }

    .nav__burger {
        display: flex;
    }

    nav a::after {
        display: none;
    }

    /* === SECTIONS === */
    section {
        padding: 60px 16px;
    }

    .section__label {
        font-size: 10px;
        letter-spacing: 3px;
    }

    .section__title {
        font-size: clamp(28px, 6vw, 40px);
        letter-spacing: 2px;
        margin-bottom: 28px;
    }

    .section__title .stroke {
        -webkit-text-stroke: 1.5px var(--text);
    }

    /* === HERO === */
    .hero {
        padding: 0 16px;
        padding-top: 20px;
        min-height: 85vh;
    }

    .hero__title {
        letter-spacing: 3px;
        font-size: clamp(32px, 9vw, 64px);
        margin-bottom: 16px;
    }

    .hero__subtitle {
        font-size: 11px;
        letter-spacing: 3px;
        margin-bottom: 32px;
    }

    .hero__cta {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .hero__marquee-item {
        font-size: 11px;
        letter-spacing: 2px;
    }

    /* === ABOUT === */
    .about__text p {
        font-size: 15px;
        line-height: 1.7;
    }

    .about__visual img {
        border-radius: 4px;
    }

    /* === TEAM === */
    .team__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .team__member {
        padding: 24px 16px;
    }

    .team__role {
        font-size: 11px;
    }

    .team__name {
        font-size: 15px;
    }

    /* === GAME CARD === */
    .game-card {
        padding: 24px 16px;
    }

    .game-card__title {
        font-size: 18px;
    }

    .game-card__desc {
        font-size: 14px;
    }

    /* === SOCIALS === */
    .socials__grid {
        flex-direction: column;
        gap: 12px;
    }

    .social-link {
        justify-content: center;
        padding: 14px 20px;
        font-size: 12px;
        min-height: 48px;
    }

    /* === CONTACT === */
    .contact__email {
        font-size: clamp(14px, 4vw, 22px);
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    /* === GALERIE === */
    .projets-header {
        padding: 80px 16px 32px;
    }

    .projets-header h1 {
        font-size: clamp(28px, 8vw, 56px);
        letter-spacing: 4px;
    }

    .projets-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 16px 60px;
    }

    .projet-image {
        height: 200px;
    }

    .projet-info {
        padding: 16px;
    }

    .projet-info h3 {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .projet-description {
        font-size: 13px;
    }

    /* === SERVICES === */
    .services-container {
        padding: 80px 16px 60px;
    }

    .services-container h1 {
        font-size: clamp(24px, 7vw, 40px);
        letter-spacing: 3px;
        margin-bottom: 40px;
    }

    .service-card {
        padding: 24px 16px;
        margin-bottom: 20px;
    }

    .service-card h2 {
        font-size: 18px;
    }

    .service-card > p {
        font-size: 14px;
    }

    .service-card ul li {
        font-size: 13px;
        padding: 8px 0;
    }

    .contact-cta {
        padding: 24px 16px;
    }

    .contact-cta h3 {
        font-size: 18px;
    }

    /* === TUNNEL PORTAL MOBILE: window style === */
    .tunnel-portal {
        min-height: auto;
    }

    .tunnel-pin {
        height: 80vh;
    }

    .tunnel-title {
        font-size: clamp(24px, 6vw, 40px);
        letter-spacing: 3px;
    }

    .tunnel-hint {
        font-size: 10px;
        letter-spacing: 2px;
    }

    .tunnel-door__text {
        font-size: clamp(28px, 8vw, 60px);
        letter-spacing: 4px;
    }

    .tunnel-overlay {
        padding: 24px 16px;
        gap: 16px;
    }

    .scrolltell::before {
        display: none;
    }

    /* === BUTTONS — min tap target 48px === */
    .btn {
        padding: 14px 28px;
        font-size: 11px;
        letter-spacing: 2px;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* === FOOTER === */
    footer {
        padding: 24px 16px;
    }

    footer p {
        font-size: 10px;
    }

    /* === CURSOR hidden on touch === */
    .cursor, .cursor-dot {
        display: none;
    }

    /* === BTN HAUT === */
    #btnHaut {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }

    /* === ENERGY ORBS: smaller on mobile === */
    .energy-orb {
        filter: blur(40px);
        opacity: 0.08;
    }

    /* === GLITCH: disable on hero title (SplitType conflict = double text) === */
    .hero__title.glitch::before,
    .hero__title.glitch::after {
        display: none;
    }

    /* === GLITCH: subtler on other elements === */
    .glitch::before {
        text-shadow: -1px 0 rgba(224, 16, 32, 0.5);
    }
    .glitch::after {
        text-shadow: 1px 0 rgba(255, 96, 48, 0.5);
    }

    /* === TUNNEL DOOR: GPU-accelerated clip === */
    .tunnel-door {
        will-change: clip-path;
    }
}

@media (max-width: 480px) {
    .hero__title {
        font-size: clamp(26px, 10vw, 48px);
        letter-spacing: 2px;
    }

    .hero__subtitle {
        letter-spacing: 2px;
        font-size: 10px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 10px;
        width: 100%;
        text-align: center;
    }

    .projets-grid {
        gap: 16px;
        padding: 0 12px 60px;
    }

    .projet-image {
        height: 180px;
    }

    .tunnel-title {
        font-size: clamp(20px, 7vw, 32px);
    }
}
