/* ============================================================
   Portfólio Davi Oliveira — design system "Editorial"
   Aprovado em 27/11/2026 (design-system-aprovado/). Preto e branco
   predominantes; azul petróleo só em trechos, estados e detalhes
   (trocado do vermelho original em 28/11/2026).
   Documentação: docs/DESIGN-SYSTEM.md
   ============================================================ */

/* ---------- 1. Tokens ---------- */

:root {
    --bg: #fbfbfa;
    --surface: #f0f0ee;
    --text: #1b1b1b;
    --muted: #626260;
    --border: #dcdcd8;
    /* Azul petróleo (matiz 192°): o mais claro e vivo com AA sobre --surface */
    --accent: #0c7792;
    /* Destaque sobre fundo invertido (ponto do ícone "d." no quadrado escuro) */
    --accent-inverse: #33adcc;
    /* Erros de formulário continuam em vermelho: é estado, não destaque */
    --error: #b3261e;
    --on: #fff;
    --header: #fbfbfa;
    --display: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #141414;
    --surface: #1d1d1d;
    --text: #f2f2ef;
    --muted: #aaa9a5;
    --border: #353534;
    --accent: #33adcc;
    --accent-inverse: #0c7792;
    --error: #ff8a80;
    --on: #141414;
    --header: #141414;
    color-scheme: dark;
}

/* Sem JS o tema não é aplicado pelo script: segue o sistema */
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) {
        --bg: #141414;
        --surface: #1d1d1d;
        --text: #f2f2ef;
        --muted: #aaa9a5;
        --border: #353534;
        --accent: #33adcc;
        --accent-inverse: #0c7792;
        --error: #ff8a80;
        --on: #141414;
        --header: #141414;
        color-scheme: dark;
    }
}

/* ---------- 2. Base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.65 var(--body);
    transition: background 0.2s, color 0.2s;
    overflow-wrap: break-word;
}

body:has(dialog[open]) {
    overflow: hidden;
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

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

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

h1,
h2,
h3,
h4,
p,
figure {
    margin: 0;
}

h1,
h2,
h3,
h4 {
    font-family: var(--display);
    font-weight: 650;
}

h1,
h2 {
    letter-spacing: -0.055em;
    line-height: 1.08;
}

h3 {
    letter-spacing: -0.035em;
    line-height: 1.35;
}

em {
    color: var(--accent);
    font-style: normal;
}

p {
    color: var(--muted);
}

svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

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

.container {
    width: min(1280px, calc(100% - 112px));
    margin-inline: auto;
}

main:focus {
    outline: none;
}

.muted {
    color: var(--muted);
}

.accent,
.brand-dot {
    color: var(--accent);
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 12px;
    z-index: 100;
    background: var(--text);
    color: var(--bg);
    padding: 10px 20px;
}

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

/* Controles que só funcionam com JavaScript não aparecem sem ele */
html:not(.js) .theme-toggle,
html:not(.js) .search-toggle,
html:not(.js) .menu-toggle,
html:not(.js) .terminal-trigger,
html:not(.js) .copy-email,
html:not(.js) .image-action {
    display: none;
}

html:not(.js) .project-image,
html:not(.js) .project-title {
    pointer-events: none;
    cursor: default;
}

/* ---------- 3. Cabeçalho e navegação ---------- */

.header {
    height: 88px;
    border-bottom: 1px solid var(--border);
    background: var(--header);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    height: 100%;
    max-width: 1440px;
    margin: auto;
    padding: 0 56px;
    display: flex;
    align-items: center;
    gap: 36px;
}

.brand {
    font-family: var(--display);
    font-size: 24px;
    letter-spacing: -1.4px;
    font-weight: 800;
    white-space: nowrap;
}

.brand-dot {
    padding-right: 1px;
}

/* Marca com ícone, no cabeçalho e no rodapé */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Ícone "d.": no claro igual ao favicon (quadrado escuro); no escuro
   invertido, para o quadrado não sumir no fundo */
.brand-icon {
    width: 32px;
    height: 32px;
}

.brand-icon-bg {
    fill: var(--text);
}

.brand-icon-bowl {
    stroke: var(--bg);
}

.brand-icon-stem {
    fill: var(--bg);
}

.brand-icon-dot {
    fill: var(--accent-inverse);
}

.desktop-nav {
    margin: auto;
    display: flex;
    gap: 28px;
    align-items: center;
}

.desktop-nav a {
    font-size: 14px;
    color: var(--muted);
    position: relative;
    transition: color 0.2s;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: var(--text);
}

