:root {
    --primary-color: #3182f6;
    --primary-hover: #1b64da;
    --primary-light: #e8f3ff;
    --bg-primary: #ffffff;
    --bg-secondary: #f7f8fa;
    --text-primary: #191f28;
    --text-secondary: #4e5968;
    --text-tertiary: #8b95a1;
    --border-color: #e5e8eb;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.08);
    --scrim-color: rgba(0, 0, 0, 0.4);
    --transition-base: 0.25s ease;
    --sheet-duration: 0.22s;
    --sheet-opacity-duration: 0.16s;
    --sheet-shadow: -8px 0 24px var(--card-shadow);
}

[data-theme="dark"] {
    --bg-primary: #111213;
    --bg-secondary: #16181a;
    --text-primary: #f5f6f7;
    --text-secondary: #c1c7cd;
    --text-tertiary: #8a9199;
    --border-color: #2a2f35;
    --card-bg: #1b1d1f;
    --card-shadow: rgba(0, 0, 0, 0.35);
    --scrim-color: rgba(0, 0, 0, 0.6);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

html.nav-motion-lite {
    --sheet-duration: 0.16s;
    --sheet-opacity-duration: 0.12s;
    --sheet-shadow: -4px 0 14px var(--card-shadow);
}

body {
    margin: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-base), color var(--transition-base);
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--primary-color);
}

.page-offset {
    padding-top: 96px;
}

.app-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
}

[data-theme="dark"] .app-header {
    background: rgba(17, 17, 17, 0.78);
}

.brand {
    font-weight: 900;
    letter-spacing: -0.3px;
    font-size: 1.4rem;
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn,
.lang-btn {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
    box-shadow: 0 2px 10px var(--card-shadow);
}

.icon-btn {
    width: 42px;
    height: 42px;
}

.lang-btn {
    min-width: 52px;
    height: 42px;
    padding: 0 16px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.icon-btn:hover,
.lang-btn:hover {
    transform: translateY(-1px);
}

.icon-btn:active,
.lang-btn:active {
    transform: translateY(0);
}

.scrim {
    position: fixed;
    inset: 0;
    background: var(--scrim-color);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    will-change: opacity;
    transition:
        opacity var(--sheet-opacity-duration) ease,
        visibility 0s linear var(--sheet-opacity-duration);
    z-index: 1050;
}

.scrim.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
        opacity var(--sheet-opacity-duration) ease,
        visibility 0s linear 0s;
}

.sheet {
    position: fixed;
    top: 0;
    right: 0;
    width: min(88vw, 340px);
    max-width: 340px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--sheet-shadow);
    opacity: 0.01;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(100%, 0, 0);
    will-change: transform, opacity;
    transition:
        transform var(--sheet-duration) cubic-bezier(0.16, 1, 0.3, 1),
        opacity var(--sheet-opacity-duration) ease,
        visibility 0s linear var(--sheet-duration);
    z-index: 1100;
}

.sheet.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    transition:
        transform var(--sheet-duration) cubic-bezier(0.16, 1, 0.3, 1),
        opacity var(--sheet-opacity-duration) ease,
        visibility 0s linear 0s;
}

.sheet-header {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.sheet-body {
    padding: 14px 12px 18px;
    display: grid;
    gap: 4px;
    overflow-y: auto;
}

.sheet-body a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    font-weight: 700;
    color: var(--text-primary);
    transition: background-color var(--transition-base), color var(--transition-base);
}

.sheet-body a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

[data-theme="dark"] .sheet-body a:hover {
    background: rgba(49, 130, 246, 0.18);
    color: #dbeafe;
}

.sheet-item-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.sheet-body a:hover .sheet-item-icon {
    background: var(--card-bg);
    color: var(--primary-color);
}

[data-theme="dark"] .sheet-body a:hover .sheet-item-icon {
    background: rgba(255, 255, 255, 0.08);
    color: #dbeafe;
}

.sheet-item-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
    line-height: 1.25;
}

.sheet-item-label {
    overflow: hidden;
    font-size: 0.98rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sheet-item-description {
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sheet-body a:hover .sheet-item-description {
    color: var(--text-secondary);
}

.sheet-service-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 3px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--card-bg) 78%, var(--bg-secondary) 22%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sheet-service-icon .service-title-icon {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.sheet-service-label {
    min-width: 0;
    flex: 1;
    line-height: 1.35;
}

[data-theme="dark"] .sheet-service-icon {
    background: rgba(255, 255, 255, 0.04);
}

.app-footer {
    padding: 18px 16px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    text-align: center;
}

[data-theme="dark"] .app-footer {
    background: rgba(20, 20, 20, 0.82);
}

.app-footer .container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.app-footer .container a {
    color: inherit;
    text-decoration: none;
    padding: 0 4px;
}

.app-footer .container a:hover {
    color: var(--primary-color);
}

.app-footer .divider {
    color: inherit;
}

@media (max-width: 768px) {
    .app-header {
        height: 68px;
        padding: 0 16px;
    }

    .brand {
        font-size: 1.2rem;
    }

    .nav-actions {
        gap: 8px;
    }

    .icon-btn,
    .lang-btn {
        border-radius: 10px;
        box-shadow: 0 2px 6px var(--card-shadow);
    }

    .icon-btn {
        width: 38px;
        height: 38px;
    }

    .lang-btn {
        min-width: 48px;
        height: 38px;
        padding: 0 12px;
    }

    .page-offset {
        padding-top: 88px;
    }
}

@media (max-width: 480px) {
    .app-header {
        height: 64px;
        padding: 0 12px;
    }

    .brand {
        font-size: 1.1rem;
    }

    .icon-btn,
    .lang-btn {
        box-shadow: 0 1px 4px var(--card-shadow);
    }

    .app-footer .container {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 4px;
    }
}
