:root {
    --bg-main: #0d0d0d;
    --bg-secondary: #141414;
    --bg-card: rgba(25, 25, 25, 0.7);
    --text-white: #ffffff;
    --text-grey: #a0a0a0;
    --text-dark: #111111;
    --yellow-main: #FFC900;
    --yellow-dark: #B38D00;
    --yellow-glow: rgba(255, 201, 0, 0.15);
    --yellow-glass: rgba(255, 201, 0, 0.05);
    --border-glass: rgba(255, 255, 255, 0.08);
    --font-display: 'Syne', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--bg-main);
    color: var(--text-white);
    font-family: var(--font-body);
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 0%, #1a1a1a 0%, var(--bg-main) 70%);
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 2rem; }
section { padding: 100px 0; position: relative; }

/* NAVBAR */
header { 
    position: fixed; top: 0; left: 0; width: 100%; 
    z-index: 1000; padding: 1.2rem 0; 
    background: rgba(13, 13, 13, 0.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass); transition: var(--transition);
}
.nav-container { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.logo { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--text-white); position: relative; z-index: 1002;}
.logo span { color: var(--yellow-main); }
.nav-links { display: flex; gap: 2.5rem; align-items: center; }
.nav-links a { font-size: 0.9rem; color: var(--text-grey); font-weight: 500; position: relative; padding-bottom: 0.5rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text-white); }
.nav-links a.active::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--yellow-main); }
.nav-links a.active::before { content: ''; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--bg-main); box-shadow: 0 0 0 2px var(--yellow-main); z-index: 2; }
.btn-nav { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.2rem; border: 1px solid rgba(255, 201, 0, 0.3); border-radius: 8px; font-size: 0.9rem; color: var(--text-white); background: rgba(255, 255, 255, 0.02); cursor: pointer; white-space: nowrap; }
.btn-nav i { color: var(--yellow-main); }
.btn-nav:hover { background: var(--yellow-glass); border-color: var(--yellow-main); }
.menu-btn { display: none; font-size: 1.5rem; color: var(--text-white); background: none; border: none; cursor: pointer; position: relative; z-index: 1002;}

/* HERO */
#inicio { min-height: 100vh; display: flex; align-items: center; padding-top: 120px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 4rem; align-items: center; }
.status-badge { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 201, 0, 0.2); padding: 0.4rem 1rem; border-radius: 30px; font-size: 0.8rem; color: var(--text-grey); margin-bottom: 2rem; }
.status-badge .dot { width: 8px; height: 8px; background-color: var(--yellow-main); border-radius: 50%; box-shadow: 0 0 10px var(--yellow-main); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 201, 0, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(255, 201, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 201, 0, 0); } }
.hero-content h1 { font-family: var(--font-display); font-size: clamp(3rem, 5vw, 4.5rem); line-height: 1.1; font-weight: 700; margin-bottom: 1.5rem; letter-spacing: -1px; }
.hero-content h1 span { color: var(--yellow-main); }
.hero-content p.desc { color: var(--text-grey); font-size: 1.05rem; line-height: 1.6; max-width: 90%; margin-bottom: 2.5rem; }
.features-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 3rem; }
.feature-item { display: flex; align-items: flex-start; gap: 0.5rem; }
.feature-item i { color: var(--text-white); font-size: 1rem; margin-top: 0.2rem; }
.feature-text h4 { color: var(--yellow-main); font-size: 0.85rem; font-weight: 600; }
.feature-text p { color: var(--text-grey); font-size: 0.75rem; }
.hero-btns { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 3rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1.8rem; border-radius: 30px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: var(--transition); border: none;}
.btn-primary { background-color: var(--yellow-main); color: var(--text-dark); border: 1px solid var(--yellow-main); }
.btn-primary:hover { box-shadow: 0 0 20px rgba(255, 201, 0, 0.4); transform: translateY(-2px); }
.btn-outline { background-color: transparent; color: var(--text-white); border: 1px solid var(--border-glass); }
.btn-outline:hover { border-color: var(--yellow-main); color: var(--yellow-main); }
.hero-social { display: flex; align-items: center; gap: 1.5rem; }
.hero-social span { color: var(--text-grey); font-size: 0.85rem; }
.hero-social .links { display: flex; gap: 1rem; }
.hero-social a { color: var(--yellow-main); font-size: 1.1rem; }
.hero-social a:hover { text-shadow: 0 0 10px var(--yellow-main); transform: scale(1.1); }