.desktop-nav a.active::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    bottom: -10px;
    left: calc(50% - 2px);
}

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

.lang-form {
    display: flex;
    margin: 0;
}

.language {
    min-height: 40px;
    padding: 0;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    margin-right: 10px;
}

.language .muted {
    font-weight: 400;
}

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

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 40px;
    border-radius: 3px;
}

.icon-btn:hover {
    background: var(--surface);
    color: var(--accent);
}

.header-actions .icon-btn + .icon-btn {
    border-left: 1px solid var(--border);
    border-radius: 0;
}

/* Sol no claro, lua no escuro */
html[data-theme="dark"] .icon-sun,
html:not([data-theme="dark"]) .icon-moon {
    display: none;
}

.menu-toggle {
    display: none;
}

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

.mobile-nav {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 16px;
    display: grid;
    gap: 2px;
    max-height: calc(100vh - 76px);
    overflow: auto;
}

.mobile-nav a {
    padding: 10px 6px;
}

.mobile-nav a:hover,
.mobile-nav a[aria-current] {
    color: var(--accent);
}

/* ---------- 4. Componentes ---------- */

.eyebrow {
    font-size: 12px;
    font-weight: 550;
    letter-spacing: 0.12em;
    color: var(--muted);
    text-transform: uppercase;
    line-height: 1.5;
}

