@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Montserrat:wght@300;400;600&family=Dancing+Script:wght@700&display=swap');

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #fdfdfd; color: #1a1a1a; font-family: 'Montserrat', sans-serif; line-height: 1.7; }
h1, h2, h3, h4 { font-family: 'Playfair Display', serif; color: #000; }

/* Navigation with Gold-to-White Glow Effect */
.nav-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1.5rem 5%; 
    background: #fff; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    border-bottom: 1px solid #eee; 
}
.nav-bar ul { display: flex; list-style: none; gap: 2rem; }
.nav-bar a { 
    color: #555; 
    text-decoration: none; 
    font-size: 0.9rem; 
    font-weight: 600; 
    letter-spacing: 1px;
    transition: 0.3s; 
}
.nav-bar a:hover { 
    color: #d4af37; 
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.6); 
}
.logo { display: flex; align-items: center; gap: 15px; }
.logo span { font-family: 'Dancing Script', cursive; font-size: var(--h2-size); color: #d4af37; }
.avatar { width: 50px; height: 50px; border-radius: 50%; border: 2px solid #d4af37; object-fit: cover; }

/* Layout Containers & Headers */
.projects-container { padding: 4rem 10%; max-width: 1000px; margin: 0 auto; }
.page-header { text-align: center; padding: 4rem 0; background: #fff; }
.page-header h1 { font-family: 'Playfair Display', serif; font-size: var(--h1-size); letter-spacing: 2px; }

/* About Essay Style */
.about-writing { 
    font-size: 1.1rem; 
    line-height: 1.8; 
    color: #333; 
    margin-bottom: 4rem; 
    padding-left: 2rem; 
    border-left: 4px solid #d4af37; 
}
.about-writing p { margin-bottom: 1.5rem; }
.about-writing p:last-child { margin-bottom: 0; }

/* Image Gallery Grid */
.gallery-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 1.5rem; 
    margin: 4rem 0; 
}
.gallery-grid img { 
    width: 100%; 
    height: 180px; 
    object-fit: cover; 
    border: 5px solid #fff; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
    cursor: pointer; 
    transition: 0.3s ease; 
}
.gallery-grid img:hover { 
    transform: scale(1.05); 
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.3);
}

/* Modal Enlarge Styles */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.95); 
    backdrop-filter: blur(5px);
}
.modal-content { 
    margin: auto; 
    display: block; 
    max-width: 85%; 
    max-height: 85%; 
    margin-top: 3.5%; 
    border: 5px solid #fff; 
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.25);
    animation: zoomIn 0.3s ease;
}
.modal:hover { cursor: zoom-out; }

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Media Player (Fixed Size) */
.media-player-container {
    background: #fff;
    padding: 2rem;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin: 0 auto 4rem auto;
    text-align: center;
    max-width: 500px; 
    border-left: 4px solid #d4af37;
}
.media-player-container h3 { font-size: 1.2rem; color: #1a1a1a; letter-spacing: 1px; }
.media-player-container p { font-size: 0.9rem; color: #666; margin-bottom: 0.5rem; }
.media-player-container audio { width: 100%; margin-top: 10px; }

/* Side-by-Side Project Items */
.project-item { 
    display: flex; 
    align-items: center; 
    gap: 4rem; 
    margin-bottom: 6rem; 
    padding: 2rem;
    background: #fdfdfd;
    border: 1px solid #f0f0f0;
    transition: 0.3s ease;
}
.project-item:hover {
    border-color: #d4af37;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.1);
}
.project-item img { 
    width: 300px; 
    height: auto; 
    border: 1px solid #ddd;
    box-shadow: 15px 15px 0px #f4f4f4;
    transition: 0.4s ease; 
}
.project-item:hover img { 
    transform: scale(1.02); 
    box-shadow: 15px 15px 0px rgba(212, 175, 55, 0.15);
}
.project-info { flex: 1; }
.project-info h2 { font-size: var(--h2-size); margin-bottom: 1rem; }
.project-info h2 a { color: #000; text-decoration: none; transition: 0.3s; }
.project-info h2 a:hover { color: #d4af37; }
.project-info p { font-size: 1.1rem; line-height: 1.6; color: #555; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .project-item { flex-direction: column; text-align: center; gap: 2rem; }
    .project-item img { width: 100%; max-width: 350px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: 1fr; }
}

/* Bulletproof CSS Keyframe Page Transitions - Solves Flashing & Black screen bugs */
@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    animation: pageFadeIn 0.4s ease-out forwards;
}

body.fade-out {
    opacity: 0 !important;
    transition: opacity 0.3s ease-in-out !important;
    animation: none !important;
}

/* ==========================================================================
   UNIFIED FLUID TYPOGRAPHY SYSTEM (Release v41)
   ========================================================================== */
html {
    font-size: 16px; /* Desktop browser baseline */
}

:root {
    --h1-size: clamp(1.8rem, 4.5vw, 3rem);
    --h2-size: clamp(1.4rem, 3.5vw, 2.2rem);
    --h3-size: clamp(1.1rem, 2.5vw, 1.5rem);
}

/* Standard Responsive Text Scaling */
@media (max-width: 850px) {
    html {
        font-size: 14px !important; /* Globally down-scales all REM dimensions by 12.5% */
    }
    body {
        line-height: 1.6 !important;
    }
}
@media (max-width: 450px) {
    html {
        font-size: 13.2px !important; /* Scale down by 17% for tiny devices */
    }
}

/* ==========================================================================
   PREMIUM MOBILE NAVIGATION RE-DESIGN - LIGHT COOPER THEME (Release v41)
   ========================================================================== */
@media (max-width: 850px) {
    .nav-bar {
        flex-direction: column !important;
        gap: 1rem !important;
        padding: 1.2rem 4% !important;
        text-align: center !important;
        position: relative !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background: #ffffff !important;
        border-bottom: 1px solid #eee !important;
    }
    .nav-bar ul {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.4rem !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }
    .nav-bar li {
        width: 100% !important;
        margin: 0 !important;
    }
    .nav-bar a {
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        padding: 0.65rem 0.2rem !important;
        text-align: center !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        border-radius: 4px !important;
        background: rgba(0, 0, 0, 0.02) !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        letter-spacing: 0.5px !important;
        transition: 0.2s ease !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        color: #555 !important;
    }
    .nav-bar a.active {
        color: #d4af37 !important;
        border-color: #d4af37 !important;
        background: rgba(212, 175, 55, 0.05) !important;
        text-shadow: none !important;
    }
    .nav-bar a:hover {
        color: #d4af37 !important;
        text-shadow: 0 0 8px rgba(212, 175, 55, 0.4) !important;
    }
}