/* ================= GLOBAL VARIABLES ================= */
:root {
    --bg-color: #FAFBFF;
    --text-main: #1E293B;
    --text-light: #64748B;
    --ms-blue: #0078D4;
    --ms-purple: #8B5CF6;
    --ms-icon: #0078D4;
    --accent-gradient: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.04);
    --shadow-deep: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 8px;
}

/* ================= RESET & BASE ================= */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    text-decoration: none;
}

body { 
    font-family: 'Segoe UI', 'Inter', sans-serif; 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    line-height: 1.5; 
    overflow-x: hidden; 
}

.container { 
    max-width: 1240px; 
    margin: 0 auto; 
    padding: 0 24px; 
}

/* ================= HEADER ================= */
.fixed-header {
    background: #FFFFFF;
    margin: 15px auto;
    border-radius: 20px;
    padding: 10px 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 15px;
    z-index: 1000;
    max-width: 1200px;
}

.header-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.logo { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-weight: 700; 
    font-size: 1.1rem; 
    color: #0F172A; 
}

.logo img { height: 42px; }

.nav-links { display: flex; list-style: none; gap: 20px; }
.nav-links a { 
    font-weight: 600; 
    font-size: 0.95rem; 
    color: var(--text-light); 
    transition: 0.2s; 
    padding: 5px 0; 
    border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--ms-blue); border-bottom-color: var(--ms-blue); }

.header-action { display: flex; align-items: center; }

/* ================= BUTTONS ================= */
.btn { 
    border-radius: 15px;
    font-weight: 600; 
    cursor: pointer; 
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; 
    border: none; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    color: rgb(255, 255, 255); 
}

.btn-primary { background: var(--ms-blue); }
.btn-primary:hover { background-color: #005A9E; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.btn-gradient { background: var(--accent-gradient); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2); }
.btn-gradient:hover { box-shadow: 0 6px 18px rgba(99, 102, 241, 0.3); transform: translateY(-1px); }

.btn-sm { padding: 8px 18px; font-size: 0.9rem; }
.btn-lg { padding: 12px 26px; font-size: 1rem; }

.btn-link { color: var(--ms-blue); font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 6px; }
.btn-link:hover { color: var(--ms-purple); }

.pulse-button { position: relative; }
.pulse-button::after { 
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    border-radius: inherit; box-shadow: 0 0 0 rgba(99, 102, 241, 0.4); 
    animation: pulse 1.5s infinite; 
}

@keyframes pulse { 
    0% { box-shadow: 0 0 0 rgba(99, 102, 241, 0.4); } 
    70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); } 
    100% { box-shadow: 0 0 0 rgba(99, 102, 241, 0); } 
}

.lift-on-hover { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.lift-on-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-deep); }

/* ================= HERO SECTION ================= */
.hero { display: flex; align-items: center; padding: 60px 0 20px 0; gap: 50px; }
.hero-content { flex: 1; }
.hero h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.1; margin-bottom: 20px; color: #0F172A;}
.text-gradient { background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--text-light); font-size: 1.15rem; margin-bottom: 35px; max-width: 500px;}
.hero-image { flex: 1.2; text-align: right; }
.hero-image img { width: 100%; max-width: 580px; filter: drop-shadow(0 15px 30px rgba(0,0,0,0.06)); }

