@font-face {
    font-family: "PixelOperator";
    src: url("../static/fonts/PixelOperator.ttf") format("truetype");
}

:root {
    /* Tema Claro-Oscuro */
    color-scheme: light dark;

    /* Variables */
    --primary-color: #FFD93D;
    --background: #111111;

    --text-light: #FFFFFF;

    --dark-border-light: 2px solid #FFFFFF;
    --border-radius: 3px;

    --font-family-primary: monospace;
    --font-family-pixel: "PixelOperator";
    --font-extra-light: 200;
    --font-light: 300;
    --font-regular: 400;
    --font-medium: 500;
    --font-bold: 700;

    --line-height: 1.45rem;
    --transition: 0.3s ease;
    
}

/* HTML y tema claro/oscuro */
html {
  scroll-behavior: smooth;
}

html.dark {
    --background: #111111;
    --text-color: #FFFFFF;
    --border-color: 1px solid #FFFFFF;
}

html:not(.dark) {
    --background: #FFFFFF;
    --text-color: #000000;
    --border-color: 1px solid #000000;
}

/* Body */
body {
    /* Reset de estilos */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    min-height: 100vh;

    /* Colores */
    background-color: var(--background);
    color: var(--text-color);

    /* Fuente */
    font-family: var(--font-family-primary);
    line-height: var(--line-height);
}

/* Header Responsive */
header {
    display: flex;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 999;
    justify-content: space-between;
    align-items: center;
    background-color: var(--background);
    flex-wrap: wrap;
    gap: 15px;
}

header span {
    display: flex;
    align-items: center;
    font-family: var(--font-family-pixel);
    font-size: clamp(24px, 5vw, 30px);
    white-space: nowrap;
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px;
    gap: clamp(0.8rem, 2vw, 1.8rem);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.navlink {
    color: var(--text-color);
    text-decoration: none;
    font-size: clamp(10px, 2.5vw, 12px);
    transition: var(--transition);
    white-space: nowrap;
}

.navlink:hover {
    color: var(--primary-color);
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.theme-btn img {
    width: 16px;
    height: 16px;
    transition: var(--transition)
}

.theme-btn img:hover {
    filter: invert(0.5);
}

/* Tema claro — debe mostrar la luna */
.icon-sun {
    display: none;
}

.icon-moon {
    display: inline;
}

/* Tema oscuro — debe mostrar el sol */
html.dark .icon-sun {
    display: inline;
}

html.dark .icon-moon {
    display: none;
}

/* Modo claro = iconos normales */
html:not(.dark) .icon {
    filter: invert(1);
}

/* Modo oscuro = iconos invertidos */
html.dark .icon {
    filter: invert(0);
}

/* Estilo común para <section> */
section {
    padding: clamp(30px, 5vw, 50px) clamp(15px, 4vw, 20px);
    max-width: 1200px;
    margin: 0 auto;
}

/* Estilo común para "section-title" */
.section-title {
    display: flex;
    justify-content: center;
    font-family: var(--font-family-pixel);
    font-size: clamp(28px, 8vw, 40px);
    line-height: 1;
    margin-bottom: 40px;
    text-align: center;
}

/* Hero Section Responsive */
.hero-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 20px 0;
}

.hero-text {
    font-family: var(--font-family-pixel);
    font-size: clamp(28px, 8vw, 45px);
}

.hero-text h5 {
    font-size: clamp(16px, 4vw, 20px);
    font-weight: var(--font-extra-light);
    margin: 20px 0 30px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 3vw, 1.5rem);
    font-size: clamp(16px, 4vw, 20px);
    flex-wrap: wrap;
}

.social-links a {
    position: relative;
    color: var(--background);
    background-color: var(--text-color);
    padding: 8px 16px;
    text-decoration: none;
    border: var(--border-color);
    border-radius: var(--border-radius);
    transition: color 0.3s ease;
    min-width: 120px;
    text-align: center;
}

/* Capa animada */
.social-links a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: var(--background);
    transition: width 0.35s ease;
    z-index: 1;
}

/* Texto encima del efecto */
.social-links a span {
    position: relative;
    z-index: 2;
}

.social-links a:hover {
    color: var(--text-color);
}

.social-links a:hover::after {
    width: 100%;
}

/* Experience Section Responsive */
.experience-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .experience-container {
        flex-direction: row;
        justify-content: space-between;
    }
}

