@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Anuphan:wght@300&display=swap');
html{
    scroll-behavior: smooth;
    font-family: "Poppins", sans-serif;
}
body{
    background-color:#ffffff;
    /* justify-content: center; */
    color: #000000;
}

/* ----------------------------Navbar----------------------------------- */
nav{
    width: calc(100% - 40px);
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(80, 80, 80, 0.22), 0 2px 16px 0 rgba(60,60,60,0.13);
    background-color: #ffffff;
    border: 0.1vw solid #dfdfdf;
    transition: box-shadow 0.2s, border-color 0.2s;
}
nav:hover {
    box-shadow: 0 12px 40px 0 rgba(80, 80, 80, 0.28), 0 4px 24px 0 rgba(60,60,60,0.18);
    border-color: #24982e;
}
nav ul{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    list-style: none;
    background-color: transparent; /* ใช้ bg ที่ nav แทน */
    box-shadow: none; /* ใช้ box-shadow ที่ nav แทน */
    border-radius: 24px;
    margin: 0;
    padding: 20px 0;
    column-gap: 100px;
}
nav a{
    display: inline-block;
    color: #535353;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    outline: none;
}
.default a:hover{
    transform: scale(1.1);
    color: #3aba42;
    transition: ease-in-out 0.2s;
}
.default .menu-button{
    display: none;
}
.sidebar{
    position: fixed;
    top: 0;
    right: 0;
    width: 70vh;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow:  -10px 0 10px rgba(167, 167, 167, 0.2) ;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
}
.sidebar li{
    width: 100%;
}
.sidebar a{
    width: 100%;
}
/* -----------------------------home---------------------------------- */
.home{
    padding: 270px 0;
    padding-left: 50%;
    transform: translateX(-25%);
    text-align: center;
}
.home p{
    font-size: 50px;
    font-weight: bold;
}
.home .name{
    left: 50%;
    transform: translateX(0%);
    letter-spacing: 8px;
    width: 100%;
    overflow: hidden;
    border-right: 3px solid;
    white-space: nowrap;
    animation: 
        typing 3s  steps(19),
        cursor .4s step-end infinite alternate;
}
@keyframes cursor{
    50%{border-color: transparent;}
}
@keyframes typing{
    from{width: 0}
}
/* ----------------------------about------------------------------------ */
.about{
    padding: 270px 0;
    position: absolute;
    right: 50%;
    transform: translateX(50%);
    display: grid;
    grid-template-columns: 1fr 2fr;
    max-width: 900px;   
    align-items: center;
    gap: 50px;
}

