:root {
    --primary: #000000;
    --secondary: #1a1a1a;
    --accent: #333333;
    --bg: #ffffff;
    --bg-alt: #f7f7f7;
    --border: #e0e0e0;
    --text-primary: #000000;
    --text-secondary: #555555;
    --text-muted: #888888;
}

body.dark-mode {
    --bg: #131313;
    --bg-alt: #1f1f1f;
    --border: #2b2b2b;
    --primary: #ffffff;
    --accent: #cfcfcf;
    --text-primary: #f5f5f5;
    --text-secondary: #e6e6e6;
    --text-muted: #9b9b9b;
}

/* Dark-mode element contrast overrides */
body.dark-mode nav {
    color: var(--text-primary);
    background-color: rgba(19,19,19,0.95);
}

body.dark-mode .nav-links a {
    color: var(--text-secondary);
}

body.dark-mode .controls-group .lang-toggle,
body.dark-mode .controls-group .theme-toggle {
    border-color: rgba(255,255,255,0.12);
    color: var(--text-primary);
    background: transparent;
}

body.dark-mode h2,
body.dark-mode h2 i {
    color: var(--text-primary);
}

body.dark-mode section {
    border-color: var(--border);
    background-color: rgba(255,255,255,0.02);
}

body.dark-mode .exp-item {
    border-left-color: rgba(255,255,255,0.12);
}

body.dark-mode .exp-item::before {
    background-color: var(--bg);
    border-color: var(--text-primary);
}

body.dark-mode .exp-company {
    color: var(--text-secondary);
}

body.dark-mode .contact-link {
    border-color: rgba(255,255,255,0.12);
    color: var(--text-primary);
}

body.dark-mode .contact-link i {
    color: var(--text-primary);
}

/* Dark-mode: safer hover styles for contact and control buttons */
body.dark-mode .contact-link:hover {
    background-color: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.12);
}

body.dark-mode .controls-group .lang-toggle:hover,
body.dark-mode .controls-group .theme-toggle:hover {
    background-color: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.18);
}

body.dark-mode nav {
    background-color: rgba(26, 26, 26, 0.97);
}