.short-line {
    display: inline-block;
    width: 26px;
    height: 2px;
    background: var(--accent);
    vertical-align: middle;
    margin-right: 12px;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    min-height: 50px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 550;
    border: 1px solid var(--text);
    border-radius: 2px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.button.solid {
    background: var(--text);
    color: var(--bg);
}

.button.solid:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.button.outline:hover {
    background: var(--surface);
}

.file-type {
    font-size: 10px;
    line-height: 1;
    padding: 4px;
    border: 1px solid var(--border);
}

.text-link {
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    padding: 3px 0;
}

.text-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.location {
    font-size: 13px;
    margin-top: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
}

.location-mark {
    font-size: 20px;
    color: var(--text);
}

.location-sep {
    color: var(--border);
    padding: 0 7px;
}

/* Retrato: foto natural, só o enquadramento muda conforme a tela */
.portrait {
    position: relative;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 2px;
}

.portrait img {
    width: 100%;
    height: auto;
    max-height: 566px;
    object-fit: cover;
    object-position: center 25%;
    background: #f5f5f7;
    border-radius: 2px;
}

.portrait figcaption {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.portrait figcaption span:first-child {
    color: var(--text);
    font-weight: 550;
}

.discipline-strip {
    list-style: none;
    margin: 0;
    border-block: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 23px 0;
    font: 13px var(--display);
    color: var(--muted);
}

.discipline-strip li {
    display: flex;
    align-items: center;
    gap: 16px;
}

.discipline-strip li::before {
    content: '+';
    color: var(--accent);
    font: 20px var(--body);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 45px;
    margin-bottom: 40px;
}

.section-heading .eyebrow {
    margin-bottom: 18px;
}

.section-heading h2 {
    font-size: clamp(36px, 3.7vw, 52px);
}

.section-heading > p {
    max-width: 330px;
    font-size: 15px;
    padding-bottom: 3px;
}

.tags {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tags li {
    font-size: 12px;
    background: var(--surface);
    padding: 3px 9px;
    color: var(--muted);
    border-radius: 2px;
}

.empty-state {
    font-size: 15px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
}

.empty-state[hidden] {
    display: none;
}

/* Carrossel de arrastar (projetos, experiência e cursos). O trilho rola de
   verdade: toque e trackpad funcionam nativamente, o mouse arrasta via JS e
   o scroll-snap alinha cada slide. A folga de 8px evita que o foco visível e
   o zoom das imagens sejam cortados nas bordas do trilho. */
.carousel {
    --gap: 30px;
}

/* --per-view slides inteiros e a ponta do próximo (--peek, fração de um
   slide) cortada na borda: o card pela metade avisa que o trilho continua.
   O --peek fica abaixo de 0,5 para o contador e as setas contarem só os
   slides inteiros. No celular, cada trilho define --slide direto. */
.carousel-track {
    --per-view: 2;
    --peek: 0.12;
    --slide: calc(
        (100% - var(--per-view) * var(--gap)) / (var(--per-view) + var(--peek))
    );
    position: relative;
    display: flex;
    gap: var(--gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scroll-padding-inline: 8px;
    padding: 8px;
    margin: -8px;
}

/* Sem nada para rolar (o JS marca .is-static), não há próximo para mostrar */
.carousel.is-static .carousel-track {
    --peek: 0;
}

.carousel-track > * {
    flex: 0 0 var(--slide);
    min-width: 0;
    scroll-snap-align: start;
}

.carousel-track > [hidden] {
    display: none;
}

/* Com JS os controles substituem a barra; sem JS ela fica à vista */
html.js .carousel-track {
    scrollbar-width: none;
}

html.js .carousel-track::-webkit-scrollbar {
    display: none;
}

html:not(.js) .carousel-track {
    scrollbar-width: thin;
    padding-bottom: 18px;
}

.carousel.is-scrollable .carousel-track {
    cursor: grab;
}

.carousel-track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
    user-select: none;
}

.carousel-track.is-dragging > * {
    pointer-events: none;
}

.carousel-track img {
    -webkit-user-drag: none;
}

.carousel-controls {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 32px;
}

.carousel-controls[hidden] {
    display: none;
}

.carousel-progress {
    flex: 1;
    height: 2px;
    background: var(--border);
    overflow: hidden;
}

.carousel-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--text);
    transition: transform 0.2s, width 0.2s;
}

.carousel-count {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.carousel-buttons {
    display: flex;
    gap: 8px;
}

.carousel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 2px;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.carousel-btn:hover:not(:disabled) {
    border-color: var(--text);
    color: var(--accent);
}

.carousel-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.carousel-btn svg {
    width: 18px;
    height: 18px;
}

/* ---------- 5. Hub ("/") — link-in-bio ----------
   Coluna central e curta: apresentação mínima e os botões de acesso logo na
   primeira tela, inclusive no celular. */

.hub-tree {
    max-width: 560px;
    margin: 0 auto;
    padding: 32px 0 64px;
}

.hub-profile {
    text-align: center;
}

.hub-photo {
    width: 96px;
    height: 120px;
    margin: 0 auto 16px;
    object-fit: cover;
    object-position: center 22%;
    background: #f5f5f7;
    border-radius: 2px;
}

.hub-profile h1 {
    font-size: clamp(36px, 4vw, 48px);
    line-height: 1.02;
    margin-bottom: 10px;
}

.hub-tagline {
    font-size: 17px;
    line-height: 1.45;
    letter-spacing: -0.02em;
    color: var(--text);
    font-weight: 500;
    max-width: 480px;
    margin: 0 auto;
}

.hub-bio {
    font-size: 14px;
    margin-top: 6px;
}

.hub-buttons {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.hub-button {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 54px;
    padding: 14px 18px;
    border: 1px solid var(--text);
    border-radius: 2px;
    font-size: 15px;
    font-weight: 550;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.hub-button > svg:first-child {
    color: var(--accent);
}

.hub-button-arrow {
    margin-left: auto;
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.hub-button:hover {
    background: var(--surface);
}

.hub-button:hover .hub-button-arrow {
    transform: translateX(3px);
}

.hub-button.primary {
    background: var(--text);
    color: var(--bg);
}

.hub-button.primary > svg:first-child {
    color: inherit;
}

.hub-button.primary:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.hub-social {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.hub-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 14px;
    transition: border-color 0.2s, color 0.2s;
}

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

.hub-social svg {
    width: 18px;
    height: 18px;
}

/* ---------- 6. Currículo ("/curriculo/") ---------- */

.body-copy {
    max-width: 515px;
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 27px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.cv-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.78fr;
    gap: 96px;
    align-items: center;
    padding: 64px 0;
}

.cv-hero h1 {
    font-size: clamp(60px, 6.2vw, 89px);
    margin: 25px 0 24px;
    line-height: 1.06;
}

.hero-lead {
    max-width: 490px;
    font-size: 20px;
    line-height: 1.6;
    color: var(--muted);
}

.hero-lead strong {
    font-weight: 500;
    color: var(--text);
}

.cv-hero .body-copy {
    font-size: 15px;
    margin-top: 12px;
    max-width: 490px;
}

.cv-hero .portrait img {
    max-height: 550px;
}

.cv-hero .hero-actions {
    gap: 12px;
}

.hero-tech {
    display: flex;
    gap: 13px;
    font-size: 12px;
    margin-top: 28px;
    color: var(--muted);
    flex-wrap: wrap;
}

.hero-tech span {
    color: var(--border);
}

/* Apresentação pessoal */
.about-note {
    display: grid;
    grid-template-columns: 1fr 2.1fr;
    gap: 30px;
    padding: 67px 0;
    border-bottom: 1px solid var(--border);
}

.about-note h2 {
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -0.04em;
    margin-bottom: 20px;
}

.about-note > div > p {
    max-width: 730px;
    line-height: 1.85;
}

.inline-meta {
    display: flex;
    gap: 24px;
    font-size: 13px;
    margin-top: 24px;
    color: var(--muted);
    flex-wrap: wrap;
}

.inline-meta a {
    color: var(--accent);
}

.section {
    padding: 88px 0;
    border-bottom: 1px solid var(--border);
}

/* Projetos */
.filters {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 32px;
}

.filter {
    font-size: 14px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 2px;
    color: var(--muted);
}

.filter:hover {
    border-color: var(--border);
    color: var(--text);
}

.filter.active {
    background: var(--text);
    color: var(--bg);
}

.project-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--muted);
}

.project[hidden] {
    display: none;
}

.project-image {
    display: block;
    padding: 0;
    background: var(--surface);
    width: 100%;
    overflow: hidden;
    position: relative;
    aspect-ratio: 2 / 1;
    border: 1px solid var(--border);
    border-radius: 3px;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}

.image-action {
    position: absolute;
    right: 14px;
    bottom: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 12px;
    padding: 7px 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.project-image:hover img {
    transform: scale(1.025);
}

.project-image:hover .image-action,
.project-image:focus-visible .image-action {
    opacity: 1;
}

/* Projeto sem interface: nome do repositório em mono, na mesma proporção */
.project-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
    background-size: 16px 16px;
    font: 13px var(--mono);
    color: var(--muted);
    text-align: center;
    overflow-wrap: anywhere;
}

.project-cover span {
    background: var(--surface);
    padding: 4px 10px;
}

.project-body {
    padding: 23px 0 0;
}

.project-body .eyebrow {
    font-size: 11px;
    letter-spacing: 0.09em;
}

.project-body h3 {
    font-size: 25px;
    margin: 10px 0;
}

.project-title {
    padding: 0;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
}

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

.project-body > p:not(.eyebrow) {
    font-size: 15px;
    min-height: 50px;
    max-width: 480px;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 22px;
    border-top: 1px solid var(--border);
    margin-top: 22px;
    padding-top: 14px;
    font-size: 13px;
}

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

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

.project-links svg {
    width: 16px;
    height: 16px;
}

/* Habilidades */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.skill {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 30px;
    position: relative;
}

.skill-symbol {
    color: var(--accent);
    font: 14px/1.5 var(--mono);
    display: block;
    margin-bottom: 19px;
}

.skill h3 {
    font-size: 21px;
    margin-bottom: 18px;
}

.skill ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 7px;
}

.skill li {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

/* Experiência: um cargo por slide, com todas as atividades à vista (o slide
   cresce até o mais alto da fileira, nunca rola por dentro) */
.experience {
    display: flex;
    flex-direction: column;
    border-top: 2px solid var(--text);
    padding: 22px 0 0;
}

.experience-date {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 18px;
}

.current-label {
    background: var(--surface);
    color: var(--accent);
    font-size: 12px;
    padding: 3px 11px;
    white-space: nowrap;
}

.experience-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.experience-content h3 {
    font-size: 25px;
}

.company {
    color: var(--text);
    font-size: 16px;
    margin: 8px 0 18px;
}

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

.experience-content ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 7px;
}

.experience-content li {
    font-size: 15px;
    padding-left: 4px;
}

.experience-content li::marker {
    color: var(--accent);
}

.experience-skills {
    font-size: 12px;
    margin-top: auto;
    padding-top: 18px;
    line-height: 1.7;
}

/* Formação e certificações */
.education-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
    margin: 10px 0 55px;
}

.education {
    border-top: 2px solid var(--text);
    padding: 24px 0 0;
}

.education h3 {
    font-size: 22px;
    margin: 14px 0;
}

.education p:not(.eyebrow) {
    font-size: 14px;
    margin-bottom: 20px;
    max-width: 300px;
}

.education-status {
    display: inline-block;
    font-size: 12px;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 3px 10px;
}

.cert-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    gap: 16px;
}

