:root {
    --background: #0b0b10;
    --surface: #12121a;
    --surface-light: #181823;
    --text: #f4f4f7;
    --muted: #a7a7b5;
    --border: rgba(255, 255, 255, 0.09);
    --accent: #a78bfa;
    --accent-strong: #8b5cf6;
    --max-width: 1120px;
    --radius: 20px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    --header-bg: rgba(11, 11, 16, 0.82);
    --code-bg: #0f0f16;
}

body.light-theme {
    --background: #f7f7fb;
    --surface: #ffffff;
    --surface-light: #eeeeF5;
    --text: #18151f;
    --muted: #646270;
    --border: rgba(24, 21, 31, 0.11);
    --accent: #7c3aed;
    --accent-strong: #6d28d9;
    --shadow: 0 20px 60px rgba(38, 28, 60, 0.12);
    --header-bg: rgba(247, 247, 251, 0.84);
    --code-bg: #17131f;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    background: var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.container {
    width: min(100% - 40px, var(--max-width));
    margin-inline: auto;
}

/* Navegação */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    order: 3;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.55);
}

.logo {
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
}

.logo::first-letter {
    color: var(--accent);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 28px;
}

.nav-menu a {
    color: var(--muted);
    font-size: 0.92rem;
    transition: color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--text);
}

.nav-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 5px;
    background: currentColor;
}

/* Apresentação */
.hero {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    padding: 90px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    width: 480px;
    height: 480px;
    right: -180px;
    top: -120px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.12);
    filter: blur(90px);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 70px;
    align-items: center;
}

.eyebrow,
.section-label,
.project-type,
.timeline-date {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 760px;
    margin: 18px 0 22px;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.hero h1 span {
    color: var(--accent);
}

.hero-description {
    max-width: 650px;
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 32px 0 20px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button.primary {
    background: var(--accent);
    color: #17121f;
}

.button.secondary {
    border: 1px solid var(--border);
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.hero-links {
    display: flex;
    gap: 22px;
    color: var(--muted);
    font-size: 0.92rem;
}

.hero-links a:hover {
    color: var(--accent);
}

.hero-card {
    position: relative;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transform: rotate(1deg);
}

.window-top {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
}

.window-top span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #777;
}

.window-top small {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.72rem;
}

.hero-card pre {
    padding: 30px;
    overflow-x: auto;
    color: #ddd;
    font-size: clamp(0.72rem, 1.4vw, 0.9rem);
}

.code-keyword {
    color: #c084fc;
}

.code-property {
    color: #67e8f9;
}

.code-string {
    color: #86efac;
}

/* Seções */
.section {
    padding: 110px 0;
}

.section-alt {
    background: var(--surface);
    border-block: 1px solid var(--border);
}

.section-heading {
    max-width: 720px;
    margin-bottom: 52px;
}

.section-heading h2 {
    margin: 10px 0 14px;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.section-heading p {
    color: var(--muted);
}

/* Sobre */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 70px;
    align-items: start;
}

.about-text {
    color: var(--muted);
    font-size: 1.02rem;
}

.about-text p + p {
    margin-top: 20px;
}

.profile-card {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}

.profile-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid rgba(167, 139, 250, 0.45);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card h3 {
    font-size: 1.35rem;
}

.profile-card p {
    color: var(--muted);
    margin-top: 5px;
    font-size: 0.9rem;
}

.profile-tags,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-tags {
    justify-content: center;
    margin-top: 20px;
}

.profile-tags span,
.tag-list span {
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: #d7d7df;
    font-size: 0.78rem;
}

/* Habilidades */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.skill-card {
    min-height: 230px;
    padding: 26px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: rgba(167, 139, 250, 0.45);
}

.skill-number {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 800;
}

.skill-card h3 {
    margin: 28px 0 22px;
    font-size: 1.1rem;
}

.tag-list {
    gap: 7px;
}

/* Projetos */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.project-card {
    position: relative;
    min-height: 340px;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: rgba(167, 139, 250, 0.45);
}

.project-card.featured {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.13), var(--surface) 50%);
}

.project-index {
    position: absolute;
    top: 20px;
    right: 24px;
    color: rgba(255, 255, 255, 0.13);
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -0.08em;
}

.project-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.project-content h3 {
    margin: 12px 0 14px;
    font-size: 1.7rem;
    letter-spacing: -0.03em;
}

.project-content p {
    max-width: 680px;
    color: var(--muted);
    margin-bottom: 22px;
}

.project-note {
    display: block;
    margin-top: 25px;
    color: #777784;
    font-size: 0.82rem;
}

/* Formação */
.timeline {
    position: relative;
    max-width: 850px;
    margin-left: 10px;
    padding-left: 32px;
    border-left: 1px solid var(--border);
}

.timeline-item {
    position: relative;
    padding: 0 0 50px 26px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -39px;
    top: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 6px var(--surface);
}

.timeline-content h3 {
    margin: 10px 0 4px;
    font-size: 1.35rem;
}

.institution {
    color: var(--text);
    font-weight: 700;
}

.timeline-content p:last-child {
    max-width: 700px;
    margin-top: 12px;
    color: var(--muted);
}

/* Experiência */
.experience-card {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 50px;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.experience-card h3 {
    margin-top: 10px;
    font-size: 1.45rem;
}

.experience-card > p {
    color: var(--muted);
}

/* Contato */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: center;
}

.contact-links {
    display: grid;
    gap: 12px;
}

.contact-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--background);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.contact-link:hover {
    transform: translateX(5px);
    border-color: rgba(167, 139, 250, 0.45);
}

.contact-link span {
    color: var(--muted);
}

.contact-link strong {
    font-size: 0.9rem;
}

/* Rodapé */
.footer {
    padding: 28px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.8rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

/* Animações */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

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

/* Responsividade */
@media (max-width: 900px) {
    .hero-grid,
    .about-grid,
    .contact-grid,
    .experience-card {
        grid-template-columns: 1fr;
    }

    .hero-card {
        max-width: 700px;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-grid {
        gap: 40px;
    }
}

@media (max-width: 700px) {
    .container {
        width: min(100% - 28px, var(--max-width));
    }

    .nav-actions {
        margin-left: auto;
    }

    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        gap: 0;
        padding: 10px 14px 18px;
        background: var(--background);
        border-bottom: 1px solid var(--border);
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-menu li a {
        display: block;
        padding: 12px;
    }

    .hero {
        padding: 70px 0;
    }

    .hero h1 {
        font-size: clamp(2.45rem, 13vw, 4rem);
    }

    .hero-card {
        transform: none;
    }

    .hero-card pre {
        padding: 20px;
        font-size: 0.7rem;
    }

    .section {
        padding: 80px 0;
    }

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

    .project-card.featured {
        grid-column: auto;
    }

    .experience-card {
        gap: 28px;
    }

    .footer-content {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
