/* 
  The Cyber Nexus - Design System
  RSousa Tech
*/

:root {
    /* Colors */
    --surface-abyss: #03060C;
    /* Azul extremamente escuro */
    --surface-dim: #0A0F1A;
    --surface-container-low: #0F172A;
    --surface-container: #1E293B;
    --surface-container-high: #334155;
    --surface-container-highest: #475569;

    --cyber-primary: #00F0FF;
    /* Ciano Fluorescente */
    --cyber-secondary: #0047FF;
    /* Azul Elétrico Profundo */
    --cyber-gradient: linear-gradient(135deg, var(--cyber-primary), var(--cyber-secondary));

    --text-primary: #E2E8F0;
    --text-muted: #64748B;

    /* Typograpy */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing & Sizes */
    --gap-sm: 1rem;
    --gap-md: 2rem;
    --gap-lg: 4rem;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

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

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

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

/* Film Grain Noise */
.bg-noise {
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    width: 200%;
    height: 200vh;
    background: transparent url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
    animation: noise 0.2s infinite alternate;
}

@keyframes noise {
    0% {
        transform: translate(0, 0)
    }

    10% {
        transform: translate(-5%, -5%)
    }

    20% {
        transform: translate(-10%, 5%)
    }

    30% {
        transform: translate(5%, -10%)
    }

    40% {
        transform: translate(-5%, 15%)
    }

    50% {
        transform: translate(-10%, 5%)
    }

    60% {
        transform: translate(15%, 0)
    }

    70% {
        transform: translate(0, 15%)
    }

    80% {
        transform: translate(3%, 35%)
    }

    90% {
        transform: translate(-10%, 10%)
    }

    100% {
        transform: translate(0, 0)
    }
}

h1,
h2,
h3,
h4,
.font-heading {
    font-family: var(--font-heading);
    color: #FFFFFF;
    letter-spacing: -0.04em;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Utilities */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--cyber-gradient);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0);
}

.btn-primary:hover {
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
    transform: translateY(-2px);
}

/* Animations */
.animate-letters {
    display: inline-block;
}

.cyber-gradient-text {
    background: var(--cyber-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Split Text Style (Champions4Good) */
.split-line {
    display: block;
    overflow: hidden;
    line-height: 1.2;
    /* Aumentado para não cortar skews */
    margin-bottom: -0.1em;
    padding-bottom: 0.1em;
    /* Buffer para descendentes */
}

.split-char {
    display: inline-block;
    will-change: transform, opacity;
}

/* Gradiente resiliente aplicado aos caracteres individuais */
.cyber-gradient-text .split-char {
    background: var(--cyber-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
}

/* Utilitário para o JS não piscar antes da animação */
.animate-letters {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.animate-letters.splitting-done {
    opacity: 1;
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    z-index: -2;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.75);
    /* Darken video */
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.6) 0%, rgba(5, 5, 5, 0.95) 100%);
    z-index: -1;
}

.hero-content {
    z-index: 1;
    padding: 2rem;
    /* Transformation updated by JS for Parallax */
    will-change: transform, opacity;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 8rem);
    line-height: 1;
    margin-bottom: 1rem;
    text-shadow: 0 0 40px rgba(0, 240, 255, 0.2);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-inline: auto;
}

/* Manifesto */
.manifesto {
    padding: 8rem 0;
    background-color: var(--surface-dim);
}

.manifesto .container {
    max-width: 900px;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: var(--cyber-primary);
}

.manifesto-text {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    line-height: 1.5;
    color: var(--text-primary);
}

/* Asymmetrical Vertical Projects Framework in Tailwind handles width */
/* We keep custom image hover zooms via GSAP or Tailwind */
.project-card-lml {
    cursor: pointer;
    overflow: hidden;
    position: relative;
    border-radius: var(--radius-sm);
}

.project-card-lml img {
    transition: transform 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.project-card-lml:hover img {
    transform: scale(1.05);
    /* Mais suave */
}

/* Services */
.services {
    padding: 8rem 2rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--surface-container-low);
    padding: 3rem;
    border-radius: var(--radius-md);
    border-top: 1px solid var(--surface-container-high);
    transition: background-color 0.3s ease;
}

.service-card:hover {
    background-color: var(--surface-container);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--fire-secondary);
}

/* Footer */
.footer {
    padding: 6rem 2rem 2rem;
    border-top: 1px solid var(--surface-container-low);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.contact-email {
    font-size: clamp(2rem, 5vw, 4rem);
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
}

.contact-email::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 4px;
    background: var(--fire-gradient);
    transition: width 0.3s ease;
}

.contact-email:hover::after {
    width: 100%;
}

.social-links {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.social-links a {
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.social-links a:hover {
    color: var(--fire-primary);
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--surface-container-high);
    padding-top: 2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(10px);
}

.modal.show {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--surface-dim);
    margin: 5% auto;
    padding: 4rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 1000px;
    position: relative;
    box-shadow: 0 0 50px rgba(255, 69, 0, 0.1);
}

.btn-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.btn-close:hover {
    color: var(--fire-primary);
}

/* Responsive Tweaks */
@media (max-width: 768px) {
    .project-card {
        width: 90vw;
    }

    .modal-content {
        padding: 2rem;
        margin: 10% auto;
    }
}

/* Custom Cursor & Electric Trail */
#custom-cursor,
#cursor-canvas {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    display: none;
    /* Escondido por padrão, ativado via Media Query */
}

#custom-cursor {
    width: 10px;
    height: 10px;
    background-color: var(--cyber-primary);
    border-radius: 50%;
    z-index: 9999;
    /* No topo de tudo */
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px var(--cyber-primary), 0 0 30px var(--cyber-primary);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
}

#cursor-canvas {
    width: 100%;
    height: 100%;
    z-index: 9991;
    /* Abaixo do cursor e do menu */
}

/* Fix para garantir que o menu lateral fique acima do rastro */
nav.fixed {
    z-index: 9995 !important;
}

main {
    padding: 0 !important;
}

@media (min-width: 1025px) {

    body,
    a,
    button,
    [role="button"],
    .interactive {
        cursor: none !important;
    }

    #custom-cursor,
    #cursor-canvas {
        display: block;
    }

    #custom-cursor.expanded {
        width: 40px;
        height: 40px;
        background-color: transparent;
        border: 2px solid var(--cyber-primary);
        mix-blend-mode: normal;
        box-shadow: 0 0 20px var(--cyber-primary);
    }
}