.cert-heading h3 {
    font-size: 23px;
}

.cert-heading > span {
    font-size: 13px;
}

.certs-track {
    --gap: 40px;
    --per-view: 3;
}

.cert {
    padding: 20px 0;
    border-top: 1px solid var(--border);
}

.cert h4 {
    font-size: 16px;
    letter-spacing: -0.02em;
    font-weight: 550;
    line-height: 1.5;
}

.cert p {
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 7px;
}

/* Contato */
.contact-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 100px;
    border-bottom: none;
    padding-bottom: 100px;
}

.contact-copy h2 {
    font-size: clamp(40px, 4.2vw, 58px);
    margin: 22px 0;
}

.contact-copy > p:not(.eyebrow):not(.location) {
    max-width: 430px;
    font-size: 15px;
}

.contact-email {
    font-size: 21px;
    letter-spacing: -0.03em;
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 30px 0 5px;
    overflow-wrap: anywhere;
}

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

.copy-email {
    font-size: 12px;
    color: var(--muted);
}

.contact-social {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    margin-top: 27px;
}

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

.contact-form,
.form-success {
    background: var(--surface);
    padding: 32px;
}

.form-top h3 {
    font-size: 23px;
    margin-bottom: 5px;
}

.form-top p {
    font-size: 14px;
    margin-bottom: 4px;
}

