/* ==========================================================================
   Portfólio — Wellington Barboza
   ========================================================================== */

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

/* --- Tokens ------------------------------------------------------------ */
:root {
    --bg: #181d2f;
    --bg-soft: #1e2439;
    --surface: #222942;
    --text: #d9dce4;
    --text-strong: #f2f3f7;
    --muted: #949cb0;
    --accent: #e9a13d;
    --accent-soft: rgba(233, 161, 61, 0.1);
    --cream: #eae7e0;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);

    --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, "SFMono-Regular",
        Consolas, monospace;

    --container: 1320px;
    --header-h: 68px;
}

/* --- Base -------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px);
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

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

a,
button,
input,
textarea {
    font: inherit;
}

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

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

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 24px;
}

.highlight {
    color: var(--accent);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 100;
    padding: 12px 20px;
    background: var(--cream);
    color: var(--bg);
    border-radius: 6px;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 12px;
}

/* --- Header ------------------------------------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--header-h);
    padding: 14px 24px;
    background: rgba(24, 29, 47, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 34px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-size: 1.05rem;
    transition: color 0.2s ease;
}

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

.social-links i {
    font-size: 1.2rem;
}

/* --- Hero -------------------------------------------------------------- */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-h));
    padding: 80px 24px;
    text-align: center;
}

.hero-intro {
    color: var(--text);
    font-size: clamp(0.95rem, 1.4vw, 1.25rem);
    font-weight: 400;
}

.hero-name {
    max-width: 100%;
    margin-top: 22px;
    color: var(--text-strong);
    font-size: clamp(1.5rem, 6.4vw, 3.9rem);
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: 0.01em;
    overflow-wrap: break-word;
}

.cursor {
    display: inline-block;
    color: var(--text-strong);
    font-weight: 300;
    animation: blink 1.05s step-end infinite;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.hero-tagline {
    max-width: 860px;
    margin-top: 30px;
    color: var(--text);
    font-size: clamp(0.9rem, 1.35vw, 1.15rem);
    line-height: 1.9;
}

.hero .btn-primary {
    margin-top: 56px;
}

/* --- Botões ------------------------------------------------------------ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 17px 30px;
    background: var(--cream);
    color: var(--bg);
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid var(--cream);
    border-radius: 6px;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.btn-primary:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: progress;
    transform: none;
    box-shadow: none;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 22px;
    color: var(--accent);
    font-size: 0.95rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

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

/* --- Seções ------------------------------------------------------------ */
.section {
    padding-block: 90px;
}

.section-title {
    margin-bottom: 54px;
    color: var(--text-strong);
    font-size: clamp(1.4rem, 2.4vw, 1.95rem);
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* --- Sobre mim --------------------------------------------------------- */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 375px;
    gap: 80px;
    align-items: start;
}

.about-text p {
    color: var(--text);
    font-size: clamp(0.9rem, 1.3vw, 1.08rem);
    line-height: 2;
}

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

.about-img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* --- Projetos (abas) --------------------------------------------------- */
.tabs {
    display: grid;
    grid-template-columns: 288px minmax(0, 1fr);
    gap: 52px;
    align-items: start;
}

.tab-list {
    list-style: none;
}

.tab-btn {
    display: block;
    width: 100%;
    padding: 15px 22px;
    background: transparent;
    color: var(--muted);
    font-size: 1.02rem;
    text-align: left;
    border: 0;
    border-left: 2px solid var(--border);
    cursor: pointer;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.tab-btn:hover {
    background: var(--accent-soft);
    color: var(--text-strong);
}

.tab-btn.active {
    background: var(--accent-soft);
    color: var(--text-strong);
    border-left-color: var(--accent);
}

.tab-panel[hidden] {
    display: none;
}

.job-title {
    color: var(--text-strong);
    font-size: clamp(1.25rem, 2.2vw, 1.85rem);
    font-weight: 700;
    line-height: 1.4;
}

.job-date {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.job-details {
    margin-top: 34px;
    list-style: none;
    display: grid;
    gap: 22px;
}

.job-details li {
    position: relative;
    padding-left: 30px;
    color: var(--text);
    font-size: clamp(0.88rem, 1.25vw, 1.02rem);
    line-height: 1.95;
}

.job-details li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.job-details strong {
    color: var(--text-strong);
    font-weight: 500;
}

.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.job-tags span {
    padding: 7px 14px;
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 0.82rem;
    border: 1px solid var(--border);
    border-radius: 999px;
}

.tab-panel .btn-ghost {
    margin-top: 34px;
}

/* --- Skills ------------------------------------------------------------ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

.skill-card {
    padding: 30px 26px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.skill-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
}

.skill-card h3 {
    color: var(--accent);
    font-size: 1.08rem;
    font-weight: 700;
}

.skill-card p {
    margin-top: 14px;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.85;
}

.skill-card .job-tags {
    margin-top: 22px;
}

.skill-card .job-tags span {
    background: var(--surface);
}

/* --- Contato ----------------------------------------------------------- */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 72px;
    align-items: start;
}

.contact-copy p {
    color: var(--text);
    font-size: clamp(0.9rem, 1.3vw, 1.08rem);
    line-height: 2;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.contact-form {
    display: grid;
    gap: 16px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 16px 18px;
    background: var(--bg-soft);
    color: var(--text);
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    resize: vertical;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--muted);
}

.contact-form input:focus,
.contact-form textarea:focus {
    background: var(--surface);
    border-color: var(--accent);
}

/* Armadilha para robôs: fora da tela, fora da ordem de tabulação. */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-status {
    margin: 0;
    color: var(--accent);
    font-size: 0.9rem;
    line-height: 1.7;
}

.form-status.error {
    color: #f08a8a;
}

/* --- Footer ------------------------------------------------------------ */
.site-footer {
    padding: 70px 24px 56px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 2;
    text-align: center;
}

/* --- Voltar ao topo ---------------------------------------------------- */
#btn-top {
    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 40;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    background: var(--cream);
    color: var(--bg);
    font-size: 1.15rem;
    border: 0;
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    transform: translateY(12px);
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;
}

#btn-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Scroll reveal ----------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition:
        opacity 0.7s ease,
        transform 0.7s ease;
}

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

/* --- Responsivo -------------------------------------------------------- */
@media (max-width: 980px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 44px;
        justify-items: center;
    }

    .about-img {
        max-width: 340px;
    }

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

@media (max-width: 820px) {
    .section {
        padding-block: 64px;
    }

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

    .tabs {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .tab-list {
        display: flex;
        gap: 4px;
        overflow-x: auto;
        border-bottom: 1px solid var(--border);
        scrollbar-width: none;
    }

    .tab-list::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        width: auto;
        white-space: nowrap;
        border-left: 0;
        border-bottom: 2px solid transparent;
    }

    .tab-btn.active {
        border-left: 0;
        border-bottom-color: var(--accent);
    }
}

@media (max-width: 560px) {
    .social-links {
        gap: 18px;
    }

    .social-links a {
        font-size: 0.9rem;
    }

    .social-links i {
        font-size: 1.05rem;
    }

    .hero {
        padding: 60px 20px;
    }

    .hero .btn-primary {
        margin-top: 40px;
        width: 100%;
    }

    .contact-actions .btn-ghost {
        width: 100%;
        justify-content: center;
    }
}

/* --- Acessibilidade: reduzir movimento --------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

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

    .reveal {
        opacity: 1;
        transform: none;
    }
}
