/* Projects page: uma seção grande por projeto. Mesma identidade da home (Inter, #1a1a1a, verde HTB). */

:root {
    color-scheme: dark;

    --canvas: #1a1a1a;
    --plate: #141414;
    --raised: #212121;
    --rule: #2d2d2d;
    --rule-strong: #3d3d3d;
    --ink: #f4f4f4;
    --text: #e4e4e4;
    --muted: #a8a8a8;
    --faint: #8f8f8f;
    --signal: #9fef00;
    --signal-line: rgba(159, 239, 0, 0.3);
    --signal-wash: rgba(159, 239, 0, 0.08);

    --type-display: clamp(3rem, 9vw, 6rem);
    --type-case: clamp(2.25rem, 5vw, 4rem);
    --type-lede: clamp(1.15rem, 1.6vw, 1.35rem);
    --type-body: 1.0625rem;
    --type-data: 0.875rem;

    --gutter: clamp(16px, 4vw, 48px);
    --measure: 1240px;
    --radius-media: 12px;
    --radius-control: 8px;

    --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

html {
    scroll-behavior: smooth;
}

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

* {
    box-sizing: border-box;
}

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

body.projects {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--canvas);
    color: var(--text);
    caret-color: var(--signal);
    accent-color: var(--signal);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--signal);
    color: #111;
}

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

html::-webkit-scrollbar {
    width: 10px;
}

html::-webkit-scrollbar-track {
    background: var(--canvas);
}

html::-webkit-scrollbar-thumb {
    background: var(--rule-strong);
    border-radius: 10px;
    border: 2px solid var(--canvas);
}

.wrap {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* Voltar (esquerda) e idiomas (direita) fixos no topo, mesma posição e desenho do about-me */
.back-home {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--signal);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 16px;
    border: 1px solid var(--signal-line);
    border-radius: var(--radius-control);
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
    transition: background-color 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}

.back-home:hover {
    background: var(--signal-wash);
    border-color: var(--signal);
    transform: translateX(-5px);
}

.back-home svg {
    width: 18px;
    height: 18px;
}

.lang-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--signal-line);
    border-radius: var(--radius-control);
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
}

.lang-switch a {
    display: flex;
    width: 34px;
    height: 24px;
    border-radius: 5px;
    overflow: hidden;
    opacity: 0.55;
    border: 2px solid transparent;
    transition: opacity 180ms var(--ease);
}

.lang-switch a:hover {
    opacity: 1;
}

.lang-switch a.active {
    opacity: 1;
    border-color: var(--signal);
}

.lang-switch svg {
    width: 100%;
    height: 100%;
}

/* Intro */
.intro {
    padding: clamp(80px, 13vw, 180px) 0 clamp(40px, 6vw, 72px);
}

.intro h1 {
    margin: 0;
    color: var(--ink);
    font-size: var(--type-display);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
}

.intro p {
    margin: 28px 0 0;
    max-width: 54ch;
    font-size: var(--type-lede);
    line-height: 1.55;
    color: var(--muted);
    text-wrap: pretty;
}

/* Um projeto por seção: nome à esquerda; sobre, imagem pequena e links à direita */
.cases {
    border-top: 1px solid var(--rule-strong);
}

.case {
    padding: clamp(56px, 9vw, 112px) 0;
    border-bottom: 1px solid var(--rule);
    scroll-margin-top: 24px;
}

.cases .case:last-child {
    border-bottom: 0;
}

.case-media {
    max-width: 400px;
    margin: 24px 0 0;
}

.case-frame {
    aspect-ratio: 16 / 10;
    border: 1px solid var(--rule-strong);
    border-radius: 10px;
    background: var(--plate);
    overflow: hidden;
    position: relative;
    display: grid;
    place-items: center;
}

.case-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
}

/* Projetos que só têm logo: o logo centralizado na placa */
.case-media--logo .case-frame img {
    position: absolute;
    inset: 0;
    margin: auto;
    width: auto;
    height: 56%;
    object-fit: contain;
}

/* Sem captura do projeto: o nome vira a capa */
.case-media--type .case-frame span {
    padding: 0 6%;
    color: var(--rule-strong);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    text-align: center;
    overflow-wrap: anywhere;
}

.case-media figcaption {
    margin-top: 10px;
    color: var(--faint);
    font-size: var(--type-data);
    line-height: 1.5;
}

.case-body {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: clamp(24px, 4vw, 64px);
    row-gap: 24px;
}

.case-head {
    grid-column: 1 / span 5;
    container-type: inline-size;
}

.case-detail {
    grid-column: 7 / -1;
}

.case h2 {
    margin: 0;
    color: var(--ink);
    /* o nome nunca quebra (Basic-Enum-Tools quebrava no hífen); nomes longos
       encolhem para caber na coluna em vez de partir em duas linhas */
    font-size: min(var(--type-case), 10.5cqi);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.case-lede {
    margin: 16px 0 0;
    color: var(--text);
    font-size: var(--type-lede);
    font-weight: 500;
    line-height: 1.45;
    text-wrap: pretty;
}

.case-about {
    margin: 0;
    color: var(--muted);
    font-size: var(--type-body);
    line-height: 1.65;
    max-width: 62ch;
    text-wrap: pretty;
}

/* Destaques: lista curta com marcador verde, abaixo do sobre */
.case-points {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    max-width: 62ch;
}

.case-points li {
    position: relative;
    padding-left: 20px;
    color: var(--text);
    font-size: 0.975rem;
    line-height: 1.55;
    text-wrap: pretty;
}

.case-points li + li {
    margin-top: 10px;
}

.case-points li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--signal);
}

/* Linha de ações: GitHub, artigo (se houver) e stack */
.links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
}

.stack {
    margin: 0;
    color: var(--muted);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* a linha de ações já tem gap; o separador vem só antes do stack */
.links .stack::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 16px;
    margin-right: 24px;
    vertical-align: -3px;
    background: var(--rule-strong);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    color: var(--signal);
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid var(--signal-line);
    border-radius: var(--radius-control);
    transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}

.btn--icon {
    padding: 0;
    width: 44px;
    height: 44px;
    justify-content: center;
}

.btn--icon svg {
    width: 22px;
    height: 22px;
}

.btn:hover {
    background: var(--signal);
    border-color: var(--signal);
    color: #111;
}

.btn:active {
    transform: scale(0.98);
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.text-link {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--rule-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
    transition: color 150ms var(--ease), text-decoration-color 150ms var(--ease);
}

.text-link:hover {
    color: var(--signal);
    text-decoration-color: var(--signal);
}

/* Mesmo rodapé do about-me (footer de styles.css) */
footer {
    background-color: #111;
    text-align: center;
    padding: 20px;
    color: #777;
    font-size: 15px;
    border-top: 1px solid #333;
}

@media (max-width: 900px) {
    .case-head,
    .case-detail {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .back-home {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .lang-switch {
        top: 10px;
        right: 10px;
        padding: 6px 8px;
    }
}
