 :root {
            --celeste: #87CEEB;
            --celeste-claro: #E6F7FF;
            --morado: #8B79F4;
            --morado-fuerte: #6841D9;
            --morado-oscuro: #49318D;
            --blanco: #FFFFFF;
            --texto: #294B8C;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            scroll-behavior: smooth;
        }

        body {
            font-family: "Segoe UI", Arial, sans-serif;
            color: var(--texto);
            background: var(--blanco);
            line-height: 1.7;
            transition: background 0.4s, color 0.4s;
        }

        a {
            text-decoration: none;
            color: inherit;
        }

        img, video {
            max-width: 100%;
            display: block;
        }

        section {
            padding: 70px 8%;
            scroll-margin-top: 75px;
        }

        h2 {
            color: var(--morado-oscuro);
            font-size: 2.2rem;
            margin-bottom: 15px;
        }

        @keyframes entradaSuave {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes entrarIzquierda {
            from { opacity: 0; transform: translateX(-45px); }
            to { opacity: 1; transform: translateX(0); }
        }

        @keyframes entrarDerecha {
            from { opacity: 0; transform: translateX(45px); }
            to { opacity: 1; transform: translateX(0); }
        }

        @keyframes flotarEstrella {
            0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
            50% { transform: translateY(-15px) rotate(12deg) scale(1.15); }
        }

        @keyframes brilloEstrella {
            0%, 100% { filter: drop-shadow(0 0 2px #6841D9); }
            50% { filter: drop-shadow(0 0 9px #6841D9); }
        }

        @keyframes pulso {
            0%, 100% { box-shadow: 0 5px 15px #6841D944; }
            50% { box-shadow: 0 5px 25px #6841D988; }
        }

        /* ENCABEZADO Y MENÚ */
        header {
            position: sticky;
            top: 0;
            z-index: 1000;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 18px 7%;
            background: rgba(255, 255, 255, 0.97);
            border-bottom: 2px solid var(--celeste-claro);
            box-shadow: 0 3px 15px #0000000d;
            animation: entradaSuave 0.8s ease both;
            transition: background 0.4s, border 0.4s;
        }

        .logo {
            font-size: 1.5rem;
            font-weight: bold;
            color: var(--morado-oscuro);
        }

        .logo i { color: var(--morado-fuerte); }

        nav {
            display: flex;
            gap: 25px;
            align-items: center;
        }

        nav a {
            font-weight: bold;
            transition: color 0.3s, transform 0.3s;
        }

        nav a:hover {
            color: var(--morado-fuerte);
            transform: translateY(-2px);
        }

        .menu-toggle {
            display: none;
            border: none;
            background: none;
            color: var(--morado-fuerte);
            font-size: 1.5rem;
            cursor: pointer;
        }

        /* BOTÓN MODO OSCURO Y CLARO */
        .boton-tema {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 9px 16px;
            border: 2px solid var(--morado-fuerte);
            border-radius: 25px;
            background: var(--morado-fuerte);
            color: white;
            font-size: 0.9rem;
            font-weight: bold;
            cursor: pointer;
            transition: 0.3s;
        }

        .boton-tema:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px #6841D955;
        }

        /* NUEVO REPRODUCTOR DE MÚSICA */
        .contenedor-musica {
            position: relative;
        }

        .boton-musica {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 9px 16px;
            border: 2px solid var(--celeste);
            border-radius: 25px;
            background: linear-gradient(135deg, #87CEEB, #8B79F4);
            color: white;
            font-size: 0.9rem;
            font-weight: bold;
            cursor: pointer;
            transition: 0.3s;
        }

        .boton-musica:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px #87CEEB77;
        }

        .panel-musica {
            display: none;
            position: absolute;
            top: calc(100% + 12px);
            right: 0;
            width: 290px;
            padding: 20px;
            background: white;
            color: #49318D;
            border: 2px solid #E5DCFF;
            border-radius: 18px;
            box-shadow: 0 8px 30px #00000025;
            z-index: 5000;
            animation: entradaSuave 0.3s ease;
        }

        .panel-musica.activo {
            display: block;
        }

        .panel-musica h3 {
            color: #6841D9;
            margin-bottom: 12px;
        }

        .explicacion-musica {
            padding: 12px;
            background: #F0EBFF;
            border-radius: 12px;
            font-size: 0.85rem;
            margin-bottom: 15px;
            color: #49318D;
        }

        .explicacion-musica button {
            margin-top: 10px;
            padding: 7px 14px;
            border: none;
            border-radius: 20px;
            color: white;
            background: #8B79F4;
            cursor: pointer;
        }

        .panel-musica label {
            display: block;
            font-size: 0.9rem;
            margin-bottom: 5px;
            font-weight: bold;
        }

        .panel-musica select {
            width: 100%;
            padding: 10px;
            border: 1px solid #C9B9F5;
            border-radius: 10px;
            background: #FAF8FF;
            color: #49318D;
            margin-bottom: 12px;
        }

        .controles-musica {
            display: flex;
            gap: 8px;
        }

        .controles-musica button {
            flex: 1;
            padding: 10px 5px;
            border: none;
            border-radius: 10px;
            color: white;
            cursor: pointer;
            font-weight: bold;
            background: #8B79F4;
            transition: 0.3s;
        }

        .controles-musica button:hover {
            transform: translateY(-2px);
        }

        .controles-musica button:last-child {
            background: #73BFE0;
        }

        .estado-musica {
            text-align: center;
            font-size: 0.8rem;
            color: #6841D9;
            margin-top: 12px;
        }

        body.modo-oscuro .panel-musica {
            background: #25243A;
            color: #E3DFFF;
            border-color: #554A79;
        }

        body.modo-oscuro .explicacion-musica {
            background: #393052;
            color: #E3DFFF;
        }

        body.modo-oscuro .panel-musica h3,
        body.modo-oscuro .estado-musica {
            color: #C5B5FF;
        }

        body.modo-oscuro .panel-musica select {
            background: #191827;
            color: white;
            border-color: #554A79;
        }

        /* BOTONES INTERACTIVOS */
        .boton {
            display: inline-block;
            padding: 12px 28px;
            margin-top: 15px;
            background: linear-gradient(135deg, var(--morado), var(--morado-fuerte));
            color: white;
            border: none;
            border-radius: 30px;
            font-size: 1rem;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 5px 15px #6841D944;
            transition: transform 0.3s, box-shadow 0.3s;
        }

        .boton:hover {
            transform: translateY(-4px) scale(1.04);
            box-shadow: 0 9px 24px #6841D977;
        }

        .boton:active { transform: scale(0.96); }

        /* PORTADA */
        .portada {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 40px;
            align-items: center;
            min-height: 520px;
            background:
                radial-gradient(circle at 90% 15%, #D9CCFF 0 10%, transparent 11%),
                linear-gradient(125deg, var(--celeste-claro), white, #E6DDFF);
        }

        .portada-texto { animation: entrarIzquierda 1s ease both; }

        .etiqueta, .subtitulo {
            display: inline-block;
            color: var(--morado-fuerte);
            font-weight: bold;
            margin-bottom: 10px;
        }

        .portada h1 {
            font-size: clamp(2.8rem, 5vw, 4.5rem);
            line-height: 1.15;
            color: var(--morado-oscuro);
            margin: 10px 0;
        }

        .portada h2 { font-size: 1.5rem; }

        .portada-texto p {
            max-width: 480px;
            margin-top: 15px;
        }

        .portada-imagen {
            min-height: 330px;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
            overflow: hidden;
            border-radius: 45% 55% 40% 60%;
            background: linear-gradient(140deg, var(--celeste), #C8B8FF);
            animation: entrarDerecha 1s ease both;
        }

        .portada-imagen img {
            width: 100%;
            height: 350px;
            object-fit: contain;
        }

        /* ESTRELLAS */
        .estrella {
            position: absolute;
            color: var(--morado-fuerte);
            font-size: 2rem;
            animation:
                flotarEstrella 3s ease-in-out infinite,
                brilloEstrella 2.5s ease-in-out infinite;
        }

        .estrella-1 { top: 12%; left: 10%; }
        .estrella-2 { right: 10%; bottom: 15%; animation-delay: 0.7s; }

        .estrella-3 {
            top: 45%;
            right: 5%;
            font-size: 1.3rem;
            animation-delay: 1.2s;
        }

        /* ESTRELLAS DEL MOUSE */
        .estrella-mouse {
            position: fixed;
            pointer-events: none;
            z-index: 9999;
            color: var(--morado-fuerte);
            text-shadow: 0 0 6px #8B79F4;
            transform: translate(-50%, -50%);
            animation: desaparecerEstrella 0.8s ease-out forwards;
        }

        @keyframes desaparecerEstrella {
            0% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
            50% { opacity: 0.8; transform: translate(-50%, -80%) scale(1.3) rotate(90deg); }
            100% { opacity: 0; transform: translate(-50%, -130%) scale(0.2) rotate(180deg); }
        }

        /* SOBRE MÍ */
        .sobre-mi {
            display: grid;
            grid-template-columns: 1.2fr 0.8fr;
            gap: 45px;
            align-items: center;
        }

        .sobre-mi p { margin-bottom: 15px; }

        .sobre-icono {
            min-height: 230px;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
            background: var(--celeste-claro);
            border-radius: 25px;
        }

        .sobre-icono .icono-principal {
            color: var(--morado-fuerte);
            font-size: 7rem;
        }

        .sobre-icono .decoracion {
            position: absolute;
            top: 15%;
            right: 15%;
            color: var(--morado-fuerte);
            font-size: 2rem;
            animation: flotarEstrella 3s infinite ease-in-out;
        }

        /* TÍTULOS */
        .titulo-seccion {
            max-width: 700px;
            text-align: center;
            margin: 0 auto 35px;
        }

        .titulo-seccion p { margin-top: 10px; }

        /* VIDEO */
        .video-seccion {
            background: linear-gradient(180deg, var(--celeste-claro), #F3EDFF);
        }

        .video-contenedor {
            max-width: 850px;
            margin: auto;
            padding: 5px;
            background: white;
            border-radius: 16px;
            box-shadow: 0 10px 30px #2D3C7820;
            animation: entradaSuave 1s ease both;
        }

        .video-contenedor video {
            width: 100%;
            aspect-ratio: 16 / 9;
            background: #172A50;
            border-radius: 10px;
        }

        .nota-video {
            text-align: center;
            margin-top: 15px;
            font-size: 0.9rem;
        }

        /* GALERÍA DE PROYECTOS ORIGINAL */
        .galeria {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 25px;
        }

        .tarjeta {
            overflow: hidden;
            border: 2px solid #E7E2FF;
            border-radius: 18px;
            background: white;
            box-shadow: 0 5px 20px #46509614;
            animation: entradaSuave 0.8s ease both;
            transition: transform 0.3s, box-shadow 0.3s;
        }

        .tarjeta:hover {
            transform: translateY(-8px) scale(1.02);
            box-shadow: 0 12px 25px #6841D933;
        }

        .tarjeta img {
            width: 100%;
            aspect-ratio: 4 / 3;
            object-fit: cover;
            background: linear-gradient(135deg, var(--celeste-claro), #E4DCFF);
        }

        .tarjeta-texto { padding: 18px; }

        .tarjeta h3 {
            color: var(--morado-oscuro);
            margin-bottom: 5px;
        }

        .tarjeta:nth-child(2) { animation-delay: 0.15s; }
        .tarjeta:nth-child(3) { animation-delay: 0.3s; }

        /* NUEVO CARRUSEL DE IMÁGENES */
        .carrusel-proyectos {
            margin-top: 50px;
            overflow: hidden;
            padding: 20px 0;
            border-radius: 18px;
            background: linear-gradient(120deg, var(--celeste-claro), #F3EDFF);
        }

        .carrusel-titulo {
            text-align: center;
            margin-bottom: 20px;
            color: var(--morado-oscuro);
        }

        .carrusel-ventana {
            width: 100%;
            overflow: hidden;
            cursor: grab;
        }

        .carrusel-ventana:active { cursor: grabbing; }

        .carrusel-pista {
            display: flex;
            width: max-content;
            gap: 20px;
            padding: 10px 20px;
            transition: transform 0.6s ease;
        }

        .carrusel-item {
            flex: 0 0 260px;
            height: 190px;
            overflow: hidden;
            border-radius: 16px;
            border: 3px solid white;
            box-shadow: 0 5px 18px #6841D933;
            transition: transform 0.4s, box-shadow 0.4s;
        }

        .carrusel-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s;
        }

        .carrusel-item:hover {
            transform: translateY(-8px) scale(1.04);
            box-shadow: 0 12px 25px #6841D966;
        }

        .carrusel-item:hover img { transform: scale(1.12); }

        .carrusel-indicacion {
            text-align: center;
            margin-top: 15px;
            font-size: 0.9rem;
        }

        /* MODO OSCURO DEL CARRUSEL */
        body.modo-oscuro .carrusel-proyectos {
            background: linear-gradient(120deg, #20283B, #302747);
        }

        body.modo-oscuro .carrusel-item { border-color: #494064; }

        /* VISOR DE IMÁGENES AGREGADO */
        .visor-imagen {
            position: fixed;
            inset: 0;
            z-index: 20000;
            display: none;
            justify-content: center;
            align-items: center;
            padding: 30px;
            background: rgba(12, 10, 25, 0.94);
            backdrop-filter: blur(8px);
        }

        .visor-imagen.activo {
            display: flex;
            animation: aparecerVisor 0.3s ease;
        }

        .visor-imagen img {
            max-width: 85%;
            max-height: 85vh;
            width: auto;
            height: auto;
            object-fit: contain;
            border: 4px solid white;
            border-radius: 15px;
            box-shadow: 0 0 30px #8B79F4;
            animation: agrandarImagen 0.4s ease;
        }

        .boton-cerrar-visor {
            position: absolute;
            top: 25px;
            right: 35px;
            z-index: 20002;
            border: none;
            background: #8B79F4;
            color: white;
            width: 45px;
            height: 45px;
            border-radius: 50%;
            font-size: 25px;
            cursor: pointer;
            transition: 0.3s;
        }

        .boton-cerrar-visor:hover {
            transform: rotate(90deg) scale(1.15);
            background: #6841D9;
        }

        @keyframes aparecerVisor {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        @keyframes agrandarImagen {
            from {
                transform: scale(0.5);
                opacity: 0;
            }
            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        /* EXPLOSIÓN DE ESTRELLAS */
        .estrella-explosion {
            position: fixed;
            z-index: 20001;
            pointer-events: none;
            color: #B69AFF;
            text-shadow: 0 0 10px #B69AFF, 0 0 18px #87CEEB;
            animation: explosionEstrellas 0.9s ease-out forwards;
        }

        @keyframes explosionEstrellas {
            0% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
            }
            60% {
                opacity: 1;
                transform: translate(
                    calc(-50% + var(--mov-x)),
                    calc(-50% + var(--mov-y))
                ) scale(1.5) rotate(180deg);
            }
            100% {
                opacity: 0;
                transform: translate(
                    calc(-50% + var(--mov-x)),
                    calc(-50% + var(--mov-y))
                ) scale(0) rotate(360deg);
            }
        }

        /* LLUVIA DE ESTRELLAS */
        .estrella-lluvia {
            position: fixed;
            top: -30px;
            z-index: 20001;
            pointer-events: none;
            color: #B69AFF;
            text-shadow: 0 0 10px #B69AFF, 0 0 18px #87CEEB;
            animation: caerEstrella linear forwards;
        }

        @keyframes caerEstrella {
            0% {
                opacity: 0;
                transform: translateY(0) rotate(0deg) scale(0.5);
            }
            15% { opacity: 1; }
            100% {
                opacity: 0;
                transform: translateY(105vh) rotate(360deg) scale(1.2);
            }
        }

        #proyectos img { cursor: zoom-in; }

        /* CONTACTO */
        .contacto {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 45px;
            align-items: start;
            background: linear-gradient(120deg, #E4F7FF, #F0EBFF);
        }

        .contacto-info p { margin-bottom: 20px; }

        /* REDES SOCIALES */
        .redes-sociales {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-top: 25px;
        }

        .redes-sociales a {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: var(--morado-fuerte);
            color: white;
            font-size: 1.35rem;
            box-shadow: 0 4px 12px #6841D933;
            transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
        }

        .redes-sociales a:hover {
            transform: translateY(-5px) rotate(-5deg) scale(1.12);
            background: var(--morado-oscuro);
            box-shadow: 0 7px 18px #6841D966;
        }

        /* FORMULARIO */
        .formulario {
            display: flex;
            flex-direction: column;
            gap: 10px;
            padding: 28px;
            border-radius: 18px;
            background: white;
            box-shadow: 0 8px 25px #46509617;
            animation: entradaSuave 1s ease both;
        }

        .formulario label { font-weight: bold; }

        .formulario input,
        .formulario textarea {
            width: 100%;
            padding: 13px;
            border: 1px solid #C9C5F7;
            border-radius: 9px;
            font: inherit;
            color: var(--texto);
            background: #FCFCFF;
        }

        .formulario input:focus,
        .formulario textarea:focus {
            outline: 2px solid var(--celeste);
            border-color: var(--morado-fuerte);
        }

        .formulario textarea { resize: vertical; }
        .formulario .boton { align-self: flex-start; }

        #respuesta-formulario {
            color: var(--morado-oscuro);
            font-size: 0.95rem;
        }

        /* PIE DE PÁGINA */
        footer {
            padding: 25px 15px;
            text-align: center;
            background: var(--morado-oscuro);
            color: white;
            font-size: 0.9rem;
        }

        /* MODO OSCURO */
        body.modo-oscuro {
            --blanco: #171522;
            --texto: #E3DFFF;
            --celeste-claro: #25243A;
            --morado-oscuro: #C5B5FF;
        }

        body.modo-oscuro {
            background: #171522;
            color: #E3DFFF;
        }

        body.modo-oscuro header {
            background: rgba(28, 25, 43, 0.97);
            border-bottom-color: #393251;
        }

        body.modo-oscuro .logo,
        body.modo-oscuro h2,
        body.modo-oscuro .portada h1,
        body.modo-oscuro .tarjeta h3 {
            color: #D3C7FF;
        }

        body.modo-oscuro nav a { color: #E3DFFF; }
        body.modo-oscuro nav a:hover { color: #B5A2FF; }

        body.modo-oscuro .portada {
            background:
                radial-gradient(circle at 90% 15%, #393052 0 10%, transparent 11%),
                linear-gradient(125deg, #20283B, #211D34, #302747);
        }

        body.modo-oscuro .portada-imagen {
            background: linear-gradient(140deg, #38546C, #514078);
        }

        body.modo-oscuro .sobre-icono { background: #25243A; }

        body.modo-oscuro .video-seccion {
            background: linear-gradient(180deg, #20283B, #28213A);
        }

        body.modo-oscuro .video-contenedor { background: #25243A; }

        body.modo-oscuro .tarjeta {
            background: #25243A;
            border-color: #494064;
            box-shadow: 0 5px 20px #00000040;
        }

        body.modo-oscuro .tarjeta-texto p { color: #D5D0E9; }

        body.modo-oscuro .contacto {
            background: linear-gradient(120deg, #20283B, #302747);
        }

        body.modo-oscuro .formulario {
            background: #25243A;
            box-shadow: 0 8px 25px #00000040;
        }

        body.modo-oscuro .formulario label { color: #E3DFFF; }

        body.modo-oscuro .formulario input,
        body.modo-oscuro .formulario textarea {
            color: #FFFFFF;
            background: #191827;
            border-color: #554A79;
        }

        body.modo-oscuro .formulario input::placeholder,
        body.modo-oscuro .formulario textarea::placeholder {
            color: #AAA2C2;
        }

        body.modo-oscuro #respuesta-formulario { color: #C5B5FF; }

        body.modo-oscuro footer { background: #100F1B; }

        body.modo-oscuro .boton-tema {
            background: #E7DFFF;
            color: #49318D;
            border-color: #E7DFFF;
        }

        /* RESPONSIVE */
        @media (max-width: 800px) {
            section { padding: 50px 6%; }

            .menu-toggle { display: block; }

            nav {
                display: none;
                position: absolute;
                top: 100%;
                left: 0;
                width: 100%;
                padding: 20px;
                flex-direction: column;
                gap: 18px;
                background: white;
                box-shadow: 0 8px 15px #4650961a;
            }

            body.modo-oscuro nav { background: #25243A; }
            nav.activo { display: flex; }

            .portada {
                grid-template-columns: 1fr;
                text-align: center;
            }

            .portada-texto p {
                margin-left: auto;
                margin-right: auto;
            }

            .portada-imagen { min-height: 250px; }
            .portada-imagen img { height: 300px; }

            .sobre-mi { grid-template-columns: 1fr; }

            .galeria { grid-template-columns: repeat(2, minmax(0, 1fr)); }

            .contacto { grid-template-columns: 1fr; }
        }

        @media (max-width: 520px) {
            header { padding: 15px 5%; }
            .logo { font-size: 1.3rem; }

            .boton-tema,
            .boton-musica {
                padding: 8px 10px;
                font-size: 0.8rem;
                gap: 5px;
            }

            .panel-musica {
                right: -45px;
                width: min(290px, calc(100vw - 20px));
            }

            .galeria { grid-template-columns: 1fr; }
            .portada h1 { font-size: 2.7rem; }
            h2 { font-size: 1.8rem; }
            .formulario { padding: 20px; }

            .carrusel-item {
                flex-basis: 220px;
                height: 160px;
            }

            .visor-imagen img {
                max-width: 95%;
                max-height: 75vh;
            }

            .boton-cerrar-visor {
                top: 15px;
                right: 15px;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation: none !important;
                scroll-behavior: auto !important;
                transition: none !important;
            }
        }