/* ==========================================================================
   1. CORE THEME & COSMETIC VARIABLES
   ========================================================================== */
:root {
    /* Cozy & Minimalist Base Tone */
    --bg-color: #fcfaf6;
    --text-main: #2b2a27;
    --text-muted: #6e6b64;
    --accent: #556b2f; /* Sage Green */
    --accent-light: #f3ede2;
    --card-bg: #ffffff;
    --border-color: #e6dfd3;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* DYNAMIC CATEGORY GLOW FALLBACKS (Overridden inline via HTML if needed) */
    --vst-primary: #00f0ff;    /* Cyan */
    --vst-secondary: #0055ff;  /* Electric Blue */
    
    --game-primary: #bd00ff;   /* Neon Purple */
    --game-secondary: #ff007c; /* Hot Pink */
    
    --music-primary: #ffaa00;  /* Bright Gold */
    --music-secondary: #ff3c00;/* Vivid Orange */
    
    --blog-primary: #00ff88;   /* Bright Mint */
    --blog-secondary: #00a1ff;  /* Sky Blue */
}

/* ==========================================================================
   2. GENERAL STRUCTURE & TYPOGRAPHY
   ========================================================================== */
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-stack);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.content-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Profile Section */
.hero-container {
    max-width: 1100px;
    margin: 4rem auto 2rem auto;
    padding: 0 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

h1 { font-size: 2.8rem; margin-bottom: 0.5rem; font-weight: 700; letter-spacing: -0.03em; }
.subtitle { font-size: 1.2rem; color: var(--accent); margin-top: 0; font-weight: 500; }
.description { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 2rem; }

/* Scrapbook Grid Photos */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    height: 320px;
}

.grid-photo {
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    background-color: var(--accent-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.3s ease;
}

.grid-photo:hover { transform: scale(1.02); }

/* Buttons & Navigation Tags */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn.primary { background-color: var(--text-main); color: var(--bg-color); z-index: 5; position: relative; }
.btn.primary:hover { background-color: var(--accent); }
.btn.secondary { background-color: var(--accent-light); color: var(--text-main); margin-right: 0.5rem; margin-top: 0.5rem;}
.btn.secondary:hover { background-color: var(--border-color); }

/* Decorative Elements */
.divider { border: 0; border-top: 1px solid var(--border-color); margin: 4rem 0; }
footer { text-align: center; padding: 4rem 0; color: var(--text-muted); font-size: 0.9rem; }

/* ==========================================================================
   3. FILTER SELECTOR WORKSPACE
   ========================================================================== */
.filter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

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

.filter-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
    background-color: var(--accent-light);
    border-color: var(--text-muted);
}

.filter-btn.active {
    background-color: var(--text-main);
    color: var(--bg-color);
    border-color: var(--text-main);
}

/* ==========================================================================
   4. LIQUID MOUSE-TRACKING GLOW GRID
   ========================================================================== */
.unified-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    transition: all 0.3s ease;
    perspective: 1000px;
}

.hidden-item {
    display: none !important;
}

/* Base interactive workspace item card */
.grid-item {
    position: relative;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1;
    overflow: hidden;

    /* Runtime Mouse Positions provided by JavaScript default to center */
    --mouse-x: 50%;
    --mouse-y: 50%;
    
    transition: 
        transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
        border-color 0.4s ease, 
        box-shadow 0.4s ease,
        background 0.4s ease;
}

/* Internal radial glow layer */
.grid-item::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 16px;
    /* FIX: Added hardcoded fallbacks directly to the variable calls */
    background: radial-gradient(
        300px circle at var(--mouse-x) var(--mouse-y), 
        var(--override-color, #556b2f) 0%, 
        transparent 80%
    );
    opacity: 0;
    /* FIX: Changed from color-burn to normal to let vibrant tints show beautifully on light mode */
    mix-blend-mode: normal; 
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.4s ease; 
}

/* Fluid Radial Mask Excluder (Neon Border Ring) */
.grid-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 16px;
    padding: 2px; /* Controls border thickness */
    
    background: radial-gradient(
        180px circle at var(--mouse-x) var(--mouse-y), 
        var(--override-color, #556b2f) 0%, 
        var(--secondary-color, #e6dfd3) 60%,
        transparent 100%
    );
    
    /* FIX: Rewritten masking using padding-box and destination-out for bulletproof cross-browser rendering */
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* Animated State Mutations upon Cursor Entry */
.grid-item:hover {
    transform: translateY(-8px) scale(1.01);
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.1);
    
    box-shadow: 
        0 20px 40px -15px rgba(0, 0, 0, 0.05), 
        inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

/* FIX: Boosted opacities so the colors register clearly against crisp light themes */
.grid-item:hover::after {
    opacity: 0.12; /* Soft inner ambient light color wash */
}

.grid-item:hover::before {
    opacity: 0.85; /* Sharp, vivid outer tracking gradient border ring */
}

/* Card Content Structural Alignment */
.card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 2;
}

.blog-card-adjust {
    justify-content: flex-start;
}

.blog-card-adjust h3 {
    margin-top: 0.75rem;
}

.project-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    background-color: var(--accent-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.4s ease;
}

/* Animated State Mutations upon Cursor Entry */
.grid-item:hover {
    transform: translateY(-8px) scale(1.01);
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.1);
    
    /* RESTORED: The dynamic color glow outside the card boundaries */
    box-shadow: 
        0 20px 40px -15px rgba(0, 0, 0, 0.05), 
        0 0 35px -5px var(--override-color, #556b2f), /* The glowing aura is back! */
        inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.grid-item h3 { 
    margin: 0.5rem 0 0.25rem 0; 
    font-size: 1.3rem; 
    letter-spacing: -0.01em;
}

.grid-item p { 
    color: var(--text-muted); 
    font-size: 0.95rem; 
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.card-meta {
    display: flex;
    align-items: center;
    margin: 1rem 0 0.5rem 0; 
}

.item-tag {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    margin: 0; /* Cleared margin to rely entirely on card-meta wrapper spacing */
}

/* Updated date layout to target the bottom-right corner */
.card-date {
    position: absolute;
    bottom: 1.5rem;      /* Matches the bottom padding of the card */
    right: 1.5rem;       /* Matches the right padding of the card */
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 300;
    margin: 0;
    white-space: nowrap; /* Forces the date to stay on one clean line */
    z-index: 3;
}

/* Adjust the actions container to leave a little extra room for the date */
.project-actions { 
    margin-top: auto; 
    padding-top: 1rem; 
    padding-right: 5rem; /* Prevents long buttons from overlapping the absolute date */
}

.tag-vst { background-color: #e3f2fd; color: #0d47a1; }
.tag-game { background-color: #ede7f6; color: #4a148c; }
.tag-music { background-color: #efebe9; color: #4e342e; }
.tag-blog { background-color: var(--accent-light); color: var(--accent); }