:root {
    --brand-primary: #00A86B;
    --brand-accent: #058c5a;
    --bg-sidebar: #0f1115;
    --bg-main: #16191e;
    --bg-card: #1c2128;
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    --border: #30363d;
    --term-bg: #000000;
    --term-header: #1a1d23;
    --term-text: #f0f6fc;
    --transition-speed: 0.25s;
    --transition-curve: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-sidebar: #f6f8fa;
    --bg-main: #ffffff;
    --bg-card: #f8f9fa;
    --text-main: #1f2328;
    --text-muted: #57606a;
    --border: #d0d7de;
    --term-bg: #1e1e1e;
    --term-header: #333333;
    --term-text: #ffffff;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-primary); }

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

body { 
    font-family: 'IBM Plex Sans', sans-serif; 
    background: var(--bg-main); 
    color: var(--text-main); 
    display: flex; 
    overflow: hidden; 
    height: 100vh;
    transition: background-color 0.3s ease;
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-capitalize, .nav-item, .section-title, .cta-btn { text-transform: capitalize; }

#canvas-nodes { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.3; will-change: transform; }

/* SIDEBAR */
.sidebar { width: 260px; height: 100vh; background: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; z-index: 1000; transition: transform var(--transition-speed) var(--transition-curve); }
.sidebar-header-profile { padding: 2.5rem 1.5rem; text-align: center; }
.main-avatar { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--brand-primary); object-fit: cover; margin-bottom: 0.8rem; }
.profile-name { display: block; font-weight: 600; font-size: 1.1rem; }
.profile-role { color: var(--brand-primary); font-family: 'JetBrains Mono'; font-size: 0.8rem; }
.sidebar-nav { flex: 1; padding: 1rem; }
.nav-item { display: block; padding: 0.8rem 1.2rem; color: var(--text-muted); text-decoration: none; border-radius: 6px; margin-bottom: 0.4rem; transition: background-color var(--transition-speed), color var(--transition-speed); }
.nav-item.active, .nav-item:hover { background: var(--bg-card); color: var(--brand-primary); }
.sidebar-socials { padding: 1.5rem; display: flex; justify-content: center; gap: 1.5rem; border-top: 1px solid var(--border); }
.social-icon { color: var(--text-muted); font-size: 1.2rem; transition: color var(--transition-speed); }
.social-icon:hover { color: var(--brand-primary); }

/* MAIN CONTENT */
.main-content { margin-left: 260px; width: calc(100% - 260px); height: 100vh; display: flex; flex-direction: column; z-index: 5; position: relative; }
.top-bar { height: 65px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; padding: 0 2.5rem; background: var(--bg-main); flex-shrink: 0; }
.breadcrumb { font-family: 'JetBrains Mono'; font-size: 0.85rem; color: var(--text-muted); }
.control-btn { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-main); padding: 0.5rem 0.8rem; border-radius: 6px; cursor: pointer; transition: border-color var(--transition-speed); display: inline-flex; align-items: center; justify-content: center; height: 38px; }
.control-btn:hover { border-color: var(--brand-primary); }

