/* =========================================================
   ÁLVARO MACHADO JR — Portfólio
   Design tokens
   ========================================================= */
:root {
    --bg: #06080a;
    --surface: #0d1117;
    --surface-2: #11161c;
    --line: rgba(125, 211, 192, 0.12);
    --line-strong: rgba(125, 211, 192, 0.3);
    --accent: #10b97e;
    --accent-soft: #7dd3c0;
    --accent-dim: rgba(16, 185, 126, 0.12);
    --text: #e9edf1;
    --text-dim: #8893a1;
    --text-mute: #5b6675;
    --danger: #e0626b;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --maxw: 1180px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

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

::selection { background: var(--accent); color: #04140e; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

a { color: inherit; }

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
    z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================================
   AMBIENT BACKGROUND — grid técnico + glow + partículas leves
   ========================================================= */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-grid {
    position: absolute;
    inset: -1px;
    background-image:
        linear-gradient(90deg, rgba(125, 211, 192, 0.05) 1px, transparent 1px),
        linear-gradient(0deg, rgba(125, 211, 192, 0.05) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 70%);
}

.bg-glow {
    position: absolute;
    top: -20%;
    left: 50%;
    width: 1100px;
    height: 700px;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, rgba(16, 185, 126, 0.16), transparent);
    filter: blur(10px);
}

.bg-glow-2 {
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(closest-side, rgba(16, 185, 126, 0.08), transparent);
}

.bg-noise-particles span {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--accent-soft);
    opacity: 0;
    animation: drift linear infinite;
}

@keyframes drift {
    0% { transform: translateY(0); opacity: 0; }
    8% { opacity: 0.5; }
    92% { opacity: 0.35; }
    100% { transform: translateY(-110vh); opacity: 0; }
}

.scanline-sweep {
    position: absolute;
    left: 0; right: 0;
    height: 140px;
    background: linear-gradient(180deg, transparent, rgba(16, 185, 126, 0.04), transparent);
    animation: sweep 9s var(--ease) infinite;
}

@keyframes sweep {
    0% { top: -140px; }
    100% { top: 100vh; }
}

/* =========================================================
   HUD SIDE PANEL — assinatura visual
   ========================================================= */
.hud {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 40;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-mute);
    background: rgba(13, 17, 23, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    padding: 12px 16px;
    border-radius: 4px;
    display: none;
    min-width: 188px;
    transition: opacity 0.3s, transform 0.3s;
}
.hud.is-hidden {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

@media (min-width: 860px) {
    .hud { display: block; }
}

.hud-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; white-space: nowrap; }
.hud-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    flex-shrink: 0;
    animation: blink-dot 2.4s ease-in-out infinite;
}
@keyframes blink-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.hud-label { color: var(--text-mute); }
.hud-value { color: var(--accent-soft); margin-left: auto; }

/* =========================================================
   HEADER / NAV
   ========================================================= */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(6, 8, 10, 0.78);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transition: border-color 0.3s, background 0.3s;
}

.site-header.is-scrolled {
    background: rgba(6, 8, 10, 0.94);
    border-bottom-color: var(--line-strong);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 0;
}

.brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1.1;
}
.brand-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
    color: var(--text);
}
.brand-name span { color: var(--accent); }
.brand-tag {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 1.5px;
    color: var(--text-mute);
    margin-top: 3px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 36px;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    position: relative;
    padding: 4px 0;
    transition: color 0.25s;
}
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -2px;
    width: 0; height: 1px;
    background: var(--accent);
    transition: width 0.3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--accent-soft); }
.nav-links a.active::after { width: 100%; }

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    text-decoration: none;
    color: var(--accent-soft);
    transition: all 0.25s;
    flex-shrink: 0;
}
.nav-cta:hover { background: var(--accent-dim); border-color: var(--accent); }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    width: 38px; height: 38px;
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
}
.nav-toggle-bars {
    position: absolute;
    top: 50%; left: 50%;
    width: 16px; height: 11px;
    transform: translate(-50%, -50%);
}
.nav-toggle-bars span {
    position: absolute;
    left: 0; right: 0;
    height: 1.5px;
    background: var(--accent-soft);
    transition: all 0.3s var(--ease);
}
.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle-bars span:nth-child(3) { bottom: 0; }
.nav-toggle.is-active .nav-toggle-bars span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.nav-toggle.is-active .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active .nav-toggle-bars span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