/* TARJETA 3D INICIO */
.hero-visuals { position: relative; display: flex; justify-content: center; align-items: center; }
.visual-glow { position: absolute; width: 80%; height: 80%; background: radial-gradient(circle, var(--yellow-glow) 0%, transparent 70%); filter: blur(40px); z-index: 0; }
.code-card { background: linear-gradient(145deg, rgba(30,30,30,0.9), rgba(15,15,15,0.95)); border: 1px solid rgba(255, 201, 0, 0.15); border-radius: 20px; width: 100%; max-width: 500px; padding: 1.5rem; position: relative; z-index: 1; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); transform-style: preserve-3d; transform: perspective(1000px); will-change: transform; transition: transform 0.1s linear; }
.card-top { display: flex; justify-content: space-between; color: #444; font-family: monospace; font-size: 1.2rem; font-weight: bold; margin-bottom: 2rem; transform: translateZ(20px); }
.card-center { display: flex; justify-content: center; align-items: center; padding: 2rem 0 4rem 0; }
.card-center h2 { font-family: var(--font-display); font-size: 6rem; color: var(--yellow-main); font-weight: 800; letter-spacing: -5px; text-shadow: 0 0 30px rgba(255, 201, 0, 0.2); transform: translateZ(60px); }
.card-stats { background: rgba(10, 10, 10, 0.6); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px; display: flex; justify-content: space-between; padding: 1.5rem; backdrop-filter: blur(5px); transform: translateZ(30px); }
.stat-item { text-align: center; flex: 1; }
.stat-item:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.05); }
.stat-item h3 { color: var(--yellow-main); font-size: 1.2rem; margin-bottom: 0.3rem; }
.stat-item p { color: var(--text-grey); font-size: 0.75rem; }
.floating-badge { position: absolute; bottom: -20px; right: 10%; background: rgba(20, 20, 20, 0.9); border: 1px solid rgba(255, 201, 0, 0.2); padding: 0.8rem 1.5rem; border-radius: 30px; display: flex; align-items: center; gap: 0.8rem; z-index: 2; box-shadow: 0 10px 20px rgba(0,0,0,0.5); transform: translateZ(50px); }
.floating-badge i { color: var(--yellow-main); }
.floating-badge p { color: var(--text-white); font-size: 0.8rem; line-height: 1.3; }

/* TITULOS */
.sec-header { text-align: center; margin-bottom: 4rem; }
.sec-subtitle { color: var(--yellow-main); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; display: flex; align-items: center; justify-content: center; gap: 1rem; }
.sec-subtitle::before, .sec-subtitle::after { content: ''; width: 40px; height: 1px; background: var(--yellow-dark); }
.sec-title { font-family: var(--font-display); font-size: 2.5rem; color: var(--text-white); }

/* TECNOLOGÍAS */
#tecnologias { background: var(--bg-secondary); border-top: 1px solid var(--border-glass); border-bottom: 1px solid var(--border-glass); }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 2rem; max-width: 900px; margin: 0 auto; }
.tech-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border-glass); padding: 2rem 1rem; border-radius: 12px; text-align: center; transition: var(--transition); cursor: default; }
.tech-card i { font-size: 2.5rem; color: var(--text-grey); margin-bottom: 1rem; transition: var(--transition); }
.tech-card p { font-size: 0.9rem; color: var(--text-white); font-weight: 500; }
.tech-card:hover { border-color: var(--yellow-main); background: var(--yellow-glass); transform: translateY(-5px); }
.tech-card:hover i { color: var(--yellow-main); }

