:root {
    --bg: #030508;
    --surface: #0a0d14;
    --surface-hover: #121620;
    --accent: #00f2ff;
    --accent-glow: rgba(0, 242, 255, 0.5);
    --accent-2: #8e2de2;
    --text: #f8f9fa;
    --text-dim: #94a3b8;
    --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
    --glass: rgba(3, 5, 8, 0.7);
    --border: rgba(255, 255, 255, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
    cursor: default;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

#bg-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }

/* --- Header --- */
header {
    position: fixed; top: 0; width: 100%; padding: 1.2rem 8%;
    display: flex; justify-content: space-between; align-items: center;
    background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border); z-index: 1000; transition: 0.3s;
}

.logo {
    font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 1.4rem; color: var(--text);
    display: flex; align-items: center; gap: 10px;
}
.logo span { color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); }

nav ul { display: flex; list-style: none; gap: 2.5rem; }
nav a {
    text-decoration: none; color: var(--text-dim); font-size: 0.85rem; font-weight: 600;
    transition: 0.3s; text-transform: uppercase; letter-spacing: 1px; position: relative;
}
nav a::after {
    content: ''; position: absolute; width: 0; height: 2px; bottom: -5px; left: 0;
    background: var(--accent); transition: 0.3s; box-shadow: 0 0 10px var(--accent);
}
nav a:hover { color: #fff; }
nav a:hover::after { width: 100%; }

/* --- Hero --- */
.hero {
    min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 0 10%; position: relative;
}
.hero::before {
    content: ''; position: absolute; width: 300px; height: 300px; background: var(--accent);
    filter: blur(150px); opacity: 0.15; border-radius: 50%; z-index: -1; animation: pulseGlow 5s infinite alternate;
}
@keyframes pulseGlow { 0% { opacity: 0.1; transform: scale(1); } 100% { opacity: 0.2; transform: scale(1.2); } }

.hero h1 {
    font-size: clamp(3rem, 8vw, 5.5rem); font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem; letter-spacing: -2px;
    margin-left: auto; margin-right: auto; max-width: 1000px;
}
.hero h1 span { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; position: relative; display: inline-block; }
.typewriter {
    font-family: 'JetBrains Mono', monospace; color: var(--accent); font-size: 1rem; margin-bottom: 1rem;
    display: inline-block; background: rgba(0, 242, 255, 0.1); padding: 5px 15px; border-radius: 20px; border: 1px solid rgba(0, 242, 255, 0.2);
}
.hero p { color: var(--text-dim); font-size: 1.2rem; max-width: 700px; margin-bottom: 2.5rem; margin-left: auto; margin-right: auto; }

/* --- Buttons --- */
.btn {
    padding: 1rem 2.5rem; border-radius: 50px; font-weight: 700; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); text-transform: uppercase; font-size: 0.85rem;
    letter-spacing: 1px; border: 1px solid transparent; cursor: pointer; position: relative; overflow: hidden; z-index: 1;
}
.btn-primary { background: rgba(255,255,255,0.05); color: #fff; border-color: rgba(255,255,255,0.1); backdrop-filter: blur(10px); }
.btn-primary::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--gradient); z-index: -1; opacity: 0.8; transition: 0.3s;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 30px rgba(0, 242, 255, 0.4); }
.btn-primary:hover::before { opacity: 1; }

/* --- Sections --- */
.section-padding { padding: 8rem 8%; }
.section-title { text-align: center; margin-bottom: 4rem; }
.section-title h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.section-title span { color: var(--accent); font-family: 'JetBrains Mono'; font-size: 0.9rem; letter-spacing: 2px; }

