/* html, body {
    height: 100%;
} */

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

html.menu-open,
body.menu-open {
    overflow: hidden;
    height: 100%;
    touch-action: none;
}

nav {
    height: var(--navbar-height);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 9998;
    transition: all .3s ease-out;
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

nav.hide {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

nav.top {
    background: #00000033;
}

.navbar {
    position: relative;
    width: 100%;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar a, 
.navbar label, 
.navbar span, 
.navbar svg {
    color: var(--text-white);
    /* mix-blend-mode: difference; */
}

.navbar svg path {
    fill: var(--text-white);
}

.navbar .navbar-menu, 
.navbar .navbar-logo, 
.navbar .navbar-contact {   
    display: flex;
    align-items: center;
    padding: 20px 50px;
    justify-content: center;
    height: var(--navbar-height);
    transition: all .2s ease;
    /* flex: 1 1 calc(100% / 3); */
    /* mix-blend-mode: darken; */
}

header.home nav#navbar .navbar .navbar-menu {
    background: #B1CE0F;
}

header.home nav#navbar .navbar .navbar-contact {
    background: #FF76D1;
}

.navbar .navbar-menu,
.navbar .navbar-contact {
    width: max-content;
    color: var(--text-white);
}

.navbar .navbar-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.navbar-menu .menu-btn {
    cursor: pointer;
}

.navbar-contact a {
    text-decoration: none;
}

/* header#head.home nav#navbar .navbar .navbar-contact a {
    width: 100%;
    height: 100%;
    padding: 20px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
} */

/* header#head.home nav#navbar .navbar .navbar-menu .menu-btn {
    width: 100%;
    height: 100%;
    padding: 20px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

header#head.home nav#navbar .navbar .navbar-contact,
header#head.home nav#navbar .navbar .navbar-menu {
    padding: 0 !important;
} */

.navbar .navbar-logo a, 
.navbar .navbar-logo a img{
    --logo-size: 54px;
    width: var(--logo-size);
    height: var(--logo-size);
}

.navbar .navbar-logo svg {
    --logo-size: 54px;
    fill: var(--text-white);
    width: var(--logo-size);
    height: var(--logo-size);
}

/* .overlay {
    height: 100dvh;
    width: 100%;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #00000000;
    transition: all .3s ease-out;
    display: none;
} */

#menu-toggle {
    display: none;
}

/* 
#MARK: Aside
*/

.menu-aside {
    display: flex;
    position: fixed;
    z-index: 10000;
    backdrop-filter: none;
    /* background: rgba(0, 0, 0, 0.3);  */
    height: 100dvh;
    overflow: hidden;
    /* width: min(90dvw, 400px); */
    width: 100%;
    inset: 0;
    /* transform: translateX(-100%); */
    background: var(--black);
    transition: clip-path 1s cubic-bezier(0.44, 1, 0.6, 1);
    /* topleft topright bottomright bottomleft */
}

.menu-aside.is-closed {
    clip-path: polygon(0px -250%, 350% -100%, 350% 0px, 0px -150%);
}

.menu-aside.is-open {
    clip-path: polygon(0px 0px, 350% 0px, 350% 100%, 0px 100%);
}

/* #navbar:has(#menu-toggle:checked) ~ .overlay {
    display: block;
} */

.aside-warpper {
    height: 100%;
    overflow-y: auto;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.aside-warpper .aside-top {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .4rem;
    padding: 2rem;
    height: auto;
}

.aside-warpper .aside-top {
    position: relative;
    overflow: hidden;
}

.aside-warpper .aside-main {
    position: relative;
    overflow: auto;
}

.aside-top > div {
    height: 100%;
}


.aside-top .aside-video,
.aside-top .aside-close,
.aside-top .aside-contact {
    /* max-height: 0; */
    height: 0;
    overflow: hidden;
    will-change: height;
    transition: height 1s cubic-bezier(0.44,1,0.6,1);
    /* aspect-ratio: 3 / 1; */
}

.menu-aside.is-open .aside-video,
.menu-aside.is-open .aside-close,
.menu-aside.is-open .aside-contact {
    /* max-height: 10vw; */
    height: 10vw;
}

.aside-top .aside-video video {
    width: 100%;    
    height: 10vw;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1),
                height 1s cubic-bezier(0.44,1,0.6,1);
    /* aspect-ratio: 3 / 1; */
    object-fit: cover;
    -o-object-fit: cover;
    display: block;
    cursor: pointer;
}

