/* ==========================================================================
   PhotoView Design System & Custom Styles
   ========================================================================== */

/* 1. Base & Reset */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    color: #1d1d1f;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Pretendard", "Noto Sans KR", sans-serif;
    letter-spacing: -0.01em;
}

/* Global Typography Readability Enhancements */
.text-xs {
    font-size: 0.8125rem !important; /* 13px (was 12px) */
    line-height: 1.5 !important;
}

.text-sm {
    font-size: 0.9375rem !important; /* 15px (was 14px) */
    line-height: 1.6 !important;
}

.text-\[11px\], .text-\[10px\] {
    font-size: 0.75rem !important; /* 12px (was 10~11px) */
    line-height: 1.4 !important;
}

.text-\[13px\] {
    font-size: 0.875rem !important; /* 14px (was 13px) */
}

/* Navigation bar font size */
header nav a {
    font-size: 0.875rem !important; /* 14px */
    letter-spacing: -0.01em;
}

/* Article & Content prose font scale */
.prose {
    font-size: 1rem !important; /* 16px base body */
    line-height: 1.75 !important;
    color: #2c2c2e;
}

.prose p {
    margin-bottom: 1.15rem;
    font-size: 1.025rem !important; /* 16.4px */
    line-height: 1.8 !important;
}

.prose ul, .prose ol {
    font-size: 0.95rem !important; /* 15.2px */
    line-height: 1.7 !important;
}

.prose h3 {
    font-size: 1.25rem !important; /* 20px */
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.prose h4 {
    font-size: 1.1rem !important; /* 17.6px */
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Footer readability */
footer {
    font-size: 0.8125rem !important; /* 13px */
    line-height: 1.6 !important;
}

footer .text-\[11px\] {
    font-size: 0.75rem !important; /* 12px */
}

::selection {
    background-color: #0071e3;
    color: #ffffff;
}

[x-cloak] {
    display: none !important;
}

/* 2. Scrollbars */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f5f5f7;
    border-radius: 8px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #d2d2d7;
    border-radius: 8px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #86868b;
}

/* 3. Glassmorphism Utilities */
.glass-header {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-header.scrolled {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    border-bottom-color: rgba(210, 210, 215, 0.6);
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(232, 232, 237, 0.8);
}

.glass-dark {
    background: rgba(29, 29, 31, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* 4. Motion & Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

.reveal-scale {
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* 5. Hover & Interactive Animations */
.hover-lift {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.08);
}

.card-hover {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover:hover {
    border-color: #0071e3;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -4px rgba(0, 113, 227, 0.12);
}

/* 6. Image Comparison Slider */
.img-compare-wrapper {
    position: relative;
    overflow: hidden;
    user-select: none;
    touch-action: pan-y;
    border-radius: 1.5rem;
}

.img-compare-before,
.img-compare-after {
    width: 100%;
    height: 100%;
}

.img-compare-after {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
}

.img-compare-after img {
    max-width: none;
}

.img-compare-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ffffff;
    cursor: ew-resize;
    z-index: 20;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
    transform: translateX(-50%);
}

.img-compare-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    color: #1d1d1f;
}

/* 7. Toast Notification */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 12px 20px;
    border-radius: 9999px;
    background: rgba(29, 29, 31, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    animation: toast-slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-success {
    border-left: 4px solid #248a3d;
}

.toast.toast-info {
    border-left: 4px solid #0071e3;
}

.toast.toast-hiding {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 8. Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 40;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #d2d2d7;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(14px) scale(0.9);
    pointer-events: none;
    color: #1d1d1f;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.back-to-top:hover {
    background: #0071e3;
    border-color: #0071e3;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.3);
}

/* 9. Interactive Calculator & Range Styling */
input[type="range"] {
    accent-color: #0071e3;
}

/* 10. Pulse Indicator */
.pulse-dot {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #248a3d;
    border-radius: 50%;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 16px;
    height: 16px;
    background-color: rgba(36, 138, 61, 0.4);
    border-radius: 50%;
    animation: pulse-ring 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}
