@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@700;800;900&family=Space+Grotesk:wght@500;700&family=Fira+Code:wght@400;500&display=swap');

:root {
    /* Emerald Success Cyber Palette */
    --bg-deep: #050505;
    --acc-emerald: #10b981;
    --acc-emerald-dark: #065f46;
    --acc-emerald-glow: rgba(16, 185, 129, 0.15);
    --text-high: #ffffff;
    --text-mid: #e2e8f0;
    --text-low: #64748b;

    /* UI Tokens */
    --glass: rgba(10, 10, 10, 0.85);
    --glass-border: rgba(16, 185, 129, 0.2);
    --blur: blur(20px);
    --gradient: linear-gradient(135deg, var(--acc-emerald) 0%, var(--acc-emerald-dark) 100%);

    --font-mono: 'Fira Code', monospace;
    --font-heading: 'Outfit', sans-serif;
    --font-sans: 'Inter', sans-serif;
}

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

a,
button {
    cursor: pointer !important;
}

html {
    scroll-behavior: smooth;
    background: var(--bg-deep);
}

body {
    background-color: var(--bg-deep);
    color: var(--text-mid);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Grid Background */
#blueprint-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(var(--acc-emerald-glow) 1px, transparent 1px);
    background-size: 32px 32px;
}

.noise {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.02;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Header - Modern & Stable */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8%;
    background: var(--glass);
    backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--glass-border);
    z-index: 2000;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: var(--acc-emerald);
    text-decoration: none;
    letter-spacing: -1px;
}

nav ul {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-mid);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

nav a i {
    font-size: 1.1rem;
    color: var(--acc-emerald);
}

.nav-socials {
    display: flex;
    gap: 1.2rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--glass-border);
}

.nav-socials a i {
    font-size: 1.3rem;
}

nav a:hover {
    color: var(--acc-emerald);
}

/* PT/EN Toggle */
.lang-toggle {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 3px;
}

.lang-btn {
    border: none;
    background: transparent;
    color: var(--text-low);
    padding: 6px 14px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 800;
    border-radius: 50px;
    transition: 0.3s;
}

.lang-btn.active {
    background: var(--acc-emerald);
    color: var(--bg-deep);
}

.lang-toggle .divider {
    width: 1px;
    height: 12px;
    background: var(--glass-border);
    margin: 0 4px;
}

/* Sections */
section {
    padding: 10rem 10% 5rem;
    scroll-margin-top: 100px;
    /* Base offset for fixed header */
}

.section-title {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--acc-emerald);
    margin-bottom: 4rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.section-title::after {
    content: "";
    height: 1px;
    background: var(--glass-border);
    flex-grow: 1;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(4rem, 15vw, 9rem);
    color: var(--text-high);
    line-height: 0.9;
    margin-bottom: 2.5rem;
    letter-spacing: -4px;
}

.shake-target {
    display: inline-block;
    color: var(--acc-emerald);
}

.shake-target:hover {
    animation: tremble 0.1s infinite;
}

@keyframes tremble {
    0% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(2px, -1px);
    }

    66% {
        transform: translate(-1px, 2px);
    }

    100% {
        transform: translate(1px, -2px);
    }
}

.hero h2 {
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    color: var(--text-mid);
    max-width: 900px;
    margin-bottom: 3.5rem;
    font-weight: 400;
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 6rem;
    align-items: start;
}

.about-content {
    font-size: 1.1rem;
    text-align: center;
    /* Back to centered for desktop */
}

.about-content p {
    margin-bottom: 2rem;
}

/* Terminal */
.terminal-about {
    background: #020202;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 3rem;
    font-family: var(--font-mono);
    max-width: 850px;
    margin: 0 auto 3rem;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.terminal-header {
    background: #0a0a0a;
    padding: 12px 20px;
    display: flex;
    align-items: center;
}

.dots {
    display: flex;
    gap: 8px;
}

.dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.8;
}

.dot-r {
    background: #ff5f56;
}

.dot-y {
    background: #ffbd2e;
}

.dot-g {
    background: #27c93f;
}

.terminal-title {
    font-size: 0.8rem;
    color: var(--text-low);
    flex-grow: 1;
    text-align: center;
}

.terminal-body {
    padding: 3rem;
    line-height: 2;
    text-align: left;
}

.terminal-body .line {
    color: var(--acc-emerald);
    margin-right: 15px;
    font-weight: 700;
}

.terminal-body .out {
    color: var(--text-mid);
    margin-bottom: 1.5rem;
    padding-left: 30px;
    border-left: 2px solid rgba(16, 185, 129, 0.1);
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    list-style: none;
    margin-top: 4rem;
}

.skills-list li {
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(16, 185, 129, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: 0.3s;
}

.skills-list li:hover {
    background: rgba(16, 185, 129, 0.06);
    transform: translateY(-3px);
}

.skills-list i {
    color: var(--acc-emerald);
    font-size: 1.8rem;
}

.profile-wrap {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    padding: 15px;
    background: rgba(16, 185, 129, 0.05);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 3rem;
}

.project-card {
    background: rgba(10, 10, 10, 0.4);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-mid);
    /* Fix: Remove browser default blue link color */
    transition: 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--acc-emerald);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    color: var(--text-high);
}

