/* =======================================================================
   TEMA TERMINAL / IDE
   Cores em tokens: escuro é o padrão, claro em [data-theme="light"].
   ======================================================================= */
:root {
    --bg: #0b0f14;
    --surface: #10151c;
    --surface-2: #151b23;
    --border: #232b36;
    --border-strong: #313b48;
    --text: #b8c2cf;
    --text-muted: #8b95a2;
    --title: #e8edf3;
    --comment: #7d8590;

    /* Cores de "syntax highlight" */
    --accent: #3fb950;      /* verde: prompt, primário */
    --accent-soft: rgba(63, 185, 80, 0.12);
    --blue: #58a6ff;        /* keywords */
    --purple: #bc8cff;      /* propriedades */
    --orange: #f0a35e;      /* strings */
    --yellow: #e3b341;

    --on-accent: #06210d;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    /* Brilho verde dos elementos em foco/hover */
    --glow: 0 0 0 1px rgba(63, 185, 80, 0.35), 0 10px 32px rgba(63, 185, 80, 0.14);
    --hero-glow-1: rgba(63, 185, 80, 0.13);
    --hero-glow-2: rgba(88, 166, 255, 0.10);
    --grid-line: rgba(255, 255, 255, 0.035);

    /* Calendário de contribuições */
    --contrib-0: #161b22;
    --contrib-1: #0e4429;
    --contrib-2: #006d32;
    --contrib-3: #26a641;
    --contrib-4: #39d353;

    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --radius: 10px;
    --radius-sm: 6px;

    /* Espaçamento (base 4/8) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    /* Movimento */
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --dur-fast: 150ms;
    --dur: 250ms;
    --dur-slow: 400ms;

    /* Camadas */
    --z-header: 100;
    --z-overlay: 110;
    --z-drawer: 120;

    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f6f8fa;
    --surface: #ffffff;
    --surface-2: #f0f3f6;
    --border: #d8dee4;
    --border-strong: #c3ccd5;
    --text: #3d444d;
    --text-muted: #59636e;
    --title: #1f2328;
    --comment: #6e7781;

    --accent: #1a7f37;
    --accent-soft: rgba(26, 127, 55, 0.1);
    --blue: #0969da;
    --purple: #8250df;
    --orange: #b35900;
    --yellow: #9a6700;

    --on-accent: #ffffff;
    --shadow: 0 14px 34px rgba(31, 35, 40, 0.1);
    --shadow-sm: 0 2px 6px rgba(31, 35, 40, 0.08);
    --shadow-lg: 0 24px 50px rgba(31, 35, 40, 0.16);
    --glow: 0 0 0 1px rgba(26, 127, 55, 0.35), 0 10px 28px rgba(26, 127, 55, 0.12);
    --hero-glow-1: rgba(26, 127, 55, 0.10);
    --hero-glow-2: rgba(9, 105, 218, 0.08);
    --grid-line: rgba(31, 35, 40, 0.05);

    --contrib-0: #ebedf0;
    --contrib-1: #9be9a8;
    --contrib-2: #40c463;
    --contrib-3: #30a14e;
    --contrib-4: #216e39;

    color-scheme: light;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.6;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Grade sutil de fundo, que some em direção às bordas */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
}

h1, h2, h3, h4 {
    color: var(--title);
    font-family: var(--mono);
    font-weight: 700;
    line-height: 1.25;
}

ul { list-style: none; }

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

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

button { font: inherit; color: inherit; }

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

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

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 200;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--mono);
    border-radius: var(--radius-sm);
}

.skip-link:focus { top: 1rem; }

/* ================= LAYOUT ================= */
.container {
    width: min(1120px, 100% - 2rem);
    margin-inline: auto;
}

.section {
    padding: clamp(4rem, 9vw, 7.5rem) 0 var(--space-4);
}

@media screen and (min-width: 768px) {
    .container { width: min(1120px, 100% - 3rem); }
}

