/* ========================================
   Variables CSS - Tema Programador
   ======================================== */
:root {
    /* Colores principales */
    --bg-primary: #0a0e27;
    --bg-secondary: #111827;
    --bg-tertiary: #1a1f3a;
    
    /* Colores de acento */
    --accent-primary: #00ff88;
    --accent-secondary: #0ea5e9;
    --accent-tertiary: #8b5cf6;
    
    /* Texto */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Bordes y líneas */
    --border-color: #1e293b;
    --border-glow: rgba(0, 255, 136, 0.3);
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --gradient-glow: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(14, 165, 233, 0.1));
    
    /* Sombras */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 255, 136, 0.3);
}

/* ========================================
   Reset y Base
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

::selection {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

/* ========================================
   Canvas de Partículas
   ======================================== */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========================================
   Contenedor
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   Header
   ======================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: visible;
}

header.scrolled {
    background: rgba(10, 14, 39, 0.95);
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-terminal {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.prompt {
    color: var(--accent-primary);
    font-weight: bold;
    font-size: 1.1rem;
}

.cursor-blink {
    color: var(--accent-primary);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.text-accent {
    color: var(--accent-primary);
}

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    position: relative;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-number {
    color: var(--accent-primary);
    font-weight: bold;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 2px solid var(--accent-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    position: relative;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(0, 255, 136, 0.1);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--accent-primary);
    margin: 4px auto;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========================================
   Main Content
   ======================================== */
main {
    padding-top: 80px;
    position: relative;
    z-index: 1;
}

section {
    padding: 100px 0;
    position: relative;
}

.section-header {
    margin-bottom: 4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-number {
    color: var(--accent-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.section-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ========================================
   Hero Section
   ======================================== */
#inicio {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    position: relative;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.terminal-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
}

.terminal-prompt {
    color: var(--accent-secondary);
}

.typing-text {
    color: var(--accent-primary);
}

.greeting {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.hero-text h1 {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.cursor {
    color: var(--accent-primary);
    animation: blink 1s infinite;
}

.hero-text h2 {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 400;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.3rem;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

/* Hero Image */
.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-frame {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.code-decoration {
    position: absolute;
    font-size: 8rem;
    color: var(--accent-primary);
    opacity: 0.1;
    z-index: 0;
}

.code-decoration.top-left {
    top: -40px;
    left: -40px;
}

.code-decoration.bottom-right {
    bottom: -40px;
    right: -40px;
}

.profile-img {
    width: 100%;
    border-radius: 8px;
    border: 2px solid var(--accent-primary);
    filter: grayscale(50%);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.profile-img:hover {
    filter: grayscale(0%);
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.image-border {
    position: absolute;
    top: 20px;
    left: 20px;
    right: -20px;
    bottom: -20px;
    border: 2px solid var(--accent-secondary);
    border-radius: 8px;
    z-index: 0;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.8rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.btn-secondary:hover {
    background: rgba(0, 255, 136, 0.1);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
    transform: translateX(5px);
}

/* ========================================
   Sobre Mí Section
   ======================================== */
#sobre-mi {
    background: var(--bg-secondary);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.code-block {
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.code-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot.red { background: #ff5f56; }
.code-dot.yellow { background: #ffbd2e; }
.code-dot.green { background: #27c93f; }

.code-title {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: auto;
}

.code-content {
    padding: 1.5rem;
    overflow-x: auto;
}

.code-content pre {
    margin: 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-keyword { color: #c678dd; }
.code-variable { color: #e06c75; }
.code-property { color: #61afef; }
.code-string { color: #98c379; }

.about-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.mini-card {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.mini-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.card-icon-small {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.mini-card h4 {
    color: var(--accent-primary);
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.mini-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ========================================
   Habilidades Section
   ======================================== */
#habilidades {
    background: var(--bg-primary);
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.skill-category:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--bg-primary);
}

.category-header h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-item {
    position: relative;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-name {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.skill-level {
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.skill-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 1s ease;
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   Proyectos Section
   ======================================== */
#proyectos {
    background: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.project-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.project-card.featured {
    grid-column: span 2;
}

.project-number {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent-primary);
    opacity: 0.1;
    z-index: 1;
}

.project-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: var(--bg-primary);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.project-card:hover .project-image img {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 255, 136, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.overlay-content {
    display: flex;
    gap: 1rem;
}

.overlay-btn {
    width: 50px;
    height: 50px;
    background: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    transition: all 0.3s ease;
}

.overlay-btn:hover {
    transform: scale(1.1) rotate(5deg);
}

.overlay-btn svg {
    width: 20px;
    height: 20px;
}

.project-content {
    padding: 2rem;
}

.project-type {
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-card h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.project-description {
    margin-bottom: 1.5rem;
}

.project-description p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tech span {
    padding: 0.4rem 0.8rem;
    background: var(--bg-primary);
    color: var(--accent-primary);
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.project-tech span:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 255, 136, 0.1);
}

/* ========================================
   Experiencia Section
   ======================================== */
#experiencia {
    background: var(--bg-primary);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 2rem;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 0;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 3px var(--border-color);
}

.timeline-content {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-content {
    border-color: var(--accent-primary);
    transform: translateX(10px);
    box-shadow: var(--shadow-md);
}

.timeline-date {
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.timeline-content h4 {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

.timeline-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-tags span {
    padding: 0.3rem 0.8rem;
    background: var(--bg-primary);
    color: var(--accent-primary);
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

/* ========================================
   Contacto Section
   ======================================== */
#contacto {
    background: var(--bg-secondary);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: start;
}

.terminal-contact {
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: auto;
}

.terminal-body {
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.terminal-line {
    margin-bottom: 0.5rem;
}

.terminal-command {
    color: var(--text-secondary);
}

.contact-item-terminal {
    margin: 0.8rem 0;
    padding-left: 1.5rem;
}

.terminal-key {
    color: var(--accent-secondary);
}

.terminal-value {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a.terminal-value:hover {
    color: var(--accent-primary);
}

.cursor-blink-terminal {
    color: var(--accent-primary);
    animation: blink 1s infinite;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    border-color: var(--accent-primary);
    transform: translateX(10px);
    box-shadow: var(--shadow-md);
}

.social-link svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent-primary);
}

.social-link span {
    font-size: 1rem;
}

.contact-form-side {
    background: var(--bg-tertiary);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.form-header {
    margin-bottom: 2rem;
}

.form-header h3 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--accent-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.9rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* ========================================
   Footer
   ======================================== */
footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-quote {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

.footer-right p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.heart {
    color: #ff5f56;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.1); }
    20%, 40% { transform: scale(1); }
}

.coffee {
    color: var(--accent-secondary);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-stats {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .image-frame {
        max-width: 350px;
        margin: 0 auto;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .project-card.featured {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    nav {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 1.5rem;
        border-bottom: 1px solid var(--border-color);
        gap: 0;
        z-index: 998;
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    }
    
    nav.active {
        display: flex;
        z-index: 999;
    }
    
    .nav-link {
        width: 100%;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-text h2 {
        font-size: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .skills-container {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .about-cards {
        grid-template-columns: 1fr;
    }
    
    .timeline {
        padding-left: 1.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    section {
        padding: 60px 0;
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .section-number {
        font-size: 1.2rem;
    }
}
/* ========================================
   Sección Estudios
   ======================================== */
#estudios {
    padding: 6rem 0;
    position: relative;
    z-index: 1;
}

/* Filtros */
.edu-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    justify-content: center;
}

.edu-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edu-filter-btn:hover,
.edu-filter-btn.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 255, 136, 0.08);
}

.edu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--bg-primary);
}

.edu-badge.basica  { background: #64748b; }
.edu-badge.media   { background: #0ea5e9; }
.edu-badge.tecnica { background: #f59e0b; }
.edu-badge.tecnologo { background: #00ff88; }
.edu-badge.curso   { background: #a855f7; }

/* Grid de cards */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
}

/* Card */
.edu-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.edu-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.edu-card[data-level="basica"]::before   { background: #64748b; }
.edu-card[data-level="media"]::before    { background: var(--accent-secondary); }
.edu-card[data-level="tecnica"]::before  { background: #f59e0b; }
.edu-card[data-level="tecnologo"]::before { background: var(--accent-primary); }
.edu-card[data-level="curso"]::before    { background: #a855f7; }

.edu-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-md);
}

/* Etiqueta de nivel */
.edu-level-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    width: fit-content;
}

.edu-level-tag.basica   { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid #64748b44; }
.edu-level-tag.media    { background: rgba(14,165,233,0.12);  color: #0ea5e9; border: 1px solid #0ea5e944; }
.edu-level-tag.tecnica  { background: rgba(245,158,11,0.12);  color: #f59e0b; border: 1px solid #f59e0b44; }
.edu-level-tag.tecnologo{ background: rgba(0,255,136,0.10);   color: #00ff88; border: 1px solid #00ff8844; }
.edu-level-tag.curso    { background: rgba(168,85,247,0.12);  color: #a855f7; border: 1px solid #a855f744; }

/* Header card */
.edu-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.edu-institute-logo {
    width: 56px;
    height: 56px;
    border-radius: 0.6rem;
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edu-institute-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.edu-logo-fallback {
    font-size: 1.6rem;
    align-items: center;
    justify-content: center;
}

.edu-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.edu-title {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.edu-year {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Descripción */
.edu-description {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.65;
    flex-grow: 1;
}

/* Certificado */
.edu-certificate {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

.certificate-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.certificate-img-wrapper {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
}

.certificate-img-wrapper .cert-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.certificate-img-wrapper:hover .cert-img {
    transform: scale(1.04);
}

.cert-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 39, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 0.85rem;
    color: var(--accent-primary);
}

.certificate-img-wrapper:hover .cert-overlay {
    opacity: 1;
}

/* Placeholder cuando no hay imagen */
.certificate-img-wrapper.cert-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 0.5rem;
}
.certificate-img-wrapper.cert-placeholder::after {
    content: '📄 Próximamente';
}

/* Modal certificado */
.cert-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(6px);
}

.cert-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.cert-modal-box {
    position: relative;
    max-width: 90vw;
    max-height: 88vh;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.cert-modal-box img {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    background: var(--bg-secondary);
}

.cert-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
    z-index: 10;
}

.cert-modal-close:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Ocultar cards filtradas */
.edu-card.edu-hidden {
    display: none;
}

/* Contador en filtros */
.edu-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    margin-left: 2px;
    transition: background 0.3s, color 0.3s;
}

.edu-filter-btn.active .edu-count,
.edu-filter-btn:hover .edu-count {
    background: rgba(0,255,136,0.15);
    color: var(--accent-primary);
}

/* Logo fallback visible por defecto */
.edu-logo-fallback {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Animación entrada card */
.edu-card-show {
    animation: fadeInUp 0.35s ease forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 640px) {
    .edu-grid {
        grid-template-columns: 1fr;
    }
    .edu-filters {
        justify-content: flex-start;
    }
}