:root {
    --primary-color: #3A86FF;
    --primary-hover: #1459c9;
    --white: #E0E0E0;
    --text-secondary: #a0a0a0;
    --main-bg: #121212;
    --cards-bg: #1E1E1E;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --border-color: #333333;
}

body.light-theme {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --white: #1f2937;
    --text-secondary: #6b7280;
    --main-bg: #f9fafb;
    --cards-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-color: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--white);
    background-color: var(--main-bg);
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    line-height: 1.6;
}

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background-color: var(--primary-color);
    z-index: 1001;
    transition: width 0.1s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px 100px;
}

.header {
    text-align: center;
    margin-bottom: 64px;
    animation: fadeIn 1s ease-out;
}

.brand h1 {
    padding-bottom: 20px;
    font-family: 'Roboto Mono', monospace;
    font-size: 2.5rem;
}

.brand h1 span {
    color: var(--primary-color);
}

.brand img {
    display: block;
    width: 100%;
    height: 100%;
}

.subtitle {
    margin-bottom: 24px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    gap: 24px;
    margin: 0;
    list-style: none;
    padding: 0;
    justify-content: center;
}

.social-links li {
    animation: fadeIn 0.5s ease-out;
}

.social-links a {
    font-size: 28px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}

.social-links a:hover, .social-links a:focus {
    color: var(--primary-color);
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    z-index: 1000;
}

.theme-toggle:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.menu-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    z-index: 1000;
}

.menu-toggle:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.menu-buttons {
    position: fixed;
    top: 70px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 999;
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.menu-buttons.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.menu-buttons .theme-toggle,
.menu-buttons .filter-toggle,
.menu-buttons .search-toggle {
    position: static;
    margin: 0;
}

.filter-container {
    position: fixed;
    top: 80px;
    right: 80px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background-color: var(--cards-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    z-index: 999;
    max-width: 300px;
}

.filter-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary);
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    text-transform: capitalize;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    color: var(--white);
    border-color: var(--primary-color);
}

.filter-btn.active {
    color: var(--white);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.search-container {
    position: relative;
}

.search-toggle {
    position: fixed;
    top: 20px;
    right: 80px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    z-index: 1000;
}

.search-toggle:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.filter-toggle {
    position: fixed;
    top: 20px;
    right: 140px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    z-index: 1000;
}

.filter-toggle:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

#search-input {
    position: fixed;
    top: 80px;
    right: 80px;
    width: 300px;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--cards-bg);
    color: var(--white);
    outline: none;
    transition: border-color 0.3s ease;
    z-index: 999;
}

#search-input:focus {
    border-color: var(--primary-color);
}

#search-input::placeholder {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .filter-container {
        right: 70px;
        max-width: 80%;
    }
    
    .filter-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .menu-buttons {
        top: 70px;
        right: 20px;
        gap: 6px;
    }
    
    .menu-buttons .theme-toggle,
    .menu-buttons .filter-toggle,
    .menu-buttons .search-toggle {
        margin-right: 0;
    }
    
    #search-input {
        right: 70px;
    }
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
    justify-content: center;
}

.project-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    background-color: var(--cards-bg);
    border-radius: 12px;
    text-align: left;
    color: var(--white);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    transform-style: preserve-3d;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(2deg) translateY(-8px);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.project-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--white);
}

.project-description {
    margin-bottom: 24px;
    color: var(--text-secondary);
    flex-grow: 1;
}

.stars {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    animation: fadeIn 0.5s ease-in-out;
    transition: color 0.3s ease;
}

.stars:hover {
    color: var(--primary-color);
}

.rate-limited {
    color: #ff6b6b !important;
}

.project-tags {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.last-updated {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tag {
    background-color: var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.tag:hover {
    transform: scale(1.05);
    background-color: var(--primary-color);
    color: var(--white);
}

.project-preview {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    border-radius: 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    object-fit: cover;
}

.action-buttons {
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
}

.action-buttons li {
    position: relative;
}

.button {
    font-size: 1rem;
    text-transform: uppercase;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    box-shadow: none;
    cursor: pointer;
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    background-color: var(--primary-color);
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
    transition: 0.3s ease-in-out;
}

.button .ib {
    margin-left: 8px;
    font-size: 1.2rem;
}

.button:active {
    box-shadow: none;
    transform: translateY(1px);
}

.button:hover {
    background-color: var(--primary-hover);
}

.button--icon {
    width: 48px;
    padding: 0;
    font-size: 20px;
    border: 1px solid var(--border-color);
    color: var(--white);
    background-color: transparent;
    transition: 0.3s ease-in-out;
}

.button--icon:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

footer {
    text-align: center;
    padding: 48px 24px;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 64px;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 1s ease-out 1s both;
}

.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--cards-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.svgIcon {
    width: 16px;
    transition-duration: 0.3s;
    fill: var(--white);
}

.back-to-top:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-4px);
}

.back-to-top::before {
    display: none;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .project-card:hover {
        transform: none;
    }
}