/* ============================================================
   ReisCode — identidade da home (v3)
   Direção: editorial técnico. Base neutra quase-preta, uma única
   cor de destaque (sem gradientes), tipografia grande e numeração
   corrida como em documento técnico/relatório. Sem cards
   repetidos, sem glow — hairlines, contadores CSS e grão de papel.
   Tipografia: Bricolage Grotesque (display), Instrument Sans
   (texto), JetBrains Mono (labels, métricas, numeração).
   ============================================================ */

:root {
    --bg: #0c0c0b;
    --bg-raised: #131311;
    --bg-card: #171714;
    --line: rgba(237, 233, 220, 0.12);
    --line-strong: rgba(237, 233, 220, 0.22);
    --text: #f2efe6;
    --text-dim: #a4a094;
    --text-faint: #6b6759;
    --accent: #2ad0ee;
    --accent-ink: #041014;
    --radius: 3px;
    --font-display: "Bricolage Grotesque", sans-serif;
    --font-body: "Instrument Sans", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
}

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

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

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

/* ---------- fundo: papel escuro, sem grid/glow neon ---------- */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg);
}

.backdrop::before {
    content: "";
    position: absolute;
    inset: -120px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.05;
    mix-blend-mode: overlay;
}

.backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(1100px 480px at 50% -12%, rgba(242, 239, 230, 0.06), transparent 65%);
}

/* progresso de leitura (linha fina no topo) */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--accent);
    z-index: 60;
    transition: width 0.1s linear;
}

@media (prefers-reduced-motion: reduce) {
    .scroll-progress { display: none; }
}

/* ---------- tipografia ---------- */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.025em;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.03em;
    color: var(--text-faint);
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    text-transform: uppercase;
}

.section {
    counter-increment: sec;
}

main {
    counter-reset: sec;
}

.section .eyebrow::before {
    content: "N\00B0" counter(sec, decimal-leading-zero);
    color: var(--accent);
    font-weight: 600;
}

.section-head {
    max-width: 680px;
    margin-bottom: 60px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.section-head h2 {
    font-size: clamp(30px, 4.2vw, 46px);
    margin-top: 12px;
}

.section-head p {
    color: var(--text-dim);
    margin-top: 14px;
    font-size: 17px;
    max-width: 58ch;
}

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

/* ---------- botões ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 14.5px;
    letter-spacing: 0.01em;
    padding: 14px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #6fe2f7;
}

.btn-ghost {
    border-color: var(--line-strong);
    color: var(--text);
    background: transparent;
}

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

.btn-sm {
    padding: 9px 16px;
    font-size: 13px;
}

/* ---------- header ---------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: background 0.25s ease, border-color 0.25s ease;
    border-bottom: 1px solid transparent;
}

.site-header.scrolled {
    background: rgba(12, 12, 11, 0.88);
    backdrop-filter: blur(10px);
    border-bottom-color: var(--line);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
}

.wordmark {
    font-family: var(--font-mono);
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.wordmark .tag {
    color: var(--accent);
}

.wordmark .cursor {
    display: inline-block;
    width: 9px;
    height: 1.05em;
    background: var(--accent);
    vertical-align: text-bottom;
    margin-left: 3px;
    animation: blink 1.1s steps(1) infinite;
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
    counter-reset: nav;
}

.nav-links li:not(:last-child) {
    counter-increment: nav;
}

.nav-links a:not(.btn) {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.nav-links li:not(:last-child) a::before {
    content: "0" counter(nav);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
}

.nav-links a:not(.btn):hover {
    color: var(--text);
}

.nav-links a:not(.btn):hover::before {
    color: var(--accent);
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 10px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    margin: 4px 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- hero ---------- */
.hero {
    padding: 150px 0 0;
}

.hero-mast {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.03em;
    color: var(--text-faint);
    text-transform: uppercase;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.hero-mast span:first-child {
    color: var(--text-dim);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 56px;
    align-items: end;
    padding: 54px 0 90px;
}

.hero h1 {
    font-size: clamp(46px, 8vw, 108px);
    font-weight: 500;
    margin: 0 0 26px;
}

.hero h1 .accent {
    font-weight: 800;
}

.hero .lead {
    color: var(--text-dim);
    font-size: 19px;
    max-width: 540px;
    margin-bottom: 36px;
}

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

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

/* foto do hero — inset assimétrico, não retrato central */
.hero-photo {
    position: relative;
    max-width: 260px;
    justify-self: end;
    width: 100%;
    align-self: end;
}

.hero-photo img {
    width: 100%;
    display: block;
    filter: grayscale(1) contrast(1.05);
    border: 1px solid var(--line-strong);
}

.hero-photo figcaption {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 10px;
    text-align: right;
}

.hero .social-row {
    margin-top: 28px;
}

/* ---------- métricas: tira horizontal, não cards ---------- */
.metrics {
    border-block: 1px solid var(--line);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: left;
}

.metric {
    padding: 30px 24px;
    border-left: 1px solid var(--line);
}

.metric:first-child {
    border-left: none;
    padding-left: 0;
}

.metric b {
    display: block;
    font-family: var(--font-mono);
    font-size: clamp(22px, 2.6vw, 30px);
    font-weight: 600;
    color: var(--text);
}

.metric span {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
    letter-spacing: 0.02em;
}

/* ---------- seções ---------- */
.section {
    padding: 110px 0;
}

.section.tinted {
    background: var(--bg-raised);
    border-block: 1px solid var(--line);
}

/* ---------- projetos: índice/dossiê, não grid de cards ---------- */
.projects-grid {
    display: block;
    counter-reset: proj;
}

.project-card {
    counter-increment: proj;
    display: grid;
    grid-template-columns: 46px 56px 1fr;
    column-gap: 22px;
    row-gap: 8px;
    align-items: start;
    padding: 30px 0;
    border-top: 1px solid var(--line);
    position: relative;
    transition: background 0.2s ease;
}

.projects-grid .project-card:last-child {
    border-bottom: 1px solid var(--line);
}

.project-card::before {
    content: counter(proj, decimal-leading-zero);
    grid-column: 1;
    grid-row: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-faint);
    padding-top: 6px;
    transition: color 0.2s ease;
}

.project-card:hover {
    background: rgba(242, 239, 230, 0.025);
}

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

.project-top {
    display: contents;
}

.project-top img {
    grid-column: 2;
    grid-row: 1;
    width: 52px;
    height: 52px;
    object-fit: cover;
    border: 1px solid var(--line);
    filter: grayscale(0.35);
}

.project-top h3 {
    grid-column: 3;
    grid-row: 1;
    font-size: 20px;
    line-height: 1.25;
    align-self: center;
}

.project-top small {
    display: block;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11.5px;
    color: var(--text-faint);
    margin-top: 4px;
    letter-spacing: 0.03em;
}

.project-stats {
    grid-column: 3;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
}

.stat-chip {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-faint);
    white-space: nowrap;
}

