/* ==========================================================================
   CSS Reset & Variables
   ========================================================================== */
:root {
    /* Color Palette */
    --color-bg-deep: #070a13;
    --color-bg-dark: #0c101d;
    --color-bg-card: rgba(255, 255, 255, 0.03);
    --color-border-card: rgba(255, 255, 255, 0.08);
    --color-text-main: #f3f4f6;
    --color-text-sub: #9ca3af;
    --color-text-muted: #6b7280;
    
    /* App Accents (RGB formats for opacity manipulation) */
    --color-company-rgb: 16, 185, 129;   /* Emerald */
    --color-block-rgb: 168, 85, 247;     /* Purple */
    --color-bunsik-rgb: 249, 115, 22;     /* Orange */
    --color-warfare-rgb: 239, 68, 68;     /* Red */
    --color-chul-rgb: 20, 184, 166;       /* Teal */
    
    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #a855f7 0%, #3b82f6 50%, #10b981 100%);
    --gradient-glow: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);

    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--color-bg-deep);
    color: var(--color-text-main);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg-deep);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Background Glow Effects
   ========================================================================== */
.glow-bg-1, .glow-bg-2 {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
}

.glow-bg-1 {
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, rgba(0,0,0,0) 70%);
}

.glow-bg-2 {
    top: 600px;
    right: -200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, rgba(0,0,0,0) 70%);
}

/* ==========================================================================
   Layout & Common Components
   ========================================================================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(7, 10, 19, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: var(--transition-fast);
}

.logo-accent {
    background: linear-gradient(135deg, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.lang-btn {
    border: 0;
    background: transparent;
    color: var(--color-text-sub);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.lang-btn:hover {
    color: var(--color-text-main);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-text-main);
}

.nav-link {
    color: var(--color-text-sub);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tag-company { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.tag-block { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.tag-bunsik { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.tag-warfare { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.tag-chul { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; }

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10rem 2rem 5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 85vh;
    justify-content: center;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-sub);
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-sub);
    max-width: 700px;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 5rem;
}

.hero-stats {
    display: flex;
    gap: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 3rem;
    width: 100%;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* ==========================================================================
   Projects Grid Section
   ========================================================================== */
.projects {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.section-subtitle {
    color: var(--color-text-sub);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.app-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-card);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

/* Neo glow background for each card */
.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: 16px;
    background: radial-gradient(circle 250px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(var(--accent-color), 0.08), transparent 80%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.app-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--accent-color), 0.3);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2), 
                0 0 20px rgba(var(--accent-color), 0.15);
}

.app-card:hover .card-glow {
    opacity: 1;
}

.app-card-content {
    padding: 2rem;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.app-card-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.app-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px; /* Apple style Squircle */
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.app-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.app-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-main);
}

.app-card-summary {
    color: var(--color-text-sub);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.app-card-footer {
    display: flex;
    justify-content: flex-end;
}

.view-detail-btn {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.app-card:hover .view-detail-btn {
    color: rgb(var(--accent-color));
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about {
    background: rgba(255, 255, 255, 0.01);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding: 8rem 2rem;
}

.about-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.about-visual {
    display: flex;
    justify-content: center;
}

.developer-profile-wrapper {
    position: relative;
    width: 250px;
    height: 250px;
}

.profile-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(135deg, #a855f7, #3b82f6, #10b981);
    border-radius: 40px;
    filter: blur(20px);
    opacity: 0.5;
    z-index: 1;
    animation: pulseGlow 8s infinite alternate;
}

.profile-avatar {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 36px;
    object-fit: cover;
    z-index: 2;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.about-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-title {
    font-size: 2rem;
    font-weight: 800;
}

.about-text {
    color: var(--color-text-sub);
    font-size: 1rem;
    line-height: 1.7;
}

.contact-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-main);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Slide-over Drawer for App Details
   ========================================================================== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 5, 10, 0.8);
    backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.app-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 580px;
    height: 100%;
    background: var(--color-bg-dark);
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.app-drawer.active {
    transform: translateX(0);
}

.drawer-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(4px);
    transition: var(--transition-fast);
}

.drawer-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

/* Drawer Banner */
.drawer-banner-container {
    position: relative;
    width: 100%;
    height: clamp(220px, 34vw, 320px);
    overflow: hidden;
    background: #000;
}

.drawer-banner-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.drawer-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 30%, var(--color-bg-dark) 100%);
}

/* Drawer Body */
.drawer-body {
    padding: 3.5rem 2.5rem 3rem;
    margin-top: -3.5rem;
    position: relative;
    z-index: 2;
}

.drawer-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.drawer-icon-img {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    border-radius: 22px;
    object-fit: cover;
    border: 3px solid var(--color-bg-dark);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.drawer-header-meta {
    min-width: 0;
    flex: 1;
}

.drawer-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.drawer-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.drawer-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-sub);
    margin-top: 0.25rem;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

/* Drawer Section */
.drawer-section {
    margin-bottom: 2.5rem;
}

.drawer-section-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.drawer-desc {
    color: var(--color-text-sub);
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-line;
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.carousel-track-wrapper {
    overflow-x: auto;
    width: 100%;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 0 0.25rem;
}

/* Hide scrollbar for carousel track */
.carousel-track-wrapper::-webkit-scrollbar {
    display: none;
}

.carousel-track {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    align-items: center;
}

.carousel-item {
    flex: 0 0 160px; /* Vertical screen typical size */
    height: 284px;
    scroll-snap-align: start;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item.landscape {
    flex: 0 0 320px; /* Horizontal screen typical size */
    height: 180px;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: var(--transition-fast);
}

.carousel-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.carousel-btn.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.carousel-btn.prev { left: 0; }
.carousel-btn.next { right: 0; }

/* Store Buttons */
.store-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.store-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-family: inherit;
    transition: var(--transition-smooth);
    width: 100%;
    justify-content: center;
}

.store-btn i {
    font-size: 1.5rem;
}

.store-btn-sub {
    display: block;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.store-btn-main {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
}

.store-btn:hover:not(.disabled) {
    background: #1f2937;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
}

.store-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 2rem;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-copyright {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.footer-note {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.05); opacity: 0.6; }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 900px) {
    html { font-size: 15px; }
    
    .hero-title { font-size: 2.75rem; }
    
    .about-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .contact-links {
        justify-content: center;
    }
    
    .hero-stats {
        gap: 2rem;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .header-container {
        padding: 1rem;
    }
    .nav-links { gap: 1rem; }
    .header-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    .lang-switcher {
        order: 3;
    }
    
    .hero { padding: 8rem 1rem 4rem; }
    .hero-title { font-size: 2.25rem; }
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    .btn { justify-content: center; }
    
    .drawer-body {
        padding: 3rem 1.5rem 2rem;
    }
    .drawer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .store-buttons {
        flex-direction: column;
    }
}