.contact-form label {
    display: block;
    font-size: 13px;
    margin: 16px 0 7px;
}

input,
textarea {
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 12px 14px;
    font-size: 16px;
    max-width: 100%;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 0.8;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form [aria-invalid="true"] {
    border-color: var(--error);
}

.field-error {
    font-size: 13px;
    color: var(--error);
    margin-top: 6px;
}

.form-alert {
    font-size: 14px;
    color: var(--text);
    border-left: 2px solid var(--error);
    padding: 4px 0 4px 12px;
    margin-top: 18px;
}

.contact-form .button {
    width: 100%;
    margin-top: 24px;
}

.form-note {
    font-size: 12px;
    text-align: center;
    margin-top: 14px;
}

.form-success h3 {
    font-size: 23px;
    margin-bottom: 10px;
}

.form-success p {
    font-size: 15px;
    margin-bottom: 20px;
}

.form-success:focus {
    outline: none;
}

/* Honeypot: fora da tela, mas ainda no DOM para os bots preencherem */
.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- 7. Rodapé ---------- */

.footer {
    border-top: 1px solid var(--border);
    padding: 45px 0 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.footer-inner p {
    font-size: 13px;
    margin-top: 6px;
}

.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 14px;
}

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

.footer-bottom {
    margin-top: 34px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
    padding: 22px 0;
    border-top: 1px solid var(--border);
}

.footer-bottom > span:last-child {
    display: flex;
    align-items: center;
}

.terminal-trigger {
    margin-left: 16px;
    min-width: 32px;
    min-height: 32px;
    font-family: var(--mono);
    color: var(--accent);
    font-size: 16px;
}

/* ---------- 8. Diálogos: paleta, projeto e terminal ---------- */

dialog {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0;
    width: min(600px, calc(100% - 32px));
    max-height: 85vh;
    box-shadow: 0 25px 90px #0003;
}

dialog::backdrop {
    background: #0009;
}

.dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 23px;
    border-bottom: 1px solid var(--border);
}

.dialog-head h2 {
    font-size: 21px;
    letter-spacing: -0.03em;
}

.dialog-bottom {
    padding: 12px 24px;
    background: var(--surface);
    font-size: 12px;
    color: var(--muted);
}

#palette-input {
    margin: 20px 24px;
    width: calc(100% - 48px);
}

.palette-results {
    list-style: none;
    margin: 0;
    max-height: 45vh;
    overflow: auto;
    padding: 0 12px 12px;
}

.command {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px;
    font-size: 15px;
    gap: 12px;
    border-radius: 2px;
    cursor: pointer;
}

.command small {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.command[aria-selected="true"],
.command:hover {
    background: var(--surface);
    color: var(--accent);
}

.empty-search {
    padding: 0 24px 16px;
    font-size: 14px;
}

.empty-search[hidden] {
    display: none;
}

.project-dialog {
    width: min(760px, calc(100% - 32px));
}

/* Fica visível enquanto o modal rola (o mini README deixa o conteúdo longo).
   A margem inferior negativa anula a altura do botão: ele flutua sobre a
   imagem sem empurrar o conteúdo. */
.floating-close {
    position: sticky;
    top: 14px;
    display: flex;
    margin: 14px 14px -54px auto;
    background: var(--bg);
    border: 1px solid var(--border);
    z-index: 1;
}

.modal-project-media {
    aspect-ratio: 2 / 1;
    background: var(--surface);
    overflow: hidden;
}

.modal-project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-project-body {
    padding: 30px;
}

.modal-project-body h2 {
    font-size: 30px;
    margin: 10px 0 18px;
}

.modal-project-body .project-links {
    font-size: 14px;
}

/* Mini README: rótulo à esquerda, conteúdo à direita, linha entre blocos */
.project-readme {
    margin: 30px 0 0;
}

.project-readme > div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 6px 24px;
    padding: 18px 0;
    border-top: 1px solid var(--border);
}

