/* --- VARIABLES --- */
:root {
    --bg-body: #050505;
    --text-main: #ffffff;
    --text-muted: #888888;
    --accent: #ff7800;
    --card-bg: #111111;
    --border-color: #222222;
    --card-overlay: linear-gradient(to top, rgba(0,0,0,0.95) 20%, rgba(0,0,0,0.5) 80%, transparent); 
    --font-main: 'Open Sans', sans-serif;
    --font-code: 'Fira Code', monospace;
    --lightbox-bg: rgba(0, 0, 0, 0.95);
    --input-bg: #1a1a1a;
}

body.light-theme {
    --bg-body: #ffffff;
    --text-main: #050505;
    --text-muted: #555555;
    --card-bg: #f5f5f5;
    --border-color: #e0e0e0;
    --card-overlay: rgba(255, 255, 255, 0.95); 
    --lightbox-bg: rgba(255, 255, 255, 0.98);
    --input-bg: #f0f0f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-body); 
    color: var(--text-main); 
    font-family: var(--font-main);
    transition: background-color 0.3s, color 0.3s; 
    overflow-x: hidden;
}

/* --- UTILIDADES --- */
.text-orange { color: var(--accent); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.highlight { 
    color: var(--text-main); 
    font-weight: 700; 
    font-style: italic; 
    border-bottom: 2px solid var(--accent); 
    padding-bottom: 1px;
}
.mono-label { 
    font-family: var(--font-code); 
    font-size: 0.7rem; 
    letter-spacing: 1px; 
    text-transform: uppercase; 
    font-weight: 700;
}

/* --- TITULOS UNIFORMES --- */
.section-title-uniform {
    font-family: var(--font-code);
    font-size: clamp(1.2rem, 2vw, 1.8rem); 
    color: var(--text-main);
    margin-bottom: 2rem;
    letter-spacing: 0px; 
    position: relative;
    display: inline-block;
    font-weight: 700;
    text-transform: uppercase;
}

/* --- WIDGETS DECORATIVOS (RADARES) --- */
.tech-widget-top, .tech-widget-bottom-left {
    position: fixed;
    width: 600px;
    height: 600px;
    z-index: 0; 
    pointer-events: none;
    opacity: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.tech-widget-top { top: -150px; right: -150px; }
.tech-widget-bottom-left { bottom: -150px; left: -150px; }

.tech-inner-svg { width: 100%; height: 100%; overflow: visible; }

/* Anillos MODO OSCURO */
.dotted-ring {
    fill: none;
    stroke: #333333; 
    stroke-width: 2px;
    stroke-linecap: round;
    transition: stroke 0.3s ease;
}
.ring-1 { stroke: #444; opacity: 0.6; stroke-dasharray: 0 20; animation: crawlPos 120s linear infinite; }
.ring-2 { stroke: #3a3a3a; opacity: 0.5; stroke-dasharray: 0 30; animation: crawlNeg 90s linear infinite; stroke-width: 4px; }
.ring-3 { stroke: #333; opacity: 0.4; stroke-dasharray: 0 40; animation: crawlPos 60s linear infinite; stroke-width: 5px; }
.ring-4 { 
    stroke: var(--accent); 
    opacity: 0.25; 
    stroke-dasharray: 0 50; 
    stroke-width: 6px;
    animation: crawlNeg 40s linear infinite; 
}

/* Anillos MODO CLARO */
body.light-theme .dotted-ring { stroke: #bbbbbb; }
body.light-theme .ring-1 { stroke: #999999; opacity: 0.7; }
body.light-theme .ring-2 { stroke: #aaaaaa; opacity: 0.6; }
body.light-theme .ring-3 { stroke: #cccccc; opacity: 0.5; }
body.light-theme .ring-4 { stroke: #dddddd; opacity: 0.8; }

.core-dot { fill: var(--accent); opacity: 0.8; }

@keyframes crawlPos { to { stroke-dashoffset: -1000; } }
@keyframes crawlNeg { to { stroke-dashoffset: 1000; } }

/* --- NAVBAR --- */
.navbar {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 1.2rem 5%; 
    position: fixed; 
    width: 100%; 
    top: 0; 
    z-index: 1000;
    background-color: var(--bg-body); 
    border-bottom: 1px solid transparent; 
    transition: 0.3s;
}
.navbar.scrolled { border-bottom-color: var(--border-color); }

/* --- LOGO (IMAGEN) --- */
.logo { 
    display: flex;
    align-items: center;
    text-decoration: none;
}

#nav-logo {
    height: 40px; /* Tamaño para escritorio */
    width: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.nav-links { display: flex; gap: 2rem; }
.nav-links a { 
    text-decoration: none; 
    color: var(--text-muted); 
    font-size: 0.9rem; 
    font-weight: 600; 
    transition: 0.3s; 
}
.nav-links a:hover, .nav-links a.active { color: var(--text-main); }

.nav-actions { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
    position: relative; 
    z-index: 1002; 
}

.icon-btn {
    background: none; 
    border: 1px solid var(--border-color); 
    color: var(--text-main);
    width: 38px; 
    height: 38px; 
    border-radius: 50%; 
    cursor: pointer; 
    transition: 0.3s;
    display: flex; 
    align-items: center; 
    justify-content: center;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.font-btn { 
    font-family: var(--font-code); 
    font-weight: 700; 
    font-size: 0.8rem; 
}

.mobile-trigger { display: none !important; margin-right: 1rem; }

/* --- HERO LAYOUT --- */
.hero { 
    padding-top: 100px; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    position: relative; 
    z-index: 1; 
}
.container { 
    width: 90%; 
    max-width: 1400px; 
    margin: 0 auto; 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
    justify-content: center; 
}

.main-hero-block {
    display: flex; 
    justify-content: center; 
    align-items: center;
    gap: 30px; 
    margin-bottom: 2rem; 
    flex-wrap: wrap;
}
.title-box-wrapper { position: relative; padding: 12px 30px; }
.boxed-title {
    font-family: var(--font-code); 
    font-size: clamp(1.8rem, 4vw, 4rem);
    font-weight: 900; 
    line-height: 1; 
    text-transform: uppercase; 
    text-align: center;
    color: var(--text-main); 
    margin: 0; 
    letter-spacing: -1px; 
    position: relative; 
    z-index: 2;
}
.border-svg { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    pointer-events: none; 
    z-index: 1; 
}
.border-svg rect {
    width: 99%; 
    height: 98%; 
    x: 0.5%; 
    y: 1%; 
    fill: none; 
    stroke: var(--accent); 
    stroke-width: 2px;
    stroke-dasharray: 100 200; 
    stroke-dashoffset: 1000; 
    animation: borderRun 8s linear infinite; 
    opacity: 0.8;
}
@keyframes borderRun { to { stroke-dashoffset: 0; } }

.cta-wrapper { display: flex; align-items: center; gap: 15px; }
.project-pill {
    background: var(--text-main); 
    color: var(--bg-body); 
    text-decoration: none;
    padding: 10px 28px; 
    border-radius: 50px; 
    font-weight: 700; 
    font-size: 0.9rem; 
    transition: transform 0.3s;
}
.arrow-circle-btn {
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    border: 1px solid var(--text-main);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: var(--text-main); 
    transition: 0.3s; 
    text-decoration: none !important;
}
.cta-wrapper:hover .project-pill { transform: scale(1.05); }
.cta-wrapper:hover .arrow-circle-btn { 
    background: var(--accent); 
    border-color: var(--accent); 
    color: white; 
    transform: rotate(-45deg); 
}

.hero-center-content { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
    margin-bottom: 3rem; 
}
.hero-description { 
    max-width: 650px; 
    font-size: 1rem; 
    color: var(--text-muted); 
    margin-bottom: 1.5rem; 
    line-height: 1.6; 
}
.social-group { 
    display: flex; 
    gap: 1rem; 
    flex-wrap: wrap; 
    justify-content: center; 
}
.social-pill {
    text-decoration: none; 
    color: var(--text-muted); 
    border: 1px solid var(--border-color);
    padding: 8px 20px; 
    border-radius: 50px; 
    font-size: 0.9rem; 
    font-weight: 600;
    display: flex; 
    align-items: center; 
    gap: 8px; 
    transition: 0.3s;
    background: transparent; 
    cursor: pointer;
}
.social-pill:hover { 
    border-color: var(--accent); 
    color: var(--text-main); 
    transform: translateY(-3px); 
}

/* CARRUSEL */
.carousel-wrapper {
    position: relative; 
    width: 100%; 
    max-width: 1200px; 
    margin: 0 auto;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 1rem;
    padding-bottom: 2rem; 
    flex-grow: 1; 
    min-height: 0;
}
.cards-showcase { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 1.5rem; 
    width: 100%; 
    position: relative; 
    height: 320px; 
}
.glass-card {
    background: var(--card-bg); 
    border: 1px solid var(--border-color); 
    border-radius: 20px;
    overflow: hidden; 
    position: relative; 
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
}
.card-left, .card-right { 
    width: 220px; 
    height: 260px; 
    opacity: 0.4; 
    filter: blur(2px); 
    position: absolute; 
    z-index: 1; 
}
.card-left { left: 0; transform: scale(0.9); }
.card-right { right: 0; transform: scale(0.9); }
.card-center {
    width: 100%; 
    max-width: 480px; 
    height: 300px; 
    z-index: 10; 
    opacity: 1; 
    filter: blur(0);
    box-shadow: 0 15px 50px rgba(0,0,0,0.25); 
    border-color: var(--border-color);
    transform: scale(1); 
    position: relative;
}
.card-bg { position: absolute; width: 100%; height: 100%; top: 0; left: 0; }
.card-bg img { width: 100%; height: 100%; object-fit: cover; }
.card-content {
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    padding: 1.5rem;
    background: var(--card-overlay); 
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255,255,255,0.05); 
    height: auto;
}
.card-content h3 { 
    font-family: var(--font-main); 
    font-weight: 700; 
    font-size: 1.2rem; 
    margin: 0.3rem 0; 
    color: var(--text-main); 
}
.card-content p { 
    color: var(--text-main); 
    font-size: 0.85rem; 
    opacity: 0.9; 
    margin-bottom: 0.5rem; 
    line-height: 1.3; 
}
.carousel-nav-btn {
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    background: var(--bg-body);
    border: 1px solid var(--border-color); 
    color: var(--text-main); 
    cursor: pointer; 
    transition: 0.3s;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 20;
}
.carousel-nav-btn:hover { 
    border-color: var(--accent); 
    color: var(--accent); 
    transform: scale(1.1); 
}

/* ABOUT SECTION */
.about-section {
    padding: 80px 0;
    position: relative;
    z-index: 2;
}
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    margin-bottom: 6rem;
    align-items: start;
}
.about-intro {
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 3rem;
    max-width: 600px;
}
.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: 0.3s;
}
.skill-card:hover {
    border-color: var(--accent);
    transform: translateX(10px);
}
.skill-title {
    font-family: var(--font-main);
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--text-main);
}
.skill-tags span::after {
    content: " /";
    color: var(--accent);
    margin-left: 5px;
}
.skill-tags span:last-child::after { content: ""; }

.photo-column {
    display: flex;
    justify-content: center;
    position: relative;
}
.photo-frame {
    width: 350px;
    height: 450px;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}
.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: 0.5s ease;
}
.photo-frame:hover .profile-photo {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* WORK SECTION */
.work-section { margin-top: 4rem; }
.work-list { border-top: 1px solid var(--border-color); }
.work-item {
    display: grid;
    grid-template-columns: 1fr 1.5fr 2fr;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: 0.3s;
    cursor: default;
}
.work-item:hover {
    background: rgba(255, 255, 255, 0.03);
    padding-left: 20px;
}
.highlight-item { background: rgba(255, 120, 0, 0.05); }
.work-date {
    font-family: var(--font-code);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.work-company { font-weight: 700; font-size: 1.1rem; }
.work-role {
    text-align: right;
    font-family: var(--font-code);
    font-size: 0.95rem;
}

/* PROJECTS SECTION */
.projects-section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
    z-index: 1; 
}

.project-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    margin-bottom: 10rem;
    position: relative;
}
.project-item:nth-child(even) { direction: rtl; }
.project-item:nth-child(even) > * { direction: ltr; }

.project-name {
    font-size: 1.4rem; 
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-main);
    font-family: var(--font-main);
}
.tech-badges { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2rem; }
.tech-badge {
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--font-code);
    transition: 0.3s;
}
.tech-badge:hover { border-color: var(--accent); color: var(--accent); }

.project-description { font-size: 1rem; line-height: 1.8; color: var(--text-muted); margin-bottom: 1.5rem; }
.project-features { list-style: none; margin-bottom: 2rem; }
.project-features li {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}
.project-features li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 1.2rem;
}

/* GITHUB BUTTON PILL */
.github-btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 5px 5px 5px 20px; 
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: transparent;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.gh-icon {
    font-size: 1.6rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.gh-arrow {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--text-main);
    color: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.github-btn-pill:hover { border-color: var(--accent); }
.github-btn-pill:hover .gh-arrow {
    background: var(--accent);
    color: white;
    transform: rotate(-45deg);
}

/* PROJECT IMAGES */
.project-images { 
    position: relative; 
    height: 500px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
}
.project-mockup {
    position: absolute;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    transition: transform 0.3s ease;
    pointer-events: none; 
}
.project-mockup img { width: 100%; height: 100%; object-fit: cover; }
.mockup-1 { width: 280px; height: 400px; z-index: 3; left: 10%; top: 50%; transform: translateY(-50%); }
.mockup-2 { width: 350px; height: 420px; z-index: 2; right: 15%; top: 45%; transform: translateY(-50%); }
.mockup-3 { width: 200px; height: 300px; z-index: 1; right: 5%; bottom: 10%; }

.project-images:hover .mockup-1 { transform: translateY(-50%) scale(1.05); z-index: 10; }
.project-images:hover .mockup-2 { transform: translateY(-50%) translateX(20px) scale(0.95); }
.project-images:hover .mockup-3 { transform: scale(0.95); }

.hidden-gallery-item { display: none; }

/* --- ARTICLES SECTION --- */
.articles-section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: 0.3s;
    background: var(--card-bg);
}

.article-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.article-title {
    font-family: var(--font-code);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.article-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.read-more-btn {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    width: fit-content; 
}

.read-more-btn span {
    background: var(--text-main);
    color: var(--bg-body);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 0.3s ease;
    border: 1px solid transparent;
}

.read-more-btn .arrow-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.read-more-btn:hover span { transform: scale(1.05); }
.read-more-btn:hover .arrow-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: rotate(-45deg);
}

/* --- CONTACT FOOTER REDESIGNED --- */
.contact-section-redesigned {
    background-color: transparent; 
    padding: 80px 0 0;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
    min-height: 500px;
}

.contact-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4rem;
    margin-top: 4rem;
}

/* Identidad (Izquierda) */
.contact-identity {
    flex: 1;
    min-width: 300px;
}

.big-name {
    font-family: var(--font-code);
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.role-text {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-weight: 400;
}

.contact-social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Créditos (Derecha) */
.contact-credits {
    flex: 0 0 auto;
    width: 100%;
    max-width: 400px;
}

.credits-box {
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    background: rgba(17, 17, 17, 0.7); 
    backdrop-filter: blur(5px);
}

body.light-theme .credits-box {
    background: rgba(245, 245, 245, 0.7);
}

.credits-box h4 {
    font-family: var(--font-main);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.credit-item {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.credit-item:last-child { margin-bottom: 0; }

.credit-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.credit-value, .credit-link {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
}

.credit-link {
    color: var(--accent);
    transition: 0.3s;
}
.credit-link:hover { text-decoration: underline; }

/* FOOTER SIMPLE (Barra final) */
footer { 
    padding: 2rem 0; 
    margin-top: 4rem;
    border-top: 1px solid var(--border-color); 
    text-align: center; 
    color: var(--text-muted); 
    font-size: 0.85rem; 
    background-color: var(--bg-body); 
    position: relative; 
    z-index: 11; 
}

/* --- MODALES --- */

/* LIGHTBOX */
.lightbox-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--lightbox-bg); z-index: 3000;
    display: none; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s;
}
.lightbox-modal.active { display: flex; opacity: 1; }
.close-lightbox {
    position: absolute; top: 20px; right: 30px; font-size: 3rem;
    color: var(--text-main); cursor: pointer; z-index: 3001; transition: 0.3s;
}
.close-lightbox:hover { color: var(--accent); }
.lightbox-content {
    max-width: 90%; max-height: 70vh; border-radius: 10px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5); margin-bottom: 20px; object-fit: contain;
}
.lightbox-controls { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.lb-btn {
    background: transparent; border: 1px solid var(--border-color); color: var(--text-main);
    width: 50px; height: 50px; border-radius: 50%; cursor: pointer; font-size: 1.2rem;
    transition: 0.3s; display: flex; align-items: center; justify-content: center;
}
.lb-btn:hover { border-color: var(--accent); color: var(--accent); }
.lb-counter { font-family: var(--font-code); color: var(--text-muted); font-size: 1rem; }
.lightbox-thumbnails { display: flex; gap: 10px; overflow-x: auto; padding: 10px; max-width: 90%; }
.lb-thumb {
    width: 60px; height: 60px; object-fit: cover; border-radius: 5px; cursor: pointer;
    opacity: 0.5; transition: 0.3s; border: 2px solid transparent;
}
.lb-thumb.active, .lb-thumb:hover { opacity: 1; border-color: var(--accent); }

/* CONTACT MODAL */
.contact-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 4000;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(5px); opacity: 0; transition: opacity 0.3s;
}
.contact-modal.active { display: flex; opacity: 1; }
.contact-modal-content {
    background: var(--card-bg); width: 90%; max-width: 500px;
    padding: 2.5rem; border-radius: 20px; border: 1px solid var(--border-color);
    position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.close-contact-modal {
    position: absolute; top: 15px; right: 20px; font-size: 2rem;
    cursor: pointer; color: var(--text-muted); transition: 0.3s;
}
.close-contact-modal:hover { color: var(--accent); }
.contact-modal-content h3 {
    font-family: var(--font-code); font-size: 1.5rem; margin-bottom: 2rem; color: var(--text-main);
}
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.9rem;
}
.form-group input, .form-group textarea {
    width: 100%; padding: 12px; border-radius: 8px;
    background: var(--input-bg); border: 1px solid var(--border-color);
    color: var(--text-main); font-family: var(--font-main); transition: 0.3s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--accent);
}
.icon-btn-wide { width: 100%; justify-content: center; margin-top: 1rem; cursor: pointer; border: none; font-family: inherit; font-size: 1rem;}

/* SIDENAV */
.sidenav-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.8); z-index: 2000; opacity: 0; visibility: hidden; 
    transition: 0.3s; backdrop-filter: blur(5px); 
} 
.sidenav-overlay.active { opacity: 1; visibility: visible; }
.sidenav { 
    position: fixed; top: 0; left: -300px; width: 280px; height: 100%; 
    background: var(--bg-body); padding: 2rem; border-right: 1px solid var(--border-color); 
    transition: 0.3s; z-index: 2001; display: flex; flex-direction: column; 
} 
.sidenav.active { left: 0; }
.sidenav-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3rem; } 
.sidenav-links { display: flex; flex-direction: column; gap: 1.5rem; }
.sidenav-link { text-decoration: none; color: var(--text-main); font-size: 1.2rem; font-weight: 600; font-family: var(--font-code); }