.experience-container-left {
    flex: 1;
    padding: 8px;
}

.experience-container-left h2 {
    font-family: var(--font-family-pixel);
    font-size: clamp(20px, 4vw, 30px);
    margin-bottom: 10px;
}

.experience-container-left p {
    font-size: clamp(14px, 2vw, 16px);
}

.experience-container-right {
    flex: 2;
    padding: 8px;
}

@media (min-width: 768px) {
    .experience-container-right {
        margin-left: 0;
    }
}

.experience-container-right h2 {
    font-family: var(--font-family-pixel);
    font-size: clamp(20px, 4vw, 30px);
    margin-bottom: 15px;
}

.experience-container-right p {
    font-family: var(--font-family-pixel);
    font-size: clamp(16px, 2.5vw, 20px);
    line-height: 1.6;
}

hr {
    border: none;
    height: 1px;
    background-color: var(--text-color);
    opacity: 0.3;
    margin: 40px auto;
    max-width: 800px;
}

/* Projects Section Responsive */
.projects-container {
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 4vw, 30px);
}

@media (min-width: 768px) {
    .projects-container {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.project-card {
    display: flex;
    flex: 1;
    min-width: 280px;
    text-decoration: none;
    color: var(--text-color);
    border: var(--border-color);
    border-radius: var(--border-radius);
    transition: transform 0.3s ease;
}

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

.project-container-item {
    display: flex;
    flex-direction: column;
    flex: 1;
    font-family: var(--font-family-pixel);
    font-size: clamp(16px, 2.5vw, 20px);
    padding: 20px;
}

.project-container-item h2 {
    font-size: clamp(20px, 4vw, 24px);
    margin-top: 0;
    margin-bottom: 15px;
}

.project-container-item p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.project-tech-stack {
    display: flex;
    margin-top: auto;
    gap: 10px;
    flex-wrap: wrap;
}

.project-tech-stack span {
    padding: 6px 12px;
    border: var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--text-color);
    color: var(--background);
    font-size: clamp(12px, 2vw, 14px);
}

/* About Section Responsive */
.about-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

@media (min-width: 992px) {
    .about-container {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: clamp(2rem, 4vw, 3rem);
    }
}

.about-container-img-wrapper {
    width: 250px;
    height: 250px;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .about-container-img-wrapper {
        width: 300px;
        height: 300px;
    }
}

.about-container-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
}

.about-container-text {
    font-family: var(--font-family-pixel);
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: var(--font-bold);
    line-height: 1.6;
    text-align: left;
}

/* Contact Section */
.contact-container {
    text-align: center;
    padding: 40px 20px;
}

/* Footer Section */
footer {
    display: flex;
    padding: 20px;
    justify-content: center;
    text-align: center;
    font-size: clamp(12px, 2vw, 14px);
}

/* Media Queries adicionales para mejor responsividad */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    nav {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
    
    .theme-btn {
        position: absolute;
        top: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .experience-container-left,
    .experience-container-right {
        text-align: center;
    }
    
    .project-card {
        min-width: 100%;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .social-links a {
        width: 100%;
        max-width: 200px;
    }
}

/* Mejoras de accesibilidad y scroll suave */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .social-links a::after,
    .project-card,
    .navlink {
        transition: none;
    }
}

.tech-stack-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 6px;
    gap: clamp(0.5rem, 2vw, 1rem);
    max-width: 100%;
    margin: 0 auto;
}

.tech-item {
    background-color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border: var(--border-color);
    border-radius: var(--border-radius);
    width: clamp(50px, 12vw, 60px);
    height: clamp(50px, 12vw, 60px);
    padding: 8px;
    transition: transform 0.3s ease;
}

.tech-item:hover {
    transform: scale(1.1);
}

.tech-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Media Queries para diferentes tamaños de pantalla */
@media (max-width: 768px) {
    .tech-stack-container {
        justify-content: center;
        gap: 0.8rem;
    }
    
    .tech-item {
        width: 50px;
        height: 50px;
        padding: 6px;
    }
}

@media (max-width: 480px) {
    .tech-stack-container {
        gap: 0.6rem;
    }
    
    .tech-item {
        width: 45px;
        height: 45px;
        padding: 5px;
    }
}

/* Para pantallas muy grandes */
@media (min-width: 1200px) {
    .tech-stack-container {
        gap: 1.2rem;
    }
    
    .tech-item {
        width: 65px;
        height: 65px;
    }
}