/* ================================================
   PORTFOLIO - Responsive & consistente con index
   ================================================ */

/* ── ACHIEVEMENTS ──────────────────────────────── */

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.achievement-box {
    background-color: var(--gb-black);
    border: 3px solid var(--gb-white);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 3px 3px 0 var(--gb-black), inset 0 0 0 2px var(--gb-dark);
    transition: all 0.1s ease;
}

.achievement-box:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--gb-black), inset 0 0 0 2px var(--gb-dark);
}

.achievement-icon {
    font-size: 2rem;
    color: var(--gb-white);
    flex-shrink: 0;
}

.achievement-content h3 {
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    color: var(--gb-white);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    line-height: 1.6;
}

.achievement-content p {
    font-size: clamp(0.65rem, 1.3vw, 0.82rem);
    color: var(--gb-light);
    line-height: 1.8;
}

/* ── HERO STATS ────────────────────────────────── */

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 3px solid var(--gb-light);
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    font-size: clamp(0.45rem, 1vw, 0.65rem);
    color: var(--gb-light);
}

.stat-value {
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    color: var(--gb-white);
}

.subtitle {
    font-size: clamp(0.5rem, 1.5vw, 0.8rem);
    color: var(--gb-light);
    margin-top: 1rem;
    letter-spacing: 3px;
}

.location {
    font-size: clamp(0.45rem, 1.2vw, 0.65rem);
    color: var(--gb-light);
    margin-top: 0.5rem;
}

/* ── DIALOG BOX ────────────────────────────────── */

.dialog-box {
    background-color: var(--gb-black);
    border: 3px solid var(--gb-light);
    padding: 20px;
    margin-bottom: 2rem;
    box-shadow: inset 0 0 0 2px var(--gb-dark);
}

.dialog-box p {
    font-size: clamp(0.7rem, 1.5vw, 0.92rem);
    line-height: 2;
    margin-bottom: 1.5rem;
    color: var(--gb-white);
    word-break: break-word;
}

.dialog-box p:last-child {
    margin-bottom: 0;
}

/* ── CONTACT INFO ──────────────────────────────── */

.contact-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.info-item {
    background-color: var(--gb-black);
    border: 3px solid var(--gb-light);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: clamp(0.5rem, 1.2vw, 0.65rem);
    word-break: break-all;
}

.info-item .icon {
    font-size: 1rem;
    color: var(--gb-light);
    flex-shrink: 0;
}

/* ── QUEST BOX (EXPERIENCE) ────────────────────── */

.quest-box {
    background-color: var(--gb-black);
    border: 4px solid var(--gb-white);
    padding: 24px;
    margin-bottom: 2rem;
    box-shadow: 4px 4px 0 var(--gb-black), inset 0 0 0 3px var(--gb-dark);
    position: relative;
}

.quest-box::before {
    content: '';
    position: absolute;
    top: -8px; left: -8px;
    right: -8px; bottom: -8px;
    border: 2px solid var(--gb-light);
    pointer-events: none;
}

.quest-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--gb-light);
    flex-wrap: wrap;
}

.quest-icon {
    font-size: 1.5rem;
    color: var(--gb-white);
    flex-shrink: 0;
}

.quest-header h3 {
    font-size: clamp(0.7rem, 1.5vw, 0.92rem);
    color: var(--gb-white);
    letter-spacing: 2px;
    line-height: 1.6;
    word-break: break-word;
}

.quest-title {
    font-size: clamp(0.68rem, 1.4vw, 0.85rem);
    color: var(--gb-light);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.quest-period {
    font-size: clamp(0.62rem, 1.3vw, 0.78rem);
    color: var(--gb-light);
    margin-bottom: 1.5rem;
}

.quest-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quest-list li {
    font-size: clamp(0.65rem, 1.3vw, 0.82rem); /* corregido: era 2rem y 3rem */
    color: var(--gb-white);
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.9;
    word-break: break-word;
}

.quest-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--gb-light);
}

/* ── SKILLS ────────────────────────────────────── */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    background-color: var(--gb-black);
    border: 3px solid var(--gb-light);
    padding: 20px;
    box-shadow: 3px 3px 0 var(--gb-black), inset 0 0 0 2px var(--gb-dark);
}