/* RESPONSIVE */
@media (max-width: 1200px) {
    .tech-widget-top { top: -100px; right: -100px; width: 500px; height: 500px; }
    .tech-widget-bottom-left { bottom: -100px; left: -100px; width: 500px; height: 500px; }
    .project-item { gap: 3rem; }
}

@media (max-width: 1024px) {
    .main-hero-block { flex-direction: column; gap: 1.5rem; }
    .boxed-title { font-size: 3rem; }
    .project-item { grid-template-columns: 1fr; gap: 3rem; }
    .project-item:nth-child(even) { direction: ltr; }
    .project-images { height: 400px; }
    .contact-layout { flex-direction: column; }
    .contact-credits { width: 100%; max-width: 100%; }
}

@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; gap: 3rem; }
    .photo-column { order: -1; margin-bottom: 2rem; }
    .photo-frame { width: 100%; max-width: 400px; height: 400px; }
    .work-item { grid-template-columns: 1fr; gap: 0.5rem; }
    .work-role { text-align: left; margin-top: 0.5rem; }
}

@media (max-width: 768px) {
    .desktop-menu { display: none; } 
    .mobile-trigger { display: flex !important; } 
    .navbar { justify-content: flex-start; } 
    .logo { margin-right: auto; margin-left: 1rem; }
    #nav-logo { height: 35px; } /* Ajuste de logo en móvil */
    .hero { padding-top: 90px; }
    .carousel-wrapper { flex-direction: column-reverse; gap: 1rem; }
    .card-left, .card-right { display: none; }
    .card-center { width: 100%; height: 320px; }
    #prevBtn, #nextBtn { position: absolute; bottom: -10px; }
    #prevBtn { left: 20px; } 
    #nextBtn { right: 20px; }
    .mockup-2, .mockup-3 { display: none; }
    .mockup-1 { position: relative; width: 100%; max-width: 300px; height: 400px; left: auto; transform: none; }
}