.animated-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: conic-gradient(from 180deg at 50% 70%,hsla(0,0%,98%,1) 0deg,
    #eec32d 72.0000010728836deg,
    #ec4b4b 144.0000021457672deg,
    #709ab9 216.00000858306885deg,
    #4dffbf 288.0000042915344deg,
    hsla(0,0%,98%,1) 1turn);
    width: 100%;
    height: 100%;
    mask:
    radial-gradient(circle at 50% 50%, white 2px, transparent 2.5px) 50% 50% / 20px 20px,
    url("https://assets.codepen.io/605876/noise-mask.png") 256px 50% / 256px 256px;
    mask-composite: intersect;
    animation: bg-flicker 20s infinite linear;
}

@keyframes bg-flicker {
    to {
    mask-position: 50% 50%, 0 50%;
    }
}

body {
    margin: 2vw 15.5vw; /* Scales with screen width instead of being fixed */
    margin-top: 2%;
    background: #262626 !important;
    color: white;
}
.contact {
    font-size: clamp(2rem, 6vw, 75px);
    font-family: Barlow;
}
.me {
    border-radius: 50%;
    width: clamp(120px, 20vw, 200px);
    height: auto;
    width: 200px;
}
.header-name-and-image {
    display: flex;
    flex-wrap: wrap; /* allows wrapping on mobile */
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
}
.title-line {
    display: inline-flex; 
    gap: 20px; 
}
.project-image {
    width: auto; 
    height: 200px;
    display: flex; 
    gap: 10px; 
    justify-content: center;
    margin-bottom: 2%;
    border-radius: 10px;
}
.sub-section {
    margin-top: 2%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.social-icons {
    text-align: center;
    margin-top: 2%;
}
.social-icons i {
    font-size: 1.5rem;
}
h1 {
    font-family: "Press Start 2P", monospace;
    word-break: break-word;
}
p{
    font-family: "Barlow", sans-serif;
    font-size: clamp(1rem, 2vw, 25px);
    line-height: 1.6;
    font-weight: bold;
}
.nes-container.with-title > .title {
    font-size: 1.25rem !important;
    font-family: "Press Start 2P", monospace;
    word-break: break-word;

}
.divider{
    width: 2px;
    height: 50px;
    background: white;
}
.projects-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.projects {
    flex: 1 1 33.333%;
    box-sizing: border-box;
}

/* Stack projects and adjust spacing on medium screens */
@media (max-width: 1200px) {
  .projects-container {
    flex-direction: column;
  }

  .nes-container.with-title {
    margin-bottom: 2%;
  }
}

/* Adjust margins and readability for small screens */
@media (max-width: 768px) {
    body {
        margin: 3vw;
    }

    .header-name-and-image {
        flex-direction: column;
    }

    .title-line {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .project-image {
        flex-direction: column;
        align-items: center;
        height: auto;
    }

    .project-image img {
        width: 100%;
        height: auto;
        max-width: 400px;
    }
    .divider {
        display: none;
    }
    .title-line{
        gap: 1px;
    }
}