/* ================= COMPONENTE: JANELA ================= */
.window {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Cards clicáveis/destacáveis: brilho verde no hover em vez de só trocar a borda */
.project-card,
.repo-card,
.log-content,
.stack-group {
    transition:
        transform var(--dur) var(--ease-out),
        border-color var(--dur) ease,
        box-shadow var(--dur) ease;
}

.window-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.4rem;
    padding: 0.55rem 0.9rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.window-dots {
    display: inline-flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.window-dots i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #ff5f57;
}

.window-dots i:nth-child(2) { background: #febc2e; }
.window-dots i:nth-child(3) { background: #28c840; }

.window-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ================= CURSOR / PROMPT ================= */
.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.15em;
    vertical-align: text-bottom;
    background: var(--accent);
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.t-prompt {
    color: var(--accent);
    font-weight: 700;
    user-select: none;
}

/* ================= BOTÕES ================= */
.button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.875rem;
    padding: 0.8rem 1.3rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
    transition:
        transform var(--dur-fast) var(--ease-out),
        box-shadow var(--dur) ease,
        background-color var(--dur) ease,
        border-color var(--dur) ease,
        color var(--dur) ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

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

.button--ghost {
    background: color-mix(in srgb, var(--surface) 60%, transparent);
    border-color: var(--border-strong);
    color: var(--title);
}

.button--ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 8px 22px var(--accent-soft);
}

/* ================= HEADER & NAV ================= */
.header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: var(--z-header);
    border-bottom: 1px solid transparent;
    transition: border-color var(--dur) ease;
}

/* O desfoque fica num pseudo-elemento: backdrop-filter no próprio header
   faria a gaveta e o overlay (position: fixed) se prenderem à altura dele */
.header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    transition: opacity var(--dur) ease;
}

.scroll-header { border-bottom-color: var(--border); }
.scroll-header::before { opacity: 1; }

.nav {
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1rem;
    color: var(--title);
    white-space: nowrap;
}

.logo-at { color: var(--text-muted); }
.logo-host { color: var(--blue); }
.logo-path { color: var(--accent); margin-right: 0.3rem; }
.logo .cursor { width: 0.55em; height: 1em; }

.nav-btns {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Celulares bem estreitos: compacta para o hambúrguer não invadir a margem */
@media screen and (max-width: 359px) {
    .nav { gap: 0.5rem; }
    .logo { font-size: 0.9rem; }
    .nav-btns { gap: 0.4rem; }
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--title);
    font-size: 1.1rem;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 2.5rem;
    padding: 0 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.lang-toggle:hover { border-color: var(--accent); }

.lang-toggle .is-active {
    color: var(--accent);
    font-weight: 700;
}

.lang-sep { color: var(--border-strong); }

/* No escuro mostra o sol (ir para o claro) e vice-versa */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

/* Hambúrguer (botão de 44px; as três barras ficam no centro) */
.nav-toggle,
.nav-close {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-right: -0.5rem;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--title);
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color var(--dur-fast) ease;
}

.nav-toggle:hover,
.nav-close:hover {
    background: var(--surface-2);
}

.nav-toggle-bars {
    display: flex;
    flex-direction: column;
    row-gap: 5px;
    width: 24px;
}

.nav-toggle-bar {
    display: block;
    height: 2px;
    border-radius: 2px;
    background-color: currentColor;
    transition: width var(--dur) var(--ease-out);
}

/* Barras de larguras diferentes, que se alinham no hover (cara de "linhas de código") */
.nav-toggle-bar:nth-child(2) { width: 70%; }
.nav-toggle-bar:nth-child(3) { width: 85%; }
.nav-toggle:hover .nav-toggle-bar { width: 100%; }

.nav-close {
    position: absolute;
    top: 0.85rem;
    right: 1.25rem;
    margin: 0;
}

.nav-close::before,
.nav-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 2px;
    margin: -1px 0 0 -11px;
    border-radius: 2px;
    background-color: currentColor;
}

.nav-close::before { transform: rotate(45deg); }
.nav-close::after { transform: rotate(-45deg); }

.nav-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(5, 8, 12, 0.6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur) ease, visibility var(--dur);
    z-index: var(--z-overlay);
}

.nav-overlay.show-overlay {
    opacity: 1;
    visibility: visible;
}

.no-scroll { overflow: hidden; }

