html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    /* transition: 0.3s; */
    font-family: 'Trebuchet MS', 'Segoe UI', 'Inter', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #080A2B;
}

h1, h2 {
    color: #E6ECFF;
    font-weight: 800;
}

h3 {
    color: #C7D2FF;
}

p {
    color: #B8C1E6;
}

p b {
    color: #B8C1E6;
}

.subtitle {
    display: block;
    font-size: 0.8rem;
    margin-top: 10px;
    color: #8F97C9;
}

.caption, .note {
    color: #6F77B0;
}

a {
    color: #9AA8FF;
}

a:hover {
    color: #C1CBFF;
}

header {
    overflow: hidden;
    height: 30dvh;
    margin: 0;
    padding: 0;
    position: relative;
    display: flex;
    visibility: hidden;
    justify-content: center;
    align-items: center;
    background-image: linear-gradient(to bottom, black, rgb(19, 21, 39), rgb(38, 46, 133), #480a99);
    background-color: rgb(0, 0, 0);
}

header img {
    will-change: opacity;
    width: 100%;
    position: absolute;
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.8s ease,
        transform 0.8s cubic-bezier(.22, 1, .36, 1);
    will-change: transform, opacity;
}

#img-5 {
    transform: translateY(0px);
}

header img.loaded {
    --hover-var: 0px;
    --scroll-y: 0px;
    opacity: 1;
    transform: translateY(calc(var(--scroll-y) + var(--hover-var)));
}

main {
    position: relative;
    background-color: #080A2B;
    background-image: linear-gradient(to bottom, #080A2B, #080A2B);
    color: white;
    padding: 50px 0px;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#loading-overlay {
    position: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-color: #474caa;
    background-image: url('../img/Backdrop\ -\ Nod-Krai.webp');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-blend-mode: color-dodge;
    color: white;
    gap: 10px;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 1s ease;
    overflow: hidden;
}

#loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.progress-track {
    background-color: rgba(255, 255, 255, 0.308);
    height: 5px;
    width: 55%;
    border-radius: 5px;
    /* mix-blend-mode: hard-light; */
}

.progress-bar {
    transform: scaleX(0);
    transform-origin: left;
    background-color: white;
    border-radius: 5px;
    height: 100%;
    width: 100%;
    transition: transform 0.2s ease;
}

/* 
    #### Modify This ####
    Each region configuration should be different.
    According to each layer of art in the header.
*/
#img-12 {
    top: 0;
    height: 100%;
}

#img-11 {
    top: 0;
    width: 80%;
    mix-blend-mode: color-dodge;
    left: 10%;
    animation: blink 5s ease-in-out infinite;
}

#img-10 {
    top: -40%;
    width: 60%;
    left: 20%;
    animation: dwindles 60s ease-in-out infinite;
}

#img-9 {
    bottom: 0;
    animation: blink 5s ease-in-out infinite;
}

#img-8 {
    bottom: 0;
}

#img-7 {
    bottom: 0;
    margin-bottom: 13%;
    animation: blink 6s ease-in-out infinite;
}

#img-6 {
    bottom: 0;
}

#img-5 {
    top: 0;
    height: 100%;
}

#img-4 {
    transform: scale(0.93);
    animation: spin 180s linear infinite;
}

#img-3 {
    transform: scale(0.96);
    animation: spin 500s linear infinite;
}

#img-2 {
    bottom: 0;
}

#img-1 {
    bottom: 0;
    right: 0;
    width: 50%;
    animation: blink 8s ease-in-out infinite;
}

#img-0 {
    bottom: -1px;
}


/* 
========================== 
        Main 
==========================
*/
#title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 0px 20px;
    color: #d9dbf3;
}

#title img {
    width: 90%;
    max-width: 700px;
}

/* =========== Header-Link =========== */
.header-span > a {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: block;
    flex-grow: 1;
    min-width: 40%;
    min-height: 400px;
    position: relative;
    margin: 0;
    padding: 0;
    transition: 0.2s ease-out;
}

.header-span > a:hover {
    transform: scale(1.03);
    outline: 2px solid rgba(187, 253, 253, 0.05);
    outline-offset: 5px;
}

.header-span > a:hover p {
    transform: translateY(-30px);
}

.header-span > a:hover > div > div {
    opacity: 1;
}

.header-span > a > div {
    background-image: linear-gradient(to bottom, #080A2B00, #0406248f, #040624);
    position: absolute;
    width: 100%;
    height: 60%;
    bottom: 0;
}

.header-span > a > div p {
    padding: 10px 20px;
    position: absolute;
    bottom: 30px;
    transition: 0.3s ease-in-out;
}

.header-span > a > div > div {
    display: flex;
    opacity: 0;
    flex-direction: column;
    width: 100%;
    gap: 5px;
    justify-content: center;
    align-items: center;
    position: absolute;
    bottom: 20px;
    transition: 0.3s ease-in-out;
}

.img-span {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 25px 0px;
    /* min-width: 60%; */
    width: 100%;
    gap: 10px;
    transition: 0.3s ease-in-out;
}

.img-span > div {
    --initial-width: 100%;
    width: var(--initial-width);
    min-height: 200px;
    max-height: 400px;
    display: block;
    height: auto;
    flex-grow: 1;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: #0a184e;
    transition: 0.3s ease-in-out;
}

.text-span {
    position: relative;
    padding: 0px 20px;
    text-align: left;
}

.text-span p {
    margin-top: 20px;
}


/* =========== Nod-Krai Overview ========= */
img.title-icon {
    width: 50px;
    transition: 0.2s ease-out;
}

img.title-icon:hover {
    transform: scale(1.4);
}

img.title-divider {
    width: 200px;
    opacity: 0.5;
}




@media screen and (min-width: 760px) {
    header {
        height: 50dvh;
    }

    main {
        padding: 50px 0px;
    }

    #title img {
        width: 75%;
    }

    .img-span {
        flex-direction: row;
    }

    .text-span {
        padding: 0px 25px;
    }
}

@media screen and (min-width: 1024px) {
    header {
        height: 100dvh;
    }

    main {
        padding: 50px 0px;
    }

    #title img {
        width: 60%;
    }

    .img-span > div {
        min-height: 300px;
    }

    /* Hover only available on desktop */
    main section:not(:nth-child(2)) .img-span > div:hover {
        width: calc(var(--initial-width) + 100%);
    }

    .text-span {
        padding: 0px 30px;
    }

    .header-span > a {
        min-width: 20%;
    }
}



/* =========== Animation =========== */

@keyframes spin {
    from {
        rotate: 0deg;
    }

    to {
        rotate: 360deg;
    }
}

@keyframes fade-out {
    from {
        opacity: 1.0;
    }

    to {
        opacity: 0.0;
    }
}

@keyframes hovering {
    0% {
        --hover-var: 0px
    }

    50% {
        --hover-var: 10px
    }

    100% {
        --hover-var: 0px
    }
}

@keyframes dwindles {
    0% {
        rotate: 0deg;
    }

    30% {
        rotate: -10deg;
    }

    60% {
        rotate: 10deg;
    }

    100% {
        rotate: 0deg;
    }
}

@keyframes sway {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(10px);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes blink {
    0% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(0.8) saturate(0.8);
    }

    100% {
        filter: brightness(1);
    }
}

/* Wobble on Hiisi Island */
/* #img-9 {
  filter: url(#lightWobbleSoft);

  mask-image: radial-gradient(
    120px 120px at 65% 30%,
    black 0%,
    black 35%,
    transparent 60%
  );

  will-change: filter;
} */