.skill-category h3 {
    font-size: clamp(0.7rem, 1.5vw, 0.88rem);
    color: var(--gb-white);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: var(--gb-dark);
    border: 2px solid var(--gb-light);
    padding: 5px 10px;
    font-size: clamp(0.62rem, 1.3vw, 0.75rem); /* corregido: era inconsistente */
    color: var(--gb-white);
    letter-spacing: 1px;
    transition: all 0.1s ease;
    font-family: 'Press Start 2P', monospace;
}

.tag:hover {
    background-color: var(--gb-light);
    color: var(--gb-black);
}

/* ── GALLERY ───────────────────────────────────── */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-frame {
    background-color: var(--gb-black);
    border: 4px solid var(--gb-white);
    padding: 8px;
    width: 100%;
    aspect-ratio: 1;
    box-shadow: 4px 4px 0 var(--gb-black), inset 0 0 0 3px var(--gb-dark);
    position: relative;
    cursor: pointer;
    transition: all 0.1s ease;
}

.gallery-frame::before {
    content: '';
    position: absolute;
    top: -8px; left: -8px;
    right: -8px; bottom: -8px;
    border: 2px solid var(--gb-light);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.gallery-frame:hover::before { opacity: 1; }

.gallery-frame:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--gb-black), inset 0 0 0 3px var(--gb-dark);
}

.placeholder-img {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        var(--gb-dark), var(--gb-dark) 10px,
        var(--gb-black) 10px, var(--gb-black) 20px
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: var(--gb-white);
    border: 2px solid var(--gb-light);
}

.placeholder-img span {
    font-size: clamp(0.6rem, 2vw, 1rem);
    text-align: center;
    letter-spacing: 2px;
    font-family: 'Press Start 2P', monospace;
}

.gallery-title {
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    color: var(--gb-white);
    margin-top: 1rem;
    letter-spacing: 2px;
    text-align: center;
    line-height: 1.6;
}

.gallery-desc {
    font-size: clamp(0.6rem, 1.2vw, 0.72rem);
    color: var(--gb-light);
    margin-top: 0.5rem;
    letter-spacing: 1px;
    text-align: center;
}

/* ── GITHUB STATS ──────────────────────────────── */

.github-stats {
    background-color: var(--gb-black);
    border: 4px solid var(--gb-white);
    padding: 30px;
    box-shadow: 4px 4px 0 var(--gb-black), inset 0 0 0 3px var(--gb-dark);
}

.github-stats h3 {
    font-size: clamp(0.72rem, 1.5vw, 0.95rem);
    color: var(--gb-white);
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1.5rem;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: var(--gb-dark);
    border: 2px solid var(--gb-light);
}

.stat-number {
    font-size: clamp(0.9rem, 2.5vw, 1.5rem);
    color: var(--gb-white);
}

.stat-box .stat-label {
    font-size: clamp(0.6rem, 1.2vw, 0.72rem);
    color: var(--gb-light);
    text-align: center;
}

/* ── HIRE ME ───────────────────────────────────── */

.hire-box {
    background-color: var(--gb-black);
    border: 4px solid var(--gb-white);
    padding: 40px;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow:
        6px 6px 0 var(--gb-black),
        inset 0 0 0 4px var(--gb-dark),
        inset 0 0 0 8px var(--gb-light);
    position: relative;
}

.hire-box::before {
    content: '';
    position: absolute;
    top: -10px; left: -10px;
    right: -10px; bottom: -10px;
    border: 2px solid var(--gb-light);
    pointer-events: none;
}

.hire-message {
    font-size: clamp(0.78rem, 2vw, 1.1rem);
    color: var(--gb-white);
    margin-bottom: 1rem;
    letter-spacing: 3px;
    animation: blink 1.5s step-end infinite;
    line-height: 1.6;
}

