/* =========================================
   Premium Projects Page 3D Architecture
   ========================================= */

@import url('https://api.fontshare.com/v2/css?f[]=general-sans@200,300,400,500,600,700&f[]=gambetta@400,500,600,700&display=swap');

/* --- Global Theme Variables --- */
:root {
    /* Dark Theme (Premium Obsidian & Champagne Bronze) */
    --bg-main: #09090b; /* Deep zinc/obsidian instead of harsh pure black */
    --bg-radial: #18181b; 
    --bg-nav-footer: #09090b;
    
    --gold: #c8a97e; /* Elegant, muted champagne bronze */
    --gold-glow: rgba(200, 169, 126, 0.12);
    
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-inverse: #09090b;
    
    --border-subtle: rgba(255, 255, 255, 0.06);
    --shadow-deep: 0 12px 50px rgba(0, 0, 0, 0.7);
    
    --frame-bg: rgba(24, 24, 27, 0.75);
    --glass-bg: rgba(9, 9, 11, 0.85);
    --modal-bg: rgba(14, 14, 17, 0.98);
    --modal-overlay: rgba(0, 0, 0, 0.85);
    --btn-bg: #fafafa;

    --spatial-easing: cubic-bezier(0.16, 1, 0.3, 1);
    --font-sans: 'General Sans', sans-serif;
    --font-serif: 'Gambetta', serif;
}

[data-theme="light"] {
    /* Light Theme (Swiss Editorial Alabaster & Deep Copper) */
    --bg-main: #fdfcfb; /* Soft warm off-white, easier on the eyes */
    --bg-radial: #ffffff;
    --bg-nav-footer: #ffffff;
    
    --gold: #9a7b4f; /* Darker, sophisticated copper-bronze for readability */
    --gold-glow: rgba(154, 123, 79, 0.15);
    
    --text-primary: #18181b; /* Near-black ink for maximum crispness */
    --text-secondary: #52525b;
    --text-inverse: #ffffff;
    
    --border-subtle: rgba(0, 0, 0, 0.08);
    --shadow-deep: 0 16px 40px rgba(0, 0, 0, 0.06);
    
    --frame-bg: rgba(255, 255, 255, 0.95);
    --glass-bg: rgba(253, 252, 251, 0.9);
    --modal-bg: rgba(255, 255, 255, 0.98);
    --modal-overlay: rgba(24, 24, 27, 0.5); /* Darker contrast overlay for modals */
    --btn-bg: #18181b;
}

/* Base Document Overrides */
body.projects-page {
    background-color: var(--bg-main);
    background-image: radial-gradient(circle at 50% 40%, var(--bg-radial) 0%, var(--bg-main) 70%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
    margin: 0;
    cursor: none; 
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Inherited Global Elements Update (Nav/Footer) */
nav { background-color: var(--bg-nav-footer); border-bottom: 1px solid var(--border-subtle); }
.site-footer { background-color: var(--bg-nav-footer); border-top: 1px solid var(--border-subtle); }
h1, h2, h3, h4, h5, p, span, li, a { transition: color 0.4s ease; }

/* =========================================
   Custom Cursor Logic
   ========================================= */
#cursor-dot {
    position: fixed; top: 0; left: 0; width: 8px; height: 8px;
    background-color: var(--gold); border-radius: 50%;
    pointer-events: none; z-index: 9999999 !important; 
    transform: translate(-50%, -50%);
}
#cursor-outline {
    position: fixed; top: 0; left: 0; width: 40px; height: 40px;
    border: 1px solid var(--text-secondary); border-radius: 50%;
    pointer-events: none; z-index: 9999998 !important; 
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
}

@media (pointer: coarse) {
    #cursor-dot, #cursor-outline { display: none !important; }
    body.projects-page, * { cursor: auto !important; }
}

/* Typography Overrides */
.gambetta-title { font-family: var(--font-serif); letter-spacing: -0.02em; font-weight: 500; color: var(--text-primary); }

/* -------------------------------------------------------------
   3D Viewport & Spatial Elements
   ------------------------------------------------------------- */
.scroll-height-manager { height: 6000px; position: relative; width: 100%; }

.viewport-3d {
    position: sticky; top: 0; left: 0; width: 100vw; height: 100vh;
    perspective: 2400px; perspective-origin: 50% 50%;
    overflow: hidden; display: flex; align-items: center; justify-content: center;
    z-index: 5; pointer-events: none; 
}

.floor-glow {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 50%;
    background: linear-gradient(to top, var(--gold-glow) 0%, transparent 100%);
    pointer-events: none; z-index: 1; opacity: 0.8; /* Slightly increased opacity for richer ambiance */
}

.ambient-particle {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle, var(--gold) 0%, var(--text-primary) 100%);
    opacity: 0.05; pointer-events: none; z-index: 2;
}

/* Cinematic Intro Overlay */
.cinematic-intro {
    position: absolute; top: 12%; left: 50%; transform: translateX(-50%);
    text-align: center; z-index: 20; transition: opacity 0.5s ease;
    pointer-events: none;
   
}

.cinematic-intro h1 { font-size: 4rem; margin-bottom: 1rem; color: var(--text-primary); font-family: var(--font-serif); }
.cinematic-intro span { color: var(--gold); }
.cinematic-intro p { color: var(--text-secondary); letter-spacing: 4px; text-transform: uppercase; font-size: 0.8rem; }

/* -------------------------------------------------------------
   3D Art Frames (The Content)
   ------------------------------------------------------------- */
