/* ========================================
   RESET Y VARIABLES CSS
   ======================================== */

:root {
    /* Colores principales */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --text-primary: #f5f5f5;
    --text-secondary: #b0b0b0;
    --accent-primary: #00C6FF;
    --accent-secondary: #7B61FF;
    --accent-tertiary: #FF7A00;

    /* Colores de estado */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;

    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 198, 255, 0.3);

    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Bordes */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;

    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
}

/* Tema claro */
body.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    -webkit-transition: background-color var(--transition-normal), color var(--transition-normal);
    -moz-transition: background-color var(--transition-normal), color var(--transition-normal);
    -ms-transition: background-color var(--transition-normal), color var(--transition-normal);
    -o-transition: background-color var(--transition-normal), color var(--transition-normal);
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ========================================
   UTILIDADES
   ======================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Skip to content link para accesibilidad */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    z-index: 10000;
    font-weight: 600;
    border-radius: 0 0 0.5rem 0;
    transition: top var(--transition-fast);
}

.skip-to-content:focus {
    top: 0;
    outline: 2px solid var(--accent-secondary);
    outline-offset: 2px;
}

/* ========================================
   NAVEGACIÓN
   ======================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 0;
    -webkit-backdrop-filter: blur(10px);
    -moz-backdrop-filter: blur(10px);
    -ms-backdrop-filter: blur(10px);
    -o-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background: rgba(15, 15, 15, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-transition: all var(--transition-normal);
    -moz-transition: all var(--transition-normal);
    -ms-transition: all var(--transition-normal);
    -o-transition: all var(--transition-normal);
    transition: all var(--transition-normal);
    will-change: transform, padding;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

body.light-theme .navbar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar.scrolled {
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.nav-logo:hover {
    transform: scale(1.05);
}

.logo-dot {
    color: var(--accent-primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width var(--transition-normal);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ========================================
   BOTONES DE UTILIDAD
   ======================================== */

/* Toggle de idioma en navbar */
.language-toggle {
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.language-toggle:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 198, 255, 0.3);
}

.lang-text {
    display: block;
    line-height: 1;
}

/* Menú móvil */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1002;
    width: 45px;
    height: 45px;
    background: var(--bg-secondary);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-normal);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 80px;
}

/* Fondo animado */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a0033 100%);
}

#particlesCanvas {
    width: 100%;
    height: 100%;
}

/* Formas flotantes */
.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-secondary);
    top: 60%;
    right: 10%;
    animation-delay: 5s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--accent-tertiary);
    bottom: 10%;
    left: 50%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -50px) scale(1.1); }
    66% { transform: translate(-50px, 50px) scale(0.9); }
}

/* Contenido del hero */
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    padding: 0 var(--spacing-md);
    text-align: center;
}

.hero-greeting {
    font-size: 1.2rem;
    color: var(--accent-primary);
    font-weight: 500;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-title {
    font-size: clamp(1.8rem, 8vw, 5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.6s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.8s forwards;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 0;
    right: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    width: fit-content;
}

.scroll-indicator p {
    margin: 0;
    padding: 0;
    text-align: center;
    white-space: nowrap;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--text-secondary);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { opacity: 1; top: 8px; }
    100% { opacity: 0; top: 20px; }
}

/* ========================================
   BOTONES
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn i {
    transition: transform var(--transition-normal);
}

.btn:hover i {
    transform: translateX(5px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 198, 255, 0.3);
}

/* Efecto pulse en el botón CTA del hero */
.hero .btn-primary {
    animation: pulse 2s ease-in-out infinite;
}

.hero .btn-primary:hover {
    animation: none;
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(0, 198, 255, 0.5);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 198, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--accent-primary);
}

.btn-secondary:hover {
    background: var(--accent-primary);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
    background: rgba(0, 198, 255, 0.8);
}

/* ========================================
   SECCIONES GENERALES
   ======================================== */

section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-label {
    display: inline-block;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    position: relative;
}

.section-label::before,
.section-label::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 2px;
    background: var(--accent-primary);
}

.section-label::before {
    right: calc(100% + 15px);
}

.section-label::after {
    left: calc(100% + 15px);
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* ========================================
   PROYECTOS
   ======================================== */

.projects {
    background: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: var(--spacing-lg);
}

@media (max-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.project-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.05);
    will-change: transform;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.project-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 198, 255, 0.9), rgba(123, 97, 255, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
    transform: translateY(20px);
}

