@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,500;1,700&display=swap");

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
    --bg: #060912;
    --bg-alt: #0a0f1c;
    --bg-card: #101a2c;
    --bg-card-2: #0d1626;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --accent: #17b6ff;
    --accent-2: #7c5cff;
    --accent-gradient: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
    --text: #eef2f9;
    --text-muted: #9aa5bd;
    --text-dim: #6c7891;
    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow-glow: 0 10px 40px -10px rgba(23, 182, 255, 0.35);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

html, body {
    font-family: "Ubuntu", Arial, sans-serif;
    width: 100%;
    height: 100%;
    background: var(--bg);
    color: var(--text);
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Poppins", "Ubuntu", sans-serif;
    color: var(--text);
}

p, li, span, a, label, input, textarea, button {
    color: var(--text-muted);
}

.pre-line { white-space: pre-line; }

a { transition: color 0.25s var(--ease); }

img { max-width: 100%; }

/* ==========================================================================
   Scrollbar
   ========================================================================== */
*::-webkit-scrollbar { width: 10px; }
*::-webkit-scrollbar-track {
    width: 12px;
    background-color: var(--bg);
}
*::-webkit-scrollbar-thumb {
    background: var(--accent-gradient);
    border-radius: 10px;
}

/* ==========================================================================
   Flash toast (Flask messages)
   ========================================================================== */
.flash-toast {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 10001;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-left: 4px solid #2ee6a6;
    color: var(--text);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 15px 40px -10px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 320px;
    animation: toastIn 0.4s var(--ease);
}
.flash-toast i { color: #2ee6a6; font-size: 1.2rem; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Sidebar / header
   ========================================================================== */
#header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background: linear-gradient(180deg, #071022 0%, #050810 100%);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    width: 300px;
    transition: all ease-in-out 0.5s;
    padding: 0 15px;
    z-index: 9997;
}

#header .profile img {
    margin: 25px auto 15px;
    display: block;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 3px solid var(--bg);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--accent), 0 0 30px -4px var(--accent);
    animation: floaty 4s ease-in-out infinite;
}

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

#header .profile h1 {
    font-size: 23px;
    margin: 0;
    padding: 0;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.3px;
    color: #fff;
}

#header .profile .role-tag {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-top: 4px;
    font-weight: 600;
}

#header .profile .social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

#header .profile .social-links a {
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: #fff;
    width: 2.6rem;
    height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0 !important;
    border-radius: 50%;
    transition: 0.3s var(--ease);
    text-decoration: none;
}

#header .profile .social-links a:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px -6px var(--accent);
}

.nav-menu {
    padding: 1.5rem 0.5rem;
}

.nav-menu a,
.nav-menu a:focus {
    display: flex;
    align-items: center;
    color: var(--text-dim);
    transition: 0.25s var(--ease);
    font-size: 15px;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.75rem;
    margin-bottom: 2px;
    position: relative;
}

.nav-menu a i,
.nav-menu a:focus i {
    font-size: 20px;
    padding-right: 0.8rem;
    color: var(--text-dim);
}

.nav-menu a:hover,
.nav-menu .active,
.nav-menu .active:focus,
.nav-menu li:hover > a {
    text-decoration: none;
    color: #fff;
    background: rgba(23, 182, 255, 0.1);
}

.nav-menu a:hover i,
.nav-menu .active i,
.nav-menu .active:focus i,
.nav-menu li:hover > a i {
    color: var(--accent);
}

.nav-menu .active::before {
    content: "";
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    border-radius: 4px;
    background: var(--accent-gradient);
}

#main {
    margin-left: 300px;
}

/* ==========================================================================
   Hero
   ========================================================================== */
section#inicio {
    position: relative;
    background-image: linear-gradient(120deg, rgba(4, 8, 18, 0.88), rgba(6, 10, 25, 0.75)), url("./img/FundoPrincipal.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

section#inicio::before,
section#inicio::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}
section#inicio::before {
    width: 420px;
    height: 420px;
    background: var(--accent);
    top: -120px;
    right: -100px;
    animation: blobMove 10s ease-in-out infinite;
}
section#inicio::after {
    width: 380px;
    height: 380px;
    background: var(--accent-2);
    bottom: -140px;
    left: -80px;
    animation: blobMove 12s ease-in-out infinite reverse;
}
@keyframes blobMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, 30px) scale(1.15); }
}

section#inicio .row { position: relative; z-index: 1; height: 100%; }

section#inicio h2 {
    font-size: 5.2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.4rem;
    line-height: 1.05;
}

section#inicio span#subtitle {
    margin-right: 8rem;
    font-size: 1.4rem;
    color: var(--text-muted) !important;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
}

section#inicio span#subtitle .cursor {
    display: inline-block;
    width: 2px;
    height: 1.4rem;
    background: var(--accent);
    margin-left: 4px;
    animation: blink 0.9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.text-shadow {
    text-shadow: 4px 4px 20px rgba(0, 0, 0, 0.6);
}

section#inicio div#arraste {
    width: 10rem;
    margin: 0 2.5rem 2.5rem 0;
    animation: bounceDown 2s ease-in-out infinite;
}
@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}
section#inicio div#arraste a {
    text-decoration: none;
    color: #fff;
    font-size: 0.95rem;
}

i.menu-mobile {
    position: fixed;
    color: #fff;
    background: var(--accent-gradient);
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    border-radius: 4rem;
    cursor: pointer;
    z-index: 10000;
    width: 45px;
    height: 45px;
    display: none;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.5);
}

