/* ============================================================
   Frankson Souza — Portfólio
   Design system: dark, tipografia Space Grotesk + Inter
   ============================================================ */

/*===== Tokens =====*/
:root {
    --bg: #0a0d12;
    --bg-elev: #10141b;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text: #eceef2;
    --text-muted: #9aa3b2;
    --text-faint: #6b7382;

    --accent: #4d7fff;
    --accent-bright: #7ba2ff;
    --accent-soft: rgba(77, 127, 255, 0.12);

    --font-display: "Space Grotesk", sans-serif;
    --font-body: "Inter", sans-serif;

    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

    --radius: 14px;
    --header-h: 64px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

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

ul,
ol {
    list-style: none;
}

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

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

.section {
    padding-block: 96px;
}

.section__eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-bright);
    margin-bottom: 12px;
}

.section__title {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.section__desc {
    color: var(--text-muted);
    max-width: 560px;
    margin-bottom: 40px;
}

.text-accent {
    color: var(--accent-bright);
}

/*===== Reveal on scroll =====*/
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 450ms var(--ease-out), transform 450ms var(--ease-out);
    will-change: opacity, transform;
}

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

/*===== Header =====*/
.header {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-h);
    z-index: 100;
    background: rgba(10, 13, 18, 0.72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 250ms var(--ease-out), background-color 250ms var(--ease-out);
}

.header.scrolled {
    border-bottom-color: var(--border);
    background: rgba(10, 13, 18, 0.88);
}

.nav {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav__logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.nav__logo-accent {
    color: var(--accent-bright);
}

.nav__list {
    display: flex;
    gap: 4px;
}

.nav__link {
    position: relative;
    display: inline-block;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 180ms var(--ease-out);
}

.nav__link::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 2px;
    border-radius: 1px;
    background: var(--accent-bright);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 200ms var(--ease-out);
}

.nav__link:hover,
.nav__link.active {
    color: var(--text);
}

.nav__link.active::after {
    transform: scaleX(1);
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/*----- Switch de idioma (PT/EN) -----*/
.lang-switch {
    position: relative;
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.lang-switch__thumb {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    border-radius: 999px;
    background: var(--accent);
    transition: transform 220ms var(--ease-out);
}

.lang-switch[data-active="en"] .lang-switch__thumb {
    transform: translateX(100%);
}

.lang-btn {
    position: relative;
    z-index: 1;
    width: 44px;
    padding: 6px 0;
    border: none;
    background: none;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-faint);
    cursor: pointer;
    transition: color 180ms var(--ease-out), transform 160ms var(--ease-out);
}

.lang-btn:active {
    transform: scale(0.97);
}

.lang-btn.active {
    color: #fff;
}

@media (hover: hover) and (pointer: fine) {
    .lang-btn:not(.active):hover {
        color: var(--text-muted);
    }
}

.nav__github {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    transition: border-color 180ms var(--ease-out), background-color 180ms var(--ease-out),
        transform 160ms var(--ease-out);
}

.nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav__toggle span {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 1px;
    background: var(--text);
    transition: transform 250ms var(--ease-in-out), opacity 200ms var(--ease-out);
}

.nav__toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav__toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/*===== Hero =====*/
.hero {
    min-height: calc(100svh - var(--header-h));
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    align-items: center;
    gap: 64px;
    padding-top: calc(var(--header-h) + 32px);
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.hero__badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
    animation: pulse 2.4s var(--ease-in-out) infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(52, 211, 153, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 6.5vw, 4.2rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    background: linear-gradient(180deg, #ffffff 30%, #aeb7c6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-muted);
    max-width: 480px;
    margin-bottom: 36px;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 36px;
}

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

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    transition: color 180ms var(--ease-out), border-color 180ms var(--ease-out),
        background-color 180ms var(--ease-out), transform 160ms var(--ease-out);
}

.hero__photo {
    position: relative;
    justify-self: center;
}

.hero__photo img {
    width: min(340px, 72vw);
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-strong);
}

.hero__photo-ring {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    border: 1px solid var(--accent-soft);
    background: radial-gradient(circle at 30% 20%, rgba(77, 127, 255, 0.16), transparent 55%);
    pointer-events: none;
}

/*===== Buttons =====*/
.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 160ms var(--ease-out), background-color 180ms var(--ease-out),
        border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.button:active {
    transform: scale(0.97);
}

.button--primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 0 rgba(77, 127, 255, 0.4);
}

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