.aside-top .aside-video:hover,
.aside-top .aside-close:hover,
.aside-top .aside-contact:hover,
.aside-top .aside-video:hover video {
    /* max-height: 12vw; */
    height: 12vw;
}

.magnetic {
    position: relative;
}

.magnetic > * {
    display: inline-block;
    transition: transform .25s ease-out;
    will-change: transform;
}

.aside-top .aside-video {
    position: relative;
    border: none;
    outline: none;
}

.aside-top .aside-video span.hidden span.label {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.aside-top .aside-video span.hidden.show span.label {
    opacity: 1;
}

.aside-top .aside-video span,
.aside-top .aside-contact a span,
.aside-top .aside-close button span {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
}

.label {
    color: var(--text-white);
    transition: color .6s cubic-bezier(0.19, 1, 0.22, 1), background .6s cubic-bezier(0.19, 1, 0.22, 1);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
}

.label-close {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.label-close .label {
    font-size: 1rem;
}

.label-x {
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.label-x .label svg, .label-x .label svg path {
    fill: var(--text-white);
    height: 24px;
    width: 24px;
}

.aside-top .aside-close:hover span.label-close {
    opacity: 1;
}

.aside-top .aside-close:hover span.label-x {
    opacity: 0;
}

.aside-top .aside-video:hover span .label,
.aside-top .aside-contact:hover a span .label {
    color: var(--black);
    background: var(--white);
}

.aside-top .aside-close:hover button span .label {
    color: var(--black);
}

.aside-top .aside-close,
.aside-top .aside-contact {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111111;
}

.aside-top .aside-close button {
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: #111111;
    outline: none;
    border: none;
    transition: background 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    
}

.aside-top .aside-close:hover button {
    background: var(--white);
}

.aside-top .aside-contact a {
    width: 100%;
    height: 100%;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    position: relative;
    cursor: pointer;
    background: #111111;
    transition: background 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.aside-top .aside-contact:hover a {
    background: #FF76D1;
}

.aside-top .aside-contact a span {
    position: absolute;
    top: 50%;
    left: 50%;
    /* translate: 50% 50%; */
}

.aside-top .aside-contact a span.hover {
    top: 0;
    left: 0;
}

.aside-warpper .aside-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.aside-main .aside-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 4rem;
    margin-bottom: 2rem;
}

.aside-link .links {
    position: relative;
    font-size: 4.8rem;
    line-height: 110%;
    text-decoration: none;
    color: var(--text-white);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    translate: 0% -400%;
    transition: 1s cubic-bezier(.13,.74,.49,1);
}

.menu-aside.is-open .aside-link a.links {
    translate: 0% 0%;
}

.aside-link a.links::before {
    display: inline-block;
    content: '';
    width: 0;
    height: 0;
    border-radius: 0;
    background: var(--primary-color);
    margin-right: 0;
    transform: rotate(0deg);
    transition: width 1.4s cubic-bezier(.19, 1, .22, 1),
                height 1.4s cubic-bezier(.19, 1, .22, 1),
                margin-right  1.4s cubic-bezier(.19, 1, .22, 1),
                border-radius  1.4s cubic-bezier(.19, 1, .22, 1),
                transform  1.4s cubic-bezier(.19, 1, .22, 1);
}

.aside-link a.links:hover::before {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    margin-right: 20px;
    transform: rotate(45deg);
}

.aside-main .aside-link-right {
    margin-right: 6rem;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    translate: 0% -200%;
    transition: 1s cubic-bezier(.13,.74,.49,1);
}

.menu-aside.is-open .aside-link-right {
    translate: 0% 0%;
}

.aside-link-right .contact,
.aside-link-right .social,
.aside-link-right .address {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.aside-link-right .contact a {
    color: var(--text-white);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.aside-link-right .contact a,
.aside-link-right .social a {
    text-decoration: none;
    position: relative;
    transition: color 0.6s cubic-bezier(.19, 1, .22, 1);
}

.aside-link-right .contact a::after,
.aside-link-right .social a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 16px;
    width: calc(100% - 16px);
    height: 1px;
    background: var(--white);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.4s cubic-bezier(.19, 1, .22, 1),
                transform-origin 0s;
}

.aside-link-right .social a::after {
    left: 0;
    width: 100%;
}

.aside-link-right .social a:hover {
    color: var(--text-white);
}

.aside-link-right .contact a:hover::after,
.aside-link-right .social a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.aside-link-right .contact a:not(:hover)::after,
.aside-link-right .social a:not(:hover)::after {
    transform-origin: right;
}

.aside-link-right .contact a::before {
    content: '';
    width: 8px;
    height: 8px;
    display: inline-block;
    background: var(--primary-color);
    border-radius: 999px;
    margin-right: 8px;

}

.aside-link-right .social span {
    color: var(--text-white);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.aside-link-right .social a {
    color: #9EA0A1;
    font-size: 1rem;
    font-weight: 300;
    margin-bottom: 0.25rem;
    text-decoration: none;
}

.aside-link-right .address span {
    color: var(--text-white);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.aside-link-right .address p {
    color: #9EA0A1;
    font-size: 1rem;
    font-weight: 300;
    margin-bottom: 0.25rem;
}

/* 
#MARK: Fullscreen 
*/

.video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10010;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;
    transition: opacity .6s cubic-bezier(0.19, 1, 0.22, 1);
}

.video-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* กล่องวิดีโอ */
.video-box {
    width: 80vw;
    max-width: 1600px;
    aspect-ratio: 16 / 9;
    position: relative;
}

.video-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* ปุ่มปิด */
.video-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 10;
}


/* 
#MARK: Loading 
*/
/* HTML: <div class="loader"></div> */

.loader-box {
    /* width: 100vw;
    height: 100vh; */
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: all;
    overflow: hidden;
}


/* ตอนเปลี่ยนหน้า (เข้า) */
.loader-box.is-in {
    animation: loader 2s forwards cubic-bezier(0.44, 1, 0.6, 1);
}

/* ตอนโหลดเสร็จ (ออก) */
.loader-box.is-out {
    animation: loaderOut 2s forwards cubic-bezier(0.44, 1, 0.6, 1);
}

/* ซ่อนจริง */
.loader-box.is-hidden {
    display: none;
    pointer-events: none;
}


.loader-bg {
    width: 100vw;
    height: 100vh;
    position: absolute;
    z-index: 10001;
    background: #000;
}

.loader {
  width: 100px;
  aspect-ratio: 1;
  padding: 10px;
  box-sizing: border-box;
  display: grid;
  background: #000;
  filter: blur(2px) contrast(10);
  /* mix-blend-mode: darken; */
}
.loader:before,
.loader:after{
  content: "";
  grid-area: 1/1;
  background:
    linear-gradient(#fff 0 0) left,
    linear-gradient(#fff 0 0) right;
  background-size: 20px 40px;
  background-origin: content-box;
  background-repeat: no-repeat;
}
.loader:after {
  height: 20px;
  width:  20px;
  margin: auto 0;
  border-radius: 50%;
  background: #fff;
  animation: l10 1s infinite;
}
@keyframes l10{
  90%,100% {transform: translate(300%)}
}

@keyframes loader {
    0% {clip-path: polygon(0px -250%, 350% -100%, 350% 0px, 0px -150%);}
    100% {clip-path: polygon(0px 0px, 350% 0px, 350% 100%, 0px 100%);}
}

@keyframes loaderOut {
    0% {clip-path: polygon(0px 0px, 350% 0px, 350% 100%, 0px 100%);}
    100% {clip-path: polygon(0px 250%, 350% 100%, 350% 200%, 0px 350%);}
}

@media screen and (max-width: 1399px) {}

@media screen and (max-width: 1199px) {
    .navbar .navbar-logo a, 
    .navbar .navbar-logo a img,
    .navbar .navbar-logo svg {
        --logo-size: 40px;
    }
}

@media screen and (max-width: 1024px) {
    .aside-main .aside-link {margin-bottom: 2rem;}
    .aside-link .links {font-size: 4.5rem;}
    .aside-main .aside-link-right {margin-bottom: 2rem;}
}

@media screen and (max-width: 991px) {
    .aside-warpper .aside-top {grid-template-columns: repeat(2, 1fr);}
    .aside-top .aside-video {display: none;}
    .aside-link .links {font-size: 4rem;}
    .aside-top .aside-close:hover span.label-close {opacity: 0;}
    .aside-top .aside-close:hover span.label-x {opacity: 1;}
    .aside-top .aside-close:hover button {background: #111111;}
    .aside-top .aside-contact:hover a span .label {color: var(--text-white); background: #111111;}

}
@media screen and (max-width: 767px) {
    .aside-warpper .aside-main {
        flex-direction: column;
        align-items: start;
    }

    .aside-main .aside-link {
        margin-bottom: 2rem;
    }

    .aside-main .aside-link-right {
        flex-direction: row;
        margin-left: 4rem;
        /* margin-right: 4rem; */
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 1.5rem;
    }

    .aside-link-right .address {order: 1;}
    .aside-link-right .social {order: 3; width: 100%;}
    .aside-link-right .contact {order: 2;}

    .aside-link-right .contact a {
        text-wrap: nowrap;
        white-space: nowrap;
    }
}

@media screen and (max-width: 575px) {

    .aside-warpper {justify-content: unset;}
    .aside-warpper .aside-top {padding: 1.5rem;}
    .aside-main {height: 100%;}
    .aside-main .aside-link {margin-left: 2rem; margin-bottom: 0.25rem;}
    .aside-main .aside-link-right {
        height: 100%;
        flex-wrap: nowrap;
        flex-direction: column;
        margin-left: 2rem;
        margin-right: 2rem;
        gap: 0.5rem;
        justify-content: space-evenly;
    }
    .aside-link .links {font-size: 3rem; margin-bottom: 0.25rem;}
    .aside-link-right .address {order: 1;}
    .aside-link-right .social {order: 2;}
    .aside-link-right .contact {order: 3;}
    .aside-link-right .social span, .aside-link-right .address span {margin-bottom: 0.25rem;}

    nav.top {
        background: rgba(0, 0, 0, 0.1);
    }

    .navbar .navbar-menu, 
    .navbar .navbar-logo, 
    .navbar .navbar-contact {
        padding: 1rem 1rem;
    }
/* 
    header#head.home nav#navbar .navbar .navbar-contact,
    header#head.home nav#navbar .navbar .navbar-menu {
        padding: 1rem 1rem !important;
    } */


    /* header#head.home nav#navbar .navbar .navbar-menu .menu-btn,
    header#head.home nav#navbar .navbar .navbar-contact a {
        padding: 1rem 1rem !important;
    } */

    .home nav .navbar .navbar-menu, 
    .home nav .navbar .navbar-contact {
        background: transparent;
    }

    .navbar .navbar-logo {
        align-self: center;
        justify-self: center;
    }

    .navbar-menu .menu-btn, .navbar-contact a{
        font-size: 0.75rem;
    }

    .navbar .navbar-logo img {
        --logo-size: 24px;
    }

    #menu-btn span{
        display: none;
    }

    #menu-btn {
        position: relative;
        width: 24px;
        height: 2px;
        background-color: var(--white);
        border-radius: 1px;
    }

    #menu-btn::before, #menu-btn::after {
        content: '';
        width: 100%;
        height: 100%;
        background-color: var(--white);
        border-radius: 1px;
        position: absolute;
    }

    #menu-btn::before {
        top: -8px;
    }

    #menu-btn::after {
        top: 8px;
    }
}
