@font-face {
    font-family: "WarhavenB";
    src: url("https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2312-1@1.1/WarhavenB.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
    text-decoration: none;
    font-family: "WarhavenB";
}

/* 페이지 아웃 애니메이션 */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 페이지 인 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 페이지가 사라질 때 적용될 클래스 */
.page-transition-out {
    animation: fadeOut 0.5s ease-in-out forwards; /* 0.5초 동안 페이드 아웃 */
}

/* 페이지가 나타날 때 적용될 클래스 */
.page-transition-in {
    animation: fadeIn 0.5s ease-in-out forwards; /* 0.5초 동안 페이드 인 */
    opacity: 0; /* 초기 상태를 투명하게 설정하여 애니메이션 시작 전 숨김 */
}

body {
    background: #000;
    color: white;
    scroll-behavior: smooth;
}
.wrap {
    margin: auto;
    max-width: 1600px;
    padding: 0 5%;
}
h1 {
    font-size: 8vw; /* 폰트 크기 조정 */
    text-align: center;
    margin-bottom: 40px;
}
nav,
nav a {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    font-size: 30px;
}
.nav-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
nav a {
    padding: 0 15px;
    font-size: 15px;
    display: flex;
    height: max-content;
    overflow: hidden; /* Crucial for hiding the text as it slides out */
    line-height: 1.3;
    transform: translateZ(0);
    position: relative; /* Needed for absolute positioning of spans */
}

nav a > span {
    position: relative;
    display: block; /* Allows transform to work correctly */
    transition: transform 0.55s cubic-bezier(0.25, 1, 0.33, 1);
}

nav a > span span {
    display: block; /* Ensures the inner span takes up full width for positioning */
}

nav a:hover > span {
    transform: translateY(-100%); /* Adjust to -100% to perfectly hide the original text */
}

nav a > span span::after {
    position: absolute;
    bottom: -100%; /* Position it below the original text initially */
    left: 0;
    width: 100%; /* Ensure it covers the full width */
    display: block; /* Allows transform to work correctly */
    transition: transform 0.55s cubic-bezier(0.25, 1, 0.33, 1);
}

nav li:nth-child(1) a > span span::after {
    content: "HOME";
}
nav li:nth-child(2) a > span span::after {
    content: "ABOUT";
}
nav li:nth-child(3) a > span span::after {
    content: "STUDY";
}
nav li:nth-child(4) a > span span::after {
    content: "PRICE";
}
nav li:nth-child(5) a > span span::after {
    content: "CONTACT";
}

nav a:hover > span span::after {
    transform: translateY(0%); /* Move it up to the original text's position */
}
.subject {
    background-color: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 200px;
    padding: 10px 22px;
    width: max-content;
    font-weight: 100;
    margin-bottom: 10px; /* 제목과 타이틀 사이 간격 추가 */
}
.card {
    margin: 10px; /* 카드 간 간격 */
    padding: 30px;
    border-radius: 25px;
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
    display: flex; /* 내부 컨텐츠 정렬을 위해 flexbox 사용 */
    flex-direction: column; /* 세로로 정렬 */
    justify-content: flex-end; /* 내용을 아래로 정렬 */
    color: white; /* 텍스트 색상 */
    position: relative; /* 자식 요소의 위치 지정을 위해 */
    overflow: hidden; /* 이미지가 카드 밖으로 나가지 않도록 */
    height: 500px; /* 최소 높이 설정 */
    cursor: pointer;
}

.card-content {
    /* subject와 title을 감싸는 div */
    position: relative;
    z-index: 2; /* 배경 이미지 위에 오도록 */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gallery .title {
    font-size: min(33px, 3vw);
}
.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2열 기본 */
    grid-template-rows: auto; /* 행 높이 자동 */
    grid-template-areas:
        "card1 card2"
        "card3 card3"
        "card4 card5";
}
.card img {
    width: 100%;
    height: 100%;
    position: absolute;
    object-fit: cover;
    top: 0;
    left: 0;
    transition: 0.5s;
}

.card:hover img {
    transform: scale(1.1);
}

/* 각 카드별 배경 이미지 및 그리드 영역 설정 */
.card:nth-child(1) {
    grid-area: card1;
}

.card:nth-child(2) {
    grid-area: card2;
}

.card:nth-child(3) {
    grid-area: card3;
    min-height: 400px; /* 더 큰 높이 설정 */
}

.card:nth-child(4) {
    grid-area: card4;
}

.card:nth-child(5) {
    grid-area: card5;
}

.question {
    font-size: 1.1em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    padding-top: 50px;
}

.question .dot {
    width: 8px;
    height: 8px;
    background-color: #55c91c;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
}

.question .dot::after {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    content: "";
    width: 100%;
    height: 100%;
    margin: -50% auto auto -50%;
    -webkit-transform-origin: 50% 50%;
    transform-origin: 50% 50%;
    border-radius: 50%;
    background-color: #55c91c;
    opacity: 1;
    z-index: 11;
    pointer-events: none;
    animation: nectar_pulsate 2s cubic-bezier(0.2, 1, 0.2, 1) infinite;
}

@keyframes nectar_pulsate {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(3);
    }
}

.logo {
    cursor: pointer;
}

#CONTACT .title {
    font-size: 130px; /* 'Contact Us' 텍스트 크기 */
    font-weight: 700;
    margin-bottom: 50px;
    color: #000;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 25px; /* 버튼 사이 간격 */
    margin-bottom: 50px; /* 하단 텍스트와의 간격 */
}

.button {
    background: none;
    border: none;
    padding: 10px 0;
    font-size: 16px;
    cursor: pointer;
    color: #333;
    position: relative;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-position: under;
    text-underline-offset: 5px;
}

.footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1em;
    color: #555;

    padding: 0 20px; /* 좌우 여백 */
}

#CONTACT {
    margin: 10px;
    padding: 30px;
    border-radius: 25px;
    background-color: #ede8e4;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: 1fr; /* 모바일에서는 1열 */
        grid-template-areas:
            "card1"
            "card2"
            "card3"
            "card4"
            "card5";
    }
    .card:nth-child(3) {
        /* 모바일에서 card3 높이 조정 */
        min-height: 250px;
    }
    #CONTACT .title {
        font-size: 30px;
    }
    .nav-menu {
        display: none;
    }
    nav {
        justify-content: center;
    }
    .card {
        height: 300px;
        padding: 20px;
    }
    #CONTACT {
        margin-bottom: 100px;
    }
    .subject {
        font-size: 12px;
    }
    .gallery .title {
        font-size: min(20px, 10vw);
    }
    h1 {
        font-size: max(20px, 10vw);
    }
}
