/* 
 * IMPORTANT NOTE REGARDING GOOGLE FONTS IN PRODUCTION:
 * For a fully production-ready website, it is highly recommended to download the font 
 * webfiles (like .woff2) from Google Fonts and serve them locally from your server's folder. 
 * E.g., @font-face { font-family: 'Inter'; src: url('fonts/Inter.woff2'); }
 * 
 * Why? 
 * 1. Faster render speed (bypasses third-party DNS lookup).
 * 2. Caching efficiency.
 * 3. Prevents GDPR liability (Google tracks IP addresses when serving CDN requests). 
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Playfair+Display:wght@600;700&display=swap');

:root {
    /* The Canvas */
    --bg-midnight: #0B1021;
    --bg-indigo: #1A1F35; /* This acts as our primary dark surface */
    
    /* The Magic */
    --accent-crimson: #9E2A2B;
    --text-cream: #E8E3D7;
}

/* General Resets and Base Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-midnight);
    color: var(--text-cream);
    font-family: 'Inter', sans-serif;
    font-size: 18px; /* Base font increased +2px */
    line-height: 1.6;
    /* Soft ambient gradient to mimic the dark room depth */
    background-image: radial-gradient(circle at 50% 0%, #111a33 0%, var(--bg-midnight) 60%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.container {
    max-width: 1080px; /* Expanded space usage */
    width: 94%;        /* Responsive to viewport */
    margin: 0 auto;
    padding: 0 0 60px 0; /* 0 top padding so banner touches ceiling */
    display: flex;
    flex-direction: column;
    gap: 70px;
}

/* Base Tactile Card Style (The Physical Elements) */
.tactile-card {
    background-color: var(--bg-indigo);
    border: 1px solid rgba(232, 227, 215, 0.05); /* Very faint cream border */
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(11, 16, 33, 0.9), 
                inset 0 1px 0 rgba(232, 227, 215, 0.05);
    transition: box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                border-color 0.3s ease;
}

/* Hover effects mimic a flashlight moving over a toy, glowing deep crimson */
.tactile-card:hover {
    border-color: rgba(158, 42, 43, 0.5); /* Crimson rim highlight */
    box-shadow: 0 12px 30px rgba(11, 16, 33, 0.9), 
                0 0 25px rgba(158, 42, 43, 0.7); /* Crimson shadow magic */
}

/* 1. Title Banner */
.title-banner {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0 0 12px 12px; /* Flat at the top to touch ceiling */
    margin-bottom: -30px;
    box-shadow: 0 15px 40px rgba(11, 16, 33, 0.9);
}

/* 2. Gallery Section */
.gallery-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.gallery-toggle {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Toggle Buttons & Glow Animation */
@keyframes subtleGlow {
    0%, 100% {
        box-shadow: 0 4px 10px rgba(11, 16, 33, 0.6);
        border-color: rgba(232, 227, 215, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(232, 227, 215, 0.15);
        border-color: rgba(232, 227, 215, 0.25);
    }
}

.toggle-btn {
    background-color: #111526; /* Deep muted navy */
    color: rgba(232, 227, 215, 0.7);
    border: 1px solid rgba(232, 227, 215, 0.1);
    padding: 12px 35px; /* Slightly wider padding */
    font-size: 18px; /* Increased +2px */
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(11, 16, 33, 0.6);
}

.toggle-btn:not(.active) {
    animation: subtleGlow 3s infinite ease-in-out;
}

.toggle-btn:hover:not(.active) {
    animation: none; /* Pause pulsing when hovered */
    border-color: var(--accent-crimson);
    color: var(--text-cream);
    box-shadow: 0 0 15px rgba(158, 42, 43, 0.3); 
}

.toggle-btn.active {
    background: linear-gradient(
        to bottom,
        var(--accent-crimson) 0%,
        #7a0d1f 45%,
        #5C0012 100%
    );
    color: var(--text-cream);
    border-color: #5C0012;
    box-shadow: 0 0 20px rgba(158, 42, 43, 0.8);
    font-weight: 600;
}

/* Audio Specific Button Styling */
.audio-btn {
    background-color: transparent;
    color: rgba(232, 227, 215, 0.8);
    border: 1px solid rgba(232, 227, 215, 0.3);
    padding: 12px 20px;
    font-size: 18px;
    font-family: 'Inter', sans-serif;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 15px; /* Separate it slightly from the tabs */
}

.audio-btn:hover {
    border-color: var(--text-cream);
    background-color: rgba(232, 227, 215, 0.05);
    color: var(--text-cream);
}

.audio-btn.muted {
    opacity: 0.5;
    border-color: rgba(232, 227, 215, 0.1);
}

/* Pre-rendered Tab Fading Logistics */
.media-container {
    position: relative;
    width: 100%;
}

.gallery-view {
    display: none;
    flex-direction: column;
    gap: 40px; /* Slightly larger gap for the expanded layout */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.gallery-view.active {
    display: flex;
}

.gallery-view.show {
    opacity: 1;
}

.media-card {
    padding: 12px;
}

.media-item {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    background-color: var(--bg-midnight);
}

video.media-item {
    cursor: pointer; /* Keep pointer for interactable video only */
}

/* Video Wrapper and Controls UI */
.video-wrapper {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--bg-midnight);
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(11, 16, 33, 0.4);
    cursor: pointer;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.play-overlay svg {
    width: 64px;
    height: 64px;
    color: var(--text-cream);
    filter: drop-shadow(0 4px 12px rgba(11, 16, 33, 0.9));
    transition: color 0.2s ease, filter 0.2s ease;
}

.play-overlay:hover svg {
    color: var(--accent-crimson);
    filter: drop-shadow(0 0 10px rgba(158, 42, 43, 0.6));
}

/* Hide play overlay when the video is actively playing */
.video-wrapper.is-playing .play-overlay {
    opacity: 0;
    pointer-events: none; /* Allows pausing by clicking the video behind it */
}

/* 3 & 5. Text Sections (Description / About) */
.text-section {
    padding: 40px;
}

.text-section h2 {
    margin-bottom: 20px;
    font-size: 30px; /* Increased +2px */
    color: #5C0012;
    border-bottom: 1px solid rgba(158, 42, 43, 0.8);
    padding-bottom: 12px;
    text-shadow: -2px -1px 0 #9E2A2B;
}

.text-section p {
    margin-bottom: 18px;
    color: var(--text-cream);
    font-size: 18px; /* Increased +2px */
}

.text-section p:last-child {
    margin-bottom: 0;
}

/* Developer Label Highlight styling */
.dev-label {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: #D15355; /* Brightened crimson for bold emphasis */
    font-size: 20px; /* Slightly larger than standard text */
    letter-spacing: 0.5px;
    margin-right: 4px;
    text-shadow: 0 0 8px rgba(158, 42, 43, 0.3);
}

/* 4. Card Art Section */
.card-art-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.card-art-item {
    padding: 12px;
    display: flex;
}

.card-art-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    box-shadow: inset 0 0 10px rgba(11, 16, 33, 0.5);
}

/* Custom Image Lightbox styling */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(11, 16, 33, 0.94);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(158, 42, 43, 0.2);
    border: 1px solid rgba(232, 227, 215, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 650px) {
    .container {
        width: 100%;
        padding: 0 15px 30px; /* 0 top padding for mobile ceiling touch */
        gap: 50px;
    }
    
    .gallery-toggle {
        flex-wrap: wrap;
    }
    .audio-btn {
        margin-left: 0;
    }

    .text-section {
        padding: 25px;
    }

    .card-art-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .card-art-item.centered {
        grid-column: span 1;
        width: 100%; 
    }
}