.project-readme dt {
    font-size: 11px;
    letter-spacing: 0.09em;
    padding-top: 3px;
}

.project-readme dd {
    margin: 0;
    font-size: 15px;
}

.project-readme dd > ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 7px;
}

.project-readme dd > ul > li {
    padding-left: 4px;
}

.project-readme dd > ul > li::marker {
    color: var(--accent);
}

/* Habilidades em linha, separadas por ponto, em texto e não em etiqueta:
   as etiquetas já são das tecnologias */
.project-readme .readme-skills {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
    color: var(--text);
}

.project-readme .readme-skills > li {
    padding: 0;
}

/* O ponto fica no fim do item: numa quebra de linha, nenhuma linha começa nele */
.project-readme .readme-skills > li:not(:last-child)::after {
    content: "·";
    margin: 0 10px;
    color: var(--accent);
}

/* O último bloco já tem respiro; a linha dos links fecha a ficha */
.project-readme + .project-links {
    margin-top: 0;
}

/* Terminal: fundo escuro constante nos dois temas */
.terminal {
    background: #161616;
    color: #eee;
    width: min(740px, calc(100% - 32px));
    font-family: var(--mono);
    border-color: #444;
}

.terminal .dialog-head {
    border-color: #444;
}

.terminal .icon-btn:hover {
    background: #262626;
    color: #33adcc;
}

.terminal-body {
    padding: 24px;
    max-height: 65vh;
    overflow: auto;
}

.terminal-output {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 14px/1.8 var(--mono);
    color: #ddd;
    margin: 0 0 20px;
}

.terminal-form {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #33adcc;
}

.terminal-prompt {
    white-space: nowrap;
}

#terminal-input {
    border: none;
    padding: 0;
    background: transparent;
    min-width: 0;
    flex: 1;
    color: #eee;
    font: 14px var(--mono);
    outline: none;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 15px);
    background: var(--text);
    color: var(--bg);
    padding: 12px 22px;
    border-radius: 3px;
    z-index: 50;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
    max-width: 90vw;
}

.toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- 9. Responsivo ---------- */

@media (min-width: 1600px) {
    .cv-hero {
        padding-block: 85px;
    }

    .cv-hero h1 {
        font-size: 94px;
    }
}

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

    .header-inner {
        padding-inline: 36px;
        gap: 24px;
    }

    .desktop-nav {
        gap: 18px;
    }

    .desktop-nav a {
        font-size: 13px;
    }

    .header-actions {
        gap: 6px;
    }

    .resume .brand-surname {
        display: none;
    }

    .cv-hero {
        gap: 55px;
    }

    .cv-hero h1 {
        font-size: 76px;
    }

    .portrait figcaption {
        font-size: 11px;
        gap: 8px;
    }

    .discipline-strip {
        gap: 12px;
        font-size: 12px;
    }

    .discipline-strip li {
        gap: 10px;
    }

    .contact-section {
        gap: 50px;
    }

    .skill {
        padding: 25px;
    }

    .contact-email {
        font-size: 19px;
    }
}

