/* Critical Custom Styles - Always Loaded */

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 4rem;
    left: 0;
    height: 0.25rem;
    z-index: 50;
    width: 0%;
    background: linear-gradient(90deg, #8B5CF6 0%, #A855F7 50%, #D946EF 100%);
    transition: width 0.05s ease-out;
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 44px;
    min-height: 44px;
    border-radius: 9999px;
    cursor: pointer;
    background-color: transparent;
    border: 2px solid #E4E4E7;
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 100;
    -webkit-tap-highlight-color: rgba(139, 92, 246, 0.3);
    touch-action: manipulation;
    user-select: none;
}

[data-theme="dark"] .theme-toggle {
    border-color: #27272A;
}

.theme-toggle:hover,
.theme-toggle:active {
    border-color: #8B5CF6;
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle__icon {
    position: absolute;
    font-size: 1.125rem;
    transition: all 0.4s ease;
}

.theme-toggle__icon--light {
    color: #f59e0b;
    transform: translateY(0) rotate(0);
    opacity: 1;
}

.theme-toggle__icon--dark {
    color: #6366f1;
    transform: translateY(30px) rotate(-90deg);
    opacity: 0;
}

[data-theme="dark"] .theme-toggle__icon--light {
    transform: translateY(-30px) rotate(90deg);
    opacity: 0;
}

[data-theme="dark"] .theme-toggle__icon--dark {
    transform: translateY(0) rotate(0);
    opacity: 1;
}

/* Projects Link Wrapper */
.projects__link-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(20px);
    transition: all 0.3s ease;
    text-decoration: none;
}

.projects__card:hover .projects__link-wrapper {
    transform: translateY(0);
}

.projects__link-wrapper:nth-child(2) {
    transition-delay: 0.1s;
}

.projects__link-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

/* Projects Grid - 3 cards per row, always centered */
.projects__grid {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.projects__card {
    flex: 0 1 calc(33.333% - 1.5rem);
    max-width: calc(33.333% - 1.5rem);
}

@media screen and (max-width: 768px) {
    .projects__card {
        flex: 0 1 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
    }
}

@media screen and (max-width: 480px) {
    .projects__card {
        flex: 0 1 100%;
        max-width: 100%;
    }
}