/* ============================================================
   Estenio Gabriel — Portfólio
   HTML5 + CSS3 puros · Tema claro/escuro automático (sem JS)
   ============================================================ */

/* ---------- Tokens de design ---------- */

:root {
    color-scheme: light dark;

    --bg: #f6f8fc;
    --band: #edf1f8;
    --surface: #ffffff;
    --surface-2: #eef2f9;
    --text: #111a2d;
    --muted: #5b6578;
    --border: #e3e8f1;

    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-contrast: #ffffff;
    --accent-soft: rgba(37, 99, 235, 0.10);

    --topbar-bg: rgba(246, 248, 252, 0.82);
    --shadow-sm: 0 1px 2px rgba(17, 26, 45, 0.06);
    --shadow-md: 0 2px 6px rgba(17, 26, 45, 0.06), 0 16px 40px rgba(17, 26, 45, 0.10);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;

    --font-body: "Inter", system-ui, -apple-system, sans-serif;
    --font-display: "Sora", var(--font-body);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1220;
        --band: #0e1728;
        --surface: #121b2e;
        --surface-2: #18233c;
        --text: #e7edfa;
        --muted: #96a3ba;
        --border: #24314d;

        --accent: #5b8def;
        --accent-strong: #7aa3f4;
        --accent-contrast: #0b1220;
        --accent-soft: rgba(91, 141, 239, 0.14);

        --topbar-bg: rgba(11, 18, 32, 0.78);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
        --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.35), 0 20px 48px rgba(0, 0, 0, 0.40);
    }
}

/* ---------- Base ---------- */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

ul {
    list-style: none;
}

::selection {
    background: var(--accent);
    color: #ffffff;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.container {
    width: min(1080px, 100% - 48px);
    margin-inline: auto;
}

section[id] {
    scroll-margin-top: 88px;
}

/* ---------- Topbar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--topbar-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 68px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 700;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 16px;
}

.nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.nav a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.nav a:hover {
    color: var(--text);
    background: var(--accent-soft);
}

.topbar-cta {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.topbar-cta:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.topbar-cta svg {
    width: 20px;
    height: 20px;
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 72px 0 88px;
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(90px);
}

.hero::before {
    width: 460px;
    height: 460px;
    top: -180px;
    right: -120px;
    background: var(--accent);
    opacity: 0.16;
}

.hero::after {
    width: 320px;
    height: 320px;
    bottom: -160px;
    left: -140px;
    background: #38bdf8;
    opacity: 0.14;
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 56px;
    align-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 20px;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 56px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.hero-role {
    font-size: 19px;
    font-weight: 500;
    margin-bottom: 10px;
}

.hero-role strong {
    font-weight: 600;
}

.hero-pitch {
    font-size: 16.5px;
    color: var(--muted);
    max-width: 54ch;
    margin-bottom: 28px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-photo {
    position: relative;
    justify-self: center;
}

.hero-photo::before {
    content: "";
    position: absolute;
    inset: -14px;
    border: 1.5px solid var(--border);
    border-radius: 34px;
    transform: rotate(5deg);
}

.hero-photo img {
    width: min(320px, 100%);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: 50% 22%;
    border-radius: 28px;
    border: 4px solid var(--surface);
    box-shadow: var(--shadow-md);
}

/* ---------- Botões ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-contrast);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* ---------- Seções ---------- */

.section {
    padding: 72px 0;
}

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

.section-head {
    margin-bottom: 36px;
}

.eyebrow {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.section-head h2 {
    font-family: var(--font-display);
    font-size: clamp(26px, 4vw, 34px);
    letter-spacing: -0.01em;
}

.section-head .lead {
    color: var(--muted);
    margin-top: 8px;
    max-width: 62ch;
}

/* ---------- Sobre ---------- */

.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
    align-items: start;
}

.about-text {
    display: grid;
    gap: 14px;
    font-size: 17px;
    color: var(--muted);
}

.about-text strong {
    color: var(--text);
    font-weight: 600;
}

.facts {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 24px;
    box-shadow: var(--shadow-sm);
}

.facts li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    font-weight: 500;
}

.facts li:last-child {
    border-bottom: 0;
}

.fact-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

/* ---------- Projetos ---------- */

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

.project-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.project-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
}

.project-year {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 999px;
}

.project-card h3 {
    font-family: var(--font-display);
    font-size: 19px;
}

.project-card h3 a {
    text-decoration: none;
    color: var(--text);
    transition: color 0.2s;
}

.project-card h3 a:hover {
    color: var(--accent);
}

.project-card p {
    font-size: 14.5px;
    color: var(--muted);
    flex-grow: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags li {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 4px 11px;
    border-radius: 999px;
}

.project-links {
    display: flex;
    gap: 18px;
    margin-top: 2px;
}

.project-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.project-links a:hover {
    text-decoration: underline;
}

.project-links svg {
    width: 15px;
    height: 15px;
}

/* Banner "ver todos no GitHub" */

.github-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 24px;
    padding: 26px 30px;
    border-radius: var(--radius);
    background: linear-gradient(120deg, var(--accent), #4f46e5);
    color: #ffffff;
    box-shadow: var(--shadow-md);
}

.github-banner h3 {
    font-family: var(--font-display);
    font-size: 19px;
    margin-bottom: 4px;
}

.github-banner p {
    opacity: 0.85;
    font-size: 14.5px;
}

.btn-banner {
    background: #ffffff;
    color: #1e3a8a;
}

.btn-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

/* ---------- Skills ---------- */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.skill-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.skill-group h3 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}

.skill-group ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-group li {
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
}

/* ---------- Contato ---------- */

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

.contact-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.contact-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.contact-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
    flex-shrink: 0;
}

.contact-icon svg {
    width: 24px;
    height: 24px;
}

.contact-info h3 {
    font-family: var(--font-display);
    font-size: 17px;
}

.contact-info p {
    font-size: 14px;
    color: var(--muted);
}

.contact-card .arrow {
    margin-left: auto;
    color: var(--muted);
    transition: transform 0.2s, color 0.2s;
}

.contact-card .arrow svg {
    width: 20px;
    height: 20px;
}

.contact-card:hover .arrow {
    color: var(--accent);
    transform: translate(3px, -3px);
}

/* ---------- Rodapé ---------- */

.footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
}

.footer-line strong {
    color: var(--text);
    font-weight: 600;
}

.footer-sub {
    font-size: 12.5px;
}

/* ---------- Responsivo ---------- */

@media (max-width: 900px) {
    .hero {
        padding: 56px 0 72px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 44px;
        text-align: center;
    }

    .hero-photo {
        order: -1;
    }

    .hero-pitch {
        margin-inline: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 620px) {
    .nav {
        display: none;
    }

    .hero {
        padding: 48px 0 64px;
    }

    .section {
        padding: 56px 0;
    }

    .hero-photo img {
        width: min(260px, 80vw);
    }

    .github-banner {
        justify-content: center;
        text-align: center;
    }
}

/* ---------- Acessibilidade: movimento reduzido ---------- */

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

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
