html { background-color: #13131b; font-size: 125%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { background-color: transparent; cursor: none; overflow-x: hidden; }

.mobile-nav-link {
    text-shadow: 0 0 8px rgba(168, 232, 255, 0.15);
    transition: text-shadow 0.3s ease, color 0.3s ease, letter-spacing 0.4s cubic-bezier(0.23,1,0.32,1);
}
.mobile-nav-link:hover, .mobile-nav-link:active {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(168, 232, 255, 1), 0 0 30px rgba(168, 232, 255, 0.8), 0 0 60px rgba(0, 212, 255, 0.6), 0 0 120px rgba(0, 212, 255, 0.3);
}
.mobile-nav-glow {
    color: #ffffff !important;
    animation: navGlowPulse 1s ease-out forwards;
}
@keyframes navGlowPulse {
    0% { text-shadow: 0 0 10px rgba(168,232,255,0.5); letter-spacing: 0.3em; }
    30% { text-shadow: 0 0 20px rgba(168,232,255,1), 0 0 50px rgba(0,212,255,0.9), 0 0 100px rgba(0,212,255,0.5), 0 0 200px rgba(0,212,255,0.2); letter-spacing: 0.6em; }
    70% { text-shadow: 0 0 15px rgba(168,232,255,1), 0 0 40px rgba(0,212,255,0.7), 0 0 80px rgba(0,212,255,0.4); letter-spacing: 0.5em; }
    100% { text-shadow: 0 0 5px rgba(168,232,255,0.3); letter-spacing: 0.3em; opacity: 0; }
}

.email-glow {
    text-shadow: 0 0 8px rgba(168, 232, 255, 0.1);
    transition: text-shadow 0.4s ease, color 0.4s ease;
}
.email-glow:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(168, 232, 255, 1), 0 0 30px rgba(168, 232, 255, 0.8), 0 0 60px rgba(0, 212, 255, 0.6), 0 0 120px rgba(0, 212, 255, 0.3);
}

.falling-pattern {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
}

.custom-cursor {
    width: 8px; height: 8px; background: #a8e8ff; border-radius: 50%;
    position: fixed; pointer-events: none; z-index: 10000; transform: translate(-50%, -50%);
    transition: width 0.3s cubic-bezier(0.23,1,0.32,1), height 0.3s cubic-bezier(0.23,1,0.32,1), background 0.3s ease;
}
.custom-cursor.cursor-hover { width: 48px; height: 48px; background: rgba(0,212,255,0.15); mix-blend-mode: difference; }
.custom-cursor-ring {
    width: 40px; height: 40px; border: 1px solid rgba(168,232,255,0.3); border-radius: 50%;
    position: fixed; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%);
    transition: width 0.4s cubic-bezier(0.23,1,0.32,1), height 0.4s cubic-bezier(0.23,1,0.32,1), opacity 0.3s ease;
}
.custom-cursor-ring.cursor-hover { width: 60px; height: 60px; opacity: 0; }

.services-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .services-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }
.service-card { opacity: 0; transform: translateY(40px); }
.service-card-desc-char { opacity: 0; }

