:root {
  --button-color: rgb(87, 109, 111);
  --button-color-text: rgb(160, 242, 230);
  --button-hover-color: rgb(57,162,152);
  --button-hover-color-text: rgb(16, 69, 64);
  --background-color: rgb(17, 89, 78);
  --transparency-background-color: rgba(128, 128, 128, 0.375);
  --shadow-color: #88fff97e
}

.home-introduction,
.portfolio {
    background: linear-gradient(160deg, rgba(208, 253, 255, 0.05), rgba(255, 238, 213, 0.05));
    margin: 2rem 3rem;
    border-bottom: 1px solid rgb(160, 242, 230);
    border-right: 1px solid rgb(160, 242, 230);
    border-top: 1px solid white;
    border-left: 1px solid white;
    box-shadow: 5px 5px rgb(143, 153, 179);
}

.logo {
    height: clamp(35px, 2vw, 40px);
    width: clamp(35px, 2vw, 40px);
}

.headerContainer {
    display:flex;
    align-items: center;
    padding: 10px;
    background-color: rgb(17, 89, 78, 0.5);
    justify-content: space-between;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Section */

.billboard {
    background-color: rgb(57, 162, 152, 0.1);
    color: white;
    padding: 200px 20px;
    text-align: center;
    position: relative;
}

.billboard h1 {
    font-weight: bold;
    text-transform: uppercase;
    font-size: clamp(2.5rem, 10vw, 4rem);
    margin-bottom: 20px;
}

.billboard p {
    color: white;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.billboardContent {
    max-width: 800px;
    margin: auto;
    z-index: 1;
    position: relative;
}

.billboardContent a {
    padding: 5px;
    color: black;
    text-decoration: none;
}

.aboutMe {
    background-color: var(--transparency-background-color);
    color: white;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2,1fr);
    align-items: center;
    grid-gap: 1em;
}

.aboutMe .grid-left {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profileFrame {
    position: relative;
    width: 260px;
    height: 260px;
    background: #596779;
    border-bottom: 2px solid rgb(160, 242, 230);
    border-right: 2px solid rgb(160, 242, 230);
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center; 
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 20px #88fff97e;
}

.profileFrame::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(180deg, rgb(59, 99, 130), rgb(138, 255, 243));
  animation: rotBGimg 3s linear infinite;
  transition: all 0.2s linear;
}

@keyframes rotBGimg {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.profileFrame::after {
    content: '';
    position: absolute;
    inset: 10px;
    background: #07182E;
    border-radius: 50%; 
}  

.profile {
    position: relative;
    z-index: 2;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border-radius: 50%;
    overflow: hidden;
}

.profile img {
    width: 100%;
    height: 100%;
}

.chat-box{
    position:absolute;
    top:225px;
    border-bottom: 2px solid rgb(160, 242, 230);
    border-right: 2px solid rgb(160, 242, 230);
    border-top: 2px solid white;
    border-left: 2px solid white;
    background: linear-gradient(160deg, rgba(208, 253, 255, 0.4), rgba(255, 238, 213, 0.4));
    backdrop-filter:blur(6px);
    font-weight: 600;
    
    padding:10px 14px;
    border-radius:8px;

    max-width:220px;

    box-shadow:0 0 10px rgba(160,242,230,0.2);
    z-index: 2;
}

.chat-box p {
    display: inline;
    text-shadow: 2px 2px 1px var(--button-hover-color-text);
}

.introduction {
    position: relative;
    max-width: 600px;
}

.introduction h1{
    font-size: clamp(1.2rem, 2vw, 2rem);
    margin-block-start: 0px;
    margin-block-end: 0.2em;
}

.introduction p {
    color: gainsboro;
    font-size: clamp(0.9rem, 2vw, 1rem);
    margin-block-start: 0.4em;
    margin-block-end: 0.4em;
}

@media (max-width: 768px) {
    .aboutMe{
        grid-template-columns: 1fr;
        padding: 20px;
    } 
    .profile {
        width: 250px;
        height: 250px;
        margin: 0 auto;
    }
    .introduction {
        max-width: 100%;
    }
}

.skill-container {
    max-width: 560px;
    padding: clamp(5px, 1.5vw, 7px) clamp(6px, 1.5vw, 9px);
    background-color: #07182e42;
    box-shadow: #fff 0 1px 1px;
    border-radius: 10px;
    display:flex;
    flex-wrap:wrap;
    gap:5px;
}


.skills {
    display: inline-block;
    padding: 5px 10px;
    font-weight: 600;
    font-size: clamp(0.8rem, 2vw, 1rem);
    background: var(--button-color);
    color: var(--button-color-text);
    border-radius: 0.2rem;
    border-bottom: 1px solid rgb(160, 242, 230);
    border-right: 2px solid rgb(160, 242, 230);
    border-top: 1px solid white;
    border-left: 1px solid white;
}

.changeText {
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.changeText h3 {
    display: inline-flex;
    margin: 0;
    vertical-align: top;
    position: relative;
    max-width: 100%;
}

.changeText h3 .word {
    position: absolute;
    display: flex;
}

.changeText h3 .word .letter{
    transform-origin: center center 25px;
    
    /* color gradient to implement the whole text */
    display: inline-block;
    background: linear-gradient(180deg, rgb(57,162,152), rgb(160, 242, 230));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


.changeText h3 .word .letter.out{
    transform: rotateX(90deg);
    transition: 0.32s cubic-bezier(0.6,0,0.7,0.2);
}

.changeText h3 .word .letter.in{
    transition: 0.38s ease;
}

.changeText h3 .word .letter.behind{
    transform: rotateX(-90deg);
}

#githubStats {
    margin-top: 0.5rem;
}

.repo {
    display: inline-block;
    text-decoration:none;
    margin-right:5px;
    margin-bottom: 5px;
    padding:4px 10px;
    color:white;
    background:#528ddb42;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    border:1px solid rgba(160,242,230,0.5);
    transition:0.2s;
    box-shadow: #fff 0 1px 1px;
}

.repo:hover{
    background:rgb(160,242,230);
    color:black;
}

.contactForm {
    background: linear-gradient(160deg, rgba(208, 253, 255, 0.05), rgba(255, 238, 213, 0.05));
    border-radius: 4px;
    border-bottom: 1px solid rgb(160, 242, 230);
    border-right: 1px solid rgb(160, 242, 230);
    border-top: 1px solid white;
    border-left: 1px solid white;
    box-shadow: 5px 5px rgb(143, 175, 179);
    margin: 50px;
    padding: 2px;
    max-width: 520px;
}

.contactForm form {
    display: flex;
    z-index: 1;
    padding: 10px 10px;
    flex-direction: column;
}

.contactForm h2 {
    color:  white;
    text-align: center;
    margin: 5px 0px 15px;
    padding: 5px 0px 10px;
    z-index: 1;
    border-bottom: 1px solid;  /* Add a underline */
    position: relative;
}

.contactForm label {
    margin: 0px 10px;
    color:  white;
    position: inherit;
    font-weight: bold;
}

.contactForm input[type="text"], input[type="email"], textarea {
    background-color: #cacaca4b;
    margin: 0px 10px;
    padding: 8px;
    border: 2px solid rgb(216, 216, 216);
    border-radius: 5px;
    font-size: 16px;
}

.main-text h2 {
    display: block;
    margin: 30px;
    text-align: center;
    color: white;
    font-size: 30px;
    border-bottom: white solid 1px;
    padding-bottom: 10px;
}

/*--section introduction box--*/
.section-introduction {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    grid-gap: 2rem;
    margin: 2rem;
}

.section-introduction .introduction-box {
    flex: 1 1 18rem;
    padding: 2rem 1rem 2rem;
    text-align: center;
    background: var(--transparency-background-color);
    border-radius: 10px;
}

.introduction-box h3 {
    color: white;
}

.introduction-box p {
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/*--skill box--*/
.section-skills {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 2rem;
    gap: 1rem;
}

.art-3D-skill,
.game-development-skill,
.other-skill {
    flex: 1 1 300px;
    border-radius: 10px;
    padding: 10px;
    background-color: var(--transparency-background-color);
}

.game-development-skill h3,
.art-3D-skill h3,
.other-skill h3 {
    margin-bottom: 1rem;
    color: white;
    font-size: clamp(20px, 4vw, 25px);
    text-align: center;
}

.skill-bar {
    margin-bottom: 2rem;
}

.skill-description {
    background-color: rgba(255, 255, 255, 0.332);
}

.skill-bar-content {
    max-height: 330px;
    padding: 0 clamp(1rem, 2vw, 2rem);
    overflow-y: scroll;
    scrollbar-width: thin;
    margin-top: 1rem;
}

.game-development-skill .skill-bar .info,
.art-3D-skill .skill-bar .info,
.other-skill .skill-bar .info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info span {
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 600;
    color: white;
}

.info p {
    color: white;
    font-size: clamp(13px, 2vw,15px);
    padding: 0px 5px;
}

.game-development-skill .skill-bar .bar,
.art-3D-skill .skill-bar .bar,
.other-skill .skill-bar .bar {
    width: 100%;
    height: clamp(10px, 2vw, 12px);
    background-color: white;
    border-radius: 25px;
    border-bottom: 2px solid rgb(160, 242, 230);
    border-right: 2px solid rgb(160, 242, 230);
    border-top: 2px solid white;
    border-left: 2px solid white;
    margin-top: clamp(0px, 2vw, 10px);
    position: relative;
}

.skill-bar .bar span {
    width: 10%;
    height: 100%;
    position: absolute;
    left: 0;
    background-color: rgb(57,162,152);
    border-radius: 25px;
    box-shadow: 0 0 15px var(--shadow-color);
}

.skill-bar .bar .unity {
    width: 50%;
    animation: unity 2s forwards;
}
@keyframes unity {
    from { width: 0; }
    to { width: 50%; }
}

.skill-bar .bar .unreal {
    width: 25%;
    animation: unreal 1s forwards;
}
@keyframes unreal {
    from { width: 0; }
    to { width: 25%; }
}

.skill-bar .bar .max {
    width: 50%;
    animation: max 2s forwards;
}
@keyframes max {
    from { width: 0; }
    to { width: 50%; }
}

.skill-bar .bar .substance {
    width: 50%;
    animation: substance 2s forwards;
}
@keyframes substance {
    from { width: 0; }
    to { width: 50%; }
}

.skill-bar .bar .drawing {
    width: 25%;
    animation: drawing 1s forwards;
}
@keyframes drawing {
    from { width: 0; }
    to { width: 25%; }
}

.skill-bar .bar .csharp {
    width: 50%;
    animation: csharp 2s forwards;
}
@keyframes csharp {
    from { width: 0; }
    to { width: 50%; }
}

.skill-bar .bar .html {
    width: 25%;
    animation: html 1s forwards;
}
@keyframes html {
    from { width: 0; }
    to { width: 25%; }
}

.skill-bar .bar .css {
    width: 25%;
    animation: css 1s forwards;
}
@keyframes css {
    from { width: 0; }
    to { width: 25%; }
}

.skill-bar .bar .javascript {
    width: 10%;
    animation: javascript 0.5s forwards;
}
@keyframes javascript {
    from { width: 0; }
    to { width: 10%; }
}

.skill-bar .bar .photoshop {
    width: 30%;
    animation: photoshop 1s forwards;
}
@keyframes photoshop {
    from { width: 0; }
    to { width: 30%; }
}

.skill-bar .bar .after-effect {
    width: 10%;
    animation: after-effect 0.5s forwards;
}
@keyframes after-effect {
    from { width: 0; }
    to { width: 10%; }
}

.skill-description {
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .home-introduction,
    .portfolio {
        margin: 30px 15px;
    }
}

.category {
    margin: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    border-bottom: white solid 1px;
}

.category-item {
    background-color: rgba(226, 234, 237, 0.866);
    padding: clamp(15px, 2vw, 20px);
    border-radius: 5px;
    box-shadow: 0 4px 2px rgba(0, 0, 0, 0.3);
    transition: 0.2s;
}

.category-item:hover{
    transform: translateY(-5px);
}

.category-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

.category-item.technical {
    background: url(../Image/FlexTechnicalWorksUI.png) no-repeat center center;
    background-size: cover;
    position: relative;
    cursor: pointer;
}

.category-item.design {
    background: url(../Image/FlexArtisticWorksUI.png) no-repeat center center;
    background-size: cover;
    position: relative;
    cursor: pointer;
}

.item-content h2, p{
    color: rgb(255, 255, 255);
    z-index: 1;
    position: relative;
}

.item-content h2 {
    font-size: clamp(1.3rem, 2vw, 1.6rem);
}

.item-content p {
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.flex-container {
    margin: 2rem;
    align-items: center;
}

.filter-option {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.filter-button {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 1rem;
}

.filter-button .btn {
    padding: 0.1em 0.25em;
    width: 12em;
    height: 4.2em;
    background-color: #212121;
    border-bottom: 0.08em solid rgb(160, 242, 230);
    border-right: 0.08em solid rgb(160, 242, 230);
    border-top: 0.08em solid white;
    border-left: 0.08em solid white;
    border-radius: 0.3em;
    font-size: 0.6rem;
    cursor: pointer;
}

.filter-button span {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    bottom: 0.4em;
    width: 7.5em;
    height: 2em;
    background-color: #212121;
    border-radius: 0.2em;
    font-size: 1.5em;
    font-family: 'Times New Roman', Times, serif;
    color: #fff;
    border: 0.08em solid #fff;
    box-shadow: 0 0.4em 0.019em var(--button-color);
}

.filter-button span:hover {
    transition: all 0.5s;
    transform: translate(0, 0.4em);
    box-shadow: 0 0 0 0 #fff;
}

.filter-button span.active {
    color: whitesmoke;
    background: var(--button-color);
    transition: all 0.5s;
    transform: translate(0, 0.4em);
    box-shadow: 0 0 0 0 #fff;
}

.filter-button span:not(:hover) {
    transition: all 1s;
}

@media (max-width: 520px) {
    .filter-button .btn{
        width: 10em;
        height: 3.2em;
    }

    .filter-button span {
        width: 7.5em;
        height: 2em;
        font-size: 1.23em;
    }
}

.filter-person-or-group {
    display: flex;
    position: relative;
    width: 300px;
    height: clamp(1.5rem, 2vw, 2rem);
    padding: 2px;
    margin-bottom: 1rem;

    border-radius: 0.3rem;
    border-bottom: 1px solid rgb(160, 242, 230);
    border-right: 1px solid rgb(160, 242, 230);
    border-top: 1px solid white;
    border-left: 1px solid white;

    background: var(--transparency-background-color);
}

.radio {
    flex: 1;
}

.radio input {
    display: none;
}

.filter-person-or-group .name {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: clamp(0.9rem, 2vw, 1rem);
    cursor: pointer;
    color: white;
    border-radius: 0.2rem;
    transition: 0.2s;
    position: relative;
    z-index: 2;
}

/* selected */
.slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(100% / 3 - 4px);
    height: calc(100% - 4px);
    background: var(--transparency-background-color);
    box-shadow: inset 0 0 0 1px white;
    border-radius: 0.2rem;
    transition: transform 0.25s ease;
}

#all:checked ~ .slider {
    transform: translateX(0%);
}

#person:checked ~ .slider {
    transform: translateX(100%);
}

#group:checked ~ .slider {
    transform: translateX(200%);
}

.portfolio-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
}

.port-box {
    max-height: 280px;
    position: relative;
    overflow: hidden;
    background: #88fff97e;
    grid-template-rows: 1fr auto;
    align-items: center;
    justify-items: center;
    border-bottom: 2px solid rgb(160, 242, 230);
    border-right: 2px solid rgb(160, 242, 230);
    border-top: 2px solid white;
    border-left: 2px solid white;

    transition: opacity .3s ease;
}

.port-box.hide {
    display: none;
    pointer-events: none;
}

.port-box.show{
    display: block;
    animation: jelly .6s;
}

@keyframes jelly{

    0%{
        transform:scale(1.05,0.95);
    }

    40%{
        transform:scale(0.95,1.05);
    }

    60%{
        transform:scale(1.05,0.95);
    }

    80%{
        transform:scale(0.98,1.02);
    }

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

}

.port-image {
    position: relative;
    background: black;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (max-width: 520px) {
    .portfolio-gallery {
        grid-template-columns: 1fr;
    }
    .port-box {
        max-height: auto;
    }
}


.port-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: 0.5s;
}

.port-box .icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    z-index: 1;
}

.port-content {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;

    opacity: 0;
    background: linear-gradient(rgb(0, 0, 0, 0.2),var(--background-color));
    flex-direction: column;
    transition: 0.5s;
    padding: 0 clamp(1rem, 2vw, 2rem);
}

.port-content h3 {
    margin: clamp(0em, 1vw, 1em);
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 600;
    color: white;
}

.port-content p {
    margin: clamp(0em, 2vw, 1em);
    font-size: clamp(0.8rem, 2vw, 1rem);
}

.port-box:hover .port-image img {
    transform: scale(1.1);
}

.port-box:hover .port-content{
    opacity: 1;
}

@media (hover:hover) {
    .port-content{
        opacity:0;
    }

    .port-box:hover .port-content{
        opacity:1;
    }
}

@media (max-width: 768px) {
    .contactForm {
        margin: 30px 15px;
        padding: 18px;
        max-width: 100%;
        text-align: left;
    }
}

p {
    color: white;
}

footer {
    background-color: rgba(255, 255, 255, 0.5);
    padding: 5px;
    text-align: center;
}

footer p {
    color: gainsboro;
    font-style: italic;
    font-size: clamp(0.8rem, 2vw, 1rem);
}