:root {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --accent: #38bdf8;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --section-gap: 120px;
    --transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base & Reset */
* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 25px; }
.code-font { font-family: 'Fira Code', monospace; color: var(--accent); }
.accent-text { color: var(--accent); }

/* --- Navegación --- */
nav { 
    height: 80px; display: flex; align-items: center; 
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 1000; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-content { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.logo { font-weight: 700; font-size: 1.2rem; }
.logo span { color: var(--accent); }
.nav-links { display: flex; list-style: none; gap: 30px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-dim); font-size: 0.9rem; transition: var(--transition); }
.nav-links a:hover { color: var(--accent); }
.btn-nav { border: 1px solid var(--accent); padding: 8px 18px; border-radius: 6px; color: var(--accent) !important; }

/* --- Redes Sociales Flotantes --- */
.social-sidebar {
    position: fixed; left: 0; top: 50%; transform: translateY(-50%);
    z-index: 1500; display: flex; flex-direction: column;
}
.social-icon {
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    text-decoration: none; color: white; font-size: 1.4rem; background: #1e293b;
    border-radius: 0 8px 8px 0; margin-bottom: 6px; transition: 0.3s; position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05); border-left: none;
}
.social-icon span {
    position: absolute; left: 50px; font-size: 0.85rem; padding-left: 10px;
    opacity: 0; pointer-events: none; transition: 0.3s; font-weight: 600;
}
.social-icon:hover { width: 140px; color: white; }
.social-icon:hover span { opacity: 1; }
.github:hover { background: #333; }
.linkedin:hover { background: #0077b5; }

/* --- Hero Section --- */
.hero { min-height: 85vh; display: flex; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.1; margin: 1.5rem 0; font-weight: 800; }
.hero p { font-size: 1.15rem; color: var(--text-dim); max-width: 600px; margin-bottom: 2.5rem; }
.hero-btns { display: flex; gap: 15px; }

.btn-primary, .btn-secondary { padding: 14px 28px; border-radius: 8px; text-decoration: none; font-weight: bold; transition: var(--transition); }
.btn-primary { background: var(--accent); color: var(--bg); border: 1px solid var(--accent); }
.btn-secondary { border: 1px solid rgba(56, 189, 248, 0.4); color: var(--accent); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(56, 189, 248, 0.2); }
.btn-secondary:hover { background: rgba(56, 189, 248, 0.05); border-color: var(--accent); }

/* --- Global Sections --- */
section { padding: var(--section-gap) 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.section-title { font-size: 2rem; margin-bottom: 3.5rem; border-left: 5px solid var(--accent); padding-left: 20px; font-weight: 700; }

/* --- Tech Stack --- */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 20px; }
.tech-item { background: var(--card-bg); padding: 25px; border-radius: 12px; text-align: center; transition: var(--transition); border: 1px solid transparent; }
.tech-item:hover { transform: translateY(-5px); border-color: var(--accent); background: rgba(30, 41, 59, 0.5); }
.tech-item i { font-size: 2.8rem; display: block; margin-bottom: 12px; }
.tech-item span { font-size: 0.9rem; font-weight: 500; }

/* --- Projects --- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.project-card {
    background: var(--card-bg); border-radius: 16px; overflow: hidden;
    transition: var(--transition); border: 1px solid rgba(255,255,255,0.05);
    display: flex; flex-direction: column; height: 100%;
}
.project-card:hover { transform: translateY(-10px); border-color: rgba(56, 189, 248, 0.4); }

.project-img { position: relative; width: 100%; height: 210px; overflow: hidden; background: #000; }
.project-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.6s ease; opacity: 0.8; }
.project-card:hover .project-img img { transform: scale(1.1); opacity: 0.5; }

.status-badge {
    position: absolute; top: 15px; left: 15px; background: rgba(34, 197, 94, 0.9);
    color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.7rem;
    font-weight: 700; z-index: 10; letter-spacing: 0.5px;
}

.overlay {
    position: absolute; inset: 0; background: rgba(15, 23, 42, 0.7);
    display: flex; justify-content: center; align-items: center; opacity: 0; transition: 0.3s;
}
.overlay a {
    color: white; text-decoration: none; padding: 10px 20px; border: 1px solid var(--accent);
    border-radius: 6px; font-size: 0.85rem; font-weight: 700; background: rgba(15, 23, 42, 0.5);
}
.project-card:hover .overlay { opacity: 1; }

.project-info { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.project-info h3 { font-size: 1.3rem; margin-bottom: 10px; color: var(--text-main); }
.project-info p { font-size: 0.95rem; color: var(--text-dim); margin-bottom: 15px; flex-grow: 1; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tags span { font-size: 0.7rem; background: rgba(56, 189, 248, 0.1); color: var(--accent); padding: 4px 10px; border-radius: 4px; border: 1px solid rgba(56, 189, 248, 0.2); }

/* --- Services & Workflow --- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.service-item { background: var(--card-bg); padding: 40px; border-radius: 20px; text-align: center; border: 1px solid rgba(255,255,255,0.05); transition: 0.3s; }
.service-item:hover { border-color: var(--accent); }
.service-item i { font-size: 3rem; margin-bottom: 20px; display: block; }

.workflow-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; }
.step { position: relative; padding-top: 20px; }
.step-number { font-size: 4rem; font-weight: 900; color: rgba(56,189,248,0.07); position: absolute; top: -15px; left: 0; line-height: 1; }
.step h4 { color: var(--accent); margin-bottom: 10px; font-size: 1.2rem; position: relative; }
.step p { font-size: 0.9rem; color: var(--text-dim); position: relative; }

/* --- Animations --- */
.reveal { opacity: 0; transform: translateY(30px); transition: 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }

/* --- WhatsApp Chat UI --- */
#wa-btn { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; cursor: pointer; z-index: 2000; transition: 0.3s; }
#wa-btn:hover { transform: scale(1.1); }
#chat-modal { 
    position: fixed; bottom: 105px; right: 30px; width: 320px; 
    background: white; border-radius: 18px; color: #333; z-index: 2000; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.4); overflow: hidden; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-hidden { opacity: 0; transform: translateY(20px) scale(0.9); pointer-events: none; }
.chat-header { background: #075e54; color: white; padding: 18px; text-align: center; }
.chat-header strong { display: block; font-size: 1rem; }
.chat-header small { opacity: 0.8; }
.chat-body { padding: 25px; background: #e5ddd5; font-size: 0.9rem; line-height: 1.4; }
.chat-footer { padding: 15px; background: white; text-align: center; }
.chat-footer a { background: #25d366; color: white; text-decoration: none; padding: 12px; border-radius: 8px; font-weight: bold; display: block; transition: 0.3s; }

/* --- Footer --- */
footer { text-align: center; padding: 80px 0; border-top: 1px solid rgba(255,255,255,0.05); color: var(--text-dim); }
footer p { margin-bottom: 10px; }

/* --- Mobile --- */
@media (max-width: 768px) {
    :root { --section-gap: 80px; }
    .nav-links { display: none; }
    .social-sidebar { display: none; }
    .hero { text-align: center; padding-top: 40px; }
    .hero h1 { font-size: 2.5rem; }
    .hero-btns { justify-content: center; flex-direction: column; }
    .section-title { font-size: 1.7rem; text-align: left; }
    .projects-grid { grid-template-columns: 1fr; }
}