.art-frame {
    position: absolute; width: 260px; height: 380px;
    top: 27%; left: 50%; margin-left: -130px;
    border-radius: 6px; overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-deep);
    background: var(--frame-bg);
    transition: filter 0.4s var(--spatial-easing), box-shadow 0.4s var(--spatial-easing);
    cursor: none; 
    pointer-events: auto;
}

.art-frame img {
    width: 100%; height: 100%; object-fit: cover; opacity: 0.85;
    transition: transform 0.8s var(--spatial-easing), opacity 0.4s var(--spatial-easing);
}

.art-frame:hover { filter: brightness(1.05); box-shadow: 0 0 40px var(--gold-glow), var(--shadow-deep); }
.art-frame:hover img { transform: scale(1.05); opacity: 1; }

/* Hover Details Glass Box */
.frame-details-glass {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
    transform: translateY(101%); transition: transform 0.5s var(--spatial-easing);
    display: flex; flex-direction: column; gap: 0.5rem;
    pointer-events: none; 
}

.art-frame:hover .frame-details-glass { transform: translateY(0); }
.frame-details-glass h3 { font-size: 1.25rem; margin: 0; color: var(--text-primary); font-family: var(--font-sans); }
.frame-details-glass p { font-size: 0.8rem; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; margin: 0; display: flex; align-items: center; gap: 5px; }

.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.card-tags span { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); background: var(--gold-glow); padding: 0.2rem 0.6rem; border-radius: 50px; border: 1px solid var(--border-subtle); }

/* -------------------------------------------------------------
   Information Modals
   ------------------------------------------------------------- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--modal-overlay);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 99999; display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.5s var(--spatial-easing);
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-content {
    background: var(--modal-bg);
    border: 1px solid var(--border-subtle); border-radius: 12px;
    width: 90%; max-width: 896px; max-height: 85vh;
    overflow-y: auto; padding: 3.5rem; position: relative;
    transform: translateY(30px) scale(0.96); transition: transform 0.6s var(--spatial-easing);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4); cursor: auto; 
}

.modal-overlay.active .modal-content { transform: translateY(0) scale(1); }

.gold-badge {
    display: inline-block; padding: 0.25rem 0.75rem;
    background: var(--gold-glow); border: 1px solid var(--border-subtle);
    color: var(--gold); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.15em;
    margin-bottom: 1.5rem; border-radius: 4px;
}

.modal-header h2 { font-size: 3rem; margin-bottom: 1rem; color: var(--text-primary); line-height: 1.1; }
.modal-tech-stack { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border-subtle); }
.modal-tech-stack span { background: transparent; color: var(--text-primary); padding: 0.4rem 1rem; border-radius: 50px; font-size: 0.8rem; border: 1px solid var(--border-subtle); text-transform: uppercase; letter-spacing: 1px; }

.modal-body p { color: var(--text-secondary); line-height: 1.8; font-size: 1.1rem; margin-bottom: 2rem; }
.modal-body h4 { color: var(--text-primary); font-family: var(--font-sans); margin-bottom: 1.2rem; font-size: 1.2rem; font-weight: 500; }
.modal-body ul { list-style: none; margin-bottom: 2rem; padding: 0; }
.modal-body ul li { color: var(--text-secondary); margin-bottom: 1rem; padding-left: 1.8rem; position: relative; line-height: 1.6; }
.modal-body ul li::before { content: '▹'; position: absolute; left: 0; color: var(--gold); font-size: 1.2rem; top: -2px; }
.modal-body ul li strong { color: var(--text-primary); font-weight: 500; }

.modal-actions { display: flex; gap: 1rem; margin-top: 2rem; }
.btn-fancy { display: inline-flex; align-items: center; gap: 8px; padding: 0.8rem 1.5rem; background: var(--btn-bg); color: var(--text-inverse); text-decoration: none; border-radius: 50px; font-weight: 600; font-size: 0.9rem; transition: all 0.3s ease; border: 1px solid var(--border-subtle); cursor: none; }
.btn-fancy:hover { background: var(--gold); color: #fff; border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 10px 20px var(--gold-glow); }
.btn-icon { width: 45px; height: 45px; border-radius: 50%; background: transparent; border: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: center; color: var(--text-primary); text-decoration: none; transition: all 0.3s ease; cursor: none; }
.btn-icon:hover { background: var(--gold); color: #fff; border-color: var(--gold); transform: translateY(-2px); }

.modal-close { position: absolute; top: 1.5rem; right: 1.5rem; background: transparent; border: 1px solid var(--border-subtle); border-radius: 50%; width: 45px; height: 45px; color: var(--text-primary); display: flex; align-items: center; justify-content: center; cursor: none; transition: all 0.3s ease; }
.modal-close:hover { background: var(--text-inverse); color: var(--bg-main); transform: rotate(90deg); }

/* =========================================
   Mobile Responsiveness
   ========================================= */
@media (max-width: 1024px) { .art-frame { width: 220px; height: 320px; margin-left: -110px; } }
@media (max-width: 768px) { .cinematic-intro h1 { font-size: 2.5rem; } .art-frame { width: 180px; height: 260px; margin-left: -90px; } .modal-content { padding: 2rem 1.5rem; } .modal-header h2 { font-size: 2rem; } }
@media (max-width: 768px) { .cinematic-intro{top: 70%;} .cinematic-intro h1 { font-size: 1.5rem; } .art-frame { width: 180px; height: 260px; margin-left: -90px; } .modal-content { padding: 2rem 1.5rem; } .modal-header h2 { font-size: 2rem; } }