/* ===========================================================================
   custom.css — Estilos complementares ao Tailwind
   Design tokens em :root para consistência.
   =========================================================================== */

:root {
    --bg:            #0a0a0a;
    --surface:       #111111;
    --surface-2:     #1a1a1a;
    --border:        #262626;
    --text:          #f5f5f5;
    --text-muted:    #a3a3a3;
    --accent-from:   #fb923c;
    --accent-to:     #ea580c;
    --radius:        12px;
}

* { scroll-behavior: smooth; }

html { scroll-padding-top: 80px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.font-display { font-family: 'Space Grotesk', sans-serif; }
.font-mono    { font-family: 'JetBrains Mono', monospace; }

/* --- Gradiente accent reutilizável ---------------------------------------- */
.accent-gradient {
    background: linear-gradient(135deg, var(--accent-from) 0%, var(--accent-to) 100%);
}
.accent-text {
    background: linear-gradient(135deg, var(--accent-from) 0%, var(--accent-to) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --- Botões --------------------------------------------------------------- */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-from) 0%, var(--accent-to) 100%);
    color: #0a0a0a;
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(234, 88, 12, .6);
}
.btn-ghost {
    border: 1px solid var(--border);
    color: var(--text);
    transition: border-color .2s ease, background .2s ease;
}
.btn-ghost:hover {
    border-color: var(--accent-from);
    background: rgba(251, 146, 60, .08);
}

/* --- Grid animado de fundo do Hero ---------------------------------------- */
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(38, 38, 38, .5) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(38, 38, 38, .5) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 40%, transparent 100%);
    animation: grid-pan 30s linear infinite;
}
@keyframes grid-pan {
    from { background-position: 0 0; }
    to   { background-position: 48px 48px; }
}

/* Brilho accent sutil no hero */
.hero-glow {
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(234, 88, 12, .18) 0%, transparent 60%);
    pointer-events: none;
    filter: blur(40px);
}

/* --- Palavra rotativa do hero --------------------------------------------- */
.rotating-word {
    display: inline-block;
    min-width: 1ch;
    transition: opacity .3s ease, transform .3s ease;
}
.rotating-word.swap { opacity: 0; transform: translateY(8px); }

/* --- Cards de projeto: scroll on hover ------------------------------------ */
.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
    cursor: pointer;
}
.project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(251, 146, 60, .4);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .8);
}
.project-thumb {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: var(--surface-2);
}
/* A imagem "rola" no hover simulando o print fullpage */
.project-thumb img {
    width: 100%;
    display: block;
    transition: transform 4s linear;
    transform: translateY(0);
}
.project-card:hover .project-thumb img {
    /* translateY definido inline via --scroll-y (calculado no JS) */
    transform: translateY(var(--scroll-y, -60%));
}
/* placeholder quando não há thumbnail */
.thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: .85rem;
}

/* --- Pills de tech stack -------------------------------------------------- */
.tech-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: .72rem;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--surface-2);
}

/* --- Filtros de categoria (underline animado) ----------------------------- */
.filter-tab {
    position: relative;
    padding: 8px 4px;
    color: var(--text-muted);
    font-weight: 500;
    transition: color .2s ease;
}
.filter-tab::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    height: 2px; width: 0;
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
    transition: width .3s ease;
}
.filter-tab.active { color: var(--text); }
.filter-tab.active::after { width: 100%; }

/* --- Modal de projeto ----------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 60;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    transform: scale(.95) translateY(10px);
    transition: transform .3s ease;
}
.modal-backdrop.open .modal-panel { transform: scale(1) translateY(0); }

/* --- Cards genéricos (sobre/serviços) ------------------------------------- */
.surface-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .3s ease, transform .3s ease;
}
.surface-card:hover {
    border-color: rgba(251, 146, 60, .35);
    transform: translateY(-3px);
}

/* --- Inputs do formulário ------------------------------------------------- */
.form-input {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent-from);
    box-shadow: 0 0 0 3px rgba(251, 146, 60, .15);
}
.form-input::placeholder { color: #6b6b6b; }
.field-error { border-color: #ef4444 !important; }

/* --- Cookie banner -------------------------------------------------------- */
.cookie-banner {
    transform: translateY(120%);
    transition: transform .4s ease;
}
.cookie-banner.show { transform: translateY(0); }

/* --- Reveal on scroll ----------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* --- Scrollbar ------------------------------------------------------------ */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* --- Acessibilidade: respeita preferências de movimento ------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    .project-card:hover .project-thumb img { transform: none; }
}
