body {
            font-family: 'Press Start 2P', cursive;
            background: #000;
            color: #fff;
            margin: 0;
            padding: 0;
            text-align: center;
        }

        /* Header estilo retro */
        .game-header {
            background: #000;
            padding: 20px;
            border-bottom: 4px solid #ff0000;
            text-transform: uppercase;
        }

        .nav-menu {
            list-style: none;
            display: flex;
            justify-content: center;
            padding: 0;
            margin: 0;
            gap: 20px;
        }

        .nav-menu li a {
            color: #fff;
            text-decoration: none;
            padding: 10px 15px;
            border: 2px solid #fff;
            background: #000;
            transition: all 0.3s;
        }

        .nav-menu li a:hover {
            background: #ff0000;
            color: #000;
        }

        /* Botones estilo arcade */
        .button {
            display: inline-block;
            text-decoration: none;
            color: #fff;
            background: #000;
            padding: 10px 25px;
            border: 3px solid #fff;
            margin: 10px;
            transition: transform 0.3s, background 0.3s;
        }

        .button:hover {
            background: #ff0000;
            transform: scale(1.1);
        }

        /* Estilo de perfil */
        .profile-pic {
            border: 4px solid #fff;
            border-radius: 50%;
            width: 150px;
            height: 150px;
            object-fit: cover;
            margin-bottom: 20px;
        }

        .skills, .projects, .contact {
            margin: 20px auto;
            max-width: 1200px;
            padding: 20px;
            background: rgba(255, 255, 255, 0.1);
            border: 3px solid #fff;
            border-radius: 10px;
        }

        /* Grid mejorado para cajas uniformes */
        .project-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            padding: 20px;
            align-items: stretch; /* Hace que todas las cajas tengan la misma altura */
        }

        .project-card {
            background: #111;
            border: 2px solid #fff;
            border-radius: 10px;
            padding: 20px;
            transition: transform 0.3s, box-shadow 0.3s;
            position: relative;
            overflow: hidden;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            min-height: 400px; /* Altura mínima uniforme */
        }

        .project-card::before {
            content: '';
            position: absolute;
            top: -100%;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(to bottom, rgba(255,0,0,0.2), transparent);
            transition: top 0.3s ease-out;
            pointer-events: none;
        }

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

        .project-card:hover::before {
            top: 0;
        }

        .project-card h3 {
            color: #ff0000;
            margin-bottom: 10px;
            font-size: 0.9em;
            min-height: 2.5em; /* Altura uniforme para títulos */
        }

        .project-card p {
            margin-bottom: 15px;
            flex-grow: 1; /* Hace que la descripción ocupe el espacio disponible */
            font-size: 0.7em;
            line-height: 1.4;
        }

        .project-image {
            width: 100%;
            height: 150px; /* Altura fija para todas las imágenes */
            object-fit: cover;
            border-radius: 8px;
            margin-bottom: 15px;
        }

        .project-links {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-top: auto; /* Empuja los botones hacia abajo */
            flex-wrap: wrap;
        }

        .project-link {
            display: inline-block;
            background: #ff0000;
            color: #000;
            padding: 8px 15px;
            border-radius: 5px;
            text-decoration: none;
            font-family: 'Press Start 2P', cursive;
            font-size: 0.6em;
            transition: background 0.3s, color 0.3s;
        }

        .project-link:hover {
            background: #fff;
            color: #ff0000;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.8);
            backdrop-filter: blur(5px);
            overflow-y: auto; /* Permite scroll en el modal */
            padding: 20px 0; /* Espacio arriba y abajo */
        }

        .modal-content {
            background-color: #111;
            margin: 0 auto;
            padding: 30px;
            border: 3px solid #ff0000;
            border-radius: 15px;
            width: 80%;
            max-width: 600px;
            position: relative;
            animation: modalAppear 0.3s ease-out;
            max-height: none; /* Permite que crezca según el contenido */
            min-height: auto;
        }

        @keyframes modalAppear {
            from { transform: scale(0.7); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }

        .close {
            color: #ff0000;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
            line-height: 1;
        }

        .close:hover {
            color: #fff;
        }

        .modal h3 {
            color: #ff0000;
            margin-bottom: 20px;
        }

        .modal-image {
            width: 100%;
            max-height: 300px;
            object-fit: contain; /* Cambiado de 'cover' a 'contain' para mostrar toda la imagen */
            background: rgba(255,255,255,0.05); /* Fondo sutil para imágenes con transparencia */
            border-radius: 10px;
            margin-bottom: 20px;
            cursor: pointer;
            transition: transform 0.3s ease;
        }

        .modal-image:hover {
            transform: scale(1.02);
        }

        /* Imagen expandida */
        .modal-image.expanded {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            max-height: none;
            z-index: 2000;
            background: rgba(0,0,0,0.95);
            object-fit: contain;
            border-radius: 0;
            cursor: zoom-out;
        }

        .modal-description {
            font-size: 0.8em;
            line-height: 1.6;
            margin-bottom: 20px;
        }

        .modal-tech {
            background: rgba(255,0,0,0.1);
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
        }

        .modal-tech h4 {
            color: #ff0000;
            margin-bottom: 10px;
            font-size: 0.7em;
        }

        .modal-links {
            display: flex;
            justify-content: center;
            gap: 15px;
            flex-wrap: wrap;
        }

        /* Media queries */
        @media screen and (max-width: 768px) {
            .nav-menu {
                flex-direction: column;
                gap: 10px;
            }

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

            .modal-content {
                width: 90%;
                margin: 0 auto;
                padding: 20px;
            }
        }

.profile {
    margin: 20px auto;
    max-width: 1000px; 
    padding: 20px 40px; 
}

.profile p {
    margin: 0 auto;
    max-width: 800px; 
    padding: 0 20px; 
    line-height: 1.6; 
}


.about {
    margin: 20px auto;
    max-width: 1000px;
    padding: 20px 40px;
}

.about p {
    margin: 0 auto;
    max-width: 800px;
    padding: 0 20px;
    line-height: 1.6;
}


@media screen and (max-width: 768px) {
    .profile, .about {
        padding: 15px 20px; 
    }
    
    .profile p, .about p {
        padding: 0 10px;
    }
}

@media screen and (max-width: 480px) {
    .profile, .about {
        padding: 10px 15px; 
    }
    
    .profile p, .about p {
        padding: 0 5px;
    }
}