:root {
    --primary: #5c7cfa;
    --secondary: #748ffc;
    --accent: #91a7ff;
    --success: #51cf66;
    --warning: #ffd43b;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

/* New Look Button */
.new-look-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.new-look-btn:hover {
    background: var(--secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(92, 124, 250, 0.3);
}

.new-look-btn:active {
    transform: translateY(0);
}

.new-look-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.new-look-btn:hover svg {
    transform: rotate(180deg);
}

/* Filter Bar */
.filter-bar {
    background: var(--bg-primary);
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.filter-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* Search Bar */
.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--bg-secondary);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(92, 124, 250, 0.1);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--text-secondary);
    stroke-width: 2;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-clear:hover {
    background: rgba(0,0,0,0.05);
}

.search-clear svg {
    width: 16px;
    height: 16px;
    fill: var(--text-secondary);
}

.search-clear.visible {
    display: flex;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    background: var(--bg-primary);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.filter-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* Project Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Project Card */
.project-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
    animation-delay: calc(var(--i) * 0.1s);
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-card:focus-within {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.card-header {
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-icon {
    width: 80px;
    height: 80px;
    fill: rgba(255,255,255,0.9);
    z-index: 1;
}

.card-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.5) 35px, rgba(255,255,255,.5) 70px);
}

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.tag.tag-game {
    background: rgba(255, 87, 34, 0.1);
    color: #ff5722;
}

.tag.tag-visualization {
    background: rgba(156, 39, 176, 0.1);
    color: #9c27b0;
}

.tag.tag-interactive {
    background: rgba(33, 150, 243, 0.1);
    color: #2196f3;
}

.tag.tag-math {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.tag.tag-fashion {
    background: rgba(233, 30, 99, 0.1);
    color: #e91e63;
}

.tag.tag-party {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.tag.tag-nature {
    background: rgba(139, 195, 74, 0.1);
    color: #8bc34a;
}

.tag.tag-voice {
    background: rgba(103, 58, 183, 0.1);
    color: #673ab7;
}

.tag.tag-travel {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.project-title {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex: 1;
    line-height: 1.7;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--bg-secondary);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.project-link:hover {
    gap: 0.75rem;
}

.project-link svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.project-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Featured Card */
.project-card.featured {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.project-card.featured .card-body {
    background: rgba(0,0,0,0.1);
}

.project-card.featured .project-title,
.project-card.featured .project-description {
    color: white;
}

.project-card.featured .tag {
    background: rgba(255,255,255,0.2);
    color: white;
}

.project-card.featured .project-link {
    color: white;
}

.project-card.featured .card-footer {
    border-top-color: rgba(255,255,255,0.2);
}

.project-card.featured .project-stats {
    color: rgba(255,255,255,0.8);
}

/* Footer */
footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 4rem;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0 0 0.5rem 0;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
    }
    
    .new-look-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card.featured {
        grid-column: span 1;
    }

    .filter-content {
        gap: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        max-width: 100%;
    }

    .filter-group {
        width: 100%;
    }

    .page-title {
        font-size: 2rem;
    }
}

/* Focus styles */
button:focus,
a:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}