:root {
    --bg-color: #050505;
    --text-color: #f0f0f0;
    --accent-color: #ff3c00;
    --grid-color: rgba(255,255,255,0.03);
    --font-heading: 'Teko', sans-serif;
    --font-body: 'Inter', sans-serif;
    --ease-samurai: cubic-bezier(0.19, 1, 0.22, 1);
}

/* --- MODO CLARO --- */
body.light-mode {
    --bg-color: #e6e6e6;
    --text-color: #1a1a1a;
    --grid-color: rgba(0,0,0,0.05);
}

/* Ajuste de imagens no modo claro */
body.light-mode .main-img-box {
    filter: grayscale(100%) contrast(1.2) brightness(0.9);
}

* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    /* Transição suave nas cores do texto para acompanhar a mancha no fundo */
    transition: background-color 0.1s, color 0.5s ease;
}

/* --- MANCHA DE TINTA (AGORA NO FUNDO) --- */
.ink-transition-blob {
    position: fixed;
    top: 50%; left: 50%;
    width: 20px; height: 20px;
    background-color: var(--blob-color, #e6e6e6);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    
    /* CAMADA BAIXA: Fica acima da grade (-1) mas abaixo do conteúdo (10) */
    z-index: 1; 
}

.ink-transition-blob.animating {
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    transform: translate(-50%, -50%) scale(250);
}

/* --- LAYOUT BÁSICO E CAMADAS --- */
.bg-grid-lines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    z-index: -1; /* Bem no fundo */
    background: repeating-linear-gradient(90deg, transparent 0, transparent 24.9%, var(--grid-color) 25%);
}

/* Header, Main e Footer precisam estar acima da mancha de tinta */
header, main, footer {
    position: relative;
    z-index: 10;
}