.nav-list {
    display: flex;
    flex-direction: column;
}

.nav-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    font-family: var(--mono);
    font-size: 0.95rem;
    color: var(--text);
    transition: color var(--dur-fast) ease;
}

.nav-num {
    font-size: 0.75em;
    color: var(--accent);
}

.nav-link:hover,
.active-link {
    color: var(--title);
}

.active-link .nav-num::before {
    content: '>';
    margin-right: 0.15rem;
}

/* Rodapé da gaveta: só aparece no celular/tablet */
.nav-drawer-footer { display: none; }

@media screen and (max-width: 1023px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        display: flex;
        flex-direction: column;
        width: min(84vw, 340px);
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--surface);
        border-left: 1px solid var(--border);
        padding: 4.75rem 1.25rem max(1.5rem, env(safe-area-inset-bottom));
        box-shadow: var(--shadow-lg);
        transform: translateX(100%);
        visibility: hidden;
        transition:
            transform var(--dur-slow) var(--ease-out),
            visibility 0s linear var(--dur-slow);
        z-index: var(--z-drawer);
    }

    .nav-menu.show-menu {
        transform: none;
        visibility: visible;
        transition: transform var(--dur-slow) var(--ease-out), visibility 0s;
    }

    /* "~/navegacao" no topo, como o caminho de uma pasta */
    .nav-menu::before {
        content: attr(data-label);
        position: absolute;
        top: 1.6rem;
        left: 1.25rem;
        font-family: var(--mono);
        font-size: 0.8rem;
        color: var(--comment);
    }

    .nav-list {
        border-top: 1px solid var(--border);
    }

    .nav-list li {
        border-bottom: 1px solid var(--border);
    }

    .nav-link {
        position: relative;
        display: flex;
        align-items: center;
        gap: 0.9rem;
        min-height: 3.25rem;
        padding: 0 0.75rem;
        font-size: 1.05rem;
        transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
    }

    .nav-link:hover { background: var(--surface-2); }

    .nav-link.active-link {
        background: var(--accent-soft);
        box-shadow: inset 3px 0 0 var(--accent);
    }

    .nav-num { min-width: 2.2ch; }

    /* Links entram em sequência quando a gaveta abre */
    .nav-list li {
        opacity: 0;
        transform: translateX(16px);
        transition: opacity var(--dur) ease, transform var(--dur) var(--ease-out);
    }

    .show-menu .nav-list li {
        opacity: 1;
        transform: none;
        transition-delay: calc(80ms + var(--i, 0) * 35ms);
    }

    .nav-drawer-footer {
        display: flex;
        flex-direction: column;
        gap: var(--space-4);
        margin-top: auto;
        padding-top: var(--space-6);
    }

    .nav-drawer-footer .button { justify-content: center; }

    .nav-social {
        display: flex;
        gap: var(--space-2);
    }

    .nav-social a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        color: var(--text-muted);
        font-size: 1.2rem;
        transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
    }

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

@media screen and (min-width: 1024px) {
    .nav { height: 4.5rem; }
    .nav-toggle, .nav-close, .nav-overlay { display: none; }
    .nav-list {
        flex-direction: row;
        column-gap: clamp(1rem, 1.8vw, 1.9rem);
    }
    .nav-link {
        position: relative;
        font-size: 0.85rem;
        padding: 0.4rem 0;
    }

    /* Sublinhado verde que cresce no hover / link ativo */
    .nav-link::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 2px;
        border-radius: 2px;
        background: var(--accent);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform var(--dur) var(--ease-out);
    }

    .nav-link:hover::after,
    .active-link::after { transform: scaleX(1); }
}

/* ================= HERO ================= */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    padding: 5.5rem 0 var(--space-6);
}

/* Brilho suave verde/azul atrás do terminal e da foto */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 50% 45% at 22% 40%, var(--hero-glow-1), transparent 70%),
        radial-gradient(ellipse 40% 40% at 82% 35%, var(--hero-glow-2), transparent 70%);
}

