:root {
    --primary-color: #ffffff;
    --secondary-color: #a1a1aa;
    --background-dark: #000000;
    --text-light: #ffffff;
    --text-accent: #e5e5e5;
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-bg: rgba(20, 20, 20, 0.6);
}

body {
    font-family: 'Montserrat', 'Noto Sans KR', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-light);
    overflow-x: hidden;
}

.gradient-bg {
    background-color: var(--background-dark);
    background-image:
        radial-gradient(circle at 50% 50%, rgba(30, 30, 30, 0.4) 0%, transparent 50%);
    position: relative;
}

.gradient-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.content {
    position: relative;
    z-index: 1;
}

.text-gradient {
    background: linear-gradient(90deg, var(--primary-color), var(--text-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(40, 40, 40, 0.6);
}

.project-card {
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.project-overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 21, 37, 0.6);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.project-card:hover .project-overlay {
    bottom: 0;
}

.skill-bar {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #ffffff, #71717a);
    border-radius: 4px;
    transition: width 1.5s ease;
    width: 0;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    margin: 0 auto;
    border-right: 3px solid var(--primary-color);
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--text-accent)
    }
}

/* Typography Enhancements */
h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(to right, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Entrance Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 네비게이션 스타일 */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .section {
        min-height: auto;
        padding: 4rem 0;
    }

    .typing-effect {
        font-size: 2rem;
    }

    .project-card {
        height: 200px;
    }
}

/* Modal styles for better mobile experience and readability */
#miceModal {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#miceModal:not(.hidden) {
    opacity: 1;
}

#miceModal .bg-slate-800 {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Mobile-specific modal styles */
@media (max-width: 768px) {
    #miceModal {
        padding: 1rem;
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #miceModal .bg-slate-800 {
        margin-top: 2rem;
        margin-bottom: 2rem;
        max-height: none;
        border-radius: 1rem;
        background: rgba(15, 23, 42, 0.98);
    }

    #miceModal .p-8 {
        padding: 1.5rem;
    }

    /* Close button improvements for mobile */
    #miceModal button[onclick="closeMiceModal()"] {
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.2);
        font-size: 1.5rem;
        z-index: 10;
    }

    #miceModal button[onclick="closeMiceModal()"]:hover {
        background: rgba(0, 0, 0, 0.7);
        border-color: rgba(255, 255, 255, 0.3);
    }

    /* Modal content improvements for mobile */
    #miceModal .text-3xl {
        font-size: 1.875rem;
        line-height: 1.2;
        margin-right: 3rem;
    }

    #miceModal .grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    #miceModal .card {
        background: rgba(16, 23, 42, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Tablet-specific modal styles */
@media (min-width: 769px) and (max-width: 1024px) {
    #miceModal .bg-slate-800 {
        max-width: 90%;
    }

    #miceModal .p-8 {
        padding: 2rem;
    }
}

/* Enhanced contrast for better readability */
#miceModal .text-gray-300 {
    color: #e2e8f0;
}

#miceModal .text-gray-400 {
    color: #cbd5e1;
}

/* Improved scrollbar styling for modal content */
#miceModal .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#miceModal .overflow-y-auto::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#miceModal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 3px;
}

#miceModal .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}