:root {
    --vite-purple: #bd34fe;
    --vite-blue: #41d1ff;
    --vite-dark: #0f0e14;
    --glass-bg: rgba(30, 30, 36, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

html, body {
    height: 100%;
    overflow: hidden;
    position: fixed;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--vite-dark);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

/* Animated Background */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(189, 52, 254, 0.15), transparent 40%),
                radial-gradient(circle at 80% 20%, rgba(65, 209, 255, 0.15), transparent 40%);
    animation: bg-pulse 15s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes bg-pulse {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-5%, -5%) scale(1.1); }
}

body {
    display: flex;
    flex-direction: column;
}
.site-header {
    flex: 0 0 auto;
    background: rgba(15, 14, 20, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    padding: 0;
}
.hub-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    gap: 2vh;
    padding: 4vh 1.5rem 4vh 1.5rem;
    box-sizing: border-box;
    perspective: 1000px;
}

/* Glassmorphism Card */
.hub-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 1.2vh 2rem;
    width: 100%;
    max-width: 420px;
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: auto;
    min-height: 14vh;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s ease-out, box-shadow 0.4s ease; /* Faster transform for tilt */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transform-style: preserve-3d; /* Enable 3D space */
    
    /* Entrance Animation */
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    
    /* Remove tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
}

/* 3D Pop-out Effect for Content */
.hub-icon, .hub-title, .hub-desc {
    transform: translateZ(20px); /* Float above card */
    transform-style: preserve-3d;
}

.hub-icon {
    transform: translateZ(40px); /* Icon floats higher */
    font-size: 3.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.2));
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/*
.hub-icon-svg {
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}
*/

.hub-card:nth-child(2) {
    animation-delay: 0.15s;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glowing Border Effect */
.hub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.02));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Spotlight Effect */
.hub-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.04), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 1;
}

.hub-card:hover::after {
    opacity: 1;
}

/* Spotlight Border */
.hub-card .spotlight-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    padding: 1px;
    background: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.4), transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 2;
}