.menu-nav-active { overflow: hidden; }
.menu-nav-active #header { left: 0; }

/* ==========================================================================
   Sections common
   ========================================================================== */
.section-bg { background-color: var(--bg-alt); }

.section-title {
    position: relative;
    font-weight: 700;
    padding-bottom: 0.9rem;
    margin-bottom: 0.4rem !important;
    display: inline-block;
}
.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 60px;
    border-radius: 4px;
    background: var(--accent-gradient);
}

/* ==========================================================================
   Skills / progress bars
   ========================================================================== */
.progress {
    height: 20px;
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}
.progress-bar {
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 20px;
    text-align: right;
    padding-right: 10px;
    width: 0;
    min-width: 2.5em;
    white-space: nowrap;
    transition: width 1.4s var(--ease);
    box-shadow: 0 0 12px -2px var(--accent);
}

/* ==========================================================================
   CV timeline
   ========================================================================== */
.cv .cv-title {
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 20px;
    color: var(--text);
}
.cv .cv-item {
    padding: 0 0 26px 22px;
    margin-top: -2px;
    border-left: 2px solid var(--border-strong);
    position: relative;
    transition: border-color 0.3s var(--ease);
}
.cv .cv-item:hover { border-left-color: var(--accent); }
.cv .cv-item h4 {
    line-height: 18px;
    font-weight: 600;
    text-transform: uppercase;
    font-family: "Poppins", sans-serif;
    color: var(--text);
    margin-bottom: 10px;
    font-size: 0.95rem;
}
.cv .cv-item h5 {
    background: rgba(23, 182, 255, 0.12);
    color: var(--accent);
    padding: 5px 15px;
    display: inline-block;
    font-weight: 600;
    margin-bottom: 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}
.cv .cv-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -9px;
    width: 16px;
    height: 16px;
    border: 2px solid var(--bg-alt);
    border-radius: 50%;
    background: var(--accent-gradient);
    box-shadow: 0 0 0 2px var(--accent);
}

/* ==========================================================================
   Portfolio / Projects — the highlight of the page
   ========================================================================== */
#portfolio .lead-text { max-width: 720px; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1.5rem 0 2.5rem;
}
.filter-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1.1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s var(--ease);
}
.filter-btn:hover {
    color: #fff;
    border-color: var(--accent);
}
.filter-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
}

.project-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s var(--ease), opacity 0.35s ease, height 0s;
    will-change: transform;
}
.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--border-strong);
    box-shadow: 0 25px 50px -18px rgba(0, 0, 0, 0.65), var(--shadow-glow);
}
.project-card.hide {
    display: none;
}

.project-card .featured-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.5);
}

.project-card .thumb {
    position: relative;
    height: 190px;
    overflow: hidden;
}
.project-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}
.project-card:hover .thumb img { transform: scale(1.1); }

.project-card .thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, var(--bg-card) 100%);
}

.project-card .body {
    padding: 1.4rem 1.4rem 1.6rem;
}

.project-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.7rem;
}
.project-card .tags span {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    background: rgba(23, 182, 255, 0.12);
    color: var(--accent);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
}

.project-card .card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.project-card .card-text {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.project-card .project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: gap 0.25s var(--ease), color 0.25s var(--ease);
}
.project-card .project-link:hover {
    color: #fff;
    gap: 0.65rem;
}

@media (min-width: 1201px) {
    .project-card { transform-style: preserve-3d; perspective: 800px; }
}

/* ==========================================================================
   Contact
   ========================================================================== */
#contato .card {
    background: var(--bg-card);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg);
}
#contato .endereco, #contato .email { margin-bottom: 1.5rem; }
#contato .endereco h4, #contato .email h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.3rem;
}
#contato .endereco i, #contato .email i, #contato h4 i { color: var(--accent); margin-right: 0.4rem; }

#contato iframe {
    border-radius: var(--radius);
    filter: invert(92%) hue-rotate(180deg) contrast(90%);
    margin-top: 1rem;
}

.contact-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.contact-form .form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1.2rem;
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.contact-form .form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(23, 182, 255, 0.2);
}
.contact-form textarea.form-control { min-height: 140px; resize: vertical; }

.btn-gradient {
    background: var(--accent-gradient);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1.8rem;
    border-radius: 30px;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
    cursor: pointer;
}
.btn-gradient:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
    color: #fff;
}

/* ==========================================================================
   Back to top
   ========================================================================== */
.back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s var(--ease);
    box-shadow: 0 10px 25px -6px rgba(0, 0, 0, 0.6);
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover { transform: translateY(-4px); }

/* ==========================================================================
   Scroll reveal animation
   ========================================================================== */
[data-anime] {
    opacity: 0;
    transition: transform 0.9s var(--ease), opacity 0.9s var(--ease);
}
[data-anime="down"] { transform: translate3d(0, -60px, 0); }
[data-anime="up"] { transform: translate3d(0, 60px, 0); }
[data-anime="left"] { transform: translate3d(-60px, 0, 0); }
[data-anime="right"] { transform: translate3d(60px, 0, 0); }

[data-anime].animate {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
    .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    #header { left: -300px; }
    i.menu-mobile { display: flex; }
    section#inicio h2 { font-size: 3.5rem; }
    section#inicio span#subtitle { margin-right: 0; font-size: 1rem; }
    #main { margin-left: 0; }
}

@media (max-width: 767px) {
    .project-grid { grid-template-columns: 1fr; }
    section#inicio h2 { font-size: 2.5rem; }
    .flash-toast { left: 1rem; right: 1rem; max-width: none; }
}