/* No computador o hero ocupa a tela; no celular ele termina onde o conteúdo termina */
@media screen and (min-width: 900px) {
    .hero {
        min-height: 100vh;
        min-height: 100svh;
        padding: 6.5rem 0 3rem;
    }
}

.hero .terminal {
    box-shadow: var(--shadow-lg);
}

.hero-container {
    display: grid;
    gap: 2.5rem;
    align-items: center;
}

.hero-main {
    min-width: 0;
}

.terminal-body {
    padding: 1.25rem 1.25rem 1.4rem;
    font-family: var(--mono);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text);
}

.terminal-body > * + * { margin-top: 0.15rem; }

.t-comment { color: var(--comment); }

.t-line .t-cmd { color: var(--title); }

.t-out {
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.hero-title.t-out {
    font-size: clamp(2rem, 7vw, 3.4rem);
    line-height: 1.08;
    color: var(--title);
    letter-spacing: -0.02em;
    margin: 0.3rem 0 0.9rem;
    white-space: normal;
}

.hero-profession.t-out {
    color: var(--orange);
}

/* Terminal interativo (js/terminal.js) */
.t-history > * + * { margin-top: 0.15rem; }

.t-last {
    display: flex;
    align-items: center;
    gap: 1ch;
}

.t-field {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

/* Cursor piscando no início do campo, só enquanto ele está vazio e sem foco */
.t-field .cursor {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: none;
}

.t-input:placeholder-shown:not(:focus) + .cursor {
    display: inline-block;
}

.t-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    color: var(--title);
    caret-color: var(--accent);
}

/* Saída do "help": tabela comando | descrição; a descrição quebra alinhada na própria coluna */
.t-help {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.15rem 2ch;
    margin: 0.1rem 0 0.6rem;
}

.t-help-title {
    grid-column: 1 / -1;
    margin-bottom: 0.2rem;
    color: var(--text-muted);
}

.t-help-cmd,
.t-help-section {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.t-help-cmd { color: var(--accent); }
span.t-help-cmd { cursor: default; }
.t-help-section { color: var(--blue); }

button.t-help-cmd:hover,
.t-help-section:hover {
    text-decoration: underline;
}

.t-help-desc { color: var(--text-muted); }

.t-help-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5ch;
}

/* O foco no campo aparece na borda da janela */
.terminal {
    transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}

.terminal:focus-within {
    border-color: var(--accent);
    box-shadow: var(--glow), var(--shadow-lg);
}

/* Enquanto o efeito de digitação roda, só aparece o que já foi "digitado" */
@media (prefers-reduced-motion: no-preference) {
    .js .terminal-body.is-typing > :not(.is-shown) {
        visibility: hidden;
    }
}

.hero-description {
    margin: 1.75rem 0 2rem;
    max-width: 560px;
    font-size: 1.05rem;
    color: var(--text);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Até caberem os três na mesma linha, ficam empilhados com a mesma largura */
@media screen and (max-width: 599px) {
    .hero-actions { flex-direction: column; }
}

.hero-photo {
    justify-self: center;
    width: min(100%, 320px);
    transition: box-shadow var(--dur) ease;
}

/* Celular: botões logo depois do terminal, sem precisar rolar */
@media screen and (max-width: 899px) {
    .hero-container { gap: var(--space-5); }
    .hero-main { display: flex; flex-direction: column; }
    .hero-actions { order: 1; margin-top: 1.25rem; }
    .hero-description { order: 2; margin: 1.25rem 0 0; }

    /* Foto compacta acima do terminal, alinhada à esquerda, em vez de um bloco grande no fim */
    .hero-photo {
        order: -1;
        justify-self: start;
        width: 8.5rem;
    }

    .hero-photo .window-bar {
        min-height: 1.6rem;
        padding: 0.35rem 0.6rem;
    }

    .hero-photo .window-dots i {
        width: 8px;
        height: 8px;
    }

    .hero-photo .window-title { display: none; }

    .hero-photo .hero-img { aspect-ratio: 1; }
}

/* Celular estreito: esconde as linhas extras do terminal ("ls stack/") para encurtar o topo */
@media screen and (max-width: 599px) {
    .terminal-body [data-extra] { display: none; }
}

.hero-photo:hover {
    box-shadow: var(--glow), var(--shadow-lg);
}

.hero-img {
    width: 100%;
    aspect-ratio: 4 / 5;
    height: auto;
    object-fit: cover;
    background: var(--surface-2);
}

@media screen and (min-width: 768px) {
    .terminal-body { padding: 1.5rem 1.75rem 1.75rem; font-size: 0.95rem; }
}

@media screen and (min-width: 900px) {
    .hero-container {
        grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
        gap: 3.5rem;
    }
    .hero-photo { width: min(100%, 360px); justify-self: end; }
}

/* ================= CABEÇALHO DAS SEÇÕES (aba de editor) ================= */
.section-head {
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.9rem;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-color: transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Barra da aba ativa, em degradê verde → azul */
.section-tab::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 2px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: linear-gradient(90deg, var(--accent), var(--blue));
}

.section-tab i { color: var(--accent); }

.section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    margin-left: 0.75rem;
    background: linear-gradient(90deg, var(--border-strong), transparent);
}

.section-num {
    color: var(--accent);
    font-weight: 500;
    font-size: 0.7em;
}

.section-comment {
    margin-top: 0.4rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--comment);
}