.line-inner { display: inline-block; will-change: transform; }
.text-reveal-line { overflow: hidden; }
.glitch-hover:hover { text-shadow: 2px 0 #00d4ff, -2px 0 #ff00c1; }

.hero-line-deco {
    width: 0; height: 1px; background: linear-gradient(90deg, #00d4ff, transparent);
    margin-top: 1.5rem; will-change: width;
}
.hero-label-char { display: inline-block; opacity: 0; will-change: transform, opacity; }
.hero-stat { opacity: 0; transform: translateY(30px); }

.hero-content, .hero-scroll-cta, #navbar, #side-nav { visibility: hidden; }
.hero-floating-tag {
    position: absolute; font-family: 'Space Grotesk', sans-serif;
    font-size: 0.625rem; letter-spacing: 0.3em; text-transform: uppercase;
    color: rgba(168,232,255,0.5); pointer-events: none; opacity: 0;
}

.nav-bar { transition: transform 0.5s cubic-bezier(0.23,1,0.32,1), opacity 0.4s ease, border-radius 0.3s ease; }
.nav-bar.nav-hidden { transform: translate(-50%, -120%); opacity: 0; }
.nav-bar.nav-open { border-radius: 0.75rem; }

.nav-tab {
    position: relative; z-index: 2; padding: 0.35rem 0.85rem;
    color: #bbc9cf; transition: color 0.3s ease; white-space: nowrap;
}
.nav-tab:hover, .nav-tab.active { color: #a8e8ff; }
.nav-hover-bg {
    position: absolute; z-index: 1; border-radius: 6px;
    background: rgba(168, 232, 255, 0.08);
    pointer-events: none; opacity: 0;
    transition: opacity 0.2s ease;
}
.nav-active-line {
    position: absolute; bottom: 0; z-index: 2; height: 2px;
    background: #a8e8ff; pointer-events: none;
    transition: opacity 0.2s ease;
}
.nav-hover-line {
    position: absolute; bottom: 0; z-index: 2; height: 2px;
    background: #a8e8ff; pointer-events: none; opacity: 0;
    transition: opacity 0.2s ease;
}

.signup-glow {
    position: absolute; inset: -8px; border-radius: 9999px;
    background: rgba(168,232,255,0.25); filter: blur(16px);
    pointer-events: none; transition: all 0.3s ease;
}
.signup-btn:hover .signup-glow { opacity: 0.5; filter: blur(20px); inset: -12px; }

.mobile-menu {
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.23,1,0.32,1);
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }

.magnetic-btn { transition: transform 0.3s cubic-bezier(0.23,1,0.32,1); }

.parallax-img-wrap { overflow: hidden; position: relative; }
.project-img-inner { will-change: transform, filter; }
.group:hover .project-img-inner { filter: brightness(1.15) contrast(1.05); }
.group .project-img-inner { transition: filter 0.8s cubic-bezier(0.23,1,0.32,1), opacity 0.8s ease; }
.group:hover .project-img-inner { opacity: 1 !important; }

#matrix-rain { border-radius: 0.5rem; }
#about-text-wrap { min-height: 4em; }
.about-char { display: inline; color: transparent; }
.about-char.revealed { color: inherit; }

.scroll-progress {
    position: fixed; top: 0; left: 0; height: 2px; background: #00d4ff;
    z-index: 99999; transform-origin: left; transform: scaleX(0); width: 100%;
}

.loading-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #13131b; z-index: 99999;
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1.5rem;
}
.loading-bar { width: 120px; height: 2px; background: rgba(168,232,255,0.1); border-radius: 2px; overflow: hidden; }
.loading-bar-fill { width: 0%; height: 100%; background: #00d4ff; border-radius: 2px; }
.loading-text { font-family:'Space Grotesk',sans-serif; font-size:0.625rem; letter-spacing:0.4em; text-transform:uppercase; color:#a8e8ff; }

.loop-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #13131b; z-index: 99998; pointer-events: none; opacity: 0;
}

.project-number {
    font-family: 'Space Grotesk', sans-serif; font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 700; color: rgba(0,212,255,0.04); position: absolute;
    top: -2rem; left: -1rem; line-height: 1; pointer-events: none; z-index: 0;
}

.counter-val { display: inline-block; }
.tag-item { opacity: 0; transform: translateY(20px) scale(0.9); }

.side-dot { height: 20px; background: rgba(255,255,255,0.1); }
.side-dot.active { height: 40px; background: #00d4ff; }

.pin-spacer { background: transparent !important; }

.matrix-text { display: inline-block; min-height: 1.2em; }
.matrix-char { display: inline-block; color: #a8e8ff; transition: color 0.3s ease; }
.matrix-char.resolved { color: #e4e1ed; }

/* Touch devices — hide custom cursor */
@media (hover: none) and (pointer: coarse), (max-width: 767px) {
    body { cursor: auto; }
    .custom-cursor, .custom-cursor-ring { display: none !important; }
}

/* ============================================================
   A11Y — Focus ring for keyboard navigation (overrides cursor:none)
   ============================================================ */
:focus-visible {
    outline: 2px solid #a8e8ff;
    outline-offset: 2px;
    border-radius: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   Reduced motion — respect user preference
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   Shared — sub-page body (portfolio, contact, legal)
   These pages don't load cursor.js, so we restore the native cursor.
   ============================================================ */
.subpage-bg { background: #13131b; cursor: auto; }
.subpage-bg a,
.subpage-bg button,
.subpage-bg .project-card,
.subpage-bg .filter-btn { cursor: pointer; }
.subpage-bg .project-card { cursor: zoom-in; }
.subpage-bg .form-input,
.subpage-bg .form-textarea,
.subpage-bg .form-select { cursor: text; }
.subpage-bg .form-select { cursor: pointer; }

/* ============================================================
   Shared — back link hover (used on portfolio/contact/legal)
   ============================================================ */
.back-link:hover .back-arrow { transform: translateX(-4px); }
.back-arrow { transition: transform 0.3s ease; }

/* Shared — pt-reveal animations (portfolio + contact) */
.pt-reveal { opacity: 0; transform: translateY(30px); }

/* ============================================================
   Portfolio page — project cards + filters + lightbox
   ============================================================ */
.project-card {
    cursor: zoom-in;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
}
.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.1);
}
.project-card:hover .project-overlay { opacity: 1; }
.project-card:hover img { transform: scale(1.05); }
.project-card img { transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.project-overlay { opacity: 0; transition: opacity 0.4s ease; }

.filter-btn { transition: all 0.3s ease; }
.filter-btn.active {
    background: rgba(168, 232, 255, 0.15);
    border-color: rgba(168, 232, 255, 0.5);
    color: #a8e8ff;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(13, 13, 22, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}
.lightbox.active { opacity: 1; pointer-events: auto; }
.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.active img { transform: scale(1); }
.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(19, 19, 27, 0.7);
    color: #bbc9cf;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.lightbox-close:hover {
    border-color: rgba(168, 232, 255, 0.5);
    color: #a8e8ff;
}

/* ============================================================
   Contact page — form controls
   ============================================================ */
.form-input,
.form-textarea,
.form-select {
    background: rgba(31, 31, 39, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: #e4e1ed;
    padding: 14px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease;
    outline: none;
}
.form-input::placeholder,
.form-textarea::placeholder { color: rgba(187, 201, 207, 0.4); }
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: rgba(168, 232, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.08);
}
.form-textarea { min-height: 160px; resize: vertical; }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23859398' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}
.form-select option { background: #1f1f27; color: #e4e1ed; }

/* Honeypot — invisible to humans, visible to bots */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.submit-btn {
    background: linear-gradient(135deg, #a8e8ff, #00d4ff);
    color: #13131b;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 14px 40px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.submit-btn:hover {
    background: linear-gradient(135deg, #c0f0ff, #3cd7ff);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
}
.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.contact-info-card {
    background: rgba(31, 31, 39, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}
.contact-info-card:hover { border-color: rgba(168, 232, 255, 0.2); }

#form-status { transition: all 0.4s ease; }

/* ============================================================
   Mentions légales — typography sections
   ============================================================ */
.legal-section { margin-bottom: 2.5rem; }
.legal-section h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #e4e1ed;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.legal-section p,
.legal-section li {
    font-size: 0.875rem;
    color: rgba(187, 201, 207, 0.7);
    line-height: 1.8;
}
.legal-section strong { color: #bbc9cf; }