.stat-chip:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
    color: var(--line-strong);
}

.project-card p {
    grid-column: 3;
    color: var(--text-dim);
    font-size: 15px;
    max-width: 62ch;
    margin-top: 4px;
}

.project-links {
    grid-column: 3;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    padding-top: 6px;
}

.store-link {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-dim);
    text-decoration: none;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

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

/* ---------- serviços: lista numerada com algarismo fantasma ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.service-card {
    position: relative;
    padding: 40px 34px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.service-card .num {
    position: absolute;
    top: -6px;
    right: 14px;
    font-family: var(--font-display);
    font-size: 92px;
    font-weight: 800;
    color: var(--text);
    opacity: 0.05;
    line-height: 1;
    pointer-events: none;
}

.service-card h3 {
    font-size: 21px;
    margin-bottom: 12px;
    position: relative;
}

.service-card p {
    color: var(--text-dim);
    font-size: 15.5px;
    max-width: 42ch;
    position: relative;
}

/* ---------- stack: lista corrida, sem pílulas ---------- */
.stack-groups {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.stack-group {
    border-top: 1px solid var(--line-strong);
    padding-top: 20px;
}

.stack-group h3 {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text-faint);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.stack-tags {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stack-tag {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--text);
    border: none;
    border-radius: 0;
    padding: 6px 0;
    background: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.stack-tag:hover {
    color: var(--accent);
    padding-left: 8px;
}

/* ---------- sobre ---------- */
.about-grid.single {
    max-width: 760px;
}

.about-text h2 {
    font-size: clamp(28px, 3.6vw, 40px);
    margin: 14px 0 22px;
}

.about-text p {
    color: var(--text-dim);
    margin-bottom: 16px;
    max-width: 64ch;
    font-size: 17px;
}

.about-text p strong {
    color: var(--text);
    font-weight: 600;
}

.about-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 26px 0 26px;
    padding: 18px 0 0;
    list-style: none;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-dim);
}

.about-facts li {
    border: none;
    border-radius: 0;
    padding: 0;
}

.about-facts li:not(:last-child)::after {
    content: "·";
    margin: 0 12px;
    color: var(--text-faint);
}

.social-row {
    display: flex;
    gap: 10px;
    list-style: none;
    padding: 0;
}

.social-row a {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text-dim);
    transition: color 0.2s ease, border-color 0.2s ease;
}

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

.social-row svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ---------- CTA final ---------- */
.cta-final {
    text-align: left;
    padding: 120px 0;
    border-top: 1px solid var(--line);
}

.cta-final .container {
    max-width: 760px;
}

.cta-final h2 {
    font-size: clamp(34px, 6vw, 64px);
    margin: 18px 0 22px;
}

.cta-final p {
    color: var(--text-dim);
    max-width: 480px;
    margin: 0 0 36px;
    font-size: 18px;
}

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

/* ---------- footer ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 30px 0;
}

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

.footer-inner small {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
    display: block;
    line-height: 1.8;
    text-align: right;
}

/* ---------- reveal on scroll ---------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--d, 0s);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    html { scroll-behavior: auto; }
    .wordmark .cursor { animation: none; }
}

/* ---------- responsivo ---------- */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        align-items: start;
    }

    .hero-photo {
        justify-self: start;
        max-width: 200px;
        order: -1;
    }

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

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

@media (max-width: 720px) {
    body {
        font-size: 16px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 76px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: rgba(12, 12, 11, 0.97);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--line);
        padding: 12px 24px 24px;
        display: none;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        padding: 12px 0;
    }

    .nav-links .btn {
        margin-top: 8px;
        justify-content: center;
    }

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

    .metric:nth-child(3) {
        border-left: none;
        padding-left: 0;
    }

    .metric:nth-child(n+3) {
        border-top: 1px solid var(--line);
        padding-top: 24px;
    }

    .project-card {
        grid-template-columns: 34px 44px 1fr;
        column-gap: 14px;
    }

    .services-grid {
        border-left: none;
    }

    .service-card {
        padding: 30px 0;
        border-right: none;
    }

    .service-card .num {
        font-size: 64px;
    }

    .stack-groups {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .section {
        padding: 80px 0;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .cta-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