/* ================= 01 SOBRE ================= */
.about-grid {
    display: grid;
    gap: 2rem;
    align-items: start;
}

.about-description {
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-description p + p { margin-top: 1.1rem; }

.about-description .highlight {
    color: var(--title);
    font-weight: 600;
}

.code {
    margin: 0;
    padding: 1.1rem 0;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.85;
}

.code code {
    display: block;
    counter-reset: line;
}

.code-line {
    display: block;
    padding: 0 1.25rem 0 0;
    white-space: pre;
}

.code-line::before {
    counter-increment: line;
    content: counter(line);
    display: inline-block;
    width: 2.6rem;
    padding-right: 1rem;
    text-align: right;
    color: var(--comment);
    opacity: 0.6;
    user-select: none;
}

.tok-kw { color: var(--purple); }
.tok-var { color: var(--blue); }
.tok-prop { color: var(--title); }
.tok-str { color: var(--orange); }
.tok-punc { color: var(--text-muted); }

@media screen and (min-width: 900px) {
    .about-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3rem; }
}

/* ================= 02 PROJETOS ================= */
/* Celular: carrossel horizontal */
/* Os cards ocupam 86% da largura: a ponta do próximo aparece e mostra que dá para rolar de lado */
.projects-container {
    display: flex;
    gap: var(--space-4);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    padding: 0.25rem 0 1rem;
    scrollbar-width: none;
}

.projects-container::-webkit-scrollbar { display: none; }

.project-card {
    flex: 0 0 86%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
}

/* Último card encosta na direita, sem sobrar espaço vazio */
.project-card:last-child:not(:first-child) { scroll-snap-align: end; }

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

.project-badge {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.55rem;
    border: 1px solid var(--yellow);
    border-radius: 50px;
    color: var(--yellow);
    font-size: 0.72rem;
}

.project-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.6s var(--ease-out);
}

/* Degradê sutil na base da imagem, que "assenta" a foto no card */
.project-img-wrapper:not(.project-placeholder):not(:has(video))::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 35%;
    pointer-events: none;
    background: linear-gradient(to top, color-mix(in srgb, var(--surface) 55%, transparent), transparent);
}

.project-card:hover .project-img { transform: scale(1.04); }

.project-note {
    margin-top: 0.75rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--comment);
}

/* Projeto sem imagem: "tela" com um trecho de terminal */
.project-placeholder {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background:
        radial-gradient(circle at 85% 20%, var(--accent-soft), transparent 55%),
        var(--surface-2);
}

.project-placeholder pre {
    font-family: var(--mono);
    font-size: 0.82rem;
    line-height: 1.8;
    color: var(--text-muted);
    white-space: pre-wrap;
}

.project-placeholder .ok { color: var(--accent); }

.project-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.75rem;
    padding: 1.25rem;
}

.project-title {
    font-size: 1.1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.project-tags li {
    padding: 0.15rem 0.55rem;
    border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
    background: color-mix(in srgb, var(--blue) 8%, transparent);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--blue);
}

