/* 
    CORE DESIGN SYSTEM & GLOBAL STYLES
    Project: Liquid Glass Portfolio
    Author: Davi do Site / Gemini
*/

:root {
    --primary-blue: #007bff;
    --primary-cyan: #22d3ee;
    --bg-dark: #050a14;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.15);
}

body {
    font-family: 'Inter', 'Open Sans', 'Prompt', sans-serif;
    background-color: var(--bg-dark);
    color: #ffffff;
    overflow-x: hidden;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

body::-webkit-scrollbar {
    display: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-heading {
    font-family: 'Montserrat', 'Prompt', sans-serif;
}

/* Ambient Liquid Blobs */
.liquid-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    z-index: -1;
    animation: float 10s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

/* Glass Panel Architecture */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-top: 1px solid var(--glass-border);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 123, 255, 0.15);
}

/* Flashlight Reveal Effect */
.flashlight-card::before {
    content: "";
    position: absolute;
    inset: 0px;
    background: radial-gradient(600px circle at var(--mouse-x, 1000px) var(--mouse-y, 1000px),
            rgba(255, 255, 255, 0.08),
            transparent 40%);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 2;
}

.flashlight-card:hover::before {
    opacity: 1;
}

/* Entrance Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.split-line {
    overflow: hidden;
    display: block;
}

.split-line>span {
    display: block;
    transform: translateY(100%);
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

body.loaded .split-line>span {
    transform: translateY(0);
}

/* Advanced Accent Fix for Hero Title */
#hero-title .split-line {
    overflow: visible;
    clip-path: inset(-0.55em 0 0 0);
}

/* Hero Shimmer Animations */
@keyframes hero-text-shimmer {
    0% {
        background-position: 220% center;
    }

    22% {
        background-position: -220% center;
    }

    100% {
        background-position: -220% center;
    }
}

@keyframes hero-text-shimmer-2 {
    0% {
        background-position: 220% 0, 0 0;
    }

    22% {
        background-position: -220% 0, 0 0;
    }

    100% {
        background-position: -220% 0, 0 0;
    }
}

#hero-title .split-line:first-child>span {
    color: transparent;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.82) 0%,
            rgba(255, 255, 255, 0.82) 28%,
            rgba(255, 255, 255, 0.95) 38%,
            rgba(255, 255, 255, 1.0) 50%,
            rgba(255, 255, 255, 0.95) 62%,
            rgba(255, 255, 255, 0.82) 72%,
            rgba(255, 255, 255, 0.82) 100%);
    background-size: 250% auto;
    -webkit-background-clip: text;
    background-clip: text;
    animation: hero-text-shimmer 7s ease-in-out infinite;
    animation-delay: 2.5s;
    display: block;
}

#hero-title .split-line:last-child>span {
    background-image:
        linear-gradient(90deg,
            rgba(255, 255, 255, 0.0) 0%,
            rgba(255, 255, 255, 0.0) 25%,
            rgba(255, 255, 255, 0.13) 40%,
            rgba(255, 255, 255, 0.18) 50%,
            rgba(255, 255, 255, 0.13) 60%,
            rgba(255, 255, 255, 0.0) 75%,
            rgba(255, 255, 255, 0.0) 100%),
        linear-gradient(to bottom, #ffffff, #ffffff, rgba(255, 255, 255, 0.2));
    background-size: 250% 100%, 100% 100%;
    background-position: 220% 0, 0 0;
    animation: hero-text-shimmer-2 7s ease-in-out infinite;
    animation-delay: 2.5s;
}

/* Service Card Refinement */
.service-card.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1.8px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 15px 45px 0 rgba(0, 0, 0, 0.4);
}

/* Service card content blur for non-active states 
   Optimized to prevent "color mixing" by blurring only 
   the internal content container, keeping the borders sharp. */
.service-card.is-dimmed .service-card-content {
    filter: blur(8px);
    opacity: 0.7;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.service-card:not(.is-dimmed) .service-card-content {
    filter: blur(0);
    opacity: 1;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Button & Border Beams */
.btn-beam-container {
    position: relative;
    overflow: hidden;
    display: inline-flex;
}

.beam-border {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(255, 255, 255, 0.5) 60deg, transparent 120deg);
    animation: rotate-beam 2s linear infinite;
    transition: opacity 0.3s;
}

.btn-beam-container:hover .beam-border {
    opacity: 1;
}

@keyframes rotate-beam {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Shimmer Sweep Effects */
@keyframes shimmer-sweep {
    0% {
        left: -100%;
        opacity: 1;
    }

    14% {
        left: 100%;
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

.shimmer-auto {
    position: relative;
    overflow: hidden;
}

.shimmer-auto::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.07), transparent);
    pointer-events: none;
    z-index: 20;
    animation: shimmer-sweep 6s ease-in-out infinite;
}

.shimmer-auto:nth-child(1)::after {
    animation-delay: 0s;
}

.shimmer-auto:nth-child(2)::after {
    animation-delay: 1.5s;
}

.shimmer-auto:nth-child(3)::after {
    animation-delay: 3s;
}

.shimmer-auto:nth-child(4)::after {
    animation-delay: 4.5s;
}

/* Navbar Active State */
.nav-link.active {
    color: var(--primary-blue) !important;
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-cyan));
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.6);
}

/* Performance & Rendering Hints */
.reveal,
.split-line>span,
.liquid-blob,
.project-card,
.service-card,
.parallax-element {
    will-change: transform, opacity;
}

#services,
#projects,
#testimonials {
    content-visibility: auto;
    contain-intrinsic-size: 1px 800px;
}

/* Floating Particles */
@keyframes glass-float-1 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(40px, -60px) rotate(45deg);
    }

    66% {
        transform: translate(-20px, -40px) rotate(90deg);
    }
}

@keyframes glass-float-2 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(-50px, -30px) rotate(-45deg);
    }

    66% {
        transform: translate(-30px, 50px) rotate(-90deg);
    }
}

@keyframes glass-float-3 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(60px, 20px) rotate(90deg);
    }

    66% {
        transform: translate(20px, 70px) rotate(180deg);
    }
}

@keyframes glass-float-4 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(-40px, 40px) rotate(45deg);
    }

    66% {
        transform: translate(40px, 60px) rotate(90deg);
    }
}

.animate-glass-float-1 {
    animation: glass-float-1 12s infinite ease-in-out;
}

.animate-glass-float-2 {
    animation: glass-float-2 15s infinite ease-in-out reverse;
}

.animate-glass-float-3 {
    animation: glass-float-3 10s infinite ease-in-out;
}

.animate-glass-float-4 {
    animation: glass-float-4 14s infinite ease-in-out reverse;
}

/* Mobile Menu Interaction */
#mobile-menu.open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Hamburger to X Animation */
#mobile-menu-btn .active-span-1 {
    transform: translateY(8px) rotate(45deg);
}

#mobile-menu-btn .active-span-2 {
    opacity: 0;
}

#mobile-menu-btn .active-span-3 {
    transform: translateY(-8px) rotate(-45deg);
    width: 20px !important;
}

/* We need to update main.js to also toggle these classes or 
   better yet, just use CSS selectors based on .open */
#mobile-menu-btn.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
#mobile-menu-btn.open span:nth-child(2) {
    opacity: 0;
}
#mobile-menu-btn.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    width: 20px !important;
}