/* =========================================================
   GERAL
========================================================= */

:root {
    --blue: #1e90ff;
    --blue-light: #4dabff;

    --dark: #080b10;
    --dark-light: #0d1117;
    --card: #111720;

    --white: #f5f7fa;
    --text: #aeb7c4;
    --border: rgba(255, 255, 255, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--dark);
    color: var(--white);
    font-family: "DM Sans", sans-serif;
    overflow-x: hidden; /* evita scroll horizontal em mobile */
}

a {
    text-decoration: none;
}

section {
    scroll-margin-top: 80px;
}


/* =========================================================
   NAVBAR
========================================================= */

.navbar {
    background: rgba(8, 11, 16, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);

    transition: 0.3s;

    /* RESP #16 - respeitar safe-area iOS */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.navbar.scrolled {
    background: rgba(8, 11, 16, 0.97);
}

.navbar-brand {
    color: var(--white);
    font-family: "Space Mono", monospace;
    font-size: 1.4rem;
    font-weight: 700;
}

.navbar-brand span {
    color: var(--blue);
}

.nav-link {
    color: var(--text);
    margin-left: 20px;
    transition: 0.3s;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--blue);
}

/* a11y #3 - foco visível */
.navbar-toggler {
    border: 1px solid var(--border);
    padding: 6px 10px;
}

.navbar-toggler:focus,
.navbar-toggler:focus-visible {
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.35);
    outline: none;
}

.navbar-toggler i {
    color: var(--white);
    font-size: 1.5rem;
}


/* =========================================================
   HERO
========================================================= */

.hero {
    position: relative;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 80% 50%,
            rgba(30, 144, 255, 0.12),
            transparent 35%
        );
}

.hero::before {
    content: "";

    position: absolute;
    inset: 0;

    background-image:
        linear-gradient(
            rgba(255,255,255,0.025) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255,255,255,0.025) 1px,
            transparent 1px
        );

    background-size: 50px 50px;

    pointer-events: none;
}

.hero-tag {
    color: var(--text);
    font-family: "Space Mono", monospace;
    margin-bottom: 20px;
}

.hero-tag span {
    color: var(--blue);
}

.hero h1 {
    max-width: 750px;

    font-size: clamp(2.5rem, 7vw, 5.5rem); /* RESP #2 - mínimo reduzido */
    font-weight: 700;
    line-height: 1.05;
}

.hero h1 span,
.contact-box h2 span {
    color: var(--blue);
}

.hero-description {
    max-width: 650px;

    margin-top: 25px;
    margin-bottom: 35px;

    color: var(--text);

    font-size: clamp(1rem, 1.5vw, 1.15rem); /* RESP #2 - fluido */
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}


/* =========================================================
   BOTÕES  -  RESP #6: área de toque mínima 44px
========================================================= */

.btn-primary-custom {
    background: var(--blue);
    border: 1px solid var(--blue);

    color: white;

    padding: 12px 24px;
    min-height: 44px;       /* a11y touch target */
    display: inline-flex;
    align-items: center;
    justify-content: center;

    transition: 0.3s;
}

.btn-primary-custom:hover {
    background: var(--blue-light);
    border-color: var(--blue-light);

    color: white;

    transform: translateY(-2px);
}

.btn-outline-custom {
    border: 1px solid var(--border);

    color: var(--white);

    padding: 12px 24px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    transition: 0.3s;
}

.btn-outline-custom:hover {
    border-color: var(--blue);
    color: var(--blue);

    transform: translateY(-2px);
}

/* SEO #12 - indicar link externo */
a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.8em;
    opacity: 0.6;
}


/* =========================================================
   TERMINAL
========================================================= */

.hero-terminal {
    position: relative;

    width: 100%;            /* RESP #5 - ocupa toda a coluna */
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;

    background: #07090d;

    border: 1px solid rgba(30, 144, 255, 0.25);

    border-radius: 12px;

    box-shadow:
        0 0 60px rgba(30, 144, 255, 0.08);

    animation: float 5s ease-in-out infinite;
}

.terminal-header {
    display: flex;
    gap: 7px;

    padding: 12px 15px;

    border-bottom: 1px solid var(--border);
}

.terminal-header span {
    width: 10px;
    height: 10px;

    border-radius: 50%;

    background: #3b4350;
}

.terminal-body {
    padding: 25px;

    font-family: "Space Mono", monospace;
    font-size: 0.85rem;
    word-break: break-word;
}

.terminal-symbol {
    color: var(--blue);
}

.terminal-output {
    color: #dce3eb;
    margin-bottom: 20px;
}

.terminal-success {
    color: #4ade80;
}


/* =========================================================
   SEÇÕES
========================================================= */

.section {
    padding: 120px 0;
    /* SEO/RESP #1 - visível POR PADRÃO; JS opcional adiciona fade-in */
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.section-dark {
    background: var(--dark-light);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 15px;

    margin-bottom: 60px;
}

.section-title span {
    color: var(--blue);

    font-family: "Space Mono", monospace;
    font-size: 0.9rem;
}

.section-title h2 {
    margin: 0;

    font-size: clamp(1.6rem, 3.5vw, 2.5rem); /* RESP #2 - fluido */
}


/* =========================================================
   SOBRE
========================================================= */

.about-image {
    position: relative;

    max-width: 400px;
    margin: auto;
}

.about-image::before {
    content: "";

    position: absolute;

    width: 100%;
    height: 100%;

    border: 1px solid var(--blue);

    border-radius: 12px;

    transform: translate(15px, 15px);

    z-index: 0;
}

.about-image img {
    position: relative;

    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;

    border-radius: 12px;

    display: block;

    z-index: 1;
}

.section-text {
    color: var(--text);

    font-size: 1.05rem;
    line-height: 1.8;

    margin-bottom: 20px;
}


/* =========================================================
   CARDS  -  RESP #7: altura uniforme com flex
========================================================= */

.tech-card,
.project-card {
    height: 100%;

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 10px;

    transition: 0.3s;

    display: flex;
    flex-direction: column;
}

.tech-card {
    padding: 30px;
}

.tech-card:hover,
.project-card:hover {
    border-color: rgba(30, 144, 255, 0.5);

    transform: translateY(-5px);
}

.tech-card i {
    color: var(--blue);

    font-size: 2rem;

    margin-bottom: 25px;
}

.tech-card h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
}