/* ================= ABOUT SECTION ================= */
.expertise { padding: 30px 0; }
.expertise-content { background: #FFFFFF; border-radius: var(--border-radius-lg); padding: 50px; display: flex; gap: 50px; box-shadow: 0 5px 25px rgba(0, 0, 0, 0.02); }
.about-bio { flex: 1.2; }
.about-icon { width: 200px; margin-bottom: 20px;}
.about-bio h2 { font-size: 2rem; font-weight: 800; color: #0F172A; margin-bottom: 15px; }
.about-bio p { color: var(--text-light); font-size: 1rem; max-width: 500px; }
.about-features-vertical { flex: 1.5; display: flex; flex-direction: column; gap: 20px; }
.feature-item { background: #F6F8FA; border-radius: var(--border-radius-md); padding: 20px; display: flex; align-items: center; gap: 20px; }
.feature-icon-box { font-size: 1.8rem; }
.ms-icon-color { color: var(--ms-icon); }
.feature-text h3 { font-size: 1.1rem; color: #0F172A; margin-bottom: 4px; font-weight: 700;}
.feature-text p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 0;}

/* ================= TECHNOLOGIES ================= */
.technologies { text-align: center; padding: 50px 0; }
.technologies h2 { font-size: 1.8rem; margin-bottom: 30px; font-weight: 800;}
.tech-grid { display: grid; grid-template-columns: repeat(4, 1fr);gap: 15px;}
.tech-card { background: white; padding: 20px; border-radius: var(--border-radius-sm); display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 600; box-shadow: var(--shadow-soft); border: 1px solid #EEF2F5; transition: border-color 0.2s, transform 0.2s;}
.tech-card img { height: 35px; }
.tech-card span { font-size: 0.95rem; }
.tech-card:hover { border-color: var(--ms-blue); }
.tech-card-interactive { cursor: pointer; }

/* ================= PROJECTS ================= */
.projects { padding: 50px 0; text-align: center; }
.projects h2 { font-size: 1.8rem; margin-bottom: 40px; font-weight: 800;}
/* Grelha atualizada para os 6 cartões acomodarem-se de forma dinâmica e elegante */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 25px; text-align: left;}
.project-card { background: white; border-radius: var(--border-radius-lg); padding: 20px; box-shadow: var(--shadow-soft); border: 1px solid #F1F5F9;}
.project-card img { width: 100%; border-radius: var(--border-radius-md); margin-bottom: 15px; height: 190px; object-fit: cover; }
.project-info h3 { font-size: 1.25rem; color: #0F172A; margin-bottom: 8px; font-weight: 700;}
.project-info p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 20px; line-height: 1.6;}
.tag { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; display: inline-block; margin-bottom: 10px; }
.tag-blue { background: #EEF2FF; color: var(--ms-blue); }
.tag-purple { background: #F3E8FF; color: var(--ms-purple); }
.tag-cyan { background: #E0F2FE; color: #0EA5E9; }
.project-card-interactive { cursor: pointer; }

/* ================= CONTACT ================= */
.contact-section { padding: 50px 0 30px 0; }
.contact-banner { background: white; border-radius: var(--border-radius-lg); padding: 50px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-deep); border: 1px solid #EEF2F5;}
.contact-text h2 { font-size: 1.8rem; margin-bottom: 8px; font-weight: 800;}
.contact-text p { color: var(--text-light); max-width: 400px;}
.contact-action-group { display: flex; align-items: center; gap: 20px; }
.email-display { font-weight: 500; font-size: 0.95rem; color: var(--text-main); display: flex; align-items: center; gap: 8px; }

/* ================= MODALS (POP-UPS) ================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-box {
    background: #FFFFFF; width: 90%; max-width: 500px;
    border-radius: var(--border-radius-lg); padding: 40px; position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.95); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .modal-box { transform: translateY(0) scale(1); }
.modal-box-large { max-width: 750px !important; }

.close-modal {
    position: absolute; top: 20px; right: 20px;
    background: #F1F5F9; border: none; width: 35px; height: 35px;
    border-radius: 50%; font-size: 1.2rem; color: var(--text-light);
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center;
}
.close-modal:hover { background: #E2E8F0; color: #0F172A; }

.modal-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #E2E8F0; }
.modal-icon-container img { width: 45px; height: auto; }
.modal-header h3 { font-size: 1.5rem; color: #0F172A; font-weight: 800; }

.modal-body p { color: var(--text-light); margin-bottom: 20px; font-size: 0.95rem; line-height: 1.6; }
.modal-body h4 { font-size: 1.05rem; color: #0F172A; margin-bottom: 10px; }

.modal-skills-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.modal-skills-list li {
    display: flex; align-items: center; gap: 10px; font-size: 0.9rem;
    color: #334155; background: #F8FAFC; padding: 8px 15px;
    border-radius: 8px; border: 1px solid #E2E8F0;
}
.modal-skills-list li i { color: var(--ms-blue); }

.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.project-tags .tag { margin-bottom: 0; }

.project-gallery {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px; max-height: 300px; overflow-y: auto; padding-right: 5px;
}
.project-gallery img {
    width: 100%; height: 160px; object-fit: cover;
    border-radius: var(--border-radius-sm); box-shadow: var(--shadow-soft);
    border: 1px solid #EEF2F5; transition: transform 0.3s ease;
}
.project-gallery img:hover { transform: scale(1.03); }
.project-gallery::-webkit-scrollbar { width: 6px; }
.project-gallery::-webkit-scrollbar-track { background: #F1F5F9; border-radius: 10px;}
.project-gallery::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px;}
.project-gallery::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ================= FOOTER ================= */
footer { padding: 30px 0; border-top: 1px solid #EEF2F5; }
.footer-container { display: flex; justify-content: space-between; align-items: center; color: var(--text-light); font-size: 0.85rem; }
.social-links { display: flex; gap: 15px; font-size: 1.1rem; }
.social-links a { color: var(--text-light); transition: 0.2s;}
.social-links a:hover { color: var(--ms-blue); }

/* ================= ANIMATIONS ================= */
.fade-in { animation: fadeIn 0.8s ease-out; }
.slide-up { animation: slideUp 0.8s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.fade-in-text { opacity: 0; animation: fadeInText 0.6s ease-out forwards; }
@keyframes fadeInText { from { opacity: 0; } to { opacity: 1; } }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

/* ================= RESPONSIVE ================= */
@media (max-width: 1100px) {
    .hero h1 { font-size: 2.8rem; }
    .expertise-content { flex-direction: column; text-align: center; }
    .about-bio, .about-features-vertical { width: 100%; align-items: center; }
    .about-bio { display: flex; flex-direction: column; align-items: center; }
    .hero-image img { max-width: 500px; }
}

@media (max-width: 900px) {
    /* No tablet, divide em 2 colunas */
    .tech-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { flex-direction: column; text-align: center; padding: 30px 0;}
    .hero h1 { font-size: 2.4rem; }
    .contact-banner { flex-direction: column; padding: 40px; text-align: center; }
    .contact-action-group { flex-direction: column; margin-top: 20px; }
    .footer-container { flex-direction: column; gap: 15px; text-align: center;}
    
    /* No smartphone, fica 1 coluna para facilitar a leitura */
    .tech-grid { grid-template-columns: 1fr; }
}