.hire-submessage {
    font-size: clamp(0.7rem, 1.5vw, 0.95rem);
    color: var(--gb-light);
    margin-bottom: 2rem;
    letter-spacing: 2px;
    line-height: 1.6;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.action-buttons .pixel-button {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: clamp(0.48rem, 1.1vw, 0.7rem);
}

/* ── EDUCATION ─────────────────────────────────── */

.education-box {
    background-color: var(--gb-black);
    border: 3px solid var(--gb-light);
    padding: 24px;
    box-shadow: 4px 4px 0 var(--gb-black), inset 0 0 0 2px var(--gb-dark);
}

.education-box h3 {
    font-size: clamp(0.72rem, 1.5vw, 0.95rem);
    color: var(--gb-white);
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.education-item {
    padding: 12px 0;
    border-bottom: 2px solid var(--gb-dark);
}

.education-item:last-child {
    border-bottom: none;
}

.edu-title {
    font-size: clamp(0.7rem, 1.5vw, 0.88rem);
    color: var(--gb-white);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    line-height: 1.6;
}

.edu-status {
    font-size: clamp(0.62rem, 1.3vw, 0.78rem);
    color: var(--gb-light);
}

/* ── RESPONSIVE ────────────────────────────────── */

@media screen and (max-width: 768px) {
    .hero-stats {
        gap: 1.2rem;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .achievement-box {
        padding: 16px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .action-buttons {
        grid-template-columns: 1fr 1fr;
    }

    .hire-box {
        padding: 28px 20px;
    }

    .quest-box {
        padding: 20px 16px;
    }

    .github-stats {
        padding: 20px 16px;
    }
}

@media screen and (max-width: 480px) {
    .hero-stats {
        gap: 1rem;
    }

    .achievement-box {
        flex-direction: column;
        text-align: center;
        padding: 14px 10px;
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .hire-box {
        padding: 20px 12px;
    }

    .quest-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hire-box::before {
        display: none; /* evita overflow en móvil muy pequeño */
    }
}

/* ── BOTÓN TRADUCTOR ───────────────────────────── */

.btn-traducir {
    position: fixed;
    top: 90px;
    right: 16px;
    z-index: 998;
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.5rem, 1.2vw, 0.65rem);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #1a1020;
    color: #e0b0ff;
    border: 2px solid #a569bd;
    box-shadow: 3px 3px 0 #000;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    white-space: nowrap;
}

.btn-traducir:hover {
    background: #a569bd;
    color: #000;
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #000;
}

/* ── MODAL DE CORREO ───────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay.modal-visible { opacity: 1; }

.modal-box {
    background: #251830;
    border: 3px solid #7c6d80;
    box-shadow: 6px 6px 0 #000, inset 0 0 0 3px #000, inset 0 0 0 6px #4a2d6a;
    padding: 2.5rem 2rem 2rem;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-sizing: border-box;
    transform: translateY(20px);
    transition: transform 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.modal-visible .modal-box { transform: translateY(0); }

.modal-cerrar {
    position: absolute;
    top: 0.8rem; right: 0.8rem;
    background: #3d1f55;
    border: 2px solid #7c6d80;
    color: #c7c6c6;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000;
}

.modal-cerrar:hover { background: #7c6d80; color: #000; }

.modal-icono {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.modal-titulo {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.82rem, 2vw, 1.1rem);
    color: #e8c4ff;
    text-align: center;
    margin: 0 0 0.6rem;
    line-height: 1.6;
    text-shadow: 2px 2px 0 #000;
}

.modal-desc {
    font-size: clamp(0.52rem, 1.2vw, 0.68rem);
    color: #b0a0c0;
    text-align: center;
    line-height: 1.9;
    margin: 0 0 1.5rem;
}

.modal-form { display: flex; flex-direction: column; gap: 1.1rem; }

.campo { display: flex; flex-direction: column; gap: 0.5rem; }

.campo label {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.68rem, 1.4vw, 0.82rem);
    color: #d4a8f0;
    line-height: 1.6;
}

.campo input,
.campo select,
.campo textarea {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.68rem, 1.4vw, 0.82rem);
    background: #1a1020;
    color: #c7c6c6;
    border: 2px solid #7c6d80;
    padding: 0.7rem 0.9rem;
    box-shadow: inset 2px 2px 0 #000;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.8;
    transition: border-color 0.15s;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    border-color: #a569bd;
    box-shadow: inset 2px 2px 0 #000, 0 0 0 2px rgba(165,105,189,0.3);
}

.campo select option { background: #1a1020; color: #c7c6c6; }
.campo textarea { resize: vertical; min-height: 90px; }

.modal-error {
    font-size: clamp(0.68rem, 1.4vw, 0.82rem);
    color: #ff6b6b;
    line-height: 1.8;
    margin: 0;
}

.modal-btn-enviar {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.55rem, 1.3vw, 0.72rem);
    padding: 0.9rem 1.2rem;
    border: 3px solid;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    margin-top: 0.5rem;
}

.btn-enviar-gmail {
    background: #1a1a3a;
    color: #7090e0;
    border-color: #7090e0;
    box-shadow: 4px 4px 0 #0a0a1a;
}

.btn-enviar-gmail:hover {
    background: #7090e0;
    color: #0a0a1a;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #0a0a1a;
}