/* PC Hover Effects (Separate from Mobile) */
@media (hover: hover) {
    .hub-card:hover .spotlight-border {
        opacity: 1;
    }

    .hub-card:hover {
        transform: translateY(-10px) scale(1.02);
        box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7), 
                    0 0 50px rgba(189, 52, 254, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    }

    /* Special Glow for Analysis Card */
    .hub-card:first-child:hover {
        box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7), 
                    0 0 60px rgba(65, 209, 255, 0.2);
    }

    /* Hover Effects - Premium */
    .hub-card:hover .hub-icon {
        transform: translateZ(60px) scale(1.15);
        filter: drop-shadow(0 0 40px rgba(255,255,255,0.5));
    }

    /* Gradient Text for Titles on Hover */
    .hub-card:first-child:hover .hub-title {
        background: linear-gradient(to right, #80dfff, #e0aaff);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .hub-card:last-child:hover .hub-title {
        background: linear-gradient(to right, #ff80bf, #ffb380);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    
    .hub-card:hover .hub-desc {
        color: #ffffff;
    }
}

.hub-title {
    font-family: 'Manrope', 'Pretendard', sans-serif;
    font-size: 2.4vh;
    font-weight: 700;
    margin-bottom: 1.2vh;
    color: #e0e0e0;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hub-desc {
    font-family: 'Pretendard', sans-serif;
    color: #aaaaaa;
    font-size: 1.5vh;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
    word-break: keep-all;
    transition: all 0.3s;
}

/*
.hub-card:hover .hub-desc {
    color: rgba(255, 255, 255, 0.9);
}
*/

.site-footer {
    flex: 0 0 auto;
    margin-top: 0 !important;
    padding: 1rem 0 !important;
    background: transparent !important;
    border-top: none !important;
    position: absolute;
    bottom: 0;
    width: 100%;
    pointer-events: none;
    z-index: 10;
}
.site-footer__inner {
    pointer-events: auto;
    padding-bottom: 1rem;
}

@media (min-width: 768px) {
    .hub-container {
        flex-direction: row;
        gap: 3rem;
        justify-content: center;
        padding: 0 2rem;
    }
    .hub-card {
        height: auto;
        max-height: none;
        padding: 3rem 2.5rem;
        flex: 0 1 450px;
        min-height: 320px;
    }
    .hub-icon { font-size: 5rem; margin-bottom: 2rem; }
    .hub-title { 
        font-size: 2rem; 
        margin-bottom: 1rem; 
        word-break: keep-all;
        text-align: center;
    }
    .hub-desc { 
        font-size: 1.1rem; 
        word-break: keep-all;
    }
    .site-footer {
        position: relative;
        bottom: auto;
        padding: 2rem 0 !important;
    }
}

/* Mobile Wow Effects (Touch Devices) */
/* Applied when hover is none OR when .is-mobile class is present */
@media (hover: none), (pointer: coarse) {
    /* 1. Active/Touch Feedback */
    .hub-card:active {
        transform: scale(0.96);
        transition: transform 0.1s;
    }

    /* 2. Neon Pulse Glow */
    @keyframes neon-pulse-1 {
        0%, 100% { box-shadow: 0 0 20px rgba(65, 209, 255, 0.1); border-color: rgba(65, 209, 255, 0.3); }
        50% { box-shadow: 0 0 35px rgba(189, 52, 254, 0.2); border-color: rgba(189, 52, 254, 0.3); }
    }
    @keyframes neon-pulse-2 {
        0%, 100% { box-shadow: 0 0 20px rgba(255, 45, 136, 0.1); border-color: rgba(255, 45, 136, 0.3); }
        50% { box-shadow: 0 0 35px rgba(255, 142, 97, 0.2); border-color: rgba(255, 142, 97, 0.3); }
    }

    /* 3. Mobile 3D Sway (Gyroscope Simulation) - Disabled */
    /*
    @keyframes mobile-3d-sway {
        0% { transform: perspective(1000px) rotateX(0) rotateY(0); }
        25% { transform: perspective(1000px) rotateX(3deg) rotateY(3deg); }
        50% { transform: perspective(1000px) rotateX(0) rotateY(0); }
        75% { transform: perspective(1000px) rotateX(-3deg) rotateY(-3deg); }
        100% { transform: perspective(1000px) rotateX(0) rotateY(0); }
    }
    */

    .hub-card:first-child {
        animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, neon-pulse-1 4s infinite ease-in-out;
    }
    
    .hub-card:last-child {
        animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, neon-pulse-2 4s infinite ease-in-out;
        animation-delay: 0.15s, 2s;
    }

    /* 4. Auto Shine Effect (자동 빛 반사) */
    .mobile-shine {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 24px;
        background: linear-gradient(
            120deg,
            transparent 30%,
            rgba(255, 255, 255, 0.01) 45%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0.01) 55%,
            transparent 70%
        );
        background-size: 200% 200%;
        animation: shine-sweep 4s infinite linear;
        pointer-events: none;
        z-index: 3;
        display: block !important; /* Force display on mobile */
    }

    @keyframes shine-sweep {
        0% { background-position: 150% 0; }
        100% { background-position: -50% 0; }
    }
}

/* Force mobile effects if JS detects mobile */
body.is-mobile .hub-card:first-child {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, neon-pulse-1 4s infinite ease-in-out;
}

body.is-mobile .hub-card:last-child {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, neon-pulse-2 4s infinite ease-in-out;
    animation-delay: 0.15s, 2s;
}

body.is-mobile .mobile-shine {
    display: block !important;
    background: linear-gradient(
        120deg,
        transparent 30%,
        rgba(255, 255, 255, 0.01) 45%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.01) 55%,
        transparent 70%
    );
    background-size: 200% 200%;
    animation: shine-sweep 4s infinite linear;
}

/* Hide mobile shine on desktop (only if not .is-mobile) */
@media (hover: hover) {
    body:not(.is-mobile) .mobile-shine {
        display: none;
    }
}

/* Mobile Default Hover State (Always Active) */
body.is-mobile .hub-card {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 
                0 0 40px rgba(189, 52, 254, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.01) 100%);
}

body.is-mobile .hub-card:first-child {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 
                0 0 50px rgba(65, 209, 255, 0.15);
}

body.is-mobile .hub-card .hub-icon {
    transform: translateZ(50px) scale(1.1);
    filter: drop-shadow(0 0 30px rgba(255,255,255,0.4));
}

body.is-mobile .hub-card:first-child .hub-title {
    background: linear-gradient(to right, #80dfff, #e0aaff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.is-mobile .hub-card:last-child .hub-title {
    background: linear-gradient(to right, #ff80bf, #ffb380);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.is-mobile .hub-card .hub-desc {
    color: rgba(255, 255, 255, 0.9);
}

body.is-mobile .hub-card::after {
    opacity: 1;
}

body.is-mobile .hub-card .spotlight-border {
    opacity: 1;
}