/*
 * Home Page CSS
 */

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: var(--space-4xl); /* 헤더 아래 넉넉한 여백 */
}

/* Particle Canvas */
.hero-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Mouse Trailing Glow (JS 제어) */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle 800px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(var(--accent-rgb), 0.12) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
    will-change: background;
}

/* 2nd Aurora Blob (Stationary) */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(var(--gradient-end-rgb), 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    filter: blur(60px);
    animation: blob-2 14s ease-in-out infinite alternate-reverse;
}

/* 3rd blob via box-shadow on the section itself */
.hero-section {
    background-image: radial-gradient(ellipse at 50% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
}

@keyframes blob-2 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(30px, -40px) scale(1.08); }
    66%  { transform: translate(-30px, 20px) scale(0.92); }
    100% { transform: translate(40px, -10px) scale(1.12); }
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    margin-bottom: var(--space-md);
    max-width: 14ch;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* P5: 라이트 테마 Hero 타이틀 대비 강화 */
[data-theme="light"] .hero-title {
    background: linear-gradient(135deg, #0f172a 40%, var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* ==========================================================================
   Core Strengths Section
   ========================================================================== */

.strength-card {
    transition: transform var(--duration-base), box-shadow var(--duration-base);
}

.strength-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
}

.strength-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: var(--space-sm);
}

.strengths-grid .strength-card:nth-child(1) { transition-delay: 0.1s; }
.strengths-grid .strength-card:nth-child(2) { transition-delay: 0.2s; }
.strengths-grid .strength-card:nth-child(3) { transition-delay: 0.3s; }

/* ==========================================================================
   Featured Projects Section
   ========================================================================== */
.section-header {
    margin-bottom: var(--space-2xl);
    text-align: center;
}
.section-header p {
    margin-top: var(--space-sm);
}

.project-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--duration-base) var(--easing-default),
                box-shadow var(--duration-base) var(--easing-default);
}
.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
}

.project-thumb {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background-color: var(--bg-secondary);
    position: relative;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--easing-default);
}

.project-card:hover .project-thumb img {
    transform: scale(1.05);
}

.project-info {
    padding: var(--space-lg);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-tags {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.project-title {
    margin-bottom: var(--space-sm);
}

/* ==========================================================================
   Services Preview (P3-1)
   ========================================================================== */
.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-lg);
    border-radius: var(--rounded-lg);
    transition: transform var(--duration-base), background-color var(--duration-base);
    text-decoration: none;
    color: inherit;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.preview-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at var(--mouse-x, -9999px) var(--mouse-y, -9999px), rgba(var(--accent-rgb), 0.15), transparent 40%);
    opacity: 0;
    transition: opacity var(--duration-base);
    pointer-events: none;
    z-index: 0;
}
.preview-item:hover::before {
    opacity: 1;
}
.preview-item > * {
    position: relative;
    z-index: 1;
}
.preview-item:hover {
    transform: translateY(-4px);
    background-color: var(--bg-surface-hover);
    border-color: var(--accent);
}
.preview-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rounded-lg);
    background: var(--accent-subtle);
    color: var(--accent);
    margin-bottom: var(--space-md);
    transition: all var(--duration-fast);
}
.preview-item:hover .preview-icon {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--on-accent);
}
.preview-item h3 {
    margin-bottom: var(--space-xs);
}

/* Bento Grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 240px;
    gap: var(--space-md);
}
.preview-grid .preview-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
    justify-content: center;
}
.preview-grid .preview-item:nth-child(2) {
    grid-column: span 2;
    grid-row: span 1;
    justify-content: center;
    flex-direction: row;
    text-align: left;
    gap: var(--space-md);
}
.preview-grid .preview-item:nth-child(2) .preview-icon {
    margin-bottom: 0;
}
.preview-grid .preview-item:nth-child(3),
.preview-grid .preview-item:nth-child(4) {
    grid-column: span 1;
    grid-row: span 1;
    justify-content: center;
}

/* 순차 리빌 */
.preview-grid .reveal-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.preview-grid .reveal-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.preview-grid .reveal-on-scroll:nth-child(3) { transition-delay: 0.15s; }
.preview-grid .reveal-on-scroll:nth-child(4) { transition-delay: 0.2s; }

/* ==========================================================================
   Home CTA Section (P3-3)
   ========================================================================== */

/* 카드 순차 리빌 */
.projects-grid .reveal-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.projects-grid .reveal-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.projects-grid .reveal-on-scroll:nth-child(3) { transition-delay: 0.3s; }

/* ==========================================================================
   Mobile Responsive (M-5, M-7, M-10, M-11)
   ========================================================================== */
@media (max-width: 767px) {
    /* M-5: 히어로 풀스크린 + 중앙 정렬 */
    .hero-section {
        min-height: 100vh;           /* fallback */
        min-height: 100dvh;          /* iOS 주소창 대응 */
        padding-top: 0;
        justify-content: center;
        text-align: center;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* P4: 모바일 타이틀 max-width 해제 */
    .hero-title {
        max-width: none;
    }

    .hero-subtitle {
        max-width: 100%;
    }

    .hero-actions {
        justify-content: center;
    }

    /* P3: 모바일 글로우 축소 */
    .hero-section::after {
        width: 250px;
        height: 250px;
        opacity: 0.6;
    }

    /* M-7: Core Strengths Mobile 1칼럼 */
    .strengths-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* M-11: 이미지 높이 축소 */
    .project-thumb {
        height: 180px;
    }

    /* Bento Grid Mobile Fallback */
    .preview-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    .preview-grid .preview-item:nth-child(1),
    .preview-grid .preview-item:nth-child(2),
    .preview-grid .preview-item:nth-child(3),
    .preview-grid .preview-item:nth-child(4) {
        grid-column: span 1;
        grid-row: span 1;
        flex-direction: column;
        text-align: center;
    }
    .preview-grid .preview-item:nth-child(2) .preview-icon {
        margin-bottom: var(--space-md);
    }
}

@media (max-width: 480px) {
    /* M-10: CTA 버튼 풀 width */
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}
