:root {
    --bg: #0e1117;
    --panel: #141922;
    --text: #e8edf1;
    --muted: #aab5c2;
    --subtle: #8d9bad;
    --line: #27303b;
    --accent: #a9c5df;
    --font-display: Oxanium, ui-sans-serif, system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.7 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

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

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

.container {
    width: min(100% - 52px, 1040px);
    margin-inline: auto;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--line);
}

.header-content {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 13px;
    font: 600 17px/1.2 var(--font-display);
    white-space: nowrap;
}

.brand-symbol {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid #42516a;
    border-radius: 5px;
}

.brand-symbol img {
    width: 23px;
    height: 23px;
    object-fit: contain;
}

nav {
    display: flex;
    gap: 28px;
}

nav a {
    color: var(--muted);
    font-size: 13px;
    transition: color .2s ease;
}

nav a:hover {
    color: var(--text);
}

/* Hero */
.hero {
    min-height: 565px;
    padding-block: 112px 90px;
    display: flex;
    position: relative;
    align-items: flex-start;
}

.hero-main {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    line-height: 1.14;
    letter-spacing: -.025em;
}

h1 {
    font-size: clamp(39px, 5.7vw, 66px);
    font-weight: 600;
    margin: 0 0 28px;
    max-width: 810px;
    text-wrap: balance;
}

h1>span:not(.period) {
    color: #afbfce;
}

/* Ponto final dos títulos: vira um pixel quadrado */
.period {
    display: inline-block;
    width: .13em;
    height: .13em;
    margin-left: .05em;
    background: var(--accent);
    color: transparent;
    overflow: hidden;
}

.lead {
    color: var(--muted);
    max-width: 650px;
    font-size: 17px;
    line-height: 1.8;
    margin: 0 0 29px;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    gap: 30px;
    justify-content: space-between;
    align-items: center;
    min-height: 46px;
    border-radius: 5px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 650;
    border: 1px solid #526277;
    transition: background .2s ease, color .2s ease;
}

.btn.primary {
    background: #b0c7dc;
    color: #111924;
    border-color: #b0c7dc;
}

.btn.primary:hover {
    background: #d1deea;
}

.btn.outline:hover {
    background: #1a2530;
}

.hero-stack,
.kind,
.section-meta,
.hero-signature>span {
    font: 600 12px/1.6 var(--font-display);
    letter-spacing: .08em;
}

.hero-stack {
    margin: 37px 0 0;
    color: var(--subtle);
}

.hero-stack span {
    margin: 0 9px;
    color: #75889d;
}

/* Grade de pontos atrás da assinatura (visor LCD) */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(169, 197, 223, .08) 1px, transparent 1.5px);
    background-size: 8px 8px;
    -webkit-mask-image: radial-gradient(ellipse at 85% 45%, #000, transparent 65%);
    mask-image: radial-gradient(ellipse at 85% 45%, #000, transparent 65%);
    pointer-events: none;
}

.hero-signature {
    position: absolute;
    right: 0;
    bottom: 92px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
    color: var(--subtle);
}

.digicode-name {
    display: flex;
    gap: 7px;
    align-items: center;
}

.digicode-name img {
    width: 23px;
    height: 23px;
    object-fit: contain;
    opacity: .7;
    animation: decode .45s steps(3) both;
}

.digicode-name img:nth-child(2) {
    animation-delay: .12s;
}

.digicode-name img:nth-child(3) {
    animation-delay: .24s;
}

.digicode-name img:nth-child(4) {
    animation-delay: .36s;
}

.digicode-name img:nth-child(5) {
    animation-delay: .48s;
}

.digicode-name img:nth-child(6) {
    animation-delay: .60s;
}

.hero-signature>span {
    font-size: 12px;
}

@keyframes decode {
    from {
        opacity: .08;
    }

    to {
        opacity: .7;
    }
}

/* Seções */
.section {
    border-top: 1px solid var(--line);
    padding-block: 83px 92px;
    scroll-margin-top: 24px;
}

.heading {
    margin-bottom: 35px;
}

.section-meta {
    color: var(--accent);
    margin: 0 0 18px;
}

h2 {
    font-size: clamp(31px, 3.5vw, 40px);
    margin: 0 0 13px;
    font-weight: 600;
    text-wrap: balance;
}

.heading>p:last-child,
.contact>p {
    color: var(--muted);
    margin: 0;
}

/* Marcador de pixel nos rótulos */
.kind::before,
.section-meta span::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 10px;
    background: currentColor;
    vertical-align: 1px;
}

