:root {
    /* Colors - Curated Premium Dark Theme */
    --bg-deep: #050507;
    /* Deeper, richer black */
    --bg-surface: #0f1012;
    --bg-card: rgba(255, 255, 255, 0.02);
    /* More subtle glass */
    --primary: #ffffff;
    --secondary: #5fb5ff;
    --accent: #e0e0e0;
    --text-dim: #8a8a93;
    /* More refined dim text */
    --text-secondary: #c0c0c5;
    --border: rgba(255, 255, 255, 0.06);
    /* Thinner feeling border */
    --glow-subtle: 0 0 20px rgba(95, 181, 255, 0.03);

    /* Typography - Premium System Stack */
    /* Prioritize system-ui for the most native, optimized, and coherent look on every OS */
    --font-display: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-display: swap;

    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-deep);
    /* Premium Background Stack:
       1. Ambient Radial Glow (Top Center) - Primary subtle light
       2. Secondary Glow (Top Right) - Accent touch
       3. Grid Pattern (Vertical)
       4. Grid Pattern (Horizontal)
       5. Base Deep Gradient
    */
    background-image:
        radial-gradient(circle at 50% 0%, rgba(95, 181, 255, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 90% 10%, rgba(95, 181, 255, 0.03) 0%, transparent 40%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(180deg, var(--bg-deep) 0%, #050507 100%);

    background-size:
        100% 100%,
        100% 100%,
        50px 50px,
        50px 50px,
        100% 100%;

    background-attachment: fixed;
    /* Creates premium parallax feel */
    background-position: center top;

    color: var(--accent);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Crisper text on Firefox */
    text-rendering: optimizeLegibility;
    /* Improved kerning */
}

h1,
h2,
h3,
h4,
.font-display {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    /* Modern "tight" heading tracking */
    color: var(--primary);
    font-weight: 700;
}

/* Layout Utilities */
#main-content {
    padding-top: 80px;
    /* Account for fixed header */
    min-height: calc(100vh - 80px);
}

.section-padding {
    padding: 6rem 2rem;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 5rem 1.5rem;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Visual Effects */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    transition: var(--transition-smooth);
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeIn 0.8s var(--transition-smooth) forwards;
}

/* Component: Splash Screen (Previously Inlined) */
nc-splash {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-deep);
    background-image:
        radial-gradient(circle at 50% 0%, rgba(95, 181, 255, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 90% 10%, rgba(95, 181, 255, 0.03) 0%, transparent 40%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(180deg, var(--bg-deep) 0%, #050507 100%);
    background-size: 100% 100%, 100% 100%, 50px 50px, 50px 50px, 100% 100%;
    background-attachment: fixed;
    background-position: center top;
    overflow: hidden;
}

nc-splash.fusion-active .orbit-ring {
    r: 0 !important;
    stroke-width: 4;
    opacity: 0.5;
    transition: all 0.5s cubic-bezier(0.6, 0, 0.4, 1);
}

nc-splash.fusion-active .n-path {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s ease-out;
}

nc-splash.portal-active .svg-container {
    transform: scale(0);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease 0.4s;
}

nc-splash.portal-active {
    opacity: 0;
    transition: opacity 0.8s ease 0.6s;
    pointer-events: none;
}

nc-splash .svg-container {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 0 20px rgba(95, 181, 255, 0.4));
    transform-origin: 25% 25%;
    will-change: transform;
}

nc-splash .n-path {
    stroke: #ffffff;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawPath 1.5s ease-out forwards;
    transform-origin: center;
}

nc-splash .core-dot {
    fill: #5fb5ff;
    animation: pulseCore 3s infinite linear;
    transform-origin: 25px 25px;
}

nc-splash .orbit-ring {
    stroke: #5fb5ff;
    stroke-dasharray: 4 8;
    animation: spin 10s infinite linear;
    transform-origin: 25px 25px;
    transition: r 0.5s ease;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes pulseCore {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Component: Navbar */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
    background: transparent;
    border-bottom: 1px solid transparent;
    /* Estabiliza a borda para evitar flicker */
}

header.scrolled {
    background: rgba(10, 10, 11, 0.95);
    backdrop-filter: blur(10px);
    border-bottom-color: var(--border);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: none;
    border: none;
    text-transform: uppercase;
}

.nav-item:hover {
    color: var(--primary);
}

/* Logo Animations (CSP Compliant) */
@keyframes pulse-flow {
    0% {
        stroke-dashoffset: 400;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        stroke-dashoffset: 0;
        opacity: 0;
    }
}

@keyframes sweep-shine {
    0% {
        transform: translateX(-150%) skewX(-25deg);
    }

    30%,
    100% {
        transform: translateX(250%) skewX(-25deg);
    }
}

.pulse-line {
    stroke-dasharray: 100 300;
    animation: pulse-flow 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    filter: drop-shadow(0 0 8px #fff);
    stroke-width: 8px !important;
    pointer-events: none;
}

.shine-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: sweep-shine 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 5;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.logo-svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 10px rgba(95, 181, 255, 0.3));
    position: relative;
    z-index: 2;
}

/* Logo animations are now handled within the component logic */

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    text-align: left;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: var(--primary);
    text-transform: uppercase;
}

.brand-sub {
    font-size: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.5em;
    color: var(--secondary);
    text-transform: uppercase;
    margin-top: 2px;
}

/* Component: Hero */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
    position: relative;
}