header { display: flex; justify-content: space-between; align-items: center; padding: 2rem 5%; }
.logo { font-family: var(--font-heading); font-size: 2.5rem; letter-spacing: 2px; }
nav ul { display: flex; gap: 2rem; list-style: none; align-items: center; }
nav a { text-decoration: none; color: #888; text-transform: uppercase; font-size: 0.9rem; transition: color 0.3s; }
nav a:hover { color: var(--accent-color); }

/* Botão de Tema */
.btn-theme {
    background: none; border: 1px solid transparent;
    font-family: var(--font-heading); font-size: 1rem;
    color: #888; padding: 4px 12px; transition: 0.3s; letter-spacing: 1px;
}
.btn-theme:hover { color: var(--accent-color); border-color: var(--accent-color); }

main { padding: 5% 10%; }

/* --- CURSOR (SEMPRE NO TOPO) --- */
.custom-cursor {
    position: fixed; width: 20px; height: 20px;
    border: 2px solid var(--accent-color); border-radius: 50%;
    transform: translate(-50%, -50%); pointer-events: none; 
    z-index: 9999; /* Máxima prioridade */
    transition: width 0.3s, height 0.3s, background-color 0.3s;
    mix-blend-mode: difference;
}
.custom-cursor.hovered { width: 50px; height: 50px; background-color: rgba(255, 60, 0, 0.2); }

/* --- VIDEO POPUP --- */
.video-preview-cursor {
    position: fixed; width: 300px; height: 170px;
    background: #000; border: 1px solid var(--accent-color);
    top: 0; left: 0; pointer-events: none; opacity: 0;
    transform: scale(0.8) translate(-50%, -50%);
    transition: opacity 0.3s, transform 0.4s var(--ease-samurai);
    z-index: 9998; box-shadow: 0 10px 40px rgba(0,0,0,0.9);
}
.video-preview-cursor.active { opacity: 1; transform: scale(1) translate(20px, 20px); }
.video-preview-cursor video { width: 100%; height: 100%; object-fit: cover; }
.video-label {
    position: absolute; top: 0; left: 0; background: var(--accent-color);
    color: #000; font-size: 10px; font-weight: bold; padding: 2px 8px;
    font-family: var(--font-heading); letter-spacing: 1px;
}

/* --- SEÇÕES DE PROJETO --- */
.project-section {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 4rem;
    align-items: center; margin-bottom: 150px; opacity: 0;
    transform: translateY(50px); transition: all 1s ease;
}
.project-section.visible { opacity: 1; transform: translateY(0); }
.project-section.layout-inverted { grid-template-columns: 1fr 1.2fr; direction: rtl; }
.project-section.layout-inverted > * { direction: ltr; }

/* Animação Samurai */
.text-container h2 {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 0.9;
    margin-bottom: 2rem;
    cursor: default;
}

.samurai-title {
    position: relative; display: inline-block;
    transition: transform 0.6s var(--ease-samurai), color 0.4s ease;
}

.samurai-title::after {
    content: ''; position: absolute; bottom: 10px; left: 0;
    width: 0%; height: 3px; background-color: var(--accent-color);
    transition: width 0.4s var(--ease-samurai); z-index: -1;
}

.samurai-title:hover {
    transform: translateX(30px); color: var(--accent-color);
    text-shadow: 4px 4px 0px rgba(255, 60, 0, 0.1);
}
.samurai-title:hover::after { width: 100%; }

.btn-magnetic {
    display: inline-block; padding: 1rem 3rem;
    border: 1px solid var(--text-color); color: var(--text-color);
    text-decoration: none; font-family: var(--font-heading);
    font-size: 1.2rem; letter-spacing: 2px;
    transition: all 0.3s ease;
}
.btn-magnetic:hover { background: var(--text-color); color: var(--bg-color); }
.text-container p { color: #999; margin-bottom: 3rem; line-height: 1.6; max-width: 400px; }

/* --- IMAGENS --- */
.collage-container { position: relative; height: 500px; width: 100%; }
.main-img-box {
    position: absolute; width: 85%; height: 90%;
    background-size: cover; background-position: center; top: 0; right: 0; z-index: 1;
    filter: grayscale(100%) contrast(1.1); transition: filter 0.5s;
}
.project-section:hover .main-img-box { filter: grayscale(0%) contrast(1.1); }
.sub-img-box { position: absolute; background-size: cover; z-index: 2; border: 2px solid #fff; }
.collage-1 .sub-1 { width: 200px; height: 260px; bottom: 0; left: 0; }
.collage-2 .main-img-box { left: 10%; }
.collage-2 .sub-3 { width: 160px; height: 160px; bottom: 10%; left: 0; }
.accent-box { position: absolute; bottom: 0; right: 0; width: 50%; height: 40%; background: var(--accent-color); z-index: 0; }
.deco-text {
    position: absolute; font-family: var(--font-heading); font-size: 8rem;
    color: var(--text-color); z-index: 10; top: -50px; left: -20px;
}

/* --- SOBRE --- */
.about-section {
    padding: 100px 0; border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0; transform: translateY(50px); transition: all 1s ease;
}
.about-section.visible { opacity: 1; transform: translateY(0); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.section-label { display: block; font-family: var(--font-body); font-size: 0.8rem; color: var(--accent-color); letter-spacing: 2px; margin-bottom: 1rem; }
.about-text h3 { font-family: var(--font-heading); font-size: 4rem; line-height: 1; margin-bottom: 2rem; }
.highlight { color: var(--accent-color); }
.bio { font-size: 1.1rem; color: #bbb; margin-bottom: 3rem; max-width: 500px; }
.skills-list { display: flex; flex-wrap: wrap; gap: 1rem; }
.skill-item {
    border: 1px solid #333; padding: 0.5rem 1.5rem;
    font-family: var(--font-heading); letter-spacing: 1px; font-size: 1.1rem; transition: 0.3s;
}
.skill-item:hover { border-color: var(--accent-color); color: var(--accent-color); }
.profile-frame { position: relative; width: 100%; max-width: 400px; height: 500px; margin-left: auto; }
.profile-frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%); transition: 0.5s; }
.profile-frame:hover img { filter: grayscale(0%); }
.frame-corner { position: absolute; width: 40px; height: 40px; border: 3px solid var(--accent-color); transition: 0.3s var(--ease-samurai); }
.top-left { top: -10px; left: -10px; border-right: none; border-bottom: none; }
.bottom-right { bottom: -10px; right: -10px; border-left: none; border-top: none; }
.profile-frame:hover .top-left { transform: translate(-10px, -10px); }
.profile-frame:hover .bottom-right { transform: translate(10px, 10px); }

@media (max-width: 900px) {
    .project-section, .project-section.layout-inverted, .about-grid { grid-template-columns: 1fr; gap: 3rem; direction: ltr; }
    .collage-container { height: 400px; order: 1; }
    .text-container { order: 2; }
    .about-visual { display: none; }
    .video-preview-cursor, .custom-cursor { display: none; }
    * { cursor: auto; }
}