:root {
    --bg-body: #f4f7f6;
    --bg-card: #ffffff;
    --text-main: #2d3436;
    --text-sub: #636e72;
    --primary: #0984e3;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --footer-bg: #dfe6e9;
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --primary: #38bdf8;
    --nav-bg: rgba(15, 23, 42, 0.9);
    --footer-bg: #020617;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', system-ui, sans-serif;
    transition: background 0.4s ease, color 0.4s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Título Responsivo Magnífico */
h1 {
    font-size: clamp(2rem, 8vw, 4.5rem); /* Ajusta entre 2rem e 4.5rem */
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

/* Navbar Responsiva */
nav {
    position: sticky; top: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.nav-links { display: flex; gap: 20px; list-style: none; }
.nav-links a { 
    text-decoration: none; 
    color: var(--text-main); 
    font-weight: 500;
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--primary); }

/* Conteúdo Principal */
main { flex: 1; padding: 80px 5%; max-width: 1200px; margin: 0 auto; width: 100%; }

/* Rodapé */
footer {
    background: var(--footer-bg);
    padding: 3rem 5%;
    text-align: center;
    margin-top: 50px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* Botões */
.theme-controls { display: flex; gap: 8px; }
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}
.btn:active { transform: scale(0.95); }
.btn-primary { background: var(--primary); color: white; }

/* Definição da animação de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Classe que aplicará a animação */
.reveal {
    opacity: 0; /* Começa invisível */
}

.reveal.active {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Delay para os cards aparecerem um após o outro */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.3s; }
.card:nth-child(3) { animation-delay: 0.5s; }

/* Estilo do Botão Hambúrguer (Escondido por padrão) */
.mobile-menu-icon {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-icon span {
    width: 25px;
    height: 3px;
    background-color: var(--text-main);
    transition: 0.3s;
}

/* Media Query para Telemóveis */
@media (max-width: 768px) {
    .mobile-menu-icon { display: flex; }

    .nav-links {
        position: fixed;
        top: 0; right: -100%; /* Escondido fora da tela */
        width: 70%;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s ease-in-out;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        right: 0; /* Desliza para dentro */
    }

    /* Animação do ícone para virar um "X" */
    .mobile-menu-icon.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .mobile-menu-icon.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-icon.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}