.hero-subtitle {
    color: var(--secondary);
    letter-spacing: 0.4em;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards 0.2s;
    display: block;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 7rem);
    line-height: 1;
    margin-bottom: 2rem;
    font-weight: 900;
    opacity: 0;
    animation: fadeIn 1s ease forwards 0.4s;
}

.hero-desc {
    font-size: 1.1rem;
    max-width: 700px;
    color: var(--text-dim);
    margin-bottom: 3.5rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards 0.6s;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards 0.8s;
}

.hero-actions nc-button {
    width: 280px;
    /* Enforce consistent premium width */
}

/* Ensure inner button takes full width of the custom element wrapper */
.hero-actions .nc-btn {
    width: 100%;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--secondary), transparent);
    opacity: 0.5;
}

/* Component: Services & Portfolio */
.section-title {
    text-align: center;
    margin-bottom: 1rem;
}

.services-grid,
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

/* Services Card Styling */
nc-services .glass-card {
    padding: 0 !important;
    /* Override default padding for full-bleed image */
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-img-container {
    width: 100%;
    height: 220px;
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
}

.service-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover .service-img {
    transform: scale(1.05);
    /* Subtle zoom on hover */
}

.service-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.service-title {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: var(--primary);
}

.service-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Feature List Styling */
.service-features {
    list-style: none;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.service-features li {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
    padding-left: 1.2rem;
    position: relative;
}

.service-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.4rem;
    width: 6px;
    height: 6px;
    background: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--secondary);
}

.service-features li:last-child {
    margin-bottom: 0;
}

.project-image-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-surface);
    margin-bottom: 1.5rem;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-card-wrapper:hover .project-img {
    transform: scale(1.05);
}

/* Component: Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2.5rem;
    transition: var(--transition-smooth);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-8px);
}

/* Component: Contact */
.contact-content {
    max-width: 600px;
    margin: 4rem auto 0;
}

.contact-header {
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: flex-start;
    width: 100%;
    overflow: hidden;
}

.input-group svg {
    position: absolute;
    left: 1rem;
    top: 1.25rem;
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    opacity: 0.5;
    pointer-events: none;
    transition: var(--transition-smooth), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.input-group input {
    padding-left: 2.8rem;
    padding-bottom: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 2px;
    font-family: inherit;
    width: 100%;
    transition: var(--transition-smooth);
}

.input-group textarea {
    padding-left: 2.8rem;
    padding-bottom: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 2px;
    font-family: inherit;
    width: 100%;
    transition: var(--transition-smooth);
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.05);
}

.input-group:focus-within svg {
    color: var(--secondary);
    opacity: 1;
    filter: drop-shadow(0 0 5px var(--secondary));
}

input,
textarea {
    padding: 1rem;
    padding-left: 2.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 2px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    width: 100%;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary);
}

/* Component: Footer */
footer {
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.5);
}

.badges {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.badge {
    position: relative;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    cursor: help;
    opacity: 0.3;
}

.badge:hover {
    opacity: 0.8;
    color: var(--secondary);
    transform: translateY(-1px);
}

.tooltip {
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(10, 10, 11, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 1rem 1.2rem;
    border-radius: 4px;
    color: #fff;
    font-size: 0.75rem;
    width: 220px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border);
}

.badge:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tooltip-title {
    display: block;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.4rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
}

.tooltip-desc {
    line-height: 1.5;
    opacity: 0.8;
}

.badge svg {
    width: 18px;
    height: 18px;
}

.copyright {
    font-size: 0.6rem;
    color: var(--text-dim);
    opacity: 0.2;
    letter-spacing: 0.05rem;
}

/* Component: Button (Global Neon Glass) */
.nc-btn {
    padding: 0.8rem 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    border-radius: 2px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.01);
    /* Ultra subtle glass base */
    backdrop-filter: blur(4px);
}

.nc-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.15),
            transparent);
    transform: skewX(-25deg);
    transition: none;
    pointer-events: none;
}

.nc-btn:hover::after {
    left: 150%;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Primary: Cyan Energy (Matches Logo) */
.nc-btn-primary {
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.05);
}

/* Secondary: White Structure */
.nc-btn-secondary {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.nc-btn:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.05);
}

.nc-btn-primary:hover {
    border-color: #00f0ff;
    color: #00f0ff;
    background: rgba(0, 240, 255, 0.05);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2), inset 0 0 10px rgba(0, 240, 255, 0.05);
}

.nc-btn-secondary:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.nc-btn:active {
    transform: scale(0.98);
    box-shadow: none;
}

/* Component: Login */
.login-wrapper {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-title {
    margin-bottom: 2rem;
    text-align: center;
}

.mt-1 {
    margin-top: 1rem;
}

.w-100 {
    width: 100%;
}

@media (max-width: 768px) {
    header {
        padding: 1.5rem;
    }

    .nav-links {
        display: none;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
}