.about img{
    width: 300px;
    height: 380px;
    object-fit: cover;
    border-radius: 20px;
}
.about ul{
    background-color: #b5b5b5;
    border-radius: 20px;
    padding: 60px 40px;
}
.about li{
    list-style-type: none;
    font-weight: 580;
    font-size: 17px;
    white-space: nowrap;    
}
/* --------------------Experiences-------------------------- */
.experiences{
    margin: 800px 0;
    max-width: 1100px;
    position: absolute;
    right: 50%;
    transform: translateX(50%);
    z-index: 1000;
}
.experiences h1{
    text-align: center;
}
.experiences .all-cer{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    /* grid-template-columns: 220px 220px 220px 220px; */
    width: 100%;
    gap: 40px;
}
.all-cer img{
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(80, 80, 80, 0.5); /* เพิ่มเงา */
    
}
.all-cer img:hover{
    transform: scale(1.2);
    rotate: 2deg;
    transition: ease-in-out 0.2s;
}
.all-cer img:active{
    transform: scale(0.9);
    transition: ease-in-out 0.2s;
}
.all-cer p{
    font-family: "Anuphan", sans-serif;
    font-weight: 600;
}
.all-cer .sub{
    display: none;
}
.ap img{
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: #7a7a7a 2px solid;
}
.ap img:hover{
    transform: scale(1.02);
    transition: ease-in-out 0.2s;
}
.ap img:active{
    transform: scale(0.9);
    transition: ease-in-out 0.2s;
}
.ap p{
    font-family: "Anuphan", sans-serif;
    font-weight: 600;
}
.projects{
    margin: 100px 0;
    max-width: 1024px;
    position: absolute;
    right: 50%;
    transform: translateX(50%);
}
.all-project{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    width: 100%;
}
.all-project img{
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
}
.all-project p{
    text-align: center;
    font-family: "Anuphan", sans-serif;
    font-weight: 600;
}
.all-project img:hover{
    transform: scale(1.02);
    transition: ease-in-out 0.2s;
}
.all-project img:active{
    transform: scale(0.9);
    transition: ease-in-out 0.2s;
}
/* -------------------------------------contacts---------------------------------- */
/* .contacts{
    padding: 270px 0;
    position: absolute;
} */
.socialscontainer{
    /* position: relative; */
    /* margin: 4300px 0 50px 0; */
    margin: 240vw 0 50px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    right: 50%;
    transform: translateX(0%);
    bottom: 0;
    z-index: -1;
}
.socialscontainer a{
    background-color: #ffffff;
    padding: 10px;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    box-sizing: border-box;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-weight: bold;
}
.socialscontainer a svg{
    height: 32px;
    fill: #18181b;
}
.socialscontainer a::before{
    content: attr(data-social);
    position: absolute;
    background-color: var(--accent-color);
    color: #ffffff;
    text-decoration: none;
    padding: 0.5em 1em;
    border-radius: 100px;
    box-shadow: 0 5px 10px rgba(255, 255, 255, 0.2);
    transform: translateY(-30px) rotate(25deg);
    opacity: 0;
    transition: 200ms cubic-bezier(.42,0,.44,1.68);
}
.socialscontainer a:hover{
    background-color: var(--accent-color);
    fill: white;
}
.socialscontainer a:hover svg{
    fill: white;
}
.socialscontainer a::after{
    content: '';
    position: absolute;
    height: 0;
    width: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--accent-color);
    transform: translateY(0) rotate(25deg);
    opacity: 0;
    transition: 200ms cubic-bezier(.42,0,.44,1.68);
}
.socialscontainer a:hover::before{
    transform: translateY(-65px) rotate(0);
    opacity: 1;
}
.socialscontainer a:hover::after{
    transform: translateY(-42px) rotate(0);
    opacity: 1;
}
@media (max-width: 1367px) and (min-width: 1023px) {
    nav a{
        font-size: 25px;
    }
    .home{
        max-width: 100%;
    }
    .home p {
        font-size: 4vw; /* ลดขนาดฟอนต์ให้เหมาะสมกับหน้าจอเล็ก */
    }
    .home .name {
        font-size: 3.5vw;
        white-space: nowrap; /* ป้องกันการตัดคำ */
        letter-spacing: 2px; /* ปรับระยะห่างตัวอักษร */
    }
    .socialscontainer{
        margin: 460vh 0 50px 0;
    }
}
@media (max-width: 800px) {
    .hideOnmobile{
        display: none;
    }
    .sidebar{
        width: 80vw;
        height: 100%;
    }
    .sidebar a{
        font-size: 30px;
    }
    .sidebar li{
        margin-top: 20px;
    }   
    .default .menu-button{
        display: block;
    }
    .default .menu-button svg{
        width: 30px;
        height: 30px;
    }
    .default{
        justify-content: flex-end;
        padding-right: 30px;
    }
    .sidebar svg{
        width: 35px;
        height: 35px;
    }
    .home {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translate(-45%);
        text-align: center;
        padding: 300px 0; /* ปรับ padding หากไม่ต้องการระยะห่าง */
    }
    .home p {
        font-size: 40px; /* ลดขนาดฟอนต์ให้เหมาะสมกับหน้าจอเล็ก */
    }
    .home .name {
        font-size: 40px;
        white-space: nowrap; /* ป้องกันการตัดคำ */
        letter-spacing: 2px; /* ปรับระยะห่างตัวอักษร */
    }
    .about{
        padding: 800px 0;
        /* position: absolute; */
        right: 50%;
        transform: translateX(50%);
        display: grid;
        grid-template-columns: 1fr;
        max-width: 800px;   
        align-items: center;
        gap: 50px;
        justify-content: center;
        z-index: 1000;
    }
    .about img{
        width: 300px;
        height: 380px;
        object-fit: cover;
        border-radius: 10px;
        padding-left: 20%;
    }
    .about ul{
        background-color: #b5b5b5;
        border-radius: 20px;
        padding: 40px 20px;
    }
    .about li{
        list-style-type: none;
        font-weight: 580;
        font-size: 17px;
        white-space: nowrap;    
    }
}

@media (max-width: 431px) {
    /* nav ul{
        flex-direction: column;
        padding: 10px 0;
        row-gap: 20px;
    } */
    .default .menu-button svg{
        width: 35px;
        height: 35px;
    }
    .default{
        justify-content: flex-end;
        padding-right: 30px;
        
    }
    .sidebar li{
        margin-top: 20px;
    }
    .home {
        position: absolute;
        top: 0;
        left:48%;
        /* transform: translate(-50%); */
        text-align: center;
        padding: 67vw 0; /* ปรับ padding หากไม่ต้องการระยะห่าง */
    }
    .home p {
        font-size: 30px; /* ลดขนาดฟอนต์ให้เหมาะสมกับหน้าจอเล็ก */
    }
    .home .name {
        font-size: 30px;
        white-space: nowrap; /* ป้องกันการตัดคำ */
        letter-spacing: 2px; /* ปรับระยะห่างตัวอักษร */
    }
    .about{
        align-items: center;
        grid-template-columns: 1fr;
        position: relative;
        gap: 20px;
        margin: 20vw 0 0 0;
    }
    .about img{
        width: 250px;
        height: 300px;
        /* object-fit: cover; */
        border-radius: 10px;
    }
    .about ul{
        background-color: #b5b5b5;
        border-radius: 10px;
        padding: 20px 20px;
    }
    .about .about-me{
        margin-left: 30px;
    }
    .about li{
        list-style-type: none;
        font-weight: 580;
        font-size: 13px;
        white-space: nowrap;   
    }
    .sidebar{
        width: 80vw;
    }
    .experiences{
        position: relative;
        margin:  -150% 0 0 0;
        max-width: 1024px;
        right: 50%;
        transform: translateX(50%);
    }
    .socialscontainer{
        /* position: relative; */
        /* margin: 4300px 0 50px 0; */
        margin: 30vw 0 50px 0;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 50px;
        right: 50%;
        transform: translateX(0%);
        bottom: 0;
        z-index: -1;
    }
}
/* @media (max-width: 400px) {
    .sidebar{
        width: 100%;
    }
} */