body.dark-mode footer {
    background-color: var(--bg-alt);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navbar */
nav {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 2rem;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.nav-logo {
    text-decoration: none;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.nav-logo i {
    font-size: 1.15rem;
    color: var(--primary);
}

.nav-logo-text {
    font-size: 0.98rem;
    font-style: normal;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s;
    position: relative;
}

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

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.controls-group {
    display: flex;
    gap: 0.6rem;
}

.lang-toggle, .theme-toggle {
    background: transparent;
    border: 1.5px solid var(--primary);
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
    border-radius: 4px;
    transition: all 0.3s;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lang-toggle:hover, .theme-toggle:hover {
    background-color: var(--text-primary);
    color: var(--bg);
}

.control-icon {
    font-size: 0.9rem;
}

/* Hero */
.hero {
    padding: 6rem 2rem 4rem;
    text-align: center;
    background: linear-gradient(to bottom, var(--bg) 0%, var(--bg-alt) 100%);
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.profile-pic {
    width: 230px;
    height: 230px;
    margin: 0 auto 2.5rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    overflow: hidden;
    background-color: var(--bg-alt);
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 0.4rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.hero .subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: block;
    clear: both;
}

.hero-bio {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    margin-top: 1.5rem;
    line-height: 1.8;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* Container */
.container {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    margin: 3rem 0;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2.5rem;
}

h2 {
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    letter-spacing: -0.3px;
}

h2 i {
    color: var(--accent);
    font-size: 1.3rem;
}

h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.2rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Experience */
.exp-item {
    border-left: 3px solid var(--primary);
    padding-left: 1.5rem;
    margin-bottom: 2.2rem;
    position: relative;
}

.exp-item::before {
    content: '';
    position: absolute;
    left: -8.5px;
    top: 3px;
    width: 13px;
    height: 13px;
    background-color: var(--bg);
    border: 2.5px solid var(--primary);
    border-radius: 50%;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.exp-title {
    font-weight: 700;
    font-size: 0.98rem;
}

.exp-company {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.exp-company span {
    display: inline;
    line-height: 1.25;
}

.org-logo {
    height: 22px;
    width: auto;
    max-width: 70px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    opacity: 1;
    transition: transform 0.25s ease;
}

.exp-item:hover .org-logo,
.edu-item:hover .org-logo {
    transform: translateY(-1px);
}

.exp-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.exp-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-top: 0.6rem;
    line-height: 1.65;
}

.exp-bullets {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.65;
    margin-top: 0.65rem;
    margin-bottom: 0;
    padding-left: 1.2rem;
}

.exp-bullets li {
    margin: 0.35rem 0;
}

/* Soft Skills */
.soft-skills-list {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.8;
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0;
}

.soft-skills-list li {
    margin: 0.4rem 0;
    padding: 0;
}

/* Skills */
.skill-section {
    margin-bottom: 2rem;
}

.skill-section h3 {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    margin-top: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--accent);
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}


.skill-item {
    background-color: var(--accent);
    color: white;
    border: 1px solid transparent;
    padding: 0.22rem 0.6rem; /* smaller pills */
    border-radius: 999px;
    font-size: 0.72rem; /* slightly smaller text */
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    cursor: default;
    letter-spacing: 0.06px;
    min-height: 28px;
}

.skill-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18);
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}

body.dark-mode .skill-item {
    background-color: #3e3e3e;
    border-color: rgba(255,255,255,0.06);
    color: var(--text-primary);
}

body.dark-mode .skill-item:hover {
    background-color: #6b6b6b;
    border-color: rgba(255,255,255,0.12);
    color: var(--bg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Light mode pills: lighter background and dark text */
body:not(.dark-mode) .skill-item {
    background-color: #f2f2f2;
    color: var(--text-secondary);
    border: 1px solid #e6e6e6;
}

body:not(.dark-mode) .skill-item:hover {
    background-color: #e9e9e9;
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.06);
}

/* Responsive tweak: make pills even smaller on narrow screens */
@media (max-width: 480px) {
    .skill-item {
        padding: 0.18rem 0.5rem;
        font-size: 0.65rem;
        min-height: 24px;
    }
}

/* Education */
.edu-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.edu-icon {
    color: var(--primary);
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.edu-content {
    flex: 1;
}

.edu-degree {
    font-weight: 700;
    font-size: 0.96rem;
}

.edu-school {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.edu-logo {
    height: 24px;
    max-width: 82px;
}

.edu-year {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

/* Contact */
.contact-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.4rem;
    border: 1.5px solid var(--primary);
    border-radius: 4px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s;
    letter-spacing: 0.2px;
}

.contact-link:hover {
    background-color: var(--text-primary);
    color: var(--bg);
}

/* Footer */
footer {
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 3rem;
}

footer p {
    margin: 0.3rem 0;
}

/* i18n */
[data-lang="pt"] {
    display: block;
}

[data-lang="en"] {
    display: none !important;
}

body.lang-en [data-lang="pt"] {
    display: none !important;
}

body.lang-en [data-lang="en"] {
    display: block !important;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-left {
        width: 100%;
        gap: 1rem;
    }

    .nav-links {
        gap: 1.5rem;
        font-size: 0.8rem;
    }

    .hero {
        padding: 3.5rem 1.5rem 2.5rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .profile-pic {
        width: 210px;
        height: 210px;
        margin-bottom: 1.5rem;
    }

    section {
        padding: 1.75rem;
        margin: 2rem 0;
    }

    h2 {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .exp-header {
        flex-direction: column;
        gap: 0.3rem;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 0.4rem;
    }

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

    .org-logo {
        height: 20px;
        max-width: 62px;
    }

    .edu-logo {
        height: 22px;
        max-width: 74px;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0.75rem 1rem;
    }

    .nav-logo {
        font-size: 1rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.75rem;
    }

    .hero {
        padding: 2.5rem 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero .subtitle {
        font-size: 0.95rem;
    }

    .profile-pic {
        width: 180px;
        height: 180px;
    }

    .container {
        padding: 0 1rem;
    }

    section {
        padding: 1.25rem;
        margin: 1.5rem 0;
    }

    h2 {
        font-size: 1.1rem;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
        gap: 0.3rem;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    }

    .skill-item {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .contact-links {
        gap: 0.75rem;
    }

    .contact-link {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .org-logo {
        height: 18px;
        max-width: 56px;
    }

    .edu-logo {
        height: 20px;
        max-width: 68px;
    }
}
