/* --- VARS E RESET --- */
:root {
    --ease-quint: cubic-bezier(0.83, 0, 0.17, 1);
    --ease-expo: cubic-bezier(0.87, 0, 0.13, 1);

    /* Dark Theme */
    --background: #080A1A;
    /* Mais escuro, tom azulado */
    --surface: #10142A;
    --card-bg: rgba(20, 26, 60, 0.6);
    /* Fundo dos cards com transparência */
    --border: rgba(60, 80, 140, 0.4);
    --text-primary: #E0E7FF;
    --text-secondary: #A0B3D9;
    --primary: #5D50F8;
    /* Roxo vibrante */
    --primary-light: #8A7FFD;
    --primary-dark: #4A3DBF;
    --accent-glow: 0 0 20px rgba(93, 80, 248, 0.5);
    /* Glow para elementos primários */
    --shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    --hover-translate: -5px;
}

.light-theme {
    /* Light Theme */
    --background: #F0F5FF;
    --surface: #FFFFFF;
    --card-bg: rgba(255, 255, 255, 0.7);
    --border: rgba(180, 200, 230, 0.6);
    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --primary: #4A40D9;
    /* Azul mais profundo */
    --primary-light: #6A5CFD;
    --primary-dark: #3A32A1;
    --accent-glow: 0 0 20px rgba(74, 64, 217, 0.3);
    --shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    overflow-x: hidden;
}

body {
    background-color: var(--background);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.5s var(--ease-quint), color 0.5s var(--ease-quint);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 10%, rgba(93, 80, 248, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(200, 100, 255, 0.08) 0%, transparent 15%);
    background-size: 80% 80%;
    animation: moveParticles 20s infinite alternate linear;
    z-index: -1;
    opacity: 0.8;
}

@keyframes moveParticles {
    0% {
        background-position: 0% 0%, 100% 100%;
    }

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

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

.section {
    padding: 8rem 0;
    border-bottom: 1px solid var(--border);
}

.section:last-of-type {
    border-bottom: none;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-header h2 {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: background-color 0.3s var(--ease-circ), box-shadow 0.3s var(--ease-circ);
}

#main-header.scrolled {
    background-color: color-mix(in srgb, var(--background) 90%, transparent);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 25px var(--shadow);
    border-bottom: 1px solid var(--border);
}

#main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
}

.logo-img {
    height: 100px;
    width: auto;
    display: block;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0;
}

nav {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    transition: color 0.3s var(--ease-quint);
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-light);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--ease-quart);
}

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

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

.theme-switcher {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: background 0.3s var(--ease-quint), border-color 0.3s var(--ease-quint);
}

.theme-switcher:hover {
    background: color-mix(in srgb, var(--surface) 80%, var(--primary));
}

.theme-switcher svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 90px;
}

#hero h1 {
    font-size: clamp(3rem, 7vw, 5.5rem);
    line-height: 1.1;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#hero h1 .highlight {
    color: var(--primary-light);
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--primary-light);
    animation: blink 0.7s infinite;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

#hero p {
    font-size: 1.3rem;
    max-width: 750px;
    margin-top: 2rem;
    color: var(--text-secondary);
}

.button-group {
    margin-top: 3.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cta-button {
    text-decoration: none;
    padding: 1rem 2.5rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s var(--ease-quint);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid transparent;
}

.cta-button.primary {
    background-color: var(--primary);
    color: white;
}

.cta-button.primary:hover {
    background-color: var(--primary-light);
    transform: translateY(var(--hover-translate));
    box-shadow: 0 8px 25px var(--accent-glow);
}

.cta-button.secondary {
    background-color: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
}

.cta-button.secondary:hover {
    background-color: var(--background);
    transform: translateY(var(--hover-translate));
    border-color: var(--primary);
    box-shadow: 0 8px 25px var(--accent-glow);
}

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

.service-card {
    background-color: var(--card-bg);
    padding: 2.5rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    backdrop-filter: blur(8px);
    transition: transform 0.3s var(--ease-quint), box-shadow 0.3s var(--ease-quint);
}

.service-card:hover {
    transform: translateY(var(--hover-translate));
    box-shadow: 0 12px 30px var(--shadow);
}

.service-card .icon {
    color: var(--primary);
    width: 48px;
    height: 48px;
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: color-mix(in srgb, var(--surface) 50%, var(--primary));
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--accent-glow);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s var(--ease-quint), box-shadow 0.3s var(--ease-quint);
}

.project-card:hover {
    transform: translateY(var(--hover-translate)) scale(1.01);
    box-shadow: 0 12px 30px var(--shadow);
}

.project-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

.project-info {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.project-info p {
    color: var(--text-secondary);
    flex-grow: 1;
}

.tags {
    margin-top: 1.2rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.tag {
    background-color: color-mix(in srgb, var(--primary) 20%, transparent);
    color: var(--primary-light);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    backdrop-filter: blur(5px);
    transition: all 0.3s var(--ease-quint);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(93, 80, 248, 0.3);
    background-color: var(--surface);
}

.contact-form button {
    border: none;
    cursor: pointer;
    align-self: center;
    padding: 1.2rem 3rem;
    border-radius: 10px;
}

#form-status {
    padding: 1.2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    text-align: center;
    display: none;
}

#form-status.success {
    background: color-mix(in srgb, var(--primary) 25%, transparent);
    color: var(--primary-light);
    border: 1px solid var(--primary);
}

#form-status.error {
    background: #3d2a3d;
    color: #ff949b;
    border: 1px solid #c74d4d;
}

#main-footer {
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

#main-footer p {
    color: var(--text-secondary);
    font-size: 1rem;
}

#back-to-top {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 55px;
    height: 55px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    box-shadow: 0 5px 15px var(--accent-glow);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s var(--ease-quint);
}

#back-to-top:hover {
    background: var(--primary-light);
    transform: translateY(-8px) scale(1.05);
}

#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

[data-reveal] {
    opacity: 0;
    transition: opacity 1s var(--ease-quint), transform 1s var(--ease-quint);
}

[data-reveal="fade-in-up"] {
    transform: translateY(50px);
}

[data-reveal="fade-in-rotate"] {
    transform: translateY(50px) rotateX(-90deg);
    transform-origin: center bottom;
}

[data-reveal="scale-in"] {
    transform: scale(0.8);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
}

[data-reveal]:nth-child(1) {
    transition-delay: 0.1s;
}

[data-reveal]:nth-child(2) {
    transition-delay: 0.2s;
}

[data-reveal]:nth-child(3) {
    transition-delay: 0.3s;
}

[data-reveal]:nth-child(4) {
    transition-delay: 0.4s;
}

[data-reveal]:nth-child(5) {
    transition-delay: 0.5s;
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 80px;
    }

    #main-header {
        height: 80px;
    }

    nav {
        display: none;
    }

    .section {
        padding: 4rem 0;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .section-header p {
        font-size: 1rem;
    }

    .button-group {
        flex-direction: column;
        align-items: center;
    }

    .cta-button {
        width: 100%;
        max-width: 350px;
        text-align: center;
    }

    .projects-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }

    #back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    #hero h1 {
        font-size: 2.5rem;
    }

    #hero p {
        font-size: 1rem;
    }

    .section-header {
        margin-bottom: 3rem;
    }
}