.tech-card p {
    color: var(--text);

    line-height: 1.7;

    margin: 0;
}


/* =========================================================
   TECNOLOGIAS  -  RESP #8: max-width + centradas
========================================================= */

.technologies {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;

    max-width: 900px;
    margin: 0 auto;
}

.technologies span,
.project-tech span {
    background: rgba(30, 144, 255, 0.08);

    border: 1px solid rgba(30, 144, 255, 0.2);

    color: #9dccff;

    border-radius: 5px;

    padding: 8px 14px;

    font-family: "Space Mono", monospace;
    font-size: 0.8rem;

    display: inline-flex;
    align-items: center;
}


/* =========================================================
   PROJETOS
========================================================= */

.project-image {
    height: 180px;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle,
            rgba(30, 144, 255, 0.15),
            transparent 60%
        );

    border-bottom: 1px solid var(--border);
}

.project-image i {
    color: var(--blue);

    font-size: 4rem;
}

.project-body {
    padding: 25px;
    flex: 1;            /* RESP #7 - empurra o link para baixo */
    display: flex;
    flex-direction: column;
}

.project-type {
    color: var(--blue);

    font-family: "Space Mono", monospace;

    font-size: 0.75rem;
}

.project-body h3 {
    margin-top: 10px;
}

.project-body p {
    color: var(--text);

    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin: 20px 0;
}

.project-tech span {
    padding: 5px 9px;
    font-size: 0.7rem;
}

/* RESP #6 - área de toque mínima */
.project-link {
    color: var(--white);

    transition: 0.3s;

    display: inline-flex;
    align-items: center;
    gap: 6px;

    min-height: 44px;
}

.project-link:hover {
    color: var(--blue);
}


/* =========================================================
   CONTATO
========================================================= */

.contact-box {
    max-width: 800px;

    margin: auto;

    text-align: center;

    padding: 70px 30px;

    background:
        radial-gradient(
            circle at center,
            rgba(30, 144, 255, 0.12),
            transparent 60%
        );

    border: 1px solid var(--border);

    border-radius: 15px;
}

.contact-box h2 {
    font-size: clamp(1.6rem, 4vw, 4rem); /* RESP #2 - fluido */
}

.contact-box p:not(.hero-tag) {
    color: var(--text);

    max-width: 550px;

    margin: 20px auto 30px;

    line-height: 1.7;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}


/* =========================================================
   FOOTER
========================================================= */

footer {
    padding: 30px 0;

    background: #05070a;

    border-top: 1px solid var(--border);
}

footer p {
    color: #68717d;

    margin: 0;
}

.footer-code {
    font-family: "Space Mono", monospace;
    font-size: 0.8rem;
}


/* =========================================================
   ANIMAÇÃO
========================================================= */

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

/* RESP #5 - respeitar prefers-reduced-motion (a11y) */
@media (prefers-reduced-motion: reduce) {

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

    .hero-terminal {
        animation: none;
    }
}


/* =========================================================
   RESPONSIVIDADE  -  RESP #2: breakpoints progressivos
========================================================= */

@media (max-width: 991px) {

    .navbar-nav {
        padding: 20px 0;
    }

    .nav-link {
        margin-left: 0;
        padding: 10px 0;
    }

    .hero {
        padding-top: 100px;
    }

    .hero-terminal {
        margin-top: 60px;
    }

    .section {
        padding: 90px 0;
    }

    /* a11y #3 - menu mobile em "card" */
    .navbar-collapse {
        background: rgba(8, 11, 16, 0.98);
        margin-top: 12px;
        padding: 20px 24px;
        border-radius: 10px;
        border: 1px solid var(--border);
    }
}


@media (max-width: 768px) {

    .hero {
        padding-top: 110px;
    }

    .section {
        padding: 70px 0;
    }

    .section-title {
        margin-bottom: 40px;
        flex-wrap: wrap;
    }

    .section-title h2 {
        font-size: 1.85rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-buttons .btn {
        text-align: center;
        width: 100%;
    }

    .contact-box {
        padding: 45px 20px;
    }

    .contact-links {
        flex-direction: column;
    }

    .contact-links .btn {
        width: 100%;
    }

    .about-image::before {
        transform: translate(10px, 10px);
    }

    .hero-terminal {
        max-width: 100%;
        animation: none; /* RESP #5 - desliga float em mobile */
    }
}


@media (max-width: 480px) {

    .hero h1 {
        font-size: clamp(2rem, 9vw, 3rem);
    }

    .hero-description {
        font-size: 1rem;
    }

    .terminal-body {
        font-size: 0.75rem;
        padding: 18px;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    footer .d-flex {
        gap: 8px;
        text-align: center;
    }

    .section-title h2 {
        font-size: 1.65rem;
    }
}


/* =========================================================
   JS-OPTIONAL FADE-IN  -  SEO/RESP #1
   Visível por padrão; .is-hidden só é aplicado via JS
========================================================= */

.section.is-hidden {
    opacity: 0;
    transform: translateY(30px);
}

.section.is-visible {
    opacity: 1;
    transform: translateY(0);
}