@media (max-width: 860px) {
    .nav-links { 
        position: fixed;
        top: 73px; left: 0; right: 0;
        background: #060a0c;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 8px 24px 20px;
        border-bottom: 1px solid var(--line);
        transform: translateY(-110%);
        opacity: 0;
        transition: transform 0.35s var(--ease), opacity 0.3s;
        pointer-events: none;
        z-index: 50;
    }
    .nav-links.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .nav-links a { width: 100%; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
    .nav-cta { display: none; }
    .nav-toggle { display: flex; align-items: center; justify-content: center; }
}

/* =========================================================
   PAGE ENTRANCE TRANSITION
   ========================================================= */
.page-veil {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: veilOut 0.7s var(--ease) forwards;
    animation-delay: 0.25s;
}
.page-veil::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
}
.page-veil span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: var(--accent-soft);
    opacity: 0;
    animation: veilText 0.5s ease forwards 0.05s;
}
@keyframes veilText { to { opacity: 1; } }
@keyframes veilOut {
    to { opacity: 0; visibility: hidden; }
}

main {
    animation: pageIn 0.8s var(--ease) backwards;
    animation-delay: 0.15s;
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

body.is-leaving { animation: pageOut 0.28s var(--ease) forwards; }
@keyframes pageOut { to { opacity: 0; transform: translateY(-10px); } }

/* =========================================================
   REVEAL ON SCROLL
   ========================================================= */
[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-reveal].in-view { opacity: 1; transform: translateY(0); }
[data-reveal="left"] { transform: translateX(-28px); }
[data-reveal="left"].in-view { transform: translateX(0); }
[data-reveal="right"] { transform: translateX(28px); }
[data-reveal="right"].in-view { transform: translateX(0); }

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--accent-soft);
    margin-bottom: 20px;
}
.eyebrow::before {
    content: '';
    width: 18px; height: 1px;
    background: var(--accent);
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.5px; }

.section-title {
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    line-height: 1.15;
    margin-bottom: 18px;
    max-width: 720px;
}
.section-title .accent { color: var(--accent); }
.section-lede {
    color: var(--text-dim);
    font-size: 1rem;
    max-width: 580px;
    margin-bottom: 56px;
}

.mono { font-family: var(--font-mono); }

/* =========================================================
   SECTIONS / LAYOUT
   ========================================================= */
.section { padding: 110px 0; position: relative; }
.section + .section { border-top: 1px solid var(--line); }
.section--tight { padding: 80px 0; }

@media (max-width: 768px) {
    .section { padding: 80px 0; }
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 28px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s var(--ease);
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #04140e;
    box-shadow: 0 0 0 0 rgba(16,185,126,0.5);
}
.btn-primary:hover { background: #14d491; box-shadow: 0 6px 24px rgba(16,185,126,0.35); transform: translateY(-2px); }
.btn-outline {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-soft); transform: translateY(-2px); }
.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    padding-left: 0;
}
.btn-ghost:hover { color: var(--accent-soft); }

/* =========================================================
   HERO (home page)
   ========================================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 150px 0 100px;
    position: relative;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 70px;
    align-items: center;
}

@media (max-width: 920px) {
    .hero-grid { grid-template-columns: 1fr; gap: 50px; text-align: center; }
    .hero-portrait { order: -1; margin: 0 auto; }
}

.hero-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    color: var(--accent-soft);
    border: 1px solid var(--line-strong);
    padding: 7px 14px 7px 10px;
    border-radius: 30px;
    margin-bottom: 30px;
    background: rgba(16,185,126,0.05);
}
.hero-status .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: blink-dot 2.4s ease-in-out infinite;
}

.hero h1 {
    font-size: clamp(2.4rem, 5.2vw, 4.2rem);
    line-height: 1.08;
    letter-spacing: -1.5px;
    margin-bottom: 26px;
}
.hero h1 .line { display: block; }
.hero h1 .accent { color: var(--accent); }

.hero-desc {
    font-size: 1.08rem;
    color: var(--text-dim);
    max-width: 540px;
    margin-bottom: 42px;
}

@media (max-width: 920px) {
    .hero-desc { max-width: 100%; margin-left: auto; margin-right: auto; }
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 56px;
}

@media (max-width: 920px) { .hero-actions { justify-content: center; } }

.hero-stats {
    display: flex;
    gap: 44px;
    flex-wrap: wrap;
}
@media (max-width: 920px) { .hero-stats { justify-content: center; } }
.hero-stat-num {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--accent);
}
.hero-stat-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-top: 4px;
}

.hero-portrait {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin-left: auto;
}
.portrait-frame {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1.08;
    border: 1px solid var(--line-strong);
    background: var(--surface);
}
.portrait-frame img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: grayscale(15%) contrast(1.05) brightness(0.96);
    display: block;
}
.portrait-frame::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(6,8,10,0.7) 100%);
    pointer-events: none;
}
.portrait-corner {
    position: absolute;
    width: 26px; height: 26px;
    border: 1.5px solid var(--accent);
    opacity: 0.85;
}
.portrait-corner.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.portrait-corner.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.portrait-tag {
    position: absolute;
    bottom: 18px; left: 18px;
    right: 18px;
    z-index: 2;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 1px;
    color: var(--accent-soft);
    display: flex;
    justify-content: space-between;
}

.scroll-cue {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 2px;
    color: var(--text-mute);
}
.scroll-cue .bar {
    width: 1px; height: 30px;
    background: linear-gradient(180deg, var(--accent), transparent);
    animation: scrollCue 1.8s ease-in-out infinite;
}
@keyframes scrollCue { 0%, 100% { transform: scaleY(0.4); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

@media (max-width: 768px) { .scroll-cue { display: none; } }

/* =========================================================
   PAGE HEADER (subpages)
   ========================================================= */