/* SOBRE MÍ */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.about-text p { color: var(--text-grey); font-size: 1.05rem; margin-bottom: 1.5rem; line-height: 1.7; }
.about-text strong { color: var(--text-white); font-weight: 500; }

/* LAPTOP 3D */
.laptop-wrapper { position: relative; width: 100%; height: 350px; display: flex; justify-content: center; align-items: center; perspective: 1200px; z-index: 1; }
.laptop-glow { position: absolute; width: 90%; height: 90%; background: radial-gradient(circle, var(--yellow-glow) 0%, transparent 60%); filter: blur(40px); z-index: -1; }
.laptop-3d { position: relative; transform-style: preserve-3d; transform: rotateX(15deg) rotateY(-15deg); will-change: transform; transition: transform 0.1s linear; }
.laptop-screen { width: 320px; height: 200px; background: #0a0a0a; border: 6px solid #2a2a2a; border-bottom: 12px solid #1a1a1a; border-radius: 12px 12px 0 0; position: relative; transform-origin: bottom center; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 20px rgba(255, 201, 0, 0.05), 0 -5px 20px rgba(0,0,0,0.5); z-index: 2; }
.laptop-screen::after { content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); width: 40px; height: 4px; background: #111; border-radius: 4px; }
.screen-content { font-family: monospace; font-size: 0.85rem; color: #ccc; width: 100%; padding: 1.5rem; line-height: 1.6; }
.screen-content .keyword { color: var(--yellow-main); }
.screen-content .string { color: #8bc34a; }
.screen-content .variable { color: #64b5f6; }
.screen-content .method { color: #ffca28; }
.cursor-blink { animation: blink 1s step-end infinite; color: var(--text-white); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.laptop-base { width: 360px; height: 220px; background: linear-gradient(to bottom, #2a2a2a, #1a1a1a); border-radius: 4px 4px 12px 12px; position: absolute; bottom: -220px; left: -20px; transform-origin: top center; transform: rotateX(75deg); display: flex; flex-direction: column; align-items: center; box-shadow: 0 30px 50px rgba(0,0,0,0.9), inset 0 2px 0 rgba(255,255,255,0.1); z-index: 1; }
.laptop-keyboard { width: 300px; height: 100px; background: #111; margin-top: 20px; border-radius: 4px; box-shadow: inset 0 0 8px #000; background-image: radial-gradient(#222 15%, transparent 16%); background-size: 10px 10px; }
.laptop-trackpad { width: 80px; height: 55px; background: #1a1a1a; margin-top: 15px; border-radius: 6px; box-shadow: inset 0 0 5px #000, 0 1px 0 rgba(255,255,255,0.05); }

/* PROYECTOS */
.filter-container { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.filter-btn { background: none; border: 1px solid var(--border-glass); padding: 0.6rem 1.5rem; border-radius: 30px; color: var(--text-grey); cursor: pointer; transition: var(--transition); font-family: var(--font-body); }
.filter-btn.active, .filter-btn:hover { border-color: var(--yellow-main); color: var(--yellow-main); background: var(--yellow-glass); }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.project-card { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: 16px; overflow: hidden; transition: var(--transition); cursor: pointer; display: flex; flex-direction: column;}
.project-card:hover { border-color: var(--yellow-main); transform: translateY(-8px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.project-img { height: 200px; background: rgba(255,255,255,0.02); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border-glass); }
.project-img i { font-size: 3rem; color: #333; transition: var(--transition); }
.project-card:hover .project-img i { color: var(--yellow-main); transform: scale(1.1); }
.project-info { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column;}
.project-info h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.5rem; }
.project-info p { color: var(--text-grey); font-size: 0.9rem; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: auto;}
.tags span { font-size: 0.75rem; padding: 0.2rem 0.6rem; background: rgba(255,255,255,0.05); border-radius: 4px; color: var(--text-grey); }

/* MODAL */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); backdrop-filter: blur(10px); z-index: 2000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: var(--transition); }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content { background: var(--bg-secondary); border: 1px solid var(--yellow-main); border-radius: 16px; width: 90%; max-width: 800px; padding: 2.5rem; position: relative; transform: translateY(20px); transition: var(--transition); max-height: 90vh; overflow-y: auto;}
.modal-overlay.active .modal-content { transform: translateY(0); }
.close-btn { position: absolute; top: 1.5rem; right: 1.5rem; background: none; border: none; font-size: 1.5rem; color: var(--text-grey); cursor: pointer; transition: var(--transition); }
.close-btn:hover { color: var(--yellow-main); transform: rotate(90deg); }
.modal-img-placeholder { height: 250px; background: rgba(255,255,255,0.02); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem; border: 1px solid var(--border-glass); }
.modal-body h2 { font-family: var(--font-display); font-size: 2rem; margin-bottom: 1rem; color: var(--text-white); }
.modal-body p { color: var(--text-grey); margin-bottom: 1.5rem; line-height: 1.6; }
.modal-links { display: flex; gap: 1rem; margin-top: 2rem; }

/* CONTACTO */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.contact-text h3 { font-family: var(--font-display); font-size: 2rem; margin-bottom: 1rem; }
.contact-text p { color: var(--text-grey); margin-bottom: 2rem; }
.form-group { margin-bottom: 1.5rem; position: relative; }
.form-group input, .form-group textarea { width: 100%; padding: 1rem; background: rgba(255,255,255,0.02); border: 1px solid var(--border-glass); border-radius: 8px; color: var(--text-white); font-family: var(--font-body); outline: none; transition: var(--transition); }
.form-group input:focus, .form-group textarea:focus { border-color: var(--yellow-main); background: rgba(255,201,0,0.02); }

/* FOOTER */
footer { border-top: 1px solid var(--border-glass); padding: 2rem 0; text-align: center; color: var(--text-grey); font-size: 0.9rem; }
footer span { color: var(--yellow-main); }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; text-align: center; gap: 3rem; }
    .hero-content p.desc { margin: 0 auto 2.5rem; }
    .features-row { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    .feature-item { justify-content: center; text-align: left; }
    .hero-btns, .hero-social, .modal-links { justify-content: center; }
    
    .hero-visuals { margin-top: 2rem; }
    .floating-badge { right: auto; left: 50%; transform: translateX(-50%) translateZ(50px); bottom: -40px; width: 90%; justify-content: center; text-align: left;}
    
    /* Menú móvil */
    .nav-links { position: fixed; top: 0; right: -100%; height: 100vh; width: 250px; background: var(--bg-secondary); border-left: 1px solid var(--border-glass); flex-direction: column; justify-content: center; transition: var(--transition); z-index: 1001; }
    .nav-links.active { right: 0; }
    .menu-btn { display: block; z-index: 1003; }
    .btn-nav { display: none; }
    
    .laptop-wrapper { transform: scale(0.9); }
}

@media (max-width: 768px) {
    .code-card { transform: perspective(1000px) rotateX(0deg) rotateY(0deg) !important; transition: none; }
    .laptop-3d { transform: rotateX(15deg) rotateY(-15deg) !important; transition: none; }
}

@media (max-width: 600px) {
    section { padding: 80px 0; }
    .features-row { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 2.5rem; }
    
    .hero-visuals { transform: scale(0.85); }
    .card-center h2 { font-size: 4rem; }
    .card-stats { flex-direction: column; gap: 1rem; }
    .stat-item:not(:last-child) { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 1rem; }
    
    .laptop-wrapper { transform: scale(0.7); height: 250px; }
    
    .tech-grid { grid-template-columns: repeat(2, 1fr); }
    
    .modal-content { padding: 1.5rem; }
    .modal-img-placeholder { height: 180px; }
    .modal-body h2 { font-size: 1.5rem; }
}

@media (max-width: 400px) {
    .hero-visuals { transform: scale(0.7); }
    .laptop-wrapper { transform: scale(0.55); height: 200px; }
    .tech-grid { grid-template-columns: 1fr; }
}