:root {
    --pt-red: #E32636;
    --pt-green: #007A33;
    --pt-yellow: #F1C400;
    
    /* Default theme colors */
    --bg-base: #B21B12;
    --bg-grad-1: #E32636;
    --bg-grad-2: #B21B12;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.85);
    --glow-1: var(--pt-green);
    --glow-2: var(--pt-yellow);
    --nav-bg: rgba(255, 255, 255, 0.1);
    --nav-border: rgba(255, 255, 255, 0.2);
    --wa-green: #25D366;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    transition: background-color 1s ease, color 1s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: linear-gradient(135deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 100%);
    z-index: -2;
    transition: opacity 1s ease;
}

::selection {
    background: var(--pt-green);
    color: white;
}

/* ------------------------ */
/* DYNAMIC THEMES */
/* ------------------------ */

body.theme-portugal {
    --bg-base: #B21B12;
    --bg-grad-1: #E32636;
    --bg-grad-2: #B21B12;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.85);
    --glow-1: var(--pt-green);
    --glow-2: var(--pt-yellow);
}

body.theme-neutral {
    --bg-base: #f5f5f7;
    --bg-grad-1: #ffffff;
    --bg-grad-2: #e0e0e0;
    --text-main: #1d1d1f;
    --text-muted: #515154;
    --glow-1: rgba(218, 41, 28, 0.1);
    --glow-2: rgba(4, 106, 56, 0.1);
}

body.theme-portugal-dark {
    --bg-base: #0f0f0f;
    --bg-grad-1: #1a0606;
    --bg-grad-2: #0f0f0f;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --glow-1: rgba(218, 41, 28, 0.3);
    --glow-2: rgba(4, 106, 56, 0.2);
}

/* ------------------------ */
/* AMBIENT GLOWS */
/* ------------------------ */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
    transition: background-color 1s ease;
}

.glow-1 {
    width: 40vw; height: 40vw;
    background-color: var(--glow-1);
    top: -10vw; left: -10vw;
    animation: float 10s ease-in-out infinite alternate;
}

.glow-2 {
    width: 30vw; height: 30vw;
    background-color: var(--glow-2);
    bottom: -10vw; right: -10vw;
    opacity: 0.4;
    animation: float 12s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 30px) scale(1.1); }
}

/* ------------------------ */
/* PRELOADER */
/* ------------------------ */
#preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background-color: var(--pt-red);
    background-image: linear-gradient(135deg, var(--pt-red) 0%, #B21B12 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s, transform 0.8s cubic-bezier(0.86, 0, 0.07, 1);
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    pointer-events: none;
}

.main-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(4rem, 15vw, 10rem);
    line-height: 0.9;
    letter-spacing: -0.02em;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 0 10px 30px rgba(0,0,0,0.15);
    text-align: center;
    color: #ffffff;
}

.greeting-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    min-height: 1.1em;
    overflow: hidden;
}

.greeting-text {
    transition: transform 0.8s cubic-bezier(0.86, 0, 0.07, 1), opacity 0.8s ease;
    white-space: nowrap;
}

.greeting-text.current { position: relative; transform: translateY(0); opacity: 1; }
.greeting-text.out { position: absolute; transform: translateY(-100%); opacity: 0; }
.greeting-text.in { position: absolute; transform: translateY(100%); opacity: 0; }

.main-title .italic {
    font-style: italic;
    font-weight: 400;
    display: block;
    margin-top: -0.1em;
}

/* ------------------------ */
/* NEW PILL NAVBAR */
/* ------------------------ */
.pill-nav-container {
    position: fixed;
    top: 2rem;
    left: 0; right: 0;
    margin: 0 auto;
    z-index: 1000;
    width: max-content;
    max-width: 90%;
}

.pill-nav-header {
    background: var(--pt-red);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    gap: 3rem;
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
}

.pill-nav-dropdown {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--pt-green);
    border-radius: 50px;
    z-index: 1;
    transform: translateY(8px);
    height: 100%;
    transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-radius 0.4s ease, transform 0.4s ease;
    overflow: hidden;
}

.nav-brand {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-links-desktop {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links-desktop a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.nav-links-desktop a:hover {
    opacity: 0.7;
}

.nav-links-mobile {
    display: none;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    border-radius: 5px;
}

/* ------------------------ */
/* SECTIONS & TYPOGRAPHY */
/* ------------------------ */
.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8rem 2rem 4rem;
    position: relative;
}

.section-content {
    max-width: 800px;
    width: 100%;
}

.hero-container, .about-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    max-width: 1100px;
    width: 100%;
}

.hero-text {
    flex: 1;
    text-align: left;
}

.about-text-wrapper {
    flex: 1;
    text-align: left;
}

