/* ========================================
   RESPONSIVE CSS - MOBILE & TABLET
   ======================================== */

/* ========================================
   TABLET - Max Width 1024px
   ======================================== */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .section {
        padding: 4rem 1.5rem;
    }

    .section__title {
        font-size: 2.2rem;
    }

    /* Hero Section */
    .hero__content {
        gap: 3rem;
    }

    .hero__title {
        font-size: 3rem;
    }

    .hero__subtitle {
        font-size: 1.5rem;
    }

    .image-container {
        width: 350px;
        height: 350px;
    }

    /* Projects */
    .projects__wrapper {
        gap: 1.5rem;
    }

    .projects__container {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-card {
        height: 400px;
    }

    .project__image {
        height: 130px;
    }

    .project__icon {
        font-size: 2.8rem;
    }

    .nav-arrow {
        width: 50px;
        height: 50px;
        min-width: 50px;
        font-size: 1.2rem;
    }

    /* Contact */
    .contact__content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* ========================================
   MOBILE - Max Width 768px
   ======================================== */
@media screen and (max-width: 768px) {

    /* Typography */
    .section__title {
        font-size: 1.8rem;
    }

    .section__subtitle {
        font-size: 0.85rem;
    }

    /* Header & Navigation */
    .nav {
        height: 70px;
    }

    .nav__menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background: rgba(10, 14, 39, 0.98);
        backdrop-filter: blur(20px);
        padding: 2rem;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        transition: var(--transition-normal);
        z-index: 100;
    }

    .nav__menu.show-menu {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        gap: 2rem;
    }

    .nav__link {
        font-size: 1.1rem;
    }

    .nav__toggle {
        display: block;
    }

    /* Hero Section */
    .hero {
        min-height: auto;
        padding: 120px 0 3rem;
    }

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

    .hero__text {
        order: 2;
        text-align: center;
    }

    .hero__image {
        order: 1;
    }

    .hero__greeting {
        font-size: 1rem;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__subtitle {
        font-size: 1.2rem;
        min-height: 40px;
    }

    .hero__description {
        font-size: 1rem;
    }

    .hero__buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .hero__socials {
        justify-content: center;
    }

    .image-container {
        width: 280px;
        height: 280px;
    }

    .floating-card {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .floating-card svg {
        width: 30px;
        height: 30px;
    }

    .scroll-indicator {
        display: none;
    }

    /* About Section */
    .about__cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .info-card {
        padding: 1.8rem 1.5rem;
    }

    .info-card__content {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .education-item {
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .certificate-btn {
        margin-top: auto;
    }

    /* Projects Section - Tablet */
    .projects__filter {
        gap: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        min-width: 120px;
    }

    .filter-btn i {
        font-size: 1rem;
    }

    .projects__wrapper {
        gap: 1rem;
    }

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

    .project-card {
        height: 380px;
    }

    .project__image {
        height: 120px;
    }

    .project__icon {
        font-size: 2.5rem;
    }

    .project__content {
        padding: 1.2rem;
    }

    .project__title {
        font-size: 1.15rem;
    }

    .project__description {
        font-size: 0.85rem;
    }

    /* Deshabilitar animación de scroll en móvil */
    .project__tech {
        flex-wrap: wrap;
        padding-bottom: 0;
    }

    .project__tech::after {
        display: none;
    }

    .project-card:hover .project__tech-scroll {
        animation: none;
    }

    .tech-tag {
        font-size: 0.72rem;
    }

    /* Ajustar botones de overlay en móvil */
    .project__link {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .nav-arrow {
        width: 45px;
        height: 45px;
        min-width: 45px;
        font-size: 1.1rem;
    }

    /* Skills Section - Mobile Interactive */
    .skills__categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .skill-category {
        padding: 0;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        min-height: 160px;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        touch-action: manipulation;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100%;
    }

    .skill-category:active:not(.expanded) {
        transform: scale(0.95);
    }

    /* Efecto hover sutil */
    .skill-category:not(.expanded):hover {
        border-color: var(--color-blue-primary);
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
    }

    /* Efecto de pulso sutil para indicar interactividad */
    .skill-category::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 20px;
        border: 2px solid var(--color-blue-primary);
        opacity: 0;
        animation: pulseHint 3s ease-in-out infinite;
        pointer-events: none;
        z-index: 0;
    }

    @keyframes pulseHint {

        0%,
        100% {
            opacity: 0;
            transform: scale(1);
        }

        50% {
            opacity: 0.3;
            transform: scale(1.02);
        }
    }

    /* Efecto glow aleatorio para incentivar interacción */
    .skill-category.glow-hint {
        animation: glowPulse 2s ease-in-out 3;
    }

    @keyframes glowPulse {

        0%,
        100% {
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
        }

        50% {
            box-shadow: 0 8px 32px rgba(37, 99, 235, 0.5),
                0 0 60px rgba(37, 99, 235, 0.3),
                inset 0 0 20px rgba(37, 99, 235, 0.1);
            border-color: var(--color-blue-primary);
        }
    }

    /* Remover botón cerrar - se cierra tocando fuera */

    /* Desactivar pulso cuando está expandido */
    .skill-category.expanded::before {
        animation: none;
    }

    /* Estado expandido - Modal */
    .skill-category.expanded {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 500px;
        max-height: 85vh;
        aspect-ratio: unset;
        min-height: auto;
        z-index: 999;
        padding: 1.5rem;
        border-radius: 24px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
        animation: expandModal 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* Scrollbar personalizado para el modal */
    .skill-category.expanded::-webkit-scrollbar {
        width: 6px;
    }

    .skill-category.expanded::-webkit-scrollbar-track {
        background: rgba(37, 99, 235, 0.1);
        border-radius: 10px;
    }

    .skill-category.expanded::-webkit-scrollbar-thumb {
        background: var(--color-blue-primary);
        border-radius: 10px;
    }

    .skill-category.expanded::-webkit-scrollbar-thumb:hover {
        background: var(--color-blue-lighter);
    }

    @keyframes expandModal {
        from {
            opacity: 0.8;
            transform: translate(-50%, -50%) scale(0.8);
        }

        to {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }

    /* Overlay oscuro global - cubre toda la página */
    .skills-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.85);
        z-index: 998;
        opacity: 0;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        pointer-events: none;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .skills-modal-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Bloquear scroll en body cuando modal está abierto */
    body.modal-open {
        overflow: hidden !important;
        touch-action: none;
        -webkit-overflow-scrolling: auto;
    }

    /* Asegurar que el overlay cubra todo desde la parte superior */
    body.modal-open .skills-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .category__header {
        gap: 0.6rem;
        margin-bottom: 0;
        justify-content: center;
        align-items: center;
        transition: all 0.3s ease;
        flex-direction: column;
        text-align: center;
        padding: 0;
        width: 100%;
        flex-shrink: 0;
        display: flex;
        position: relative;
        z-index: 1;
    }

    .skill-category.expanded .category__header {
        justify-content: center;
        margin-bottom: 2rem;
        flex-direction: column;
        text-align: center;
        padding: 0;
        align-items: center;
        width: 100%;
        gap: 1rem;
    }

    .category__header i {
        font-size: 2.8rem;
        transition: all 0.3s ease;
        margin: 0;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        width: 100%;
    }

    .skill-category.expanded .category__header i {
        font-size: 3.5rem;
        margin: 0;
        width: auto;
        color: var(--color-blue-lighter);
    }

    .category__header h3 {
        font-size: 0.85rem;
        transition: all 0.3s ease;
        margin: 0;
        font-weight: 600;
        line-height: 1.3;
        max-width: 100%;
        word-wrap: break-word;
        text-align: center;
        padding: 0 0.5rem;
        width: 100%;
    }

    .skill-category.expanded .category__header h3 {
        font-size: 1.6rem;
        line-height: 1.4;
        width: auto;
        padding: 0;
        text-align: center;
        font-weight: 700;
        color: var(--color-text-primary);
        margin: 0;
    }

    .skills-grid {
        display: none;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        width: 100%;
    }

    .skill-category.expanded .skills-grid {
        display: grid;
        opacity: 0;
        animation: fadeInGrid 0.4s ease 0.2s forwards;
    }

    @keyframes fadeInGrid {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .skill-item {
        padding: 1rem 0.8rem;
        gap: 0.5rem;
        min-height: 70px;
    }

    .skill-item i,
    .skill-item img,
    .skill-item svg {
        font-size: 2rem;
        width: 35px;
        height: 35px;
    }

    .skill-item span {
        font-size: 0.85rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    /* Contact Section */
    .contact__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .contact__card-modern {
        padding: 2rem 1.5rem;
    }

    .contact__form {
        padding: 2rem;
    }

    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }

    .footer__content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .footer__left {
        max-width: 100%;
    }

    .footer__logo {
        font-size: 1.3rem;
        justify-content: center;
    }

    .footer__social {
        justify-content: center;
    }

    /* Back to Top */
    .back-to-top {
        width: 50px;
        height: 50px;
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

/* ========================================
   SMALL MOBILE - Max Width 480px
   ======================================== */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 3rem 0;
    }

    /* Skills Section - Pantallas pequeñas */
    .skills__categories {
        gap: 0.8rem;
    }

    .skill-category {
        padding: 0;
        min-height: 140px;
    }

    .category__header i {
        font-size: 2.3rem;
    }

    .category__header h3 {
        font-size: 0.8rem;
    }

    .skill-category.expanded::after {
        width: 32px;
        height: 32px;
        font-size: 1.3rem;
        top: 0.8rem;
        right: 0.8rem;
    }

    .section__header {
        margin-bottom: 2.5rem;
    }

    .section__title {
        font-size: 1.5rem;
    }

    .section__subtitle {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }

    /* Navigation */
    .nav__logo {
        font-size: 1.2rem;
    }

    .code-bracket {
        font-size: 1.4rem;
    }

    .nav__menu {
        width: 85%;
    }

    /* Hero Section */
    .hero {
        padding: 100px 0 2rem;
    }

    .hero__title {
        font-size: 1.7rem;
    }

    .hero__subtitle {
        font-size: 1rem;
    }

    .hero__description {
        font-size: 0.95rem;
    }

    .hero__socials {
        flex-wrap: wrap;
    }

    .social-link {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .image-container {
        width: 240px;
        height: 240px;
    }

    .floating-card {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .floating-card svg {
        width: 25px;
        height: 25px;
    }

    /* About Section - Mobile Interactive Modal */
    .about__cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .info-card {
        padding: 1rem;
        aspect-ratio: 1 / 1;
        min-height: 160px;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        cursor: pointer;
        transition: all 0.3s ease;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        touch-action: manipulation;
    }

    .info-card:active:not(.expanded) {
        transform: scale(0.95);
    }

    /* Mostrar solo icono y título en estado normal */
    .info-card:not(.expanded) .education-item,
    .info-card:not(.expanded) .info-list {
        display: none !important;
    }

    .info-card__icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
        transition: transform 0.3s ease;
    }

    .info-card:hover:not(.expanded) .info-card__icon {
        transform: scale(1.1);
    }

    .info-card__content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
    }

    .info-card:not(.expanded) .info-card__content {
        flex: 0 !important;
    }

    .info-card__content h3 {
        font-size: 0.9rem !important;
        margin: 0 !important;
        width: 100%;
        text-align: center;
        padding: 0 0.5rem;
        line-height: 1.3;
    }

    /* Estado expandido (modal) */
    .info-card.expanded {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important;
        max-width: 500px !important;
        max-height: 85vh !important;
        aspect-ratio: unset !important;
        min-height: auto !important;
        z-index: 999 !important;
        padding: 2rem 1.5rem !important;
        border-radius: 24px !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
        animation: expandModal 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        cursor: default !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    .info-card.expanded .education-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        opacity: 0;
        animation: fadeInContent 0.4s ease 0.2s forwards;
        width: 100%;
    }

    .info-card.expanded .info-list {
        display: flex !important;
        flex-direction: column !important;
        opacity: 0;
        animation: fadeInContent 0.4s ease 0.2s forwards;
        width: 100%;
    }

    @keyframes fadeInContent {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .info-card.expanded .info-card__content {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        align-items: center !important;
    }

    .info-card.expanded .info-card__icon {
        width: 70px !important;
        height: 70px !important;
        font-size: 2.2rem !important;
        margin-bottom: 1rem !important;
    }

    .info-card.expanded .info-card__content h3 {
        font-size: 1.4rem !important;
        margin-bottom: 1.5rem !important;
        text-align: center !important;
    }

    .info-card.expanded .education-item h4 {
        font-size: 1.1rem !important;
        text-align: center !important;
        color: var(--color-blue-lighter) !important;
        margin-bottom: 0.8rem !important;
    }

    .info-card.expanded .institution {
        font-size: 1rem !important;
        text-align: center !important;
        margin-bottom: 0.5rem !important;
        display: block !important;
    }

    .info-card.expanded .period {
        font-size: 0.85rem !important;
        padding: 0.3rem 0.8rem !important;
        display: inline-block !important;
        margin: 0 0 1rem 0 !important;
        background: rgba(37, 99, 235, 0.1) !important;
        border-radius: 8px !important;
    }

    .info-card.expanded .description {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1.5rem !important;
        text-align: center !important;
        display: block !important;
    }

    .info-card.expanded .certificate-btn {
        padding: 0.8rem 1.5rem !important;
        font-size: 0.95rem !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.6rem !important;
    }

    /* Scrollbar personalizado para modal expandido */
    .info-card.expanded::-webkit-scrollbar {
        width: 6px;
    }

    .info-card.expanded::-webkit-scrollbar-track {
        background: rgba(37, 99, 235, 0.1);
        border-radius: 10px;
    }

    .info-card.expanded::-webkit-scrollbar-thumb {
        background: var(--color-blue-primary);
        border-radius: 10px;
    }

    /* Overlay para bloquear fondo */
    .about-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.85);
        z-index: 998;
        opacity: 0;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        pointer-events: none;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .about-modal-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Bloquear scroll del body cuando modal está abierto */
    body.about-modal-open {
        overflow: hidden !important;
        touch-action: none;
        -webkit-overflow-scrolling: auto;
    }

    .info-list li {
        font-size: 0.9rem;
    }

    .education-item h4,
    .experience-item h4 {
        font-size: 1.1rem;
    }

    /* Projects Section - Grid 2x2 en móvil */
    .projects__filter {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .filter-btn {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 0.5rem;
    }

    .filter-btn i {
        display: inline-block;
        font-size: 1rem;
        margin-right: 0.3rem;
    }

    .projects__wrapper {
        gap: 0.8rem;
    }

    .project-card {
        height: 360px;
    }

    .project__image {
        height: 110px;
    }

    .project__icon {
        font-size: 2.3rem;
    }

    .project__content {
        padding: 1.1rem;
    }

    .project__title {
        font-size: 1.1rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .project__description {
        font-size: 0.82rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .tech-tag {
        font-size: 0.68rem;
        padding: 0.22rem 0.5rem;
    }

    /* Asegurar que no haya scroll en móvil pequeño */
    .project__tech {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    /* Reducir tamaño de botones en móvil pequeño */
    .project__overlay {
        padding: 0.6rem;
    }

    .project__link {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }

    .nav-arrow {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1rem;
        border-width: 1.5px;
    }

    .projects__dots {
        gap: 0.6rem;
        margin-top: 0.5rem;
    }

    .dot {
        width: 10px;
        height: 10px;
    }

    .dot.active {
        width: 24px;
    }

    /* Skills Section */
    .skill-category {
        padding: 1.5rem;
    }

    .category__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .category__header i {
        font-size: 1.5rem;
    }

    .category__header h3 {
        font-size: 1rem;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .skill-item {
        padding: 0.6rem;
    }

    .skill-item i,
    .skill-item img,
    .skill-item svg {
        font-size: 1.8rem;
        width: 30px;
        height: 30px;
    }

    .skill-item span {
        font-size: 0.8rem;
    }

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

    .stat-item {
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 2.2rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }

    /* Contact Section */
    .contact__grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .contact__card-modern {
        padding: 1.8rem 1.2rem;
    }

    .contact__icon-circle {
        width: 70px;
        height: 70px;
        font-size: 1.7rem;
    }

    .contact__title {
        font-size: 1.2rem;
    }

    .contact__value {
        font-size: 1rem;
    }

    .contact__actions {
        flex-direction: column;
    }

    .contact__copy-btn,
    .contact__whatsapp-btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
        width: 100%;
    }

    .copy-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
    }

    .copy-notification i {
        font-size: 1.1rem;
    }

    .contact__data h3 {
        font-size: 1.1rem;
    }

    .contact__data a,
    .contact__data p {
        font-size: 0.9rem;
    }

    .contact__social {
        justify-content: center;
    }

    .social-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .contact__form {
        padding: 1.5rem;
    }

    .form-group {
        margin-bottom: 1.2rem;
    }

    .form-group label {
        font-size: 0.95rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 0.95rem;
    }

    /* Footer */
    .footer__content {
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .footer__logo {
        font-size: 1.1rem;
    }

    .footer__text {
        font-size: 0.85rem;
    }

    .footer__social-link {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }

    .footer__copy {
        font-size: 0.8rem;
    }

    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.1rem;
    }
}

/* ========================================
   EXTRA SMALL MOBILE - Max Width 360px
   ======================================== */
@media screen and (max-width: 360px) {
    .container {
        padding: 0 0.8rem;
    }

    /* Skills Section - Pantallas extra pequeñas */
    .skills__categories {
        gap: 0.6rem;
    }

    .skill-category {
        padding: 0;
        min-height: 120px;
    }

    .category__header i {
        font-size: 2rem;
    }

    .category__header h3 {
        font-size: 0.75rem;
        line-height: 1.2;
    }

    .skill-category.expanded::after {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
        top: 0.6rem;
        right: 0.6rem;
    }

    .hero__title {
        font-size: 1.5rem;
    }

    .hero__subtitle {
        font-size: 0.9rem;
    }

    .image-container {
        width: 200px;
        height: 200px;
    }

    .floating-card {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .floating-card svg {
        width: 22px;
        height: 22px;
    }

    .section__title {
        font-size: 1.3rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    /* About Section - Extra Small */
    .about__cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-card {
        padding: 1.5rem 1rem;
    }

    .info-card__content h3 {
        font-size: 0.95rem;
    }

    .certificate-btn {
        padding: 0.6rem 0.9rem;
        font-size: 0.8rem;
    }

    .skill-category,
    .contact__form {
        padding: 1rem;
    }

    .project-card {
        height: 340px;
    }

    .project__image {
        height: 100px;
    }

    .project__icon {
        font-size: 2rem;
    }

    .project__content {
        padding: 1rem;
    }

    .project__title {
        font-size: 1.05rem;
    }

    .project__description {
        font-size: 0.8rem;
    }

    .tech-tag {
        font-size: 0.65rem;
        padding: 0.2rem 0.45rem;
    }

    .project__tech {
        gap: 0.25rem;
    }

    /* Filtro de proyectos compacto en pantallas muy pequeñas */
    .projects__filter {
        gap: 0.6rem;
    }

    .filter-btn {
        padding: 0.7rem 0.4rem;
        font-size: 0.85rem;
    }

    .filter-btn i {
        font-size: 0.9rem;
        margin-right: 0.2rem;
    }

    /* Botones aún más pequeños en pantallas extra pequeñas */
    .project__overlay {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .project__link {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
        min-width: 36px;
        min-height: 36px;
    }

    .projects__wrapper {
        gap: 0.5rem;
    }

    .nav-arrow {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 0.9rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Project Modal Responsive */
    .project-modal__container {
        width: 95%;
        max-height: 90vh;
        border-radius: 20px;
    }

    .project-modal__content {
        padding: 2rem 1.5rem;
    }

    .project-modal__icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }

    .project-modal__title {
        font-size: 1.5rem;
    }

    .project-modal__description {
        font-size: 0.95rem;
    }

    .project-modal__tech-item {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .project-modal__close {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        top: 0.8rem;
        right: 0.8rem;
    }

    .project-modal__technologies h4 {
        font-size: 1rem;
        justify-content: center;
    }
}

/* ========================================
   LANDSCAPE MODE FOR MOBILE
   ======================================== */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 100px 0 2rem;
    }

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

    .hero__text {
        order: 1;
        text-align: left;
    }

    .hero__image {
        order: 2;
    }

    .image-container {
        width: 200px;
        height: 200px;
    }

    .floating-card {
        display: none;
    }

    .hero__title {
        font-size: 1.5rem;
    }

    .hero__subtitle {
        font-size: 1rem;
        min-height: auto;
    }

    .hero__description {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .hero__buttons {
        flex-direction: row;
        gap: 1rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }

    .social-link {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .scroll-indicator {
        display: none;
    }

    .section {
        padding: 3rem 0;
    }
}

/* ========================================
   HIGH RESOLUTION DISPLAYS
   ======================================== */
@media screen and (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .section__title {
        font-size: 3rem;
    }

    .hero__title {
        font-size: 4rem;
    }

    .hero__subtitle {
        font-size: 2rem;
    }

    .image-container {
        width: 450px;
        height: 450px;
    }
}

/* ========================================
   DARK MODE ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .particles-bg::before,
    .particles-bg::after {
        animation: none;
    }

    .image-blob,
    .profile-img {
        animation: none;
    }

    .floating-card {
        animation: none;
    }

    .wheel {
        animation: none;
    }

    .cursor {
        animation: none;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {

    .header,
    .nav__toggle,
    .scroll-indicator,
    .back-to-top,
    .particles-bg,
    .floating-card {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .section {
        page-break-inside: avoid;
    }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================== */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets for mobile */
    .nav__link {
        padding: 0.5rem 0;
    }

    .btn {
        min-height: 48px;
    }

    .social-link,
    .social-btn,
    .nav-arrow {
        min-width: 48px;
        min-height: 48px;
    }

    .filter-btn {
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover::before {
        display: none;
    }

    .project__overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.6);
    }

    /* Modal optimizations for touch */
    .project-modal__close {
        min-width: 44px;
        min-height: 44px;
    }

    .project-modal__tech-item:hover {
        transform: none;
    }

    .project-modal__close:hover {
        transform: none;
    }

    .project-modal__close:active {
        transform: scale(0.95);
    }
}