/* SECTIONS */
.page-section { display: none; flex-direction: column; align-items: center; flex: 1; overflow-y: auto; padding: 2rem 2.5rem 5rem; animation: fadeIn 0.4s ease-out; scroll-behavior: smooth; }
.page-section.active { display: flex; }
.section-container { max-width: 950px; width: 100%; padding: 2rem 0; position: relative; }
.section-title { margin-bottom: 2.5rem; font-size: 1.8rem; border-left: 4px solid var(--brand-primary); padding-left: 1rem; position: sticky; top: 0; background: var(--bg-main); z-index: 10; padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* SKILLS - PILLS */
.skills-stack { display: flex; flex-direction: column; gap: 3rem; }
.skill-row { border-bottom: 1px solid var(--border); padding-bottom: 2rem; }
.skill-row h3 { color: var(--text-muted); font-size: 1rem; margin-bottom: 1.2rem; font-family: 'JetBrains Mono'; }
.skills-tag-container { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.skill-tag { display: flex; align-items: center; gap: 10px; background: var(--bg-card); border: 1px solid var(--border); padding: 8px 16px; border-radius: 50px; font-size: 0.9rem; color: var(--text-main); transition: all 0.3s var(--transition-curve); }
.skill-tag i { font-size: 1.25rem; width: 24px; display: flex; justify-content: center; color: var(--brand-primary); }
.skill-tag:hover { border-color: var(--brand-primary); transform: translateY(-3px); background: rgba(0, 168, 107, 0.05); }

/* HERO & TERMINAL */
.hero-layout { display: flex; flex-direction: column; gap: 3rem; }
.hero-text-content h1 { font-size: 2.8rem; margin-bottom: 1.5rem; line-height: 1.2; font-family: 'Inter', sans-serif; }
.bio-text .lead { font-size: 1.25rem; color: var(--text-main); margin-bottom: 1rem; font-weight: 500; }
.bio-text .text-muted { font-size: 1.05rem; max-width: 700px; line-height: 1.6; }
.hero-btns { display: flex; gap: 1rem; margin-top: 2rem; }
.cta-btn { padding: 0.8rem 1.5rem; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: background-color var(--transition-speed), border-color var(--transition-speed); }
.cta-btn.primary { background: var(--brand-primary); color: white; border: 1px solid var(--brand-primary); }
.cta-btn.primary:hover { background: var(--brand-accent); }
.cta-btn.secondary { background: transparent; color: var(--brand-primary); border: 1px solid var(--brand-primary); }
.cta-btn.secondary:hover { background: rgba(0, 168, 107, 0.1); }
.terminal-window { background: var(--term-bg); border-radius: 8px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.terminal-header { background: var(--term-header); padding: 10px; display: flex; gap: 8px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.red { background: #ff5f56; } .yellow { background: #ffbd2e; } .green { background: #27c93f; }
.terminal-title { font-family: 'JetBrains Mono'; font-size: 0.75rem; color: var(--text-muted); margin-left: auto; margin-right: auto; }
.terminal-body { padding: 1.5rem; font-family: 'JetBrains Mono'; font-size: 0.85rem; color: var(--term-text); line-height: 1.6; }
.prompt { color: var(--brand-primary); font-weight: bold; }
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--brand-primary); animation: blink 1s infinite; }

/* PROJECTS */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; margin-bottom: 2rem; padding-top: 1rem; }
.project-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: border-color 0.3s, transform 0.3s; display: flex; flex-direction: column; height: 100%; }
.project-card:hover { border-color: var(--brand-primary); transform: translateY(-5px); }
.project-img { height: 180px; background-color: #000; background-size: cover; background-position: center; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.project-info { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; gap: 0.8rem; }
.project-tags { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.project-tags span { font-size: 0.7rem; font-family: 'JetBrains Mono'; background: rgba(0, 168, 107, 0.1); color: var(--brand-primary); padding: 2px 8px; border-radius: 4px; border: 1px solid rgba(0, 168, 107, 0.2); }
.link-btn { color: var(--brand-primary); text-decoration: none; font-size: 0.9rem; font-weight: 600; margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 1rem; }

/* GUIDES - MANUALES ENRIQUECIDOS (ACTUALIZADO) */
.guides-list { display: flex; flex-direction: column; gap: 1.2rem; }
.guide-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; transition: border-color 0.3s; overflow: hidden; }
.guide-item:hover { border-color: var(--brand-primary); }
summary { padding: 1.5rem; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; align-items: center; list-style: none; }
summary::after { content: '→'; color: var(--brand-primary); transition: transform 0.3s; }
details[open] summary::after { transform: rotate(90deg); }
.guide-content { padding: 0 1.5rem 1.5rem; line-height: 1.6; animation: fadeIn 0.3s ease; }
.guide-intro { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.guide-body { color: var(--text-main); font-size: 0.95rem; }
.guide-body p { margin-bottom: 1rem; }
.guide-body pre { background: var(--term-bg); color: var(--brand-primary); padding: 1rem; border-radius: 6px; overflow-x: auto; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; margin: 1.2rem 0; border: 1px solid var(--border); }
.guide-body img.guide-media { width: 100%; border-radius: 8px; margin: 1.5rem 0; border: 1px solid var(--border); display: block; }
.guide-body .note { background: rgba(0, 168, 107, 0.1); border-left: 4px solid var(--brand-primary); padding: 1rem; margin: 1.5rem 0; border-radius: 0 4px 4px 0; font-size: 0.9rem; }

/* CONTACT & ANIMATIONS */
.contact-form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 3rem; }
.input-group { display: flex; gap: 1rem; }
.form-field { flex: 1; }
input, textarea { background: var(--bg-card); border: 1px solid var(--border); padding: 1rem; border-radius: 8px; color: var(--text-main); font-family: inherit; width: 100%; transition: border-color var(--transition-speed); }
input:focus, textarea:focus { outline: none; border-color: var(--brand-primary); }
input.error, textarea.error { border-color: #ff5f56; }
.submit-btn { background: var(--brand-primary); color: white; border: none; padding: 1.2rem; border-radius: 8px; cursor: pointer; font-weight: 600; transition: background-color var(--transition-speed); }
.submit-btn:hover { background: var(--brand-accent); }
.contact-footer-links { display: flex; gap: 1.5rem; justify-content: center; width: 100%; flex-wrap: wrap; margin-top: 2rem; }
.info-card-inline { background: var(--bg-card); border: 1px solid var(--border); padding: 1rem 1.5rem; border-radius: 10px; text-decoration: none; color: var(--text-main); font-weight: 500; transition: border-color 0.3s, color 0.3s; display: flex; align-items: center; gap: 0.5rem; }
.info-card-inline:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* RESPONSIVE */
.mobile-navbar { display: none; }
@media (max-width: 768px) {
    body { flex-direction: column; overflow: hidden; }
    .sidebar { left: 0; top: 65px; width: 100%; height: auto; max-height: calc(100vh - 65px); transform: translateY(-120%); border-right: none; border-bottom: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,0.3); z-index: 1050; overflow-y: auto; }
    .sidebar.open { transform: translateY(0); }
    .sidebar-header-profile { display: none; }
    .main-content { margin-left: 0; width: 100%; height: calc(100vh - 65px); margin-top: 65px; }
    .top-bar { display: none; }
    .mobile-navbar { display: flex; flex-direction: row; align-items: center; justify-content: space-between; position: fixed; top: 0; left: 0; width: 100%; height: 65px; background: var(--bg-sidebar); border-bottom: 1px solid var(--border); padding: 0 15px; z-index: 1100; }
    .mobile-nav-identity { display: flex; align-items: center; gap: 12px; }
    .avatar-sm { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--brand-primary); }
    .mobile-nav-actions { display: flex; align-items: center; gap: 8px; }
    .mobile-nav-actions .control-btn { width: 42px; height: 42px; padding: 0; font-size: 1rem; }
    .page-section { padding: 1.5rem 1.5rem 4rem; }
    .hero-btns { flex-direction: column; width: 100%; }
    .input-group, .contact-footer-links { flex-direction: column; }
    .projects-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .skill-tag { width: 100%; justify-content: flex-start; }
}