.hero-image-wrapper, .about-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-image, .about-image {
    max-width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    filter: drop-shadow(0 25px 45px rgba(0,0,0,0.4));
    transition: transform 0.5s ease;
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.hero-image:hover, .about-image:hover {
    transform: scale(1.02) translateY(-10px);
}

.subtitle {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 6vw, 5.5rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.section-title .italic {
    font-style: italic;
    font-weight: 400;
}

.section-text {
    font-size: clamp(1.1rem, 1.8vw, 1.3rem);
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 650px;
}

.profile-text p {
    margin-bottom: 1.5rem;
}

#skills .section-title, #skills .section-text,
#parcerias .section-title, #parcerias .section-text,
#parcerias {
    text-align: center;
    margin-inline: auto;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--text-main);
    color: var(--bg-base);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 1s ease, color 1s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.highlight {
    font-weight: 600;
    color: var(--text-main);
}

body.theme-neutral .highlight {
    color: var(--pt-red);
}

/* ------------------------ */
/* SERVICES GRID */
/* ------------------------ */
.services-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 3rem;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
}

body.theme-portugal-dark .service-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.featured-service {
    background: linear-gradient(135deg, var(--pt-red), #B21B12);
    color: white;
}

.featured-service .service-title {
    color: white;
}

.featured-service .service-desc {
    color: rgba(255,255,255,0.9);
}

.featured-badge {
    position: absolute;
    top: -15px;
    right: 30px;
    background: var(--pt-yellow);
    color: #111;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(241, 196, 0, 0.4);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.service-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #111;
}

.service-desc {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
}

.service-card-group {
    display: flex;
    gap: 2rem;
}

.service-card-group .service-card {
    flex: 1;
}

@media (max-width: 900px) {
    .service-card-group {
        flex-direction: column;
        gap: 2rem;
    }
    .service-card {
        padding: 2rem;
    }
}

/* ------------------------ */
/* TOOLS GRID */
/* ------------------------ */
.tools-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    min-width: 140px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.tool-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    border-color: var(--text-main);
}

.tool-icon, .tool-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.filter-white {
    filter: brightness(0) invert(1);
}

.tool-card span {
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

/* ------------------------ */
/* BRANDS MARQUEE */
/* ------------------------ */
.brands-marquee-container {
    width: 100vw;
    max-width: 100%;
    margin-bottom: 4rem;
}

.marquee-wrapper {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    padding: 2rem 0;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

.marquee-track {
    display: inline-flex;
    gap: 6rem;
    align-items: center;
    animation: marquee-scroll 25s linear infinite;
    padding-left: 6rem;
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); } 
}

.brand-logo {
    height: 45px;
    object-fit: contain;
    opacity: 0.75;
    transition: opacity 0.3s ease;
}

.brand-logo:hover {
    opacity: 1;
}

/* ------------------------ */
/* SOCIAL BUTTONS */
/* ------------------------ */
.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 2rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.social-btn .icon {
    width: 20px;
    height: 20px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-btn:hover {
    background: var(--text-main);
    color: var(--bg-base);
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.social-btn:hover .icon {
    transform: scale(1.15);
}

/* ------------------------ */
/* FLOATING WHATSAPP */
/* ------------------------ */
.floating-whatsapp {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 65px;
    height: 65px;
    background-color: var(--wa-green);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse-wa 2s infinite;
}

.floating-whatsapp svg {
    width: 35px;
    height: 35px;
}

.floating-whatsapp:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
    animation: none;
}

@keyframes pulse-wa {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.footer {
    position: relative;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
}

.loop-link {
    color: var(--text-main);
    text-decoration: underline;
    font-weight: bold;
}

/* ------------------------ */
/* ANIMATIONS (FADE UP) */
/* ------------------------ */
.fade-up-element {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ------------------------ */
/* RESPONSIVE */
/* ------------------------ */
@media (max-width: 900px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }
    
    .about-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 4rem;
    }

    .hero-text, .about-text-wrapper {
        text-align: center;
    }
    
    .hero-image, .about-image {
        max-height: 400px;
    }

    .pill-nav-container {
        width: 85%;
        max-width: 400px;
    }

    .pill-nav-header {
        padding: 1rem 1.5rem;
        gap: 0;
    }

    .nav-links-desktop {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .nav-links-mobile {
        display: flex;
        flex-direction: column;
        padding: 4rem 1.5rem 2rem 1.5rem;
        gap: 1.5rem;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .nav-links-mobile a {
        color: #ffffff;
        text-decoration: none;
        font-weight: 600;
        font-size: 1.1rem;
        text-align: center;
        display: block;
    }

    .pill-nav-container.active .pill-nav-dropdown {
        height: 350px;
        border-radius: 25px;
        transform: translateY(0);
    }

    .pill-nav-container.active .nav-links-mobile {
        opacity: 1;
        transition-delay: 0.2s;
    }

    .pill-nav-container.active .hamburger .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .pill-nav-container.active .hamburger .bar:nth-child(2) {
        opacity: 0;
    }
    .pill-nav-container.active .hamburger .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .tools-grid {
        gap: 1rem;
    }
    
    .tool-card {
        min-width: 100px;
        padding: 1rem;
    }
    
    .tool-icon, .tool-img {
        width: 40px;
        height: 40px;
    }
    
    .brand-logo {
        height: 35px;
    }

    .floating-whatsapp {
        bottom: 2rem;
        right: 1.5rem;
        width: 55px;
        height: 55px;
    }
    
    .floating-whatsapp svg {
        width: 30px;
        height: 30px;
    }
}
