* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: #232323;
}

.frame {
    border: 2px solid #000000;
    border-radius: 10px;
    background-color: rgb(242, 241, 232);
    margin: 30px 100px;
    padding: 10px 30px 70px 30px;
    min-height: calc(100vh - 40px);
    overflow: visible;
    box-shadow: 0px 20px 60px rgba(0, 0, 0, 0.50),
                inset 20px 0px 50px rgba(0,0,0,0.5),
                inset -20px 0px 50px rgba(0,0,0,0.2);
}

.scrollbar {
    width: auto;
    overflow: visible;
}

.font1,
.font4 {
    font-family: 'Noto Sans Thai', sans-serif;
}

.font4 {
    font-size: 20px;
}

.align-center {
    display: flex;
    align-items: center;
    gap: 50px;
    margin: 60px 40px;
}

.logo {
    display: block;
    width: 250px;
    max-width: 100%;
    height: auto;
    border-radius: 1000px;
    animation: vikingSwing 3s ease-in-out infinite;
    transform-origin: center bottom;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.8);
}

.intro-line {
    flex: 0 0 auto;
    width: 3px;
    height: 220px;
    background-color: #000000;
    border-radius: 10px;
    position: relative;
    overflow: visible;
}

.intro-line::after {
    content: "";
    position: absolute;
    top: 0;
    left: 100%;
    width: 120px;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 220, 120, 0.7),
        rgba(255, 220, 120, 0)
    );
    transform-origin: left center;
    animation: lightFade 1.4s ease forwards;
}

.intro-text {
    min-width: 0;
    text-align: left;
    animation: textReveal 1.2s ease forwards;
}

.text1 {
    font-size: clamp(34px, 4vw, 45px);
    color: #000000;
    text-align: left;
    margin: 10px 0 0;
}

.text2 {
    font-size: clamp(17px, 2vw, 20px);
    color: #575757;
    text-align: left;
    margin-top: 10px;
    line-height: 2;
}

.text3 {
    font-size: 15px;
    line-height: 35px;
    color: #000000;
    text-align: left;
    width: 85%;
    max-width: 1000px;
    margin: 70px auto;
}

.about-text {
    display: block;
    width: 80%;
    max-width: 1000px;
    margin: 70px auto 0;
}

.about-text p {
    margin: 0;
}

.footer {
    width: 80%;
    max-width: 1000px;
    margin: 70px auto 0;
}

.text4 {
    font-size: 17px;
    line-height: 25px;
    color: #383838;
    text-align: left;
    margin: 0;
}

.box1 {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 100px 20px 0;
}

.box1 a {
    text-decoration: none;
}

.button1,
.button2,
.button3,
.button4 {
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.1s ease-in-out;
    white-space: nowrap;
}

.button1,
.button2 {
    min-width: 280px;
    padding: 15px 60px;
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.6);
}

.button1 {
    background-color: #000000;
    color: #ffffff;
}

.button1:hover {
    background-color: #ff1717;
    color: #ffffff;
    transform: scale(1.02);
}

.button2 {
    background-color: #ffffff;
    color: #000000;
}

.button2:hover {
    background-color: #87ff7a;
    color: #000000;
    transform: scale(1.02);
}

.button3,
.button4 {
    min-width: 185px;
    padding: 18px 42px;
}

.button3 {
    background-color: #000000d1;
    color: #ffffff;
}

.button3:hover {
    background-color: #000000;
    color: #ffffff;
    transform: scale(1.02);
}

.button4 {
    background-color: #ffffffdf;
    color: #000000;
}

.button4:hover {
    background-color: #ffffff;
    color: #000000;
    transform: scale(1.02);
}

.modal {
    display: flex;
    position: fixed;
    inset: 0;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
    z-index: 9999;
    padding: 18px;
}

.modal-box {
    position: relative;
    z-index: 10000;
    background: rgba(83, 131, 83, 0.92);
    color: rgb(255, 255, 255);
    width: 80%;
    max-width: 600px;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 20px 80px rgba(0,0,0,0.5);
    transform: translateY(40px) scale(.9);
    transition: transform .2s ease, opacity .2s ease;
    opacity: 0;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 50px;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal.show .modal-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 18px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #fafafa;
    transition: .2s;
}

