:root {
    --primary-color: #272727;
    --secondary-color: #f4f4f4;
    --accent-color: #007BFF;
    --base-font-size: 16px; /* Base para rem y em */
    
    /* Variables para modo claro (default) */
    --bg-color: #f4f4f4;
    --text-color: #333;
    --card-bg: #fff;
    --section-bg: #fff;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --project-text: #666;
    --tech-tag-bg: #f4f4f4;
    --tech-tag-text: #272727;
    --credits-bg: #f9f9f9;
    --credits-text: #666;
    --cursor-color: #000;
}

/* Variables para modo oscuro */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --card-bg: #2d2d2d;
    --section-bg: #2d2d2d;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --project-text: #b0b0b0;
    --tech-tag-bg: #3d3d3d;
    --tech-tag-text: #e0e0e0;
    --credits-bg: #252525;
    --credits-text: #b0b0b0;
    --cursor-color: #fff;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem; /* Basado en --base-font-size */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
header {
    background: var(--primary-color);
    color: #fff;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.2);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: auto;
    padding: 0 1rem;
}

header .logo-container {
    display: flex;
    align-items: center;
}

header .logo-img {
    width: 3rem;
    height: 3rem;
    margin-right: 0.625rem;
}

header .logo {
    margin: 0;
    font-size: 1.5rem;
    color: #fff;
}

header nav {
    display: flex;
    align-items: center;
}

header nav .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

header nav .menu li {
    margin-left: 1.25rem;
}

header nav .menu a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

header nav .menu a:hover {
    text-decoration: underline;
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    transition: all 0.3s ease;
    color: #fff;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.theme-icon {
    display: inline-block;
    transition: transform 0.9s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(-360deg);
}
/* Name Animation */

.animated-text {
    display: inline-block;
    font-size: 2.2rem;
    font-family: monospace;
    overflow: hidden; /* Oculta el texto que no está visible durante la animación */
    border-right: 2px solid var(--cursor-color); /* Simula el cursor */
    white-space: nowrap; /* Evita que el texto se envuelva */
    max-width: fit-content; /* Limita el ancho al contenido */
    animation: typing 4s steps(40, end) infinite alternate-reverse, blink 0.9s step-end infinite;
}

@keyframes typing {
    from {
        width: 0; /* Comienza sin mostrar texto */
    }
    to {
        width: 100%; /* Muestra todo el texto */
    }
}

@keyframes blink {
    from, to {
        border-color: transparent; /* Hace que el cursor parpadee */
    }
    50% {
        border-color: var(--cursor-color);
    }
}


/* About Section */
.about {
    margin-top: 8rem; /* Espacio para el header fijo */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;
    background: var(--section-bg);
    box-shadow: 0 0.125rem 0.3125rem var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.about-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Para que se adapte en pantallas pequeñas */
    max-width: 1480px; /* Ajustable */
    margin: auto;
}

.about-img {
    width: 22rem; /* Tamaño original en rem */
    height: 23rem;
    max-width: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    margin-right: 2rem;
    flex-shrink: 0;
}

.about-text {
    max-width: 50rem; /* 480px */
    flex: 1;
}

.about-text h2 {
    margin: 0 0 1rem;
    font-size: 2rem;
}

.about-text p {
    margin: 0;
    font-size: 1.3rem;
    text-align: justify;
    line-height: 1.8;
}

/* Redes sociales - Social Media Section */
.social-links {
    margin-top: 1.4rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem; /* Espacio entre los iconos */
}

.social-links a {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8; /* Leve transparencia */
}

.social-links a:hover {
    transform: scale(1.2); /* Ampliación al pasar el cursor */
    opacity: 1; /* Opacidad completa al pasar el cursor */
}

.social-icon {
    width: 3em;
    height: 3em;
    border-radius: 30%; /* Opcional: redondear los íconos */
    background: white;
    box-shadow: 0 4px 8px 1px rgb(189 188 255 / 70%);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.social-icon:hover {
    box-shadow: 0 4px 8px 3px rgb(189 188 255 / 80%); /* Sombra más intensa al pasar el cursor */
}

.social-text {
    margin-top: 0.2rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
    transition: color 0.3s ease;
}

/* Sections */
section {
    margin: 2rem 1rem;
    padding: 1rem;
    background: var(--section-bg);
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.3125rem var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

section h2 {
    margin: 0 0 1rem;
    text-align: center;
    font-size: 1.5rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 1px 4px 7px var(--shadow-color);
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    text-align: center;
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    transition: transform 0.4s ease, height 0.4s ease;
}

.project-image:hover {
    height: 400px;
    transform: scale(1.18);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px var(--shadow-color);
}

.project-card h3 {
    padding: 1rem;
    margin: 0;
    color: var(--text-color);
    transition: color 0.3s ease;
}

/* Color del texto de las tarjetas de los proyectos */
.project-card p {
    padding: 0 1rem;
    color: var(--project-text);
    transition: color 0.3s ease;
}

.project-tech {
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: var(--tech-tag-bg);
    color: var(--tech-tag-text);
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.project-links {
    padding: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.project-btn {
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: white;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background 0.3s ease;
}

.project-btn:hover {
    background: #0056b3;
    text-decoration: none;
}

/* Creditos - Footer */
.credits {
    font-size: 0.8rem; /* Texto pequeño */
    color: var(--credits-text); /* Color tenue */
    text-align: center; /* Centrado */
    margin-top: 2rem; /* Separación del contenido principal */
    padding: 1rem;
    background: var(--credits-bg); /* Fondo suave */
    border-top: 1px solid var(--border-color); /* Línea divisoria */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.credits ul {
    list-style: none; /* Sin viñetas */
    padding: 0;
    margin: 0.5rem 0;
}

.credits li {
    display: inline; /* Mostrar en línea */
    margin: 0 0.5rem;
}

.credits a {
    color: #003BFF; /* Color de enlace */
    text-decoration: none;
    font-weight: normal;
}

.credits a:hover {
    text-decoration: underline; /* Subrayado al pasar el mouse */
}

/* Media Queries para Responsividad */
@media (max-width: 768px) {
    .about {
        padding: 1rem;
    }

    .animated-text {
        font-size: 1.8rem; /* Centra la imagen en pantallas pequeñas */
    }

    .about-container {
        flex-direction: column; /* Cambia a diseño vertical */
    }

    .about-img {
        margin: 0 auto 1rem; /* Centra la imagen en pantallas pequeñas */
    }

}

/* Media Queries para teléfonos */
@media (max-width: 480px) {

    .logo {
        display: none;
    }

    h2, .container h2 {
        font-size: 1.5rem !important;
    }

    .animated-text {
        font-size: 1.2rem; /* Centra la imagen en pantallas pequeñas */
    }

}

#about,
#projects,
#contact {
  scroll-margin-top: 6rem;
}