@import url('base.css');

:root {
    --glass-card: rgba(255, 255, 255, 0.03);
    --glass-tab: rgba(255, 255, 255, 0.06);
    --glass-tab-active: rgba(255, 255, 255, 0.15);
    --blur-card: blur(12px) saturate(140%);
    --accent-red: #ff4d4d;
    --radius-tab: 24px;
}

body {
    font-family: 'Chillax', sans-serif;
    background-color: var(--bg-dark);
    height: 100vh;
    overflow: hidden;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 1024px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }
    .custom-cursor, #cursor-trail-container {
        display: none !important;
    }
    * {
        cursor: auto !important;
    }
}

/* Projects page overrides */
#bg-video {
    opacity: 0.8;
}

.overlay {
    background: radial-gradient(circle at center, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.9) 100%);
}

.main-wrapper {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    perspective: 2000px;
}

/* Header & Tabs */
.page-header {
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.hacker-text {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    text-transform: uppercase;
    display: inline-block;
    white-space: nowrap;
}

.hacker-char {
    display: inline-block;
    position: relative;
    color: transparent;
    background: linear-gradient(120deg, #666 0%, #666 40%, #fff 50%, #666 60%, #666 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 5px 15px rgba(0, 0, 0, 0.5);
    animation: shine-sweep 4s linear infinite;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes shine-sweep {
    0% { background-position: 200% 0; }
    100% { background-position: 0% 0; }
}
.hacker-char.active {
    color: #fff;
    -webkit-text-fill-color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.8), 0 0 20px var(--accent);
    transform: scale(1.1) translateY(-3px);
    z-index: 10;
}

/* Segmented Control */
.segmented-control {
    position: relative;
    display: flex;
    background: var(--glass-tab);
    backdrop-filter: var(--blur-major);
    -webkit-backdrop-filter: var(--blur-major);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-tab);
    padding: 6px;
    width: max-content;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.tab-indicator {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: calc(var(--radius-tab) - 4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(255,255,255,0.1);
    transition: transform var(--motion-smooth), width var(--motion-smooth);
    z-index: 1;
}

.tab-btn {
    position: relative;
    z-index: 2;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: 'Chillax', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 30px;
    border-radius: calc(var(--radius-tab) - 4px);
    transition: color var(--motion-fast);
}

@media (max-width: 768px) {
    .tab-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

.tab-btn.active {
    color: #fff;
}

/* Projects Grid */
.tab-content {
    display: none;
    width: 100%;
}
.tab-content.active {
    display: block;
    animation: fadeIn var(--motion-smooth) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Bento/Asymmetric Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(320px, auto);
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 60px;
}

@media (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 10px;
    }
    .project-card.featured {
        grid-column: span 1 !important;
    }
}

.project-card {
    background: var(--glass-card);
    backdrop-filter: var(--blur-card);
    -webkit-backdrop-filter: var(--blur-card);
    border: var(--border-card);
    border-radius: var(--radius-card);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.1s linear, box-shadow var(--motion-fast);
    text-decoration: none;
    color: white;
    opacity: 0;
    animation-fill-mode: forwards;
    box-shadow: var(--shadow-card);
}

.project-card.featured {
    grid-column: span 2;
}
@media (max-width: 768px) {
    .project-card.featured {
        grid-column: span 1;
    }
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.1), transparent 50%);
    opacity: 0;
    transition: opacity var(--motion-fast);
    pointer-events: none;
    z-index: 2;
}

.project-card:hover::after {
    opacity: 1;
}

.project-card:hover {
    box-shadow: 0 30px 60px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.1);
}

.card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-bottom: var(--border-card);
    transform: translateZ(20px);
    position: relative;
    background: rgba(0,0,0,0.5);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-card:hover .card-image img {
    transform: scale(1.08);
}

/* Fallback Gradient if image is not there */
.card-image.placeholder {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}
.card-image.placeholder i {
    font-size: 3rem;
    color: rgba(255,255,255,0.2);
}

.card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    transform: translateZ(30px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-badge.private {
    background: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.2);
}

.cursor-blink {
    animation: blink 1s infinite;
    margin-left: 2px;
    font-weight: 300;
    display: inline-block;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.5;
    font-weight: 400;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.chip {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.05);
}

.card-links {
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    transform: translateZ(40px);
    transition: color var(--motion-fast);
}

.project-card:hover .card-links {
    color: rgba(255, 255, 255, 0.9);
}

.card-links span {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.card-links span::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0%;
    height: 1px;
    background: #fff;
    transition: width var(--motion-fast);
}
.card-links span:hover::after {
    width: 100%;
}

.fade-in-up {
    opacity: 0;
    filter: blur(15px);
    transform: translateY(40px) scale(0.9) rotateX(-10deg) translateZ(0);
    animation: fadeInUpAdvanced 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes fadeInUpAdvanced {
    from { opacity: 0; filter: blur(15px); transform: translateY(40px) scale(0.9) rotateX(-10deg); }
    to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1) rotateX(0); }
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* Back Link */
.back-btn {
    position: absolute;
    top: 40px;
    left: 40px;
    color: rgba(255,255,255,0.5);
    font-size: 1.5rem;
    text-decoration: none;
    transition: color var(--motion-fast), transform var(--motion-fast);
    z-index: 20;
}
.back-btn:hover {
    color: #fff;
    transform: translateX(-5px);
}
@media (max-width: 1024px) {
    .back-btn {
        top: 20px;
        left: 20px;
    }
}