@media (hover: hover) and (pointer: fine) {

    .nav__github:hover,
    .social-icon:hover,
    .button--ghost:hover {
        border-color: var(--border-strong);
        background-color: var(--surface-hover);
    }

    .social-icon:hover {
        color: var(--text);
    }

    .button--primary:hover {
        background: #5d8aff;
        box-shadow: 0 8px 24px -8px rgba(77, 127, 255, 0.55);
    }
}

/*===== Sobre =====*/
.about__text {
    max-width: 720px;
    color: var(--text-muted);
    display: grid;
    gap: 16px;
    font-size: 1.05rem;
}

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

/*===== Skills =====*/
.skills__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    transition: border-color 180ms var(--ease-out), background-color 180ms var(--ease-out);
}

.skill-chip__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--dot, var(--accent));
}

@media (hover: hover) and (pointer: fine) {
    .skill-chip:hover {
        border-color: var(--border-strong);
        background-color: var(--surface-hover);
    }
}

/*===== Trajetória =====*/
.journey {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
}

.journey__subtitle {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 28px;
    color: var(--text);
}

.timeline {
    position: relative;
    display: grid;
    gap: 8px;
}

.timeline__item {
    position: relative;
    padding: 18px 20px;
    padding-left: 24px;
    border-left: 1px solid var(--border);
    margin-left: 4px;
}

.timeline__item::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 26px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline__date {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-bright);
    margin-bottom: 6px;
}

.timeline__item h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline__item p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/*===== Projetos =====*/
.projects__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elev);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out),
        border-color 180ms var(--ease-out);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card--skeleton {
    min-height: 180px;
    opacity: 1;
    transform: none;
    background: linear-gradient(100deg, var(--bg-elev) 40%, rgba(255, 255, 255, 0.045) 50%, var(--bg-elev) 60%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

.project-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-card__icon {
    color: var(--accent-bright);
    flex-shrink: 0;
}

.project-card__links {
    display: flex;
    gap: 4px;
}

.project-card__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--text-faint);
    transition: color 180ms var(--ease-out), background-color 180ms var(--ease-out),
        transform 160ms var(--ease-out);
}

.project-card__link:active {
    transform: scale(0.97);
}

.project-card__title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.project-card__desc {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-faint);
}

.project-card__lang {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.project-card__lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.project-card__stars {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.project-card__tag {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-bright);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (hover: hover) and (pointer: fine) {
    .project-card:not(.project-card--skeleton):hover {
        border-color: var(--border-strong);
    }

    .project-card__link:hover {
        color: var(--text);
        background: var(--surface-hover);
    }
}

.projects__more {
    display: flex;
    justify-content: center;
}

/*===== Footer =====*/
.footer {
    border-top: 1px solid var(--border);
    padding-block: 40px;
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer__name {
    font-family: var(--font-display);
    font-weight: 700;
}

.footer__name span {
    color: var(--accent-bright);
}

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

.footer__social .social-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

.footer__copy {
    font-size: 0.8rem;
    color: var(--text-faint);
}

/*===== Mobile =====*/
@media (max-width: 860px) {
    .section {
        padding-block: 72px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
        min-height: auto;
        padding-bottom: 24px;
    }

    .hero__subtitle {
        margin-inline: auto;
    }

    .hero__cta,
    .hero__social {
        justify-content: center;
    }

    .hero__photo {
        order: -1;
    }

    .journey {
        grid-template-columns: 1fr;
        gap: 48px;
    }

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

    .nav__toggle {
        display: flex;
    }

    .nav__github span {
        display: none;
    }

    .nav__github {
        padding: 8px;
    }

    .nav__menu {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: rgba(10, 13, 18, 0.97);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border);
        padding: 12px 24px 20px;
        opacity: 0;
        transform: translateY(-10px);
        visibility: hidden;
        pointer-events: none;
        transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out),
            visibility 0s 220ms;
    }

    .nav__menu.show {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
        transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
    }

    .nav__list {
        flex-direction: column;
        gap: 0;
    }

    .nav__link {
        display: block;
        padding: 14px 4px;
        font-size: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .nav__link::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        width: calc(100% - 40px);
    }

    .hero__cta .button {
        flex: 1;
        justify-content: center;
    }
}

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

    .reveal,
    .project-card {
        transform: none;
        transition: opacity 200ms ease;
    }

    .hero__badge-dot,
    .project-card--skeleton {
        animation: none;
    }

    .lang-switch__thumb {
        transition: none;
    }

    .nav__toggle span,
    .nav__menu {
        transition: none;
    }
}