.project-description {
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-more {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.82rem;
}

.project-more:hover { text-decoration: underline; }

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.project-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--title);
    font-family: var(--mono);
    font-size: 0.8rem;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.project-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.project-btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
}

.project-btn--primary:hover {
    color: var(--on-accent);
    transform: translateY(-2px);
}

/* Controles do carrossel: ← pontos → e contador "01/04" */
.projects-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.projects-nav[hidden] { display: none; }

.projects-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--title);
    font-size: 1.1rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease, opacity var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.projects-arrow:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.projects-arrow:active:not(:disabled) { transform: scale(0.94); }

.projects-arrow:disabled {
    opacity: 0.4;
    cursor: default;
}

.projects-dots {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

/* Bolinha visual de 6px num botão de 16px; as setas (44px) são o controle principal de toque */
.projects-dots { justify-content: center; }

.projects-dot {
    position: relative;
    width: 16px;
    height: 24px;
    flex-shrink: 0;
    border: none;
    padding: 0;
    cursor: pointer;
    background: none;
    transition: width var(--dur) var(--ease-out);
}

.projects-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5px;
    right: 5px;
    height: 6px;
    margin-top: -3px;
    border-radius: 50px;
    background: var(--border-strong);
    transition: background-color var(--dur) ease;
}

.projects-dot.active { width: 30px; }
.projects-dot.active::before { background: var(--accent); }

.projects-count {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.projects-count strong { color: var(--accent); }

/* Tablet e computador: grade, com o destaque ocupando a linha inteira */
@media screen and (min-width: 768px) {
    .projects-container {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
        overflow: visible;
        padding: 0;
    }

    .project-card--featured { grid-column: 1 / -1; }

    .project-card--featured .project-inner { flex-direction: row; }

    .project-card--featured .project-img-wrapper {
        width: 56%;
        flex-shrink: 0;
        aspect-ratio: auto;
        min-height: 320px;
        border-bottom: none;
        border-right: 1px solid var(--border);
    }

    .project-card--featured .project-body {
        padding: 2rem;
        justify-content: center;
    }

    .project-card--featured .project-title { font-size: 1.5rem; }

    .project-card--featured .project-description {
        -webkit-line-clamp: 6;
        line-clamp: 6;
    }

    .projects-nav { display: none; }
}

@media screen and (min-width: 768px) and (max-width: 1023px) {
    .project-card--odd { grid-column: 1 / -1; }
    .project-card--odd .project-inner { flex-direction: row; }
    .project-card--odd .project-img-wrapper {
        width: 50%;
        flex-shrink: 0;
        aspect-ratio: auto;
        border-bottom: none;
        border-right: 1px solid var(--border);
    }
}

@media screen and (min-width: 1024px) {
    .projects-container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Janela "Ler mais" */
.project-modal {
    width: min(680px, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    margin: auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.project-modal::backdrop {
    background: rgba(5, 8, 12, 0.75);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.project-modal-close {
    position: sticky;
    top: 0.75rem;
    float: right;
    margin: 0.75rem 0.75rem -3rem 0;
    z-index: 2;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.15rem;
}

.project-modal-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: top;
    border-bottom: 1px solid var(--border);
}

.project-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.5rem;
}

.project-modal-description { line-height: 1.75; }

/* ================= 03 STACK ================= */
.stack-grid {
    display: grid;
    gap: 1rem;
}

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

.stack-group:hover {
    border-color: var(--border-strong);
}

.stack-group-title {
    margin-bottom: 1rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--comment);
}

.stack-group-title span { color: var(--blue); }

.stack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.stack-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--title);
    transition:
        border-color var(--dur-fast) ease,
        background-color var(--dur-fast) ease,
        transform var(--dur-fast) var(--ease-out);
}

.stack-chip i {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: color var(--dur-fast) ease;
}

.stack-chip:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.stack-chip:hover i { color: var(--accent); }

.soft-skills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 1.5rem;
    font-family: var(--mono);
    font-size: 0.85rem;
}

.soft-skills:empty { display: none; }