.project-card .icon,
.project-card i {
    color: var(--acc-emerald) !important;
    /* Fix: Force emerald, remove blue devicons */
    font-size: 2.5rem;
    opacity: 0.8;
}

.project-card h3 {
    font-family: var(--font-heading);
    color: var(--text-high);
    font-size: 1.6rem;
}

.project-tags {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-tags span {
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--acc-emerald);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* REDESIGNED CONTACT SECTION */
.contact-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.contact-card {
    background: rgba(16, 185, 129, 0.03);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 24px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 2rem;
    transition: 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    text-align: left;
}

.contact-card:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: var(--acc-emerald);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: rgba(16, 185, 129, 0.05);
    color: var(--acc-emerald);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.contact-icon i,
.project-card .icon,
.project-card i {
    color: var(--acc-emerald) !important;
}

.contact-meta label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-low);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.contact-meta span {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--text-high);
    font-weight: 700;
}

.contact-arrow {
    margin-left: auto;
    color: var(--acc-emerald);
    opacity: 0;
    transform: translateX(-10px);
    transition: 0.3s;
}

.contact-card:hover .contact-arrow {
    opacity: 1;
    transform: translateX(0);
}

.contact-echo {
    margin-bottom: 4rem;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-low);
}

/* Premium CTA Button */
.contact-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--acc-emerald);
    color: var(--bg-deep);
    padding: 2.5rem 6rem;
    border-radius: 20px;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: 0.3s;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
}

.contact-cta-btn:hover {
    background: #0df2c0;
    transform: scale(1.05);
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.5);
}

/* Base Buttons */
.btn {
    padding: 1.5rem 3.5rem;
    border-radius: 100px;
    font-weight: 800;
    text-decoration: none;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-transform: uppercase;
}

.btn.primary {
    background: var(--acc-emerald);
    color: var(--bg-deep);
}

.btn.secondary {
    border: 2px solid var(--glass-border);
    color: var(--text-high);
}

.btn:hover {
    transform: translateY(-8px);
}

/* Reveal Effects */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: 1.2s cubic-bezier(0.2, 1, 0.3, 1);
}

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

/* PT/EN Logic */
html[lang="pt"] .en-only {
    display: none !important;
}

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

/* MOBILE OPTIMIZATION - EXTREME PASS */
@media (max-width: 1200px) {
    header {
        padding: 0 5%;
    }

    section {
        padding: 8rem 8% 4rem;
        scroll-margin-top: 90px;
    }
}

@media (max-width: 900px) {
    .about-grid {
        display: flex;
        flex-direction: column-reverse;
        gap: 3rem;
        text-align: left;
        /* Alinhamento do Sobre Mim no mobile */
    }

    .about-content {
        text-align: left;
    }

    .profile-wrap {
        max-width: 320px;
        margin: 0 auto;
    }

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

    .project-card {
        padding: 2.5rem;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    header {
        height: auto;
        padding: 0.8rem 5%;
        /* Shrink: Much smaller vertical padding */
        flex-direction: column;
        gap: 0.8rem;
        background: rgba(5, 5, 5, 0.98);
        border-bottom: 2px solid var(--acc-emerald-dark);
        /* Quality indicator */
    }

    .logo {
        font-size: 1.3rem;
    }

    nav ul {
        gap: 0.6rem;
        flex-wrap: wrap;
        justify-content: center;
        padding-bottom: 0.2rem;
    }

    nav a {
        font-size: 0.6rem;
        gap: 4px;
    }

    nav a i {
        font-size: 0.8rem;
    }

    .nav-socials {
        display: none;
    }

    .hero {
        min-height: 80vh;
        padding-top: 10rem !important;
        /* Force more padding on mobile */
    }

    .hero h1 {
        font-size: 3rem;
        margin-bottom: 1.2rem;
        letter-spacing: -2px;
    }

    .hero h2 {
        font-size: 0.95rem;
        margin-bottom: 1.8rem;
    }

    #hero div[style*="display: flex"] {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 1.1rem;
        font-size: 0.9rem;
    }

    .section-title {
        margin-bottom: 2.5rem;
        font-size: 0.8rem;
        gap: 0.8rem;
    }

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

    .project-card {
        padding: 1.5rem;
        gap: 0.8rem;
    }

    .project-card h3 {
        font-size: 1.3rem;
    }

    .contact-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        gap: 1rem;
    }

    .contact-icon {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
        margin: 0 auto;
    }

    .contact-meta span {
        font-size: 1.1rem;
    }

    .contact-cta-btn {
        width: 100%;
        padding: 1.5rem;
        font-size: 1rem;
    }

    section {
        padding: 5rem 6% 3rem;
        scroll-margin-top: 140px;
        /* Correct offset for sticky mobile header */
    }

    .terminal-body {
        padding: 1.2rem;
        font-size: 0.8rem;
    }

    footer {
        padding: 2rem 5%;
        font-size: 0.7rem;
    }
}