/* ==========================================
   Phase Craft - Premium Design System
   ========================================== */

/* CSS Variables */
:root {
    /* Colors - Light & Vibrant with Purple accent */
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-muted: #888888;
    
    --accent-primary: #A855F7;
    --accent-secondary: #7C3AED;
    --accent-gradient: linear-gradient(135deg, #A855F7 0%, #7C3AED 100%);
    --accent-light: rgba(168, 85, 247, 0.1);
    
    --border-color: #e5e5e5;
    --border-light: #f0f0f0;
    
    --card-shadow: 0 2px 8px rgba(0,0,0,0.06);
    --card-shadow-hover: 0 12px 32px rgba(0,0,0,0.12);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Typography */
    --font-sans: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ==========================================
   Navigation
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    height: 72px;
}

.nav-container {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-image {
    height: 38px;
    width: auto;
    display: block;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-center {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-link {
    padding: var(--space-sm) var(--space-md);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--text-primary);
    color: white;
}

.btn-talk {
    padding: var(--space-sm) var(--space-lg);
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.btn-talk:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.45);
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    min-height: 100vh;
    padding: 100px var(--space-xl) var(--space-4xl);
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--space-3xl);
    max-width: 1400px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-primary);
    background: var(--accent-light);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-lg);
}

.badge-pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.hero-title {
    font-size: clamp(42px, 6vw, 64px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-lg);
}

.typed-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cursor {
    color: var(--accent-primary);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-desc {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.45);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.btn-ghost:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    height: 500px;
}

.hero-image-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

.stack-card {
    position: absolute;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--card-shadow-hover);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stack-card img {
    display: block;
}

.card-1 {
    width: 280px;
    height: 360px;
    top: 10%;
    left: 5%;
    z-index: 3;
}

.card-2 {
    width: 240px;
    height: 300px;
    top: 25%;
    right: 10%;
    z-index: 2;
    transform: rotate(3deg);
}

.card-3 {
    width: 200px;
    height: 260px;
    bottom: 5%;
    left: 30%;
    z-index: 1;
    transform: rotate(-3deg);
}

.stack-card:hover {
    transform: scale(1.05) rotate(0deg);
    z-index: 10;
}

/* ==========================================
   Clients Marquee
   ========================================== */
.clients-marquee {
    padding: var(--space-xl) 0;
    background: var(--bg-secondary);
    overflow: hidden;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.marquee-content {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    padding-right: var(--space-xl);
}

.client-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.client-dot {
    color: var(--accent-primary);
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ==========================================
   Section Headers
   ========================================== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-header h2 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.section-header p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}

.filter-tab {
    padding: var(--space-sm) var(--space-lg);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.filter-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--accent-gradient);
    color: white;
}

/* ==========================================
   Work Section - Masonry Grid
   ========================================== */
.work {
    padding: var(--space-4xl) var(--space-lg);
    background: var(--bg-secondary);
}

.masonry-grid {
    max-width: 1400px;
    margin: 0 auto;
    columns: 4;
    column-gap: var(--space-md);
}

.pin-card {
    break-inside: avoid;
    margin-bottom: var(--space-md);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-smooth);
}

.pin-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
}

.pin-image {
    position: relative;
    overflow: hidden;
}

.pin-image img {
    position: absolute;
    inset: 0;
    transition: transform 0.5s ease;
}

.pin-card:hover .pin-image img {
    transform: scale(1.05);
}

.pin-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, transparent 40%, transparent 60%, rgba(0,0,0,0.6) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-md);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.pin-card:hover .pin-overlay {
    opacity: 1;
}

.pin-tag {
    align-self: flex-start;
    padding: var(--space-xs) var(--space-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
}

.pin-actions {
    display: flex;
    justify-content: flex-end;
}

.pin-save {
    padding: var(--space-sm) var(--space-md);
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.pin-save:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

.pin-content {
    padding: var(--space-md);
}

.pin-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.pin-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.pin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.tech-tag {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent-primary);
    background: var(--accent-light);
    border-radius: var(--radius-sm);
}

/* ==========================================
   Services Section
   ========================================== */
.services {
    padding: var(--space-4xl) 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.service-card {
    position: relative;
    padding: var(--space-2xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    transition: all var(--transition-smooth);
    border: 1px solid transparent;
}

.service-card:hover {
    background: white;
    border-color: var(--border-color);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
}

.service-card.featured {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.05) 0%, rgba(124, 58, 237, 0.1) 100%);
    border: 2px solid var(--accent-primary);
}

.featured-label {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    padding: var(--space-xs) var(--space-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
}

.service-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
}

.service-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--accent-primary);
}

.service-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.service-card > p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

.service-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.service-list li {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: var(--space-md);
    position: relative;
}

.service-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
}

/* ==========================================
   About Section
   ========================================== */
.about {
    padding: var(--space-4xl) 0;
    background: var(--bg-secondary);
}

.about-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
    align-items: start;
}

.about-tag {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-primary);
    background: var(--accent-light);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-lg);
}

.about-left h2 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: var(--space-lg);
}

.about-lead {
    font-size: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.about-text {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-2xl);
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.feature {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.feature-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
}

.feature strong {
    display: block;
    font-size: 16px;
    margin-bottom: 2px;
}

.feature span {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: var(--space-2xl);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-xl);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-2xl) + 2px);
    top: 8px;
    width: 10px;
    height: 10px;
    background: var(--border-color);
    border-radius: 50%;
    border: 2px solid white;
}

.timeline-item.active::before {
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.timeline-year {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: var(--space-xs);
}

.timeline-content strong {
    display: block;
    font-size: 16px;
    margin-bottom: var(--space-xs);
}

.timeline-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==========================================
   Clients Section
   ========================================== */
.clients {
    padding: var(--space-4xl) 0;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-md);
}

.client-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.client-logo span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.client-logo:hover {
    background: var(--accent-light);
}

.client-logo:hover span {
    color: var(--accent-primary);
}

/* ==========================================
   Contact Section
   ========================================== */
.contact {
    padding: var(--space-4xl) 0;
    background: var(--bg-secondary);
}

.contact-card {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--card-shadow-hover);
}

.contact-left {
    padding: var(--space-3xl);
    background: var(--accent-gradient);
    color: white;
}

.contact-left h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.contact-left > p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: var(--space-2xl);
    line-height: 1.6;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-full);
    font-size: 14px;
    transition: all var(--transition-fast);
    width: fit-content;
}

.contact-link svg {
    width: 18px;
    height: 18px;
}

.contact-link:hover {
    background: rgba(255,255,255,0.25);
}

.contact-form {
    padding: var(--space-3xl);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-md);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    background: white;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.45);
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--border-light);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.footer-info {
    display: flex;
    flex-direction: column;
}

.footer-name {
    font-weight: 600;
}

.footer-address {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: var(--space-xl);
}

.footer-links a {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-copy {
    font-size: 14px;
    color: var(--text-muted);
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 1200px) {
    .masonry-grid {
        columns: 3;
    }
    
    .clients-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 120px;
    }
    
    .hero-visual {
        display: none;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .about-wrapper {
        grid-template-columns: 1fr;
    }
    
    .contact-card {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-center,
    .nav-right {
        display: none;
    }
    
    .masonry-grid {
        columns: 2;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .clients-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-brand {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        columns: 1;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .stat-divider {
        display: none;
    }
    
    .clients-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