@media (max-width: 980px) {
    .desktop-nav {
        display: none;
    }

    .header-actions {
        margin-left: auto;
    }

    .menu-toggle {
        display: inline-flex;
    }

    /* Sem JS o menu móvel fica aberto: a navegação nunca depende da paleta */
    html:not(.js) .mobile-nav[hidden] {
        display: grid;
    }

    .header {
        height: 76px;
    }

    .resume .brand-surname {
        display: inline;
    }

    .cv-hero {
        gap: 35px;
        grid-template-columns: 1.1fr 0.85fr;
        padding-block: 48px;
    }

    .cv-hero h1 {
        font-size: 64px;
    }

    .body-copy {
        font-size: 15px;
    }

    .hero-lead {
        font-size: 18px;
    }

    .cv-hero .body-copy {
        font-size: 14px;
    }

    .hero-actions {
        gap: 18px;
    }

    .button {
        padding: 12px 18px;
        font-size: 13px;
    }

    .location {
        font-size: 12px;
    }

    .portrait figcaption {
        flex-direction: column;
        gap: 0;
    }

    .discipline-strip {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding-block: 18px;
        gap: 12px;
    }

    .skills-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .education-grid {
        gap: 22px;
    }

    .education h3 {
        font-size: 19px;
    }

    .contact-section {
        gap: 32px;
    }

    .contact-section h2 {
        font-size: 41px;
    }

    .contact-form,
    .form-success {
        padding: 24px;
    }

    .contact-email {
        font-size: 17px;
    }

    .footer-social {
        gap: 16px;
    }

    .footer-bottom {
        font-size: 11px;
    }

    /* Um cargo por vez, com a ponta do próximo à vista (convite ao arrasto) */
    .experience-track {
        --slide: 86%;
    }

    .certs-track {
        --gap: 28px;
        --per-view: 2;
    }

    .section {
        padding-block: 65px;
    }
}

