* {
    box-sizing: border-box;
}

body,
ul,
li,
a {
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration: none;
    color: #333;
}

body {
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    background: #f7f8fb;
}

/* =========================
색상 변수 설정
========================= */
.site-header {
    --header-bg: var(--color-coding-bg);
    --header-sub-bg: var(--color-coding-bg);
    --header-point: #2563eb;
    --header-point-soft: #dbeafe;
}

/* 코딩 */
.site-header.coding {
    --header-sub-bg: var(--color-coding-bg);
    --header-point: var(--color-coding-main);
    --header-point-light: var(--color-coding-light);
    --header-point-soft: #dbeafe;
}

/* 영어 + 수학 (오렌지 통일) */
.site-header.english,
.site-header.math {
    /* --header-bg: var(--color-academy-bg); */
    /* --header-sub-bg: var(--color-academy-bg); */
    --header-point: var(--color-academy-main);
    --header-point-light: var(--color-academy-light);
    --header-point-soft: #fed7aa;
}

/* ========================= */

header {
    position: relative;
    width: 100%;
    background-color: var(--header-bg);
    border-bottom: 1px solid #ddd;
    z-index: 1000;
}

/* 헤더 전체 배경판 */
header::before {
    content: '';
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    height: 0;
    background-color: var(--header-sub-bg);
    border-bottom: 0 solid #ddd;
    transition: height 0.4s ease, box-shadow 0.4s ease, border-bottom 0.4s ease;
    z-index: -1;
}

header:hover::before {
    height: 250px;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 1200px;
    height: 80px;
    margin: 0 auto;
    gap: 24px;
}

.logo-area {
    flex: 0 0 220px;
    display: flex;
    align-items: center;
    height: 80px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 800;
    color: var(--header-point);
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.logo-mark {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    overflow: hidden;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: var(--header-point-soft); */
}

.logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    padding-left: 10px;
}

.logo-text .ko {
    font-size: 20px;
    font-weight: 650;
}

.logo-text .en {
    font-size: 14px;
    color: #6b7280;
    letter-spacing: 0.04em;
}

.gnb {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    height: 80px;
}

.depth1 {
    position: relative;
    display: flex;
    height: 80px;
}

.depth1 > li {
    width: 150px;
    text-align: center;
}

.depth1 > li > a {
    display: block;
    line-height: 80px;
    font-size: 18px;
    font-weight: 600;
    transition: color 0.3s;
    white-space: nowrap;
}

.depth1 > li:hover > a {
    color: var(--header-point);
}

/* 슬라이딩 바 */
.menu-indicator {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 78px;
    height: 4px;
    background-color: var(--header-point-light);
    border-radius: 999px;
    opacity: 0;
    transition: left 0.28s ease, width 0.28s ease, opacity 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

.depth2 {
    opacity: 0;
    padding: 15px 0 25px;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.35s;
}

header:hover .depth2 {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.25s ease 0.2s, transform 0.25s ease 0.2s, visibility 0s linear 0s;
}

.depth2 li a {
    display: block;
    padding: 12px 0;
    font-size: 15px;
    color: #666;
    transition: all 0.2s;
}

.depth2 li a:hover {
    color: var(--header-point);
    font-weight: 500;
}

/* 모바일 */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: space-around;
    height: 72px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    z-index: 1200;
}

.mobile-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
}

.mobile-bottom-nav a .icon {
    width: 24px;
    height: 24px;
    display: block;
}

.mobile-bottom-nav a.active {
    color: var(--header-point);
}

.mobile-bottom-nav a.active .icon {
    background: var(--header-point-soft);
    border-radius: 8px;
}

/* 반응형 */
@media (max-width: 1260px) {
    .header-inner {
        width: 100%;
        padding: 0 20px;
    }
}

@media (max-width: 1024px) {
    .logo-area {
        flex-basis: 150px;
    }

    .depth1 > li {
        width: 130px;
    }

    .depth1 > li > a {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    header {
        position: sticky;
        top: 0;
    }

    header::before {
        display: none;
    }

    .header-inner {
        width: 100%;
        height: 64px;
        padding: 0 16px;
        justify-content: center;
    }

    .logo-area {
        flex: 0 0 auto;
        height: 64px;
        justify-content: center;
    }

    .logo {
        font-size: 22px;
        gap: 10px;
    }

    .logo-mark {
        width: 36px;
        height: 36px;
        border-radius: 50px;
        flex: 0 0 36px;
    }

    .logo-text .ko {
        font-size: 17px;
    }

    .logo-text .en {
        font-size: 11px;
    }

    .gnb {
        display: none;
    }

    .mobile-bottom-nav {
        display: flex;
    }
}