.project-card:hover .project-link {
    transform: translateY(0);
}

.project-link:hover {
    transform: scale(1.2) rotate(10deg);
}

.project-info {
    padding: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent-primary);
    border: 1px solid rgba(0, 198, 255, 0.3);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================================
   SOBRE MÍ
   ======================================== */

.about-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.about-image {
    position: relative;
}

.image-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 2rem;
}

.image-container img {
    width: 100%;
    border-radius: var(--border-radius-xl);
    position: relative;
    z-index: 2;
}

.image-border {
    display: none;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all var(--transition-normal);
}

.stat-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Contenido sobre mí */
.about-content .section-label {
    margin-bottom: 1rem;
}

.about-content .section-title {
    text-align: left;
    margin-bottom: 1.5rem;
}

.about-text {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Skills */
.skills-section {
    margin: 2.5rem 0;
}

.skills-title {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all var(--transition-normal);
    cursor: pointer;
    will-change: transform;
}

.skill-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.skill-item:active {
    transform: translateY(-2px);
}

.skill-icon {
    font-size: 2.5rem;
    color: var(--accent-primary);
    transition: transform var(--transition-normal);
}

.skill-item:hover .skill-icon {
    transform: scale(1.2) rotate(5deg);
}

.skill-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ========================================
   CONTACTO
   ======================================== */

.contact {
    background: var(--bg-secondary);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

/* Información de contacto */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all var(--transition-normal);
}

.info-item:hover {
    transform: translateX(10px);
    border-color: var(--accent-primary);
}

.info-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.info-content h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.info-content a,
.info-content p {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.info-content a:hover {
    color: var(--accent-primary);
}

/* Redes sociales */
.social-links h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.2rem;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.social-link:hover {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    transform: translateY(-5px) rotate(10deg);
    box-shadow: var(--shadow-glow);
}

/* Formulario */
.contact-form {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--border-radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: all var(--transition-normal);
    -webkit-appearance: none;
    appearance: none;
}

/* Evitar zoom en iOS */
@media screen and (max-width: 768px) {
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
    }
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.error-message {
    display: block;
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

.form-group.error input,
.form-group.error textarea {
    border-color: var(--error);
}

.btn-submit {
    width: 100%;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-submit.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-submit:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-submit .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius-md);
    text-align: center;
    display: none;
}

.form-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
    display: block;
}

.form-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
    display: block;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background: var(--bg-secondary);
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-description {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-social a:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-3px);
    border-color: var(--accent-primary);
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-links,
.footer-contact {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a,
.footer-contact a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--accent-primary);
    padding-left: 5px;
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.footer-contact i {
    color: var(--accent-primary);
    font-size: 1rem;
    width: 20px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    text-align: center;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   BOTÓN VOLVER ARRIBA
   ======================================== */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1004;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 198, 255, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all var(--transition-normal);
    will-change: transform, opacity;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(0, 198, 255, 0.5);
}

.scroll-to-top:active {
    transform: translateY(-2px);
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablets landscape - Optimización específica */
@media (max-width: 1200px) and (min-width: 1025px) {
    .container {
        max-width: 1024px;
        padding: 0 2.5rem;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .hero-content {
        padding: 0 3rem;
    }
}

@media (max-width: 1024px) {
    .about-wrapper,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }

    /* Mejor visualización de proyectos en tablet */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .project-image {
        height: 220px;
    }

    /* Stats en 3 columnas para tablet */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    /* Mejor spacing para botones en tablet */
    .hero-buttons {
        gap: 1.5rem;
    }
}

/* Breakpoint intermedio para tablets pequeñas */
@media (max-width: 900px) {
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Orientación landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding-top: 60px;
    }

    .hero-content {
        padding: 1rem;
    }

    .hero-title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
        margin-bottom: 0.5rem;
    }

    .hero-subtitle {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
    }

    .hero-description {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .hero-buttons {
        flex-direction: row;
        gap: 1rem;
    }

    .scroll-indicator {
        display: none;
    }

    .floating-shapes {
        opacity: 0.5;
    }
}

@media (max-width: 768px) {
    /* Mostrar hamburguesa */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Navbar visible con fondo */
    .navbar {
        background: var(--bg-primary);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
        padding-left: 0;
    }

    .nav-container {
        justify-content: flex-start;
        gap: 0;
        padding-left: 6rem;
    }

    /* Logo a la derecha de la hamburguesa */
    .nav-logo {
        position: static;
        z-index: auto;
        margin-left: 0;
    }

    /* Menú móvil que se desliza desde la izquierda */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 280px;
        background: var(--bg-secondary);
        border-right: 2px solid rgba(255, 255, 255, 0.1);
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        gap: 1rem;
        padding: 2rem;
        opacity: 1;
        visibility: visible;
        pointer-events: all;
        transition: left 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(10px);
        z-index: 1001;
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(0, 198, 255, 0.05), rgba(123, 97, 255, 0.05));
        z-index: -1;
    }

    .nav-menu li {
        width: 100%;
        text-align: left;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 1rem 1.5rem;
        border-radius: var(--border-radius-sm);
        transition: all var(--transition-fast);
        display: block;
        width: 100%;
        text-align: left;
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(0, 198, 255, 0.1);
        transform: translateX(5px);
    }

    .nav-link::after {
        display: none;
    }

    .nav-menu .language-toggle {
        margin-top: 1rem;
        padding: 0.75rem 1.5rem;
        width: 100%;
        justify-content: center;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .btn {
        justify-content: center;
        min-height: 48px; /* Touch target mínimo */
    }

    /* Scroll indicator más visible en móvil */
    .scroll-indicator {
        bottom: 2rem;
        font-size: 0.85rem;
    }

    .mouse {
        width: 24px;
        height: 36px;
    }

    /* Stats grid: mantener 2 columnas para mejor balance */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-item:last-child {
        grid-column: 1 / -1;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact form: mejor padding en inputs */
    .contact-form input,
    .contact-form textarea {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px; /* Touch target mínimo */
    }

    .contact-form textarea {
        min-height: 120px;
    }

    .btn-submit {
        min-height: 52px; /* Touch target más grande para botón principal */
        font-size: 1rem;
    }

    .section-label::before,
    .section-label::after {
        width: 20px;
    }

    .section-label::before {
        right: calc(100% + 10px);
    }

    .section-label::after {
        left: calc(100% + 10px);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    /* Footer responsive */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .footer-links a,
    .footer-contact a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    /* Proyectos: stack vertical en móvil */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .project-image {
        height: 200px;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-lg: 2.5rem;
        --spacing-xl: 3.5rem;
    }

    /* Tipografía optimizada para pantallas pequeñas */
    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .hero-subtitle {
        font-size: clamp(1rem, 4vw, 1.3rem);
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }

    .section-description {
        font-size: 1rem;
    }

    /* Reducir padding general */
    .container {
        padding: 0 1.5rem;
    }

    section {
        padding: var(--spacing-lg) 0;
    }

    /* Hero: mejor espaciado */
    .hero-content {
        padding: 0 1.5rem;
    }

    .hero-greeting {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .hero-buttons {
        gap: 0.875rem;
    }

    .scroll-indicator {
        bottom: 1.5rem;
        font-size: 0.8rem;
        gap: 0.75rem;
    }

    .mouse {
        width: 22px;
        height: 34px;
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .project-card {
        border-radius: var(--border-radius-md);
    }

    .project-image {
        height: 180px;
    }

    .project-info {
        padding: 1.25rem;
    }

    .project-title {
        font-size: 1.3rem;
    }

    .project-description {
        font-size: 0.9rem;
    }

    /* Skills */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.875rem;
    }

    .skill-item {
        padding: 0.875rem 0.5rem;
    }

    .skill-icon {
        font-size: 2rem;
    }

    .skill-name {
        font-size: 0.85rem;
    }

    /* Stats */
    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    /* Contact form */
    .contact-form {
        padding: 1.5rem;
    }

    .contact-form label {
        font-size: 0.9rem;
    }

    .contact-form input,
    .contact-form textarea {
        font-size: 0.95rem;
    }

    /* Info items */
    .info-item {
        padding: 1rem;
    }

    .info-item h4 {
        font-size: 0.9rem;
    }

    .info-item a,
    .info-item p {
        font-size: 0.95rem;
    }

    /* Social links */
    .social-link {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    /* About text */
    .about-text {
        font-size: 0.95rem;
    }

    /* Section labels más pequeños */
    .section-label {
        font-size: 0.8rem;
    }

    .section-label::before,
    .section-label::after {
        width: 15px;
    }

    /* Footer */
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    /* Navbar mobile - logo más pequeño */
    .nav-logo {
        font-size: 1.5rem;
    }

    .nav-container {
        padding-left: 5.5rem;
    }
}

/* ========================================
   ANIMACIONES PERSONALIZADAS
   ======================================== */

/* Animación de carga */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Efecto de brillo en hover */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

/* Animación de pulso */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 198, 255, 0.3);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 6px 25px rgba(0, 198, 255, 0.5);
    }
}

/* ========================================
   ACCESIBILIDAD
   ======================================== */

/* Foco visible para navegación por teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Focus específico para botones primarios */
.btn-primary:focus-visible {
    outline: 3px solid var(--accent-secondary);
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(0, 198, 255, 0.2);
}

/* Focus para controles de menú */
.language-toggle:focus-visible,
.mobile-menu-toggle:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 4px;
}