.soft-skills-label { color: var(--comment); }

.soft-skill {
    color: var(--text);
}

.soft-skill:not(:last-child)::after {
    content: ',';
    color: var(--comment);
}

@media screen and (min-width: 640px) {
    .stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ================= 04/05 EXPERIÊNCIA E FORMAÇÃO (git log) ================= */
.log {
    position: relative;
    max-width: 820px;
}

/* Linha do tempo: verde no topo (mais recente), sumindo para baixo */
.log::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    left: 7px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--border) 45%);
}

.log-item {
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 1.5rem;
}

.log-dot {
    position: absolute;
    left: 0;
    top: 1.35rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    transition: box-shadow var(--dur) ease;
}

.log-item:hover .log-dot {
    box-shadow: 0 0 0 6px var(--accent-soft), 0 0 14px var(--accent-soft);
}

.log-content {
    padding: 1.25rem 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.log-content:hover {
    border-color: var(--accent);
    transform: translateX(4px);
    box-shadow: var(--glow);
}

.log-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.6rem;
    margin-bottom: 0.5rem;
    font-family: var(--mono);
    font-size: 0.78rem;
}

.log-hash { color: var(--yellow); }

.log-ref {
    color: var(--accent);
    font-weight: 700;
}

.log-date { color: var(--text-muted); }

.log-title { font-size: 1.1rem; }

.log-company {
    margin: 0.15rem 0 0.75rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--blue);
}

.log-description {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Cursos: lista estilo "ls -l" */
.courses-window {
    margin-top: 2.5rem;
}

.course-list {
    font-family: var(--mono);
    font-size: 0.84rem;
}

.course-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding: 0.8rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}

.course-row:last-child { border-bottom: none; }

.course-row:hover { background: var(--surface-2); }

.course-date { color: var(--text-muted); }

.course-title { color: var(--title); }

.course-institution { color: var(--blue); }

@media screen and (min-width: 768px) {
    .course-row {
        grid-template-columns: 9.5rem minmax(0, 1fr) 11rem;
        gap: 1.25rem;
        align-items: baseline;
    }
    .course-institution { text-align: right; }
}

/* ================= 06 GITHUB ================= */
.github-profile {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.github-profile:empty,
.github-repos:empty { display: none; }

.github-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
}

.github-profile-info {
    flex: 1;
    min-width: 160px;
}

.github-profile-name { font-size: 1.1rem; }

.github-profile-meta {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.github-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.github-stat {
    display: flex;
    flex-direction: column;
    font-family: var(--mono);
}

.github-stat strong {
    color: var(--title);
    font-size: 1.15rem;
}

.github-stat span {
    font-size: 0.72rem;
    color: var(--comment);
}

.github-activity { margin-bottom: 1.25rem; }

.github-activity-body { padding: 1.25rem 1.5rem 1.5rem; }

.contrib-scroll {
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.contrib-grid {
    display: grid;
    grid-template-rows: repeat(7, 11px);
    grid-auto-flow: column;
    grid-auto-columns: 11px;
    gap: 3px;
    width: max-content;
}

.contrib-cell,
.contrib-legend i {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: var(--contrib-0);
}

.contrib-cell--empty { background: transparent; }

/* Em telas largas a grade estica para ocupar a janela inteira */
@media screen and (min-width: 1024px) {
    .contrib-grid {
        width: 100%;
        grid-template-rows: repeat(7, auto);
        grid-auto-columns: minmax(0, 1fr);
    }
    .contrib-grid .contrib-cell {
        width: auto;
        height: auto;
        aspect-ratio: 1;
    }
}

[data-level="1"] { background: var(--contrib-1); }
[data-level="2"] { background: var(--contrib-2); }
[data-level="3"] { background: var(--contrib-3); }
[data-level="4"] { background: var(--contrib-4); }

.contrib-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    margin-top: 0.5rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--comment);
}

.contrib-legend span { margin: 0 0.3rem; }

.lang-stats { margin-top: 1.25rem; }

.lang-stats:empty { display: none; }

.lang-bar {
    display: flex;
    height: 8px;
    overflow: hidden;
    border-radius: 50px;
    background: var(--surface-2);
}

