@import url('https://fonts.cdnfonts.com/css/milkyway-2');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    position: relative;
    margin: 20px auto 0;
    width: 90%;
    max-width: 600px;
    z-index: 99;
    padding: 0 5px;
}

.container h1 {
    font-size: clamp(2rem, 8vw, 4rem);
    font-family: 'Milkyway', sans-serif;
    text-align: center;
    color: #ffffff;
    -webkit-text-stroke: 1px #000000;
    text-stroke: 1px #b4851f;
}

.animatedBackground {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgb(0, 128, 0);
    z-index: 1;
}

.animatedBackground::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to left, #ffffff63, #ffffff33);
}

.squares {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.squares li {
    list-style: none;
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    animation: goingUp 25s linear infinite;
    bottom: -150px;
}

.squares li:nth-child(1) {
    left: 5%;
    width: 60px;
    height: 60px;
    animation-delay: 2s;
    animation-duration: 25s;
}

.squares li:nth-child(2) {
    left: 10%;
    width: 20px;
    height: 20px;
    animation-delay: 1s;
    animation-duration: 35s;
}

.squares li:nth-child(3) {
    left: 20%;
    width: 19px;
    height: 19px;
    animation-delay: 3s;
    animation-duration: 18s;
}

.squares li:nth-child(4) {
    left: 25%;
    width: 50px;
    height: 50px;
    animation-delay: 2s;
    animation-duration: 22s;
}

.squares li:nth-child(5) {
    left: 35%;
    width: 80px;
    height: 80px;
    animation-delay: 5s;
    animation-duration: 29s;
}

.squares li:nth-child(6) {
    left: 40%;
    width: 40px;
    height: 40px;
    animation-delay: 0s;
    animation-duration: 15s;
}

.squares li:nth-child(7) {
    left: 50%;
    width: 25px;
    height: 25px;
    animation-delay: 2s;
    animation-duration: 17s;
}

.squares li:nth-child(8) {
    left: 65%;
    width: 20px;
    height: 20px;
    animation-delay: 6s;
    animation-duration: 17s;
}

.squares li:nth-child(9) {
    left: 70%;
    width: 30px;
    height: 30px;
    animation-delay: 3s;
    animation-duration: 30s;
}

.squares li:nth-child(10) {
    left: 75%;
    width: 70px;
    height: 70px;
    animation-delay: 4s;
    animation-duration: 45s;
}

.squares li:nth-child(11) {
    left: 85%;
    width: 90px;
    height: 90px;
    animation-delay: 5s;
    animation-duration: 19s;
}

.box {
    background-color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(10px);
    width: 90%;
    max-width: 600px;
    min-height: 350px;
    transition: transform .2s;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.11);
    border-radius: 15px;
    margin: 280px auto 50px;
    margin-bottom: 20px;
    margin-top: 60px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.box img {
    position: absolute;
    top: 20px;
    left: 90%;
    transform: translateX(-50%);
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    width: 120px;
    height: 120px;
    margin-right: auto;
    object-fit: cover;
    object-position: center bottom;
    background-color: #fff;
}

.box  img:hover {
    transform: translateX(-50%) scale(1.05);
    transition: transform 0.3s ease;
}

.box:nth-child(3) img {
    top: 15px;
    width: 150px;
    height: 300px;
    margin-right: 20px;
}

.content {
    padding: clamp(20px, 5vw, 40px);
    text-align: center;
}

.content h2 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 20px;
    color: #0f0f0f;
}

.content p {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    line-height: 1.6;
    color: #292929;
    text-align: justify;
}

.box:hover {
  -ms-transform: scale(0.3); /* IE 9 */
  -webkit-transform: scale(1.03); /* Safari 3-8 */
  transform: scale(1.03); 
}

@keyframes goingUp {
    0% {
        transform: translateY(0) rotate(0);
        opacity: 1;
        border-radius: 0;
    }
    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
        border-radius: 50%;
    }
}

/* Media queries para mejor control en diferentes dispositivos */
@media (max-width: 768px) {
    .container {
        top: 10%;
    }

    .box {
        margin-bottom: 20px;
        margin-top: 60px;
        width: 92%;
    }

    .squares li {
        opacity: 0.5;
    }

    /* Reducir tamaños en móviles para mejor rendimiento */
    .squares li:nth-child(5),
    .squares li:nth-child(10),
    .squares li:nth-child(11) {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .container {
        top: 8%;
    }

    .box {
        margin-bottom: 20px;
        margin-top: 60px;
        border-radius: 10px;
    }

    .content p {
        text-align: left;
    }
}

@media (min-width: 1200px) {
    .box {
        margin-bottom: 20px;
        margin-top: 60px;
    }
}