@font-face {
    font-family: 'MaplestoryOTFBold';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@2.1/MaplestoryOTFBold.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --main-font: 'MaplestoryOTFBold', 'Pretendard', sans-serif;
    --bg-image: url('../../background.webp');
    --bg-color: #f0f2f5;
}

body {
    background-color: var(--bg-color);
    background-image: var(--bg-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

body.theme-dark {
    background-color: #080b12;
    background-image:
        radial-gradient(circle at 50% 8%, rgba(43, 82, 132, 0.34), transparent 42%),
        linear-gradient(180deg, rgba(10, 24, 45, 0.74), rgba(6, 16, 34, 0.88)),
        var(--bg-image);
}

.container,
.style-page {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(249, 247, 240, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

body.theme-dark :is(.container, .style-page) {
    background-color: rgba(13, 17, 27, 0.88);
    border-color: rgba(240, 211, 163, 0.16);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.38);
}

.site-title-logo {
    display: block;
    width: min(8.5em, 100%);
    height: auto;
    margin-inline: auto;
}

.site-title-dark,
body.theme-dark .site-title-light {
    display: none;
}

body.theme-dark .site-title-dark {
    display: block;
}

.container > .site-title {
    margin-block: 8px;
}

.page-header > .site-title {
    width: 100%;
    min-width: 0;
}

@media (min-width: 601px) {
    .style-page .page-header { margin-bottom: 3px; }
}

@media (max-width: 600px) {
    .container > .site-title { margin-block: 4px 5px; }
}

.theme-toggle {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 120;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 106px;
    min-height: 38px;
    padding: 7px 9px 7px 12px;
    color: #4a4038;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(78, 60, 43, 0.18);
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(62, 48, 34, 0.12);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.92);
}
.theme-toggle-track {
    position: relative;
    flex: 0 0 auto;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: rgba(113, 93, 74, 0.25);
    border: 1px solid rgba(113, 93, 74, 0.18);
}
.theme-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f4c85b;
    box-shadow: 0 0 8px rgba(244, 200, 91, 0.42);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

body.theme-dark .theme-toggle {
    color: #f4ead8;
    background: rgba(23, 28, 42, 0.88);
    border-color: rgba(205, 167, 104, 0.28);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
body.theme-dark .theme-toggle-track {
    background: rgba(115, 91, 170, 0.42);
    border-color: rgba(199, 165, 255, 0.22);
}
body.theme-dark .theme-toggle-thumb {
    background: #d9cff7;
    box-shadow: 0 0 10px rgba(201, 164, 255, 0.54);
    transform: translateX(16px);
}

@media (max-width: 600px) {
    .theme-toggle {
        top: 10px;
        right: 10px;
        min-width: 82px;
        min-height: 30px;
        padding: 5px 7px 5px 9px;
        gap: 6px;
        font-size: 8px;
    }
    .theme-toggle-track {
        width: 28px;
        height: 16px;
    }
    .theme-toggle-thumb {
        width: 10px;
        height: 10px;
    }
    body.theme-dark .theme-toggle-thumb {
        transform: translateX(12px);
    }
}
