:root {
    --deep-blue: #001F3F;
    --gold: #D4AF37;
    --gold-hover: #b8962e;
    --bg-light: #f8fafc;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    overflow-y: scroll;            /* 항상 스크롤바 공간 확보 — 히어로↔콘텐츠 전환 시 좌우 이동 방지 */
    scrollbar-gutter: stable;      /* 모던 브라우저: 스크롤바 공간을 안정적으로 예약 */
}

body {
    scroll-behavior: smooth;
    color: #1e293b;
    letter-spacing: -0.02em;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5 {
    letter-spacing: -0.04em;
}

/* SR-Only (Screen Reader Only) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Gold Gradient Utility */
.text-gold-gradient {
    background: linear-gradient(135deg, #D4AF37 0%, #F5E0A3 50%, #D4AF37 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Custom Animations */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.animate-fade-up {
    animation: fade-up 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.animate-on-scroll {
    will-change: transform, opacity;
}

/* Before/After Slider */
.before-after-slider {
    position: relative;
    user-select: none;
    touch-action: none;
}

.slider-handle {
    transform: translateX(-50%);
}

/* Premiumface-style Before/After Slider */
.ba-slider {
    --pos: 50%;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.ba-slider .before-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: inset(0 calc(100% - var(--pos)) 0 0);
    z-index: 2;
}

.ba-slider .after-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.ba-slider .slider-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 4;
    cursor: ew-resize;
}

.ba-slider .slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos);
    z-index: 3;
}

/* FAQ Accordion Styling */
.faq-item.active {
    border-color: var(--gold);
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.1);
}

.faq-answer {
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Language Dropdown — closed state (overrides Tailwind) */
.lang-dropdown-container #lang-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(0.5rem) !important;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

/* Language Dropdown — open state (.show 토글) */
.lang-dropdown-container #lang-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto;
}

/* Language menu link clickability */
.lang-dropdown-container #lang-menu a {
    display: flex;
    cursor: pointer;
    position: relative;
    z-index: 51;
}

/* Selection */
::selection {
    background: var(--gold);
    color: white;
}

/* Responsive Font Optimizations */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--deep-blue);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Table Specific Styling */
#surgery-table-container tr:hover td {
    background-color: rgba(212, 175, 55, 0.02);
    transition: background-color 0.3s ease;
}

/* Quick Bar (snbMain) */
#snbMain {
    position: fixed;
    right: 20px;
    bottom: 100px;
    z-index: 100;
}

#asideRight ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#asideRight li a {
    display: block;
    transition: transform 0.2s ease;
}

#asideRight li a:hover {
    transform: scale(1.1);
}

#asideRight img {
    display: block;
    width: 60px;
    /* Adjust size as needed based on actual images */
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* =========================================
   Hero Background Image (body-center)
   ========================================= */
.hero-bg-image {
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    animation: heroZoom 20s infinite alternate;
}

@keyframes heroZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

/* 모바일에서는 줌 효과 축소 + 위치 조정 */
@media (max-width: 768px) {
    .hero-bg-image {
        background-position: center top;
        animation: heroZoom 25s infinite alternate;
    }
    @keyframes heroZoom {
        0% { transform: scale(1); }
        100% { transform: scale(1.04); }
    }
}

@media (max-width: 768px) {
    #snbMain {
        right: 10px;
        bottom: 20px;
        transform: scale(0.8);
        transform-origin: bottom right;
    }
}