.close-btn:hover {
    color: #000;
    transform: scale(1.15);
}

.lang-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    background: #e4e4e4;
    color: #000000;
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.lang-btn:hover {
    background: #ffffff;
}

@keyframes textReveal {
    from {
        transform: translateX(-45px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes lightFade {
    0% {
        opacity: 0;
        transform: scaleX(0);
    }

    35% {
        opacity: 1;
        transform: scaleX(1);
    }

    100% {
        opacity: 0;
        transform: scaleX(1);
    }
}

@keyframes vikingSwing {
    0% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(4deg);
    }

    100% {
        transform: rotate(-4deg);
    }
}

@media (min-width: 1200px) {
    .frame {
        max-width: 1350px;
        margin: 30px auto;
    }
}

@media (max-width: 1024px) {
    .frame {
        margin: 25px 40px;
        padding: 10px 24px 60px;
    }

    .align-center {
        gap: 35px;
        margin: 55px 20px;
    }

    .logo {
        width: 220px;
    }

    .button1,
    .button2 {
        min-width: 240px;
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (max-width: 768px) {
    body {
        min-width: 0;
    }

    .frame {
        width: auto;
        margin: 14px;
        padding: 26px 18px 45px;
        min-height: auto;
        border-radius: 12px;
        box-shadow: 0px 14px 45px rgba(0, 0, 0, 0.45),
                    inset 12px 0px 35px rgba(0,0,0,0.15),
                    inset -12px 0px 35px rgba(0,0,0,0.15);
    }

    .lang-btn {
        top: 14px;
        right: 14px;
        padding: 7px 15px;
    }

    .align-center {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 24px;
        margin: 42px 0 0;
    }

    .logo {
        width: min(190px, 72vw);
        margin: 0 auto;
    }

    .intro-line {
        width: 170px;
        max-width: 65vw;
        height: 3px;
    }

    .intro-line::after {
        width: 100%;
        height: 70px;
        top: 100%;
        left: 0;
        background: linear-gradient(
            to bottom,
            rgba(255, 220, 120, 0.5),
            rgba(255, 220, 120, 0)
        );
        transform-origin: top center;
    }

    .intro-text {
        width: 100%;
        text-align: center;
    }

    .text1 {
        font-size: clamp(30px, 9vw, 38px);
        text-align: center;
        line-height: 1.25;
    }

    .text2 {
        font-size: 16px;
        line-height: 1.8;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .box1 {
        flex-direction: column;
        gap: 18px;
        margin: 58px 0 0;
    }

    .box1 a,
    .button1,
    .button2 {
        width: 100%;
        max-width: 300px;
    }

    .button1,
    .button2 {
        min-width: 0;
        padding: 15px 0;
    }

    .text3,
    .about-text {
        width: 100%;
        font-size: 14px;
        line-height: 1.9;
        margin: 56px auto 0;
    }

    .footer {
        width: 100%;
        margin: 55px auto 0;
    }

    .text4 {
        font-size: 14px;
        line-height: 1.8;
        text-align: left;
    }

    .modal {
        align-items: center;
        padding: 16px;
    }

    .modal-box {
        width: 100%;
        max-width: 420px;
        padding: 28px 18px 24px;
    }

    .modal-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-top: 35px;
    }

    .button3,
    .button4 {
        width: 100%;
        max-width: 280px;
        min-width: 0;
        padding: 15px 0;
    }
}

@media (max-width: 420px) {
    .frame {
        margin: 10px;
        padding: 24px 14px 38px;
    }

    .align-center {
        margin-top: 50px;
    }

    .logo {
        width: min(165px, 70vw);
    }

    .font4 {
        font-size: 18px;
    }

    .text2 {
        font-size: 15px;
    }

    .text3,
    .about-text {
        font-size: 13.5px;
    }
}
