/* === RESET & BASE === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; min-height: 100vh; font-family: 'Courier New', Courier, monospace; background: #0a0a14; color: #000; line-height: 1.6; scroll-behavior: smooth; }

/* === CANVAS === */
#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0.08; pointer-events: none; }
#portfolio-content { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; background: #fff; box-shadow: 0 0 60px rgba(0,0,0,0.4); }

/* === HEADER === */
header { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 2.5rem; border-bottom: 1px solid #000; background: #fff; position: sticky; top: 0; z-index: 20; }
.logo { font-size: 1.1rem; font-weight: bold; color: #000; text-decoration: none; border: 2px solid #000; padding: 0.2rem 0.6rem; letter-spacing: 1px; }
.blink { animation: blink 1s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
nav ul { display: flex; gap: 1.8rem; list-style: none; }
nav a { color: #333; text-decoration: none; font-size: 0.75rem; letter-spacing: 1px; transition: color .3s; text-transform: uppercase; cursor: pointer; }
nav a:hover, nav a.active { color: #000; font-weight: bold; }

/* === HERO === */
.hero { padding: 4rem 3rem 3.5rem; background: #000; border-bottom: 1px solid #333; text-align: left; color: #fff; }
.hero h1 { font-size: 2rem; margin-bottom: 1.2rem; line-height: 1.5; color: #fff; letter-spacing: 2px; }
.hero p { font-size: 1rem; max-width: 550px; margin-bottom: 2rem; color: #ccc; line-height: 1.6; }
.hero a { display: inline-block; padding: 0.7rem 1.8rem; border: 1px solid #fff; background: transparent; color: #fff; text-decoration: none; font-size: 0.8rem; letter-spacing: 1px; transition: all .3s; text-transform: uppercase; cursor: pointer; }
.hero a:hover { background: #fff; color: #000; }

/* === CONTAINER === */
.container { display: grid; grid-template-columns: 280px 1fr; gap: 0; background: #fff; }

/* === SIDEBAR === */
aside { padding: 2rem 1.5rem; border-right: 1px solid #000; background: #fafafa; color: #000; }
.profile-card { margin-bottom: 2rem; text-align: center; padding-bottom: 1.5rem; border-bottom: 1px solid #ddd; }
.profile-img { width: 140px; height: 140px; border: 2px solid #000; object-fit: cover; margin: 0 auto 1rem; display: block; filter: grayscale(100%); }
.profile-card h3 { margin-bottom: 1.5rem; color: #000; font-size: 1.05rem; letter-spacing: 1px; }
.profile-bio p { font-size: 0.82rem; margin-bottom: 0.6rem; color: #222; line-height: 1.5; text-align: left; }
.profile-bio strong { color: #000; }
aside > h3 { font-size: 1.1rem; font-weight: bold; margin: 2rem 0 1.5rem; color: #000; letter-spacing: 0.5px; }
.skills-container { margin-bottom: 2rem; }
.skill-item { margin-bottom: 1.2rem; }
.skill-header { display: flex; justify-content: space-between; margin-bottom: 0.4rem; font-size: 0.82rem; color: #000; font-weight: bold; }
.skill-bar { height: 8px; background: #e0e0e0; border: 1px solid #ccc; overflow: hidden; }
.skill-progress { height: 100%; width: 0; background: #000; transition: width 1s ease-out; }
aside > h3.contact-title { font-size: 1rem; margin: 2rem 0 1rem; color: #000; letter-spacing: 0.5px; padding-top: 1rem; border-top: 1px solid #000; }
.contact-links { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.contact-links a { color: #000; text-decoration: none; padding: 0.6rem 1rem; border: 1px solid #000; background: #fff; transition: all .3s; font-size: 0.8rem; text-align: center; letter-spacing: 1px; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.contact-links a:hover { background: #000; color: #fff; }

/* === MAIN === */
main { padding: 0; background: #fff; color: #000; }
.section-title { font-size: 0.85rem; color: #fff; padding: 1.2rem 2rem; letter-spacing: 2px; background: #000; border-bottom: 1px solid #000; }
.post { padding: 1.5rem 2rem; border-bottom: 1px solid #000; background: #fff; color: #000; transition: background .3s ease; cursor: pointer; }
.post:hover { background: #f0f0f0; }
.post-meta { font-size: 0.72rem; color: #666; margin-bottom: 0.8rem; display: flex; gap: 0.5rem; align-items: center; letter-spacing: 1px; }
.post h2 { margin-bottom: 0.8rem; font-size: 1.5rem; color: #000; line-height: 1.3; font-weight: bold; }
.post p { color: #333; font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.6; }
.tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag { font-size: 0.68rem; padding: 0.28rem 0.7rem; border: 1px solid #000; background: #fff; color: #000; letter-spacing: 1px; }
.tag:hover { background: #000; color: #fff; }

/* === PROJECTS === */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; padding: 2rem; background: #fff; }
.project-card { border: 1px solid #000; background: #fff; padding: 1.8rem; transition: all .2s ease; position: relative; }
.project-card:hover { background: #fafafa; }
.project-locked { text-align: center; }
.cipher-text { background: #111; color: #0f0; padding: 1rem; font-family: 'Courier New', monospace; margin-bottom: 1.5rem; border-left: 4px solid #0f0; font-size: 0.9rem; letter-spacing: 2px; word-spacing: 5px; }
.access-form { display: flex; gap: 0.5rem; margin-top: 1rem; }
.access-form input { flex: 1; padding: 0.5rem; border: 1px solid #000; font-family: 'Courier New', monospace; background: #fafafa; text-transform: uppercase; font-size: 0.85rem; }
.access-form input:focus { outline: none; border-width: 2px; }
.access-form button { padding: 0.5rem 1rem; border: 1px solid #000; background: #000; color: #fff; font-family: 'Courier New', monospace; cursor: pointer; text-transform: uppercase; font-weight: bold; font-size: 0.8rem; transition: all .2s; }
.access-form button:hover { background: #fff; color: #000; }
.status-msg { font-size: 0.75rem; margin-top: 0.5rem; height: 1rem; font-weight: bold; font-family: 'Courier New', monospace; }
.status-msg.denied { color: #d00; }
.status-msg.granted { color: #0a0; }
.project-unlocked { display: none; flex-direction: column; justify-content: space-between; height: 100%; }
.project-icon { font-size: 2rem; margin-bottom: 1rem; }
.project-title { font-size: 1.1rem; font-weight: bold; margin-bottom: 0.8rem; color: #000; text-transform: uppercase; letter-spacing: 1px; }
.project-desc { font-size: 0.85rem; color: #333; margin-bottom: 1.5rem; line-height: 1.5; flex-grow: 1; }
.project-tech { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.project-tech span { font-size: 0.65rem; padding: 0.2rem 0.5rem; border: 1px solid #666; color: #666; letter-spacing: 0.5px; }
.project-links { display: flex; gap: 0.5rem; margin-top: auto; }
.project-links a { flex: 1; text-align: center; font-size: 0.75rem; padding: 0.5rem; text-decoration: none; letter-spacing: 1px; text-transform: uppercase; border: 1px solid #000; color: #000; transition: all .2s; }
.project-links a:hover { background: #000; color: #fff; }
.project-links a.primary { background: #000; color: #fff; }
.project-links a.primary:hover { background: #fff; color: #000; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* === FOOTER === */
footer { text-align: center; padding: 2rem 1rem; border-top: 1px solid #000; background: #000; color: #fff; font-size: 0.78rem; }
footer p { color: #fff; margin-bottom: 0.3rem; }
footer a { color: #ccc; text-decoration: underline; }
footer a:hover { color: #fff; }
footer .footer-sub { color: #888; font-size: 0.7rem; margin-top: 1rem; }

/* === MODAL (CON IFRAME) === */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.85); display: none; justify-content: center; align-items: center; backdrop-filter: blur(4px); }
.modal.active { display: flex; animation: fadeIn .3s ease; }
.modal-window { background: #fff; width: 92%; max-width: 1000px; height: 85vh; border: 2px solid #000; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.4); animation: slideUp .35s ease; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.modal-close { position: absolute; top: 0; right: 0; background: #000; border: none; border-bottom-left-radius: 8px; font-size: 1.5rem; cursor: pointer; color: #fff; font-weight: bold; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; transition: all .3s; z-index: 10; }
.modal-close:hover { background: #d00; color: #fff; }
.modal-content { flex: 1; overflow: hidden; background: #fff; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* === CLASES PARA ESQUIVAR CSP (SIN INLINE STYLES) === */
body.modal-open { overflow: hidden; }
.modal-iframe { width: 100%; height: 100%; border: none; display: block; }
.img-hidden { display: none !important; }
.shake-animation { animation: shake 0.4s; }
.section-hidden { display: none !important; }
.section-visible { display: block !important; }
.proyectos-hidden { display: none; }
.lock-icon { font-size: 2rem; margin-bottom: 1rem; }
.decode-hint { font-size: 0.8rem; color: #666; margin-bottom: 0.5rem; }
.footer-link { margin-top: 0.5rem; }

/* === RESPONSIVE === */
@media (max-width: 900px) { .container { grid-template-columns: 1fr; } aside { border-right: none; border-bottom: 1px solid #000; } header { flex-direction: column; gap: 1rem; padding: 0.8rem 1.5rem; } nav ul { gap: 1rem; flex-wrap: wrap; justify-content: center; } .hero { padding: 3rem 1.5rem 2.5rem; } .hero h1 { font-size: 1.6rem; } }
@media (max-width: 600px) { header { padding: 0.8rem 1rem; } .hero { padding: 2.5rem 1rem 2rem; } .hero h1 { font-size: 1.4rem; } .post { padding: 1.2rem 1rem; } .post h2 { font-size: 1.2rem; } }