@media (max-width: 700px) {
    html {
        scroll-padding-top: 90px;
    }

    .container {
        width: calc(100% - 40px);
    }

    .header-inner {
        padding-inline: 20px;
        gap: 16px;
    }

    .header {
        height: 72px;
    }

    .brand {
        font-size: 21px;
    }

    .brand {
        gap: 8px;
    }

    .brand-icon {
        width: 28px;
        height: 28px;
    }

    .language {
        font-size: 12px;
        margin-right: 0;
    }

    .header-actions {
        gap: 2px;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
    }

    .header-actions .icon-btn + .icon-btn {
        border: 0;
    }

    .language .muted {
        display: none;
    }

    .cv-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 34px;
        padding: 38px 0 32px;
    }

    /* Hub no celular: apresentação compacta para os 4 botões principais
       caberem na primeira tela até em aparelhos baixos (360x640) */
    .hub-tree {
        padding: 20px 0 44px;
    }

    .hub-photo {
        width: 80px;
        height: 100px;
        margin-bottom: 14px;
    }

    .hub-profile h1 {
        font-size: 34px;
        margin-bottom: 8px;
    }

    .hub-tagline {
        font-size: 16px;
    }

    .hub-buttons {
        gap: 8px;
        margin-top: 20px;
    }

    .hub-button {
        min-height: 52px;
        padding: 12px 16px;
    }

    .hub-social {
        gap: 8px;
        margin-top: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .body-copy {
        font-size: 16px;
        line-height: 1.75;
    }

    .hero-actions {
        gap: 24px;
        margin-top: 27px;
    }

    .button {
        font-size: 14px;
        min-height: 50px;
        padding-inline: 21px;
    }

    .location {
        margin-top: 24px;
        font-size: 12px;
    }

    .portrait {
        max-width: 100%;
        padding: 0;
    }

    .portrait img {
        max-height: none;
        height: 440px;
        object-position: center 27%;
    }

    .portrait figcaption {
        flex-direction: row;
        font-size: 12px;
        padding-top: 12px;
    }

    .discipline-strip {
        font-size: 11px;
        gap: 12px 15px;
    }

    .discipline-strip li {
        gap: 8px;
    }

    .discipline-strip li::before {
        font-size: 17px;
    }

    .section-heading {
        display: block;
        margin-bottom: 30px;
    }

    .section-heading > p {
        margin-top: 22px;
        max-width: 100%;
        font-size: 15px;
    }

    .section-heading .eyebrow {
        margin-bottom: 15px;
    }

    .section-heading h2 {
        font-size: 40px;
    }

    .cv-hero h1 {
        font-size: clamp(55px, 13vw, 78px);
        margin: 23px 0;
        line-height: 1.06;
    }

    .cv-hero .hero-lead {
        font-size: 20px;
    }

    .cv-hero .body-copy {
        font-size: 16px;
    }

    .cv-hero .portrait img {
        max-height: none;
        height: 440px;
    }

    .hero-tech {
        font-size: 12px;
        gap: 12px;
    }

    .about-note {
        display: block;
        padding: 40px 0;
    }

    .about-note > .eyebrow {
        margin-bottom: 20px;
    }

    .about-note h2 {
        font-size: 28px;
    }

    .about-note p {
        font-size: 16px;
    }

    .inline-meta {
        gap: 13px;
        font-size: 12px;
    }

    .section {
        padding: 54px 0;
    }

    .filters {
        gap: 5px;
        margin-bottom: 25px;
    }

    .filter {
        font-size: 13px;
        padding: 9px 11px;
    }

    .project-count {
        width: 100%;
        margin: 10px 0 0;
    }

    .carousel {
        --gap: 20px;
    }

    .projects-track {
        --slide: 86%;
    }

    .carousel-controls {
        gap: 16px;
        margin-top: 24px;
    }

    .project-body {
        padding-top: 19px;
    }

    .project-body h3 {
        font-size: 25px;
    }

    .project-body > p:not(.eyebrow) {
        min-height: 0;
        font-size: 16px;
    }

    .image-action {
        opacity: 1;
        font-size: 11px;
        padding: 5px 9px;
        right: 10px;
        bottom: 10px;
    }

    .project-links {
        font-size: 14px;
    }

    .skills-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .skill {
        padding: 22px 16px;
    }

    .skill h3 {
        font-size: 18px;
    }

    .skill li {
        font-size: 14px;
    }

    .skill-symbol {
        margin-bottom: 12px;
    }

    .experience-track {
        --slide: 88%;
    }

    .experience {
        padding-top: 20px;
    }

    .experience-date {
        gap: 10px;
        font-size: 12px;
    }

    .experience-content h3 {
        font-size: 24px;
    }

    .experience-content li {
        font-size: 16px;
    }

    .experience-skills {
        font-size: 12px;
    }

    .company {
        margin: 7px 0 16px;
    }

    .education-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
        margin-bottom: 40px;
    }

    .education h3 {
        font-size: 23px;
        max-width: 350px;
    }

    .education p:not(.eyebrow) {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .education {
        padding-top: 21px;
    }

    .cert-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .certs-track {
        --gap: 20px;
        --slide: 82%;
    }

    .cert {
        padding-block: 18px;
    }

    .cert h4 {
        font-size: 16px;
    }

    .contact-section {
        grid-template-columns: minmax(0, 1fr);
        gap: 35px;
        padding-bottom: 60px;
    }

    .contact-section h2 {
        font-size: 44px;
    }

    .contact-copy > p:not(.eyebrow):not(.location) {
        font-size: 16px;
    }

    .contact-email {
        font-size: 21px;
    }

    .contact-social {
        gap: 22px;
        font-size: 14px;
    }

    .contact-form,
    .form-success {
        padding: 24px 20px;
    }

    .footer {
        padding-top: 32px;
    }

    .footer-inner {
        display: block;
    }

    .footer-social {
        margin-top: 25px;
        gap: 24px;
        font-size: 13px;
    }

    .footer-bottom {
        display: block;
        margin-top: 26px;
        font-size: 11px;
        padding-block: 20px;
    }

    .footer-bottom > span:last-child {
        margin-top: 9px;
        justify-content: space-between;
    }

    .footer-bottom .terminal-trigger {
        margin: 0;
    }

    .modal-project-body {
        padding: 24px;
    }

    .modal-project-body h2 {
        font-size: 27px;
    }

    .project-readme > div {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px 0;
    }

    .project-readme dt {
        padding-top: 0;
    }

    .dialog-bottom {
        font-size: 11px;
    }

    .terminal-form {
        font-size: 11px;
        gap: 7px;
    }

    #terminal-input {
        font-size: 16px;
    }
}

@media (max-width: 370px) {
    .brand-surname,
    .resume .brand-surname {
        display: none;
    }

    .skills-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cv-hero .hero-actions {
        gap: 10px;
    }

    .cv-hero .button {
        padding-inline: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

/* ---------- 10. Impressão ---------- */

@media print {
    .header,
    .footer,
    .hero-actions,
    .filters,
    .contact-section,
    dialog,
    .skip-link,
    .project-image,
    .portrait,
    .hub-buttons,
    .hub-social,
    .toast {
        display: none !important;
    }

    .container {
        width: 100%;
    }

    body {
        color: #111;
        background: #fff;
        font-size: 11pt;
    }

    .section {
        padding: 25px 0;
    }

    .cv-hero {
        display: block;
        padding: 20px 0;
    }

    .cv-hero h1 {
        font-size: 40px;
    }

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

    /* No papel o carrossel vira grade: todos os itens impressos */
    .carousel-track {
        display: grid;
        grid-template-columns: 1fr 1fr;
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    .carousel-controls {
        display: none !important;
    }

    .project,
    .skill,
    .experience,
    .education,
    .cert {
        break-inside: avoid;
    }

    em {
        color: #0a5f74;
    }
}
