/* --- Import Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* --- General Styles & Variables (Intermediate/Dusk Theme) --- */
:root {
    --bg-color: #1a202c; /* Dark Slate */
    --text-color: #e2e8f0; /* Light Slate */
    --text-muted: #a0aec0; /* Medium Slate */
    
    /* Pastel colors for the background mesh */
    --mesh-color-1: #5a67d8; /* Indigo */
    --mesh-color-2: #9f7aea; /* Purple */
    --mesh-color-3: #ed64a6; /* Pink */
    --mesh-color-4: #4fd1c5; /* Teal */

    --card-bg: #18181b; /* Near-black for carbon fiber feel */
    --card-border: #333; /* Lighter border for contrast */
    --card-shadow: rgba(0, 0, 0, 0.4); /* More pronounced shadow */
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- Animated Gradient Mesh Background --- */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(circle at 15% 25%, var(--mesh-color-1), transparent 35%),
        radial-gradient(circle at 85% 35%, var(--mesh-color-2), transparent 35%),
        radial-gradient(circle at 70% 80%, var(--mesh-color-3), transparent 35%),
        radial-gradient(circle at 30% 70%, var(--mesh-color-4), transparent 35%);
    filter: blur(100px);
    z-index: -1;
    animation: mesh-anim 25s infinite alternate;
}

@keyframes mesh-anim {
    0% { transform: rotate(0deg) scale(1.2); opacity: 0.5; }
    100% { transform: rotate(360deg) scale(1.5); opacity: 0.8; }
}

/* --- Header --- */
header {
    text-align: center;
    padding: 6rem 1rem 4rem;
}

header h1 {
    font-size: 4.5rem;
    font-weight: 700;
    margin: 0;
    color: #fff; /* Brighter white for header */
    letter-spacing: -2px;
}

header p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* --- Main Content & Horizontal Scroll --- */
main { padding: 0 0 4rem; }
section { margin-bottom: 4rem; }

section h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-color);
    padding-left: 5%;
    margin: 0 0 2rem; /* Increased bottom margin */
    text-shadow: 0 0 8px rgba(79, 209, 197, 0.3); /* Subtle glow with mesh color */
}

.horizontal-scroll-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 2rem 5%; /* Increased top/bottom padding */
    -webkit-overflow-scrolling: touch;
}
.horizontal-scroll-wrapper::-webkit-scrollbar { display: none; }
.horizontal-scroll-wrapper { -ms-overflow-style: none; scrollbar-width: none; }

.project-grid {
    display: inline-flex;
    gap: 2rem;
}

/* --- Project Card (Carbon Fiber Theme) --- */
.project-card {
    display: inline-flex;
    flex-direction: column;
    width: 360px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%), var(--card-bg); /* Subtle top-down sheen */
    border: 1px solid var(--card-border);
    border-radius: 16px;
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-card:hover {
    /* transform is handled by JS */
    box-shadow: 0 16px 40px 0 rgba(0,0,0,0.3); /* Re-added box-shadow on hover */
    border-color: rgba(255, 255, 255, 0.2);
}

/* New styles for the 2-layer image effect */
.card-image-wrapper {
    position: relative;
    height: 200px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    border-bottom: 1px solid var(--card-border);
}

.card-image-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(10px) brightness(0.8); /* Reduced blur, increased brightness */
    transform: scale(1.2); /* Scale up to hide blurred edges */
}

.card-image-foreground {
    position: relative; /* Sits on top of the absolute positioned background */
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(0,0,0,0.5)); /* Adjusted drop shadow */
}

.project-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.meta-date {
    position: relative;
    padding-left: 1.5em; /* Space for the icon */
}

.meta-date::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    width: 1em;
    height: 1em;
    border: 2px solid var(--text-muted);
    border-radius: 2px;
    border-top-width: 5px; /* Thicker top bar */
}

.platform-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.platform-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 1rem; /* Pill shape */
    text-decoration: none;
    transition: all 0.2s ease;
}

.platform-tag:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border-color: rgba(255, 255, 255, 0.2);
}

.project-card-content h3 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--text-color);
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.project-card-content p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
    margin: 0 0 1.5rem;
    white-space: normal;
}

.card-metadata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    border-top: 1px solid var(--card-border);
    padding-top: 1rem;
}

.project-card-content a {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.project-card-content a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.project-card-content a.disabled {
    background: transparent;
    color: var(--text-muted);
    pointer-events: none;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--card-border);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    header h1 { font-size: 3rem; }
    
    .horizontal-scroll-wrapper {
        overflow-x: visible;
        padding: 0 5%;
    }

    .project-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-card { 
        width: 100%;
    }
}