/* --- Services Grid --- */
.grid-services { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.card {
    background: rgba(255, 255, 255, 0.02); padding: 3rem 2rem; border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05); position: relative; overflow: hidden; transition: transform 0.3s; cursor: default;
}
.card::before {
    content: ""; position: absolute; height: 100%; width: 100%; top: 0; left: 0;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.06), transparent 40%);
    z-index: 0; opacity: 0; transition: opacity 0.5s; pointer-events: none;
}
.card::after {
    content: ""; position: absolute; height: 100%; width: 100%; top: 0; left: 0;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(0, 242, 255, 0.15), transparent 40%);
    z-index: 1; opacity: 0; transition: opacity 0.5s; pointer-events: none; border-radius: 20px;
}
.grid-services:hover .card::before, .grid-services:hover .card::after { opacity: 1; }
.card-content { position: relative; z-index: 2; }
.card-icon {
    width: 60px; height: 60px; background: rgba(255,255,255,0.05); border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--accent);
    margin-bottom: 1.5rem; border: 1px solid rgba(255,255,255,0.05); transition: 0.3s;
}
.card:hover .card-icon { background: var(--accent); color: #000; box-shadow: 0 0 20px var(--accent-glow); transform: rotateY(180deg); }
.card h3 { font-size: 1.3rem; margin-bottom: 1rem; color: #fff; font-weight: 700; }
.card p { color: var(--text-dim); font-size: 0.95rem; line-height: 1.6; }

/* --- Tech Stack --- */
.tech-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 4rem; margin-top: 2rem; opacity: 0.8; }
.tech-item { display: flex; flex-direction: column; align-items: center; gap: 1rem; transition: 0.3s; filter: grayscale(1) opacity(0.5); }
.tech-item:hover { filter: grayscale(0) opacity(1); transform: scale(1.1); }
.tech-item i { font-size: 3.5rem; }
.tech-item span { font-family: 'JetBrains Mono'; font-size: 0.8rem; letter-spacing: 1px; }

/* --- Modal --- */
.modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(3, 5, 8, 0.85); backdrop-filter: blur(8px);
    align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease;
}
.modal.show { display: flex; opacity: 1; }
.modal-content {
    background: linear-gradient(145deg, var(--surface), #000); padding: 3rem; border: 1px solid var(--accent);
    width: 90%; max-width: 500px; border-radius: 20px; box-shadow: 0 0 40px rgba(0, 242, 255, 0.15);
    position: relative; transform: scale(0.8); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal.show .modal-content { transform: scale(1); }
.close-btn {
    position: absolute; top: 20px; right: 25px; color: var(--text-dim); font-size: 28px;
    font-weight: bold; cursor: pointer; transition: 0.3s;
}
.close-btn:hover { color: var(--accent); text-shadow: 0 0 10px var(--accent); }
.modal-header h2 { font-size: 1.8rem; margin-bottom: 0.5rem; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.modal-header p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 2rem; font-family: 'JetBrains Mono', monospace; }
.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--accent); }
.form-control {
    width: 100%; padding: 12px 15px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px; color: #fff; font-family: 'Inter', sans-serif; transition: 0.3s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 10px rgba(0, 242, 255, 0.2); background: rgba(0, 242, 255, 0.02); }

/* PHP Mensagens */
.php-msg { padding: 10px; border-radius: 5px; margin-bottom: 15px; font-size: 0.9rem; text-align: center; }
.php-success { background: rgba(16, 163, 127, 0.2); border: 1px solid #10a37f; color: #10a37f; }
.php-error { background: rgba(255, 0, 0, 0.1); border: 1px solid red; color: #ff5555; }

/* --- Footer --- */
footer { padding: 4rem 8%; border-top: 1px solid var(--border); background: #010204; display: flex; flex-direction: column; align-items: center; text-align: center; }
.socials { margin: 2rem 0; display: flex; gap: 1.5rem; }
.socials a {
    width: 45px; height: 45px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
    color: var(--text); text-decoration: none; transition: 0.3s;
}
.socials a:hover { background: var(--accent); border-color: var(--accent); color: #000; }

@media (max-width: 768px) {
    header { padding: 1rem 5%; }
    nav { display: none; }
    .hero h1 { font-size: 2.8rem; }
    .grid-services { grid-template-columns: 1fr; }
    .modal-content { padding: 2rem; }
}
.reveal { opacity: 0; transform: translateY(30px); transition: 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }