:root {
    --bg: #121212;
    --bg-2: #1e1e1e;
    --text: #f5f5f5;
    --muted: #ccc;
    --border: #333;
    --chip: #2a2a2a;
    --chip-hover: #444;
    --accent: #7dd3fc;
    /* um leve ciano para foco/acessibilidade */
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* Navbar */
nav {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* centraliza no desktop */
    position: relative;
    gap: 12px;
    flex-wrap: wrap;
}

.brand {
    position: absolute;
    left: 20px;
    font-weight: 600;
    opacity: .9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand i {
    opacity: .8;
}

.nav-links {
    display: flex;
    gap: 12px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    background: var(--chip);
    padding: 8px 14px;
    border-radius: 50px;
    transition: background .25s, transform .08s;
    font-size: .95rem;
}

.nav-links a:hover {
    background: var(--chip-hover);
}

.nav-links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.nav-links a.active {
    box-shadow: 0 0 0 2px var(--border) inset;
}

/* Hambúrguer (mobile) */
.hamburger {
    display: none;
    position: absolute;
    right: 20px;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

.hamburger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Hero */
.hero {
    min-height: 70vh;
    background: url('https://source.unsplash.com/random/1600x900?technology,dark') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
    padding: 0 20px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: .5px;
}

/* Seções */
section {
    max-width: 900px;
    margin: 40px auto; /* Reduzida a margem */
    padding: 0 20px;
}

h2 {
    font-weight: 500;
    margin: 0 0 12px; /* Reduzida a margem */
    letter-spacing: .3px;
}

p {
    color: var(--muted);
    line-height: 1.6;
}

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

.habilidade {
    background: var(--bg-2);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: transform .25s;
}

.habilidade:hover {
    transform: translateY(-5px);
}

.habilidade i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.skills-extra.hidden {
    display: none;
}

.btn {
    background: var(--chip);
    color: var(--text);
    border: none;
    border-radius: 50px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 500;
    transition: background .25s, transform .08s;
}

.btn:hover {
    background: var(--chip-hover);
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.hero-img {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #f5f5f5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.projeto {
    background: var(--bg-2);
    padding: 20px;
    border-radius: 12px;
    text-align: left;
    transition: transform .25s;
    max-height: 300px;
    overflow: hidden;
    position: relative;
}

.projeto:hover {
    transform: translateY(-5px);
}

.projeto h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.projeto p {
    font-size: .95rem;
    line-height: 1.5;
}

/* Fade que indica mais conteúdo */
.projeto::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 70px;
    background: linear-gradient(to top, var(--bg-2) 30%, rgba(30, 30, 30, 0));
    pointer-events: none;
}

.projeto.expandido {
    max-height: none;
}

.projeto.expandido::after {
    display: none;
}

.ver-mais {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: var(--chip);
    color: var(--text);
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: .8rem;
    cursor: pointer;
    box-shadow: 0 0 0 1px var(--border) inset;
}

.ver-mais:hover {
    background: var(--chip-hover);
}

.ver-mais:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Contato */
.contato a {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text);
    text-decoration: none;
    background: var(--chip);
    padding: 10px 15px;
    border-radius: 50px;
    transition: background .25s;
}

.contato a:hover {
    background: var(--chip-hover);
}

.contato a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Rodapé */
footer {
    text-align: center;
    padding: 20px;
    font-size: .9rem;
    color: #888;
    border-top: 1px solid var(--border);
}

/* Mobile */
@media (max-width: 768px) {
    .nav-container {
        justify-content: space-between;
    }

    .brand {
        position: static;
        margin-right: auto;
    }

    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--bg-2);
        padding: 10px;
        border-top: 1px solid var(--border);
    }

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

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

    section {
        margin: 48px auto;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 60vh;
    }

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