/* Projetos */
.projects {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.project {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 27px;
    min-height: 305px;
    display: flex;
    flex-direction: column;
    transition: border-color .25s ease, background .25s ease;
}

.project:hover,
.project:focus-within {
    border-color: #526982;
    background: #18202b;
}

/* Cantos de enquadramento que acendem no hover/foco */
.project::before,
.project::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 1px solid var(--accent);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}

.project::before {
    top: -1px;
    left: -1px;
    border-right: 0;
    border-bottom: 0;
    border-top-left-radius: 8px;
}

.project::after {
    bottom: -1px;
    right: -1px;
    border-left: 0;
    border-top: 0;
    border-bottom-right-radius: 8px;
}

.project:hover::before,
.project:hover::after,
.project:focus-within::before,
.project:focus-within::after {
    opacity: 1;
}

.kind {
    color: var(--accent);
    margin: 0 0 16px;
}

.project h3 {
    font-weight: 600;
    font-size: 24px;
    margin: 0 0 12px;
}

.project>p:not(.kind) {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
    margin: 0 0 20px;
    max-width: 60ch;
}

.tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
    margin-bottom: 22px;
}

.tags span {
    border: 1px solid #425168;
    color: #c2d0dc;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 1px;
}

.project>a {
    border-top: 1px solid var(--line);
    padding-top: 14px;
    font-weight: 650;
    color: #c1d6e7;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.project>a:hover,
.plain-link:hover,
.contact-links a:hover {
    color: #fff;
}

.plain-link {
    display: inline-block;
    color: #c1d6e7;
    font-size: 13px;
    font-weight: 650;
    margin-top: 26px;
}

/* Sobre */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    gap: 80px;
}

.about-grid .heading {
    margin: 0;
}

.about-copy>p,
.info-group p {
    color: var(--muted);
    line-height: 1.8;
    margin: 0 0 17px;
}

.info-group {
    margin-top: 31px;
}

.info-group h3 {
    font-size: 15px;
    letter-spacing: 0;
    margin-bottom: 8px;
}

.info-group p {
    font-size: 14px;
}

/* Contato e rodapé */
.contact>p {
    margin-bottom: 26px;
}

.contact-links {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.contact-links a {
    color: #c1d6e7;
    font-size: 14px;
    font-weight: 650;
}

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

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 23px 0;
    color: var(--subtle);
    font-size: 12px;
}

.footer-sign {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-sign img {
    opacity: .5;
}

/* Responsivo */
@media (max-width: 780px) {
    .container {
        width: min(100% - 36px, 1040px);
    }

    .header-content {
        min-height: 66px;
    }

    .hero {
        padding-block: 75px 68px;
        min-height: 0;
        flex-direction: column;
    }

    h1 {
        font-size: clamp(37px, 7vw, 51px);
    }

    .lead {
        font-size: 16px;
    }

    .hero-signature {
        position: static;
        align-items: flex-start;
        margin-top: 42px;
    }

    .section {
        padding-block: 66px 72px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

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

    .project {
        min-height: 0;
    }

    .heading {
        margin-bottom: 26px;
    }
}

@media (max-width: 500px) {
    .header-content {
        flex-wrap: wrap;
        padding-block: 14px;
        gap: 14px;
    }

    nav {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    nav a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .hero-stack {
        line-height: 2;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .project {
        padding: 23px;
    }
}

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

    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation: none !important;
    }
}