.page-hero {
    padding: 150px 0 70px;
    border-bottom: 1px solid var(--line);
}
.page-hero .section-title { margin-bottom: 14px; }
.page-hero .section-lede { margin-bottom: 0; }

/* =========================================================
   CARDS — Expertise
   ========================================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}
.card {
    background: var(--bg);
    padding: 38px 32px;
    position: relative;
    transition: background 0.3s;
}
.card:hover { background: var(--surface); }
.card-index {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-mute);
    margin-bottom: 24px;
    display: block;
}
.card-icon {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 22px;
    display: block;
}
.card h3 {
    font-size: 1.12rem;
    margin-bottom: 12px;
    font-weight: 600;
}
.card p {
    color: var(--text-dim);
    font-size: 0.89rem;
    line-height: 1.65;
}
.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 22px;
}
.card-tags span {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.5px;
    color: var(--accent-soft);
    border: 1px solid var(--line);
    padding: 4px 9px;
    border-radius: 20px;
}

/* =========================================================
   PROCESS / HOW I WORK (replaces pricing)
   ========================================================= */
.process-list {
    display: flex;
    flex-direction: column;
}
.process-item {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 28px;
    padding: 36px 0;
    border-top: 1px solid var(--line);
    align-items: start;
}
.process-item:last-child { border-bottom: 1px solid var(--line); }
.process-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    padding-top: 4px;
}
.process-item h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
}
.process-item p {
    color: var(--text-dim);
    font-size: 0.92rem;
    max-width: 620px;
}
@media (max-width: 600px) {
    .process-item { grid-template-columns: 1fr; gap: 10px; }
}

/* =========================================================
   ABOUT — timeline / stats
   ========================================================= */
.about-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 70px;
}
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; gap: 50px; } }

.stat-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-top: 36px;
}
.stat-box { background: var(--bg); padding: 24px; }
.stat-box .num { font-family: var(--font-display); font-size: 1.7rem; color: var(--accent); font-weight: 700; }
.stat-box .lbl { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 1px; color: var(--text-mute); margin-top: 6px; text-transform: uppercase; }

.timeline { border-left: 1px solid var(--line-strong); padding-left: 28px; display: flex; flex-direction: column; gap: 30px; }
.timeline-item { position: relative; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -33px; top: 4px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--bg), 0 0 10px var(--accent);
}
.timeline-item .ti-meta {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-mute);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.timeline-item h4 { font-size: 1rem; margin-bottom: 6px; font-weight: 600; }
.timeline-item p { color: var(--text-dim); font-size: 0.86rem; }

/* =========================================================
   CONTACT
   ========================================================= */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}
.contact-card {
    background: var(--bg);
    padding: 40px 30px;
    text-align: left;
    transition: background 0.3s;
}
.contact-card:hover { background: var(--surface); }
.contact-card i { font-size: 1.4rem; color: var(--accent); margin-bottom: 18px; display: block; }
.contact-card h3 { font-size: 1rem; margin-bottom: 8px; }
.contact-card p { color: var(--text-dim); font-size: 0.86rem; margin-bottom: 18px; }

.cta-banner {
    margin-top: 70px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(16,185,126,0.06), transparent);
    position: relative;
    overflow: hidden;
}
.cta-banner h3 { font-size: 1.5rem; margin-bottom: 8px; }
.cta-banner p { color: var(--text-dim); font-size: 0.92rem; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 50px 0 36px;
    position: relative;
    z-index: 2;
}
.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-grid .brand-name { font-size: 0.92rem; }
.footer-links { display: flex; gap: 26px; }
.footer-links a { text-decoration: none; color: var(--text-mute); font-size: 0.78rem; transition: color 0.25s; }
.footer-links a:hover { color: var(--accent-soft); }
.footer-meta {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--text-mute);
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
