:root {
    /* Color Palette */
    --bg-main: #0a0a0f;
    --bg-secondary: #12121c;
    --bg-card: rgba(22, 22, 35, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #8b5cf6;
    --accent: #0ea5e9;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Typography */
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    /* Effects */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-blur: blur(12px);
    
    /* Reactive State Variables (defaults mapping to night/cloudy initially) */
    --env-hue: 220;
    --env-saturation: 80%;
    --env-lightness: 5%;
    --particle-glow: rgba(59, 130, 246, 0.5);
    --circuit-color: rgba(59, 130, 246, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: hsl(var(--env-hue), var(--env-saturation), var(--env-lightness));
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 2s ease-in-out;
}

/* Base Canvas for Reactive System */
#reactive-env {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
}

/* Time of Day States */
body.morning { 
    --env-hue: 200; 
    --env-saturation: 60%;
    --env-lightness: 8%;
    --circuit-color: rgba(14, 165, 233, 0.2);
}
body.afternoon { 
    --env-hue: 210; 
    --env-saturation: 70%;
    --env-lightness: 6%;
}
body.night { 
    --env-hue: 230; 
    --env-saturation: 50%;
    --env-lightness: 4%;
    --circuit-color: rgba(139, 92, 246, 0.2);
}

/* Background Effect Element */
.glow-bg {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(10, 10, 15, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    animation: pulseGlow 10s infinite alternate;
}

.glow-bg::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -100%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(10, 10, 15, 0) 70%);
    border-radius: 50%;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(5%, 5%); }
}

/* Typography & Utils */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    padding: 70px 0;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.sm-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 15px 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a:not(.btn) {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
    position: relative;
}

.nav-links a:not(.btn):hover,
.nav-links a.active:not(.btn) {
    color: var(--text-main);
}

.nav-links a:not(.btn)::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links a:not(.btn):hover::after,
.nav-links a.active:not(.btn)::after {
    width: 100%;
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
    background: none;
    border: none;
    padding: 5px;
}

/* Hero Section */
.hero {
    padding: 160px 0 60px 0;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 40px;
}

.profile-frame {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.image-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--bg-main);
}

.status-badge {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: blink 2s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.description {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 35px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 50px;
}

.tech-stack {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 1.8rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.tech-stack span {
    transition: var(--transition);
}

.tech-stack span:hover {
    color: var(--primary);
    transform: translateY(-5px);
}

/* Sections Global */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* About Section */
.about-grid {
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-text {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.about-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
}

.about-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.about-bullets {
    margin-top: 30px;
}

.about-bullets li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--text-main);
}

.about-bullets i {
    font-size: 1.2rem;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
    opacity: 0;
    transition: var(--transition);
    z-index: 0;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.service-card > * {
    position: relative;
    z-index: 1;
}

.service-icon {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 25px;
}

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

.service-card p {
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.service-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-main);
}

.service-list i {
    color: var(--primary);
    font-size: 0.85rem;
}

/* Portfolio */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.portfolio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 35px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.portfolio-card:hover {
    border-color: var(--secondary);
    transform: translateY(-5px);
}

.portfolio-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tag {
    background: rgba(139, 92, 246, 0.1);
    color: var(--secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolio-content h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.portfolio-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
    flex-grow: 1;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.read-more:hover {
    gap: 12px;
}

/* Certifications */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.cert-card {
    background: linear-gradient(135deg, rgba(22, 22, 35, 0.5), rgba(10, 10, 15, 0.5));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: var(--transition);
    position: relative; /* Necessário para posicionar o tooltip dentro do limite do card (ou referenciá-lo) */
    overflow: hidden; /* Mantém o conteúdo do tooltip dentro da caixa ao subir */
}

.cert-tooltip {
    position: absolute;
    top: 100%; /* Começa escondido abaixo */
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95); /* Fundo muito escuro sólido */
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-main);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.cert-card:hover .cert-tooltip {
    opacity: 1;
    visibility: visible;
    top: 0; /* Desliza e cobre o cartão orginal */
}

.cert-card:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cert-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    transition: var(--transition);
}

.cert-card:hover .cert-icon {
    color: var(--secondary);
}

.cert-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.cert-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Stats */
.stats {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 60px 0;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Contact */
.contact-card {
    background: linear-gradient(135deg, rgba(22, 22, 35, 0.9), rgba(10, 10, 15, 0.9));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 24px;
    padding: 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.contact-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: var(--primary);
    filter: blur(150px);
    opacity: 0.2;
    z-index: 0;
}

.contact-card > * {
    position: relative;
    z-index: 1;
}

.contact-card h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.contact-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 60px 0 0;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 10px;
    font-size: 0.95rem;
}

.footer-socials {
    display: flex;
    gap: 15px;
}

.footer-socials a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.footer-socials a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

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

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

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 999;
}

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

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-5px);
}

/* Responsive */
@media (max-width: 992px) {
    .title { font-size: 3rem; }
    .stats-container { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .hamburger { display: block; }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 20px 0;
        gap: 20px;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s ease-in-out;
    }
    
    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    
    .title { font-size: 2.5rem; }
    .hero-actions { flex-direction: column; }
    .contact-links { flex-direction: column; }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
}