.lang-bar span { height: 100%; }

.lang-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    margin-top: 0.75rem;
    font-family: var(--mono);
    font-size: 0.78rem;
}

.lang-legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.lang-legend small { color: var(--comment); }

.github-repos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.repo-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.15rem 1.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.repo-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--glow);
}

.repo-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--title);
}

.repo-header > i {
    font-size: 1.15rem;
    color: var(--text-muted);
}

.repo-name {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--blue);
    word-break: break-word;
}

.repo-arrow {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.25s ease, color 0.25s ease;
}

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

.repo-description {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.6;
}

.repo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--text-muted);
}

.repo-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.github-status {
    grid-column: 1 / -1;
    text-align: center;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.github-status a { color: var(--accent); }

@media screen and (min-width: 640px) {
    .github-repos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (min-width: 1024px) {
    .github-repos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ================= 07 CONTATO ================= */
.contact-window {
    max-width: 820px;
}

.contact-list {
    padding: 0.5rem 0;
}

.contact-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "cmd cmd arrow"
        "icon data arrow";
    align-items: center;
    gap: 0.2rem 0.6rem;
    min-height: 3rem;
    padding: 0.85rem 1.4rem;
    font-family: var(--mono);
    font-size: 0.9rem;
    transition: background-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.contact-item:hover {
    background: var(--surface-2);
    box-shadow: inset 3px 0 0 var(--accent);
}

.contact-cmd {
    grid-area: cmd;
    color: var(--title);
}

.contact-icon {
    grid-area: icon;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.contact-data {
    grid-area: data;
    color: var(--orange);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-arrow {
    grid-area: arrow;
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

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

.contact-item:hover .contact-icon { color: var(--accent); }

@media screen and (min-width: 640px) {
    .contact-item {
        grid-template-columns: 7.5rem auto minmax(0, 1fr) auto;
        grid-template-areas: "cmd icon data arrow";
    }
}

/* Contatos + formulário: lado a lado no computador, empilhados no celular */
.contact-grid {
    display: grid;
    gap: 1.25rem;
    align-items: start;
}

@media screen and (min-width: 1024px) {
    .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.contact-form-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.4rem 1.4rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--title);
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: max(16px, 0.88rem); /* 16px evita o zoom automático do iPhone ao focar */
    color: var(--title);
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.form-field textarea {
    resize: vertical;
    min-height: 6.5rem;
    line-height: 1.6;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: var(--comment);
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.form-actions .button:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.form-status {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.form-status.is-sent { color: var(--accent); }
.form-status.is-error { color: #f85149; }
:root[data-theme="light"] .form-status.is-error { color: #cf222e; }

.download-resume {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* Quando quebram em duas linhas, os botões ocupam a largura da coluna por igual */
.hero-actions .button,
.download-resume .button {
    flex: 1 1 auto;
    justify-content: center;
}

/* ================= FOOTER ================= */
.footer {
    margin-top: clamp(4rem, 9vw, 6rem);
    padding: 2rem 0 max(2rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--comment);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 0.75rem;
    text-align: center;
}

.footer a {
    color: var(--text);
    transition: color 0.2s ease;
}

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

.footer-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.footer-top .t-prompt { font-weight: 400; }

@media screen and (max-width: 639px) {
    .footer-sep { display: none; }
    .footer-inner { flex-direction: column; }
}

/* ================= ANIMAÇÕES DE ENTRADA ================= */
.reveal,
.reveal-delay {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s var(--ease-out);
}

.reveal-delay { transition-delay: 0.15s; }

.reveal.active,
.reveal-delay.active {
    opacity: 1;
    transform: none;
}

/* Sem JS, nada fica escondido */
:root:not(.js) .reveal,
:root:not(.js) .reveal-delay {
    opacity: 1;
    transform: none;
}

/* ================= MOVIMENTO REDUZIDO ================= */
@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,
    .reveal-delay {
        opacity: 1;
        transform: none;
    }

    .cursor { animation: none; }

    .nav-list li {
        opacity: 1 !important;
        transform: none !important;
    }
}
