:root {
    --color-bg: #faf9f7;
    --color-surface: #ffffff;
    --color-text: #1a1614;
    --color-text-muted: #6b6560;
    --color-accent: #d97706;
    --color-accent-dark: #b45309;
    --color-border: #e7e5e1;
    
    --font-display: 'Fraunces', serif;
    --font-body: 'Instrument Sans', -apple-system, sans-serif;
    
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 3rem;
    --space-xl: 6rem;
}

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

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(250, 249, 247, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wordmark {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.nav-cta {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border: 1.5px solid var(--color-text);
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-cta:hover {
    background: var(--color-text);
    color: var(--color-bg);
}

/* Hero */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
    padding: var(--space-xl) var(--space-lg);
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content {
    padding-top: 4rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-md);
}

.hero-lead {
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
    max-width: 32rem;
}

.btn-primary {
    display: inline-block;
    background: var(--color-accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 8px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--color-accent-dark);
    transform: translateY(-1px);
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-preview {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--space-md);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.preview-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border);
}

.preview-icon {
    color: var(--color-accent);
    font-size: 1.25rem;
}

.preview-title {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.preview-body {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.875rem;
    line-height: 1.8;
}

.code-line {
    padding: 0.25rem 0;
}

.token-key {
    color: var(--color-accent);
}

.token-value {
    color: var(--color-text);
}

/* Featured */
.featured {
    padding: var(--space-xl) var(--space-lg);
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: var(--space-lg);
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xs);
}

.section-header p {
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--space-md);
}

.skill-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--space-md);
    transition: all 0.2s;
}

.skill-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.1);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.skill-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.skill-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    white-space: nowrap;
}

.skill-desc {
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: var(--space-md);
}

.skill-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Upload */
.upload {
    padding: var(--space-xl) var(--space-lg);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.upload-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.upload-intro {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.upload-intro h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
}

.upload-intro p {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.upload-form {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--space-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-field {
    margin-bottom: var(--space-md);
}

.form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-field input[type="text"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 0.875rem;
    border: 1.5px solid var(--color-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--color-surface);
    transition: border-color 0.2s;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--color-accent);
}

.file-drop {
    position: relative;
}

.file-drop input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-placeholder {
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    padding: var(--space-lg);
    text-align: center;
    background: var(--color-surface);
    transition: all 0.2s;
}

.file-drop:hover .file-placeholder {
    border-color: var(--color-accent);
    background: var(--color-bg);
}

.file-placeholder svg {
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.file-text {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.file-hint {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.btn-submit {
    width: 100%;
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: var(--space-sm);
}

.btn-submit:hover {
    background: var(--color-accent-dark);
}

/* Community */
.community {
    padding: var(--space-xl) var(--space-lg);
    max-width: 1400px;
    margin: 0 auto;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

/* Footer */
.footer {
    padding: var(--space-lg);
    text-align: center;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
}

/* Explore Page */
.explore-page {
    padding-top: 5rem;
    min-height: 100vh;
}

.page-header {
    text-align: center;
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
    max-width: 800px;
    margin: 0 auto;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
}

.page-header p {
    font-size: 1.25rem;
    color: var(--color-text-muted);
}

.filters {
    max-width: 1400px;
    margin: 0 auto var(--space-lg);
    padding: 0 var(--space-lg);
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--color-accent);
}

.filter-btn.active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    background: var(--color-surface);
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.skills-grid-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg) var(--space-xl);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-md);
}

.loading, .error, .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-xl);
    color: var(--color-text-muted);
}

/* Skill Detail Page */
.skill-detail-page {
    padding-top: 5rem;
    min-height: 100vh;
}

.detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.breadcrumb {
    display: flex;
    gap: var(--space-xs);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.breadcrumb a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--color-accent);
}

.detail-header h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
}

.detail-meta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    align-items: center;
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.meta-item {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.detail-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-xl);
    margin-top: var(--space-lg);
}

.detail-main h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    margin-top: var(--space-lg);
}

.detail-main h2:first-child {
    margin-top: 0;
}

.detail-description {
    line-height: 1.7;
    color: var(--color-text-muted);
}

.file-info {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.file-icon {
    font-size: 2rem;
}

.file-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.file-type {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.detail-sidebar {
    position: sticky;
    top: 6rem;
    height: fit-content;
}

.btn-download {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download:hover {
    background: var(--color-accent-dark);
}

.sidebar-info {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.sidebar-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.sidebar-info p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.nav-links {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.nav-links a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--color-accent);
}

.nav-links a.active {
    color: var(--color-accent);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .hero-visual {
        order: -1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .detail-body {
        grid-template-columns: 1fr;
    }
    
    .detail-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    :root {
        --space-lg: 2rem;
        --space-xl: 4rem;
    }
    
    .nav-content {
        padding: var(--space-sm) var(--space-md);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-header h2,
    .upload-intro h2 {
        font-size: 2rem;
    }
    
    .skills-list {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .stat-value {
        font-size: 3rem;
    }
    
    .skills-grid-page {
        grid-template-columns: 1fr;
    }
    
    .page-header h1,
    .detail-header h1 {
        font-size: 2rem;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        width: 100%;
    }
}
