:root {
    --bg: #f7f7f7;
    --card: #ffffff;
    --text: #111111;
    --muted: #666;
    --border: #e8e8ec;
    --primary: #550000;
    --primary-hover: #7c3c3c;
    --accent: #118Dff;
    --accent-quiet: #e8f1ff;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(0, 0, 0, .06);
    --hero-img: url("images/hero.jpg");
}

/* colores:
#550000
#641414
#7c3c3c
#a67c7c */

* {
    box-sizing: border-box
}

html,
body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    padding-top: 80px;
}

header#headerFix {
    width: 100%;
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(85, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

header#headerFix div.left {
    margin-left: 5%;
    font-weight: 700;
    font-size: 1.2rem;
}

header#headerFix div.right {
    margin-right: 5%;
    display: flex;
    gap: 24px;
}

header#headerFix div.right a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    transition: color 0.2s;
}

header#headerFix div.right a:hover {
    color: white;
}



/* CONTENEDOR GENERAL */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 16px 80px;
}

/* SOBRE MI */
.sobre-mi {
    margin-top: -20px;
    margin-bottom: 40px;
}

.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
}

.about-photo {
    margin: 0;
    text-align: center;
}

.about-photo img {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--primary);
    padding: 4px;
    background: white;
    display: block;
    margin: 0 auto;
    box-shadow: var(--shadow);
}

.about-photo figcaption {
    margin-top: 16px;
    text-align: center;
}

.about-photo .nombre {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text);
}

.about-photo .rol {
    color: var(--muted);
    font-size: 0.95rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.about-card p {
    font-size: 1.05rem;
    color: #333;
}

/* LAYOUT PRINCIPAL */
.grid-2col {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    align-items: start;
    margin-top: 28px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact .chip,
.contact .chip-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    margin-top: 8px;
    gap: 8px;
}

.skills h3,
.contact h3 {
    margin: 0 0 16px;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}

.skills-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skills-list li {
    background: #f0f0f3;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #444;
    transition: background 0.2s, color 0.2s;
}

.skills-list li:hover {
    background: var(--primary);
    color: white;
}

/* PROYECTOS */
.ascii-logo{
    color: #550000;
    font-weight: 800;
    font-size: 1.2rem;
}
.projects-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .projects-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.projects-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.projects-title img {
    width: 24px;
}

.projects-title h2 {
    margin: 0;
    font-size: 1.4rem;
}

.projects-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab {
    border: 1px solid var(--border);
    background: #fafafa;
    border-radius: 999px;
    padding: 6px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: var(--muted);
}

.tab:hover {
    background: #eee;
}

.tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.projects-grid {
    margin-top: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}

.project-card .thumb {
    aspect-ratio: 16/9;
    background: #f0f0f3;
    overflow: hidden;
}

.project-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.project-card:hover .thumb img {
    transform: scale(1.05);
}

.p-body {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.p-body h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 700;
}

.meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
}

/* INSIGNIAS / CHIPS */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: #f3f3f6;
    border: 1px solid #e8e8ee;
    color: #555;
}

.chip,
.chip-ghost {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--primary);
    background: #fff;
    transition: all 0.2s;
}

.chip .logos {
    width: 20px;
}

a.chip:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

a.chip img {
    vertical-align: middle;
}

a.chip:hover img {
    filter: none;
}


.chip-ghost {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.chip-ghost:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* MODAL */
.no-scroll {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.open {
    display: flex;
    opacity: 1;
}

.modal-dialog {
    width: min(900px, 95vw);
    max-height: 90vh;
    overflow: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    padding: 32px;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    border: 0;
    background: #f4f4f7;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #e4e4e7;
}

.modal h3 {
    margin: 0 0 16px;
    font-size: 1.5rem;
    padding-right: 40px;
}

.modal p {
    margin: 0 0 24px;
    font-size: 1.05rem;
    color: #444;
    line-height: 1.7;
}

.modal-gallery {
    display: grid;
    gap: 24px;
    margin: 24px 0;
}

.modal-gallery img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.modal-gallery figcaption {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--muted);
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid var(--primary);
    transition: all 0.2s;
}

.btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn.ghost {
    background: transparent;
    color: var(--primary);
}

.btn.ghost:hover {
    background: var(--primary);
    color: white;
}

a.btnGit {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

a.btnGit:hover {
    background: white;
    color: var(--primary);
}

#certificaciones {
    padding: 2rem 0;
}

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

.cert-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s ease;
}

.cert-card:hover {
    transform: translateY(-5px);
}

.cert-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    color: var(--primary);
}


footer#footerFix {
    width: 100%;
    padding: 24px 0;
    background: #222;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 60px;
}

footer#footerFix .mid {
    display: flex;
    gap: 32px;
}

footer#footerFix a {
    color: #ccc;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

footer#footerFix a:hover {
    color: white;
}


/* RESPONSIVE */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-photo figcaption {
        text-align: center;
        border-left: none;
        padding-left: 0;
    }

    .grid-2col {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
        /* Move sidebar to bottom on mobile if desired, or keep top */
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}