/* Focus para tarjetas de proyecto */
.project-card:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.3);
}

/* Focus para scroll to top */
.scroll-to-top:focus-visible {
    outline: 3px solid white;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(0, 198, 255, 0.5);
}

/* Mejorar contraste para hover en modo claro */
body.light-theme .nav-link:hover,
body.light-theme .btn-secondary:hover {
    background: rgba(0, 198, 255, 0.15);
}

/* Reducir movimiento para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Detener animaciones del canvas */
    .floating-shapes .shape {
        animation: none !important;
    }

    /* Detener el efecto de typing */
    .cursor {
        animation: none !important;
        opacity: 1 !important;
    }
}
}

/* ========================================
   MODO IMPRESIÓN
   ======================================== */

@media print {
    .navbar,
    .mobile-menu-toggle,
    .scroll-indicator,
    .floating-shapes,
    .hero-background {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}

/* ========================================
   DESKTOP BREAKPOINTS (1440px+)
   ======================================== */

@media (min-width: 1440px) {
    .container {
        max-width: 1320px;
        padding: 0 var(--spacing-lg);
    }

    h1 {
        font-size: clamp(3.5rem, 5vw, 4.5rem);
    }

    h2 {
        font-size: clamp(2.75rem, 4vw, 3.5rem);
    }

    section {
        padding: var(--spacing-xl) 0;
    }

    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .timeline-item {
        padding-left: var(--spacing-lg);
    }
}

@media (min-width: 1920px) {
    .container {
        max-width: 1440px;
        padding: 0 var(--spacing-xl);
    }

    :root {
        --spacing-xl: 8rem;
        --spacing-lg: 5rem;
    }

    h1 {
        font-size: clamp(4rem, 5vw, 5.5rem);
    }

    h2 {
        font-size: clamp(3rem, 4vw, 4rem);
    }

    h3 {
        font-size: clamp(1.75rem, 3vw, 2.25rem);
    }

    section {
        padding: calc(var(--spacing-xl) * 1.2) 0;
    }

    .hero-content h1 {
        font-size: clamp(4.5rem, 6vw, 6rem);
    }

    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem;
    }

    .contact-content {
        gap: var(--spacing-xl);
    }
}

@media (min-width: 2560px) {
    .container {
        max-width: 1680px;
        padding: 0 calc(var(--spacing-xl) * 1.5);
    }

    :root {
        --spacing-xl: 10rem;
        --spacing-lg: 6rem;
    }

    h1 {
        font-size: clamp(5rem, 6vw, 7rem);
    }

    h2 {
        font-size: clamp(3.5rem, 5vw, 5rem);
    }

    h3 {
        font-size: clamp(2rem, 3vw, 2.75rem);
    }

    .hero-content h1 {
        font-size: clamp(6rem, 7vw, 8rem);
    }

    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .project-card {
        border-radius: var(--border-radius-xl);
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }

    .skill-card {
        padding: var(--spacing-lg);
    }

    .timeline-item {
        padding-left: calc(var(--spacing-xl) * 1.2);
    }

    .contact-content {
        gap: calc(var(--spacing-xl) * 1.2);
    }
}
