/* ==========================================================================
   1. CORE CSS SYSTEM CONFIGURATION VARIABLES
   ========================================================================== */
:root {
    --bg-base: #101524; 
    --bg-gradient-1: #1e1b4b; 
    --bg-gradient-2: #172554;
    --card-bg: #1e293b; 
    --card-border: #334155; 
    --footer-bg: #0c111e;
    --text-main: #f1f5f9; 
    --text-muted: #94a3b8; 
    --text-on-accent: #ffffff;
    --accent-main: #3d7ee2; 
    --accent-hover: #5d95eb; 
    --accent-subtle: rgba(61, 126, 226, 0.1);
    --btn-secondary-hover: rgba(255, 255, 255, 0.05); 
    --btn-secondary-border: #475569;

    /* HARDCODED LOGO BLOCKS - Ensures text colors never warp when switching */
    --logo-white: #f1f5f9;
    --logo-grey: #c1cad5;
    --logo-pipe-color: #334155;
}

/* ==========================================================================
   2. LIGHT MODE OVERRIDE PROPERTIES MATRIX
   ========================================================================== */
html.light-mode {
    --bg-base: #f8fafc; 
    --bg-gradient-1: #e0f2fe; 
    --bg-gradient-2: #e0e7ff;
    --card-bg: #ffffff; 
    --card-border: #e2e8f0; 
    --footer-bg: #f1f5f9;
    --text-main: #0f172a; 
    --text-muted: #64748b;
    --accent-main: #2563eb; 
    --accent-hover: #1d4ed8; 
    --accent-subtle: rgba(37, 99, 235, 0.08);
    --btn-secondary-hover: rgba(15, 23, 42, 0.05); 
    --btn-secondary-border: #cbd5e1;

    --logo-white: #0f172a;
    --logo-grey: #475569;
    --logo-pipe-color: #cbd5e1;
}

/* ==========================================================================
   3. CORE ARCHITECTURE LAYOUT INFRASTRUCTURE
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Segoe UI', sans-serif; }

body {
    background-color: var(--bg-base); color: var(--text-main); line-height: 1.6;
    background-image: radial-gradient(at 10% 10%, var(--bg-gradient-1) 0px, transparent 50%), 
                      radial-gradient(at 90% 90%, var(--bg-gradient-2) 0px, transparent 50%);
    background-attachment: fixed; transition: background-color 0.3s, color 0.3s;
    display: flex; flex-direction: column; min-height: 100vh;
}

header { width: 100%; max-width: 1200px; margin: 0 auto; padding: 3rem 2rem 1.5rem 2rem; display: flex; flex-direction: column; align-items: flex-start; }
.header-logo { width: 100%; max-width: 380px; height: auto; margin-bottom: 1.5rem; }

/* Desktop Navigation Link Framework Row */
.site-nav { display: flex; gap: 1rem; width: 100%; border-bottom: 1px solid var(--card-border); padding-bottom: 1.5rem; margin-bottom: 2rem; }
.nav-btn { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--text-main); font-weight: 600; font-size: 0.95rem; padding: 0.5rem 1.2rem; border-radius: 6px; border: 1px solid transparent; transition: all 0.2s; }
.nav-btn:hover, .nav-btn.active { background-color: var(--accent-subtle); border-color: var(--accent-main); color: var(--accent-main); }

/* ==========================================================================
   4. MOBILE NAVIGATION BUTTON & DRAW OVERLAYS
   ========================================================================== */
.menu-trigger { display: none; position: fixed; top: 1.5rem; z-index: 2000; background: var(--accent-main); border: none; color: #fff; width: 48px; height: 48px; border-radius: 50%; justify-content: center; align-items: center; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.3); font-size: 1.2rem; transition: left 0.3s ease, right 0.3s ease; }
.menu-trigger.pos-right { right: 1.5rem; }
.menu-trigger.pos-left { left: 1.5rem; }

.mobile-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--bg-base); z-index: 1999; flex-direction: column; justify-content: center; align-items: center; gap: 2rem; padding: 2rem; opacity: 0; transition: opacity 0.3s ease; }
.mobile-overlay.open { display: flex; opacity: 1; }
.mobile-overlay .nav-btn { font-size: 1.5rem; padding: 1rem 2rem; width: 80%; max-width: 300px; justify-content: center; }

.menu-controls { display: flex; flex-direction: column; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.theme-toggle-btn { background: transparent; border: 1px solid var(--card-border); color: var(--text-main); padding: 0.6rem 1.5rem; border-radius: 20px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; transition: all 0.2s; }
.theme-toggle-btn:hover { background: var(--accent-subtle); border-color: var(--accent-main); color: var(--accent-main); }
.side-swapper { font-size: 0.85rem; color: var(--text-muted); cursor: pointer; text-decoration: underline; }

/* ==========================================================================
   5. HOVER SECTOR CARDS & GRID COMPONENTS
   ========================================================================== */
main { flex-grow: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 0 2rem 4rem 2rem; }
.tagline-container { max-width: 750px; margin-bottom: 3rem; }
.tagline { font-size: 1.25rem; color: var(--text-muted); font-weight: 300; margin-bottom: 1.5rem; }
.bio-badge { display: inline-flex; align-items: center; gap: 0.75rem; background: var(--accent-subtle); border: 1px solid var(--accent-main); color: var(--accent-main); padding: 0.6rem 1.2rem; border-radius: 30px; font-weight: 600; font-size: 0.95rem; }

.section-title { font-size: 2.25rem; margin-bottom: 2.5rem; border-left: 5px solid var(--accent-main); padding-left: 1.25rem; font-weight: 700; letter-spacing: -0.5px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2.5rem; margin-bottom: 4rem; }
.card { background-color: var(--card-bg); border-radius: 14px; padding: 2.5rem; border: 1px solid var(--card-border); display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; }
.card:hover { transform: translateY(-8px); box-shadow: 0 12px 24px rgba(0,0,0,0.15); border-color: var(--accent-main); }
.card-icon { font-size: 3rem; color: var(--accent-main); margin-bottom: 1.25rem; }
.card h3 { font-size: 1.6rem; margin-bottom: 0.75rem; font-weight: 600; }
.card p { color: var(--text-muted); margin-bottom: 2rem; font-size: 1.05rem; flex-grow: 1; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.game-card { background-color: var(--card-bg); border-radius: 12px; border: 1px solid var(--card-border); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; position: relative; }
.game-card:hover { transform: translateY(-6px); box-shadow: 0 12px 24px rgba(0,0,0,0.15); border-color: var(--accent-main); }

.carousel-container { position: relative; width: 100%; padding-top: 56.25%; background-color: rgba(0, 0, 0, 0.2); overflow: hidden; border-bottom: 1px solid var(--card-border); }
.carousel-track { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.carousel-slide { min-width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }

.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(16, 21, 36, 0.8); border: none; color: #fff; width: 36px; height: 36px; border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; z-index: 10; opacity: 0; transition: opacity 0.2s, background 0.2s; }
.carousel-nav:hover { background: var(--accent-main); } .carousel-nav.prev { left: 0.5rem; } .carousel-nav.next { right: 0.5rem; }
.game-card:hover .carousel-nav { opacity: 1; }

.game-info { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; text-decoration: none; color: inherit; }
.game-title { font-size: 1.35rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-main); }
.game-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; margin-top: auto; }

/* Interactive Interface Controllers */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; background-color: var(--accent-main); color: var(--text-on-accent); text-decoration: none; padding: 0.8rem 1.8rem; border-radius: 8px; font-weight: 600; transition: background-color 0.2s; }
.btn:hover { background-color: var(--accent-hover); }
.btn-secondary { background-color: transparent; color: var(--text-main); border: 1px solid var(--btn-secondary-border); }
.btn-secondary:hover { background-color: var(--btn-secondary-hover); }

footer { text-align: center; padding: 4rem 2rem; color: var(--text-muted); border-top: 1px solid var(--card-border); background-color: var(--footer-bg); margin-top: auto; }
footer span.accent { color: var(--accent-main); font-weight: 600; }

/* ==========================================================================
   6. HIGH-RESOLUTION ZOOM OVERLAY PREVIEW MODAL
   ========================================================================== */
.lightbox-modal { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(10, 14, 26, 0.96); z-index: 5000; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease; }
.lightbox-modal.active { display: flex; opacity: 1; }
.lightbox-content-frame { position: relative; max-width: 90%; max-height: 80%; display: flex; justify-content: center; align-items: center; }
.lightbox-img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); object-fit: contain; }
.lightbox-close { position: absolute; top: -3.5rem; right: 0; background: transparent; border: none; color: #fff; font-size: 2rem; cursor: pointer; }
.lightbox-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; width: 54px; height: 54px; border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; font-size: 1.2rem; transition: all 0.2s; }
.lightbox-arrow:hover { background: var(--accent-main); border-color: var(--accent-main); }
.lightbox-arrow.l-prev { left: -5rem; } .lightbox-arrow.l-next { right: -5rem; }

/* ==========================================================================
   7. DISPATCH QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
    .lightbox-arrow.l-prev { left: 1rem; background: rgba(16,21,36,0.8); }
    .lightbox-arrow.l-next { right: 1rem; background: rgba(16,21,36,0.8); }
    .lightbox-close { right: 1rem; top: 1rem; position: fixed; }
}
@media (max-width: 768px) {
    .site-nav { display: none; } .menu-trigger { display: flex; }
    header { padding: 2rem 1.5rem 1rem 1.5rem; } .header-logo { max-width: 280px; margin-top: 1rem; }
    main { padding: 0 1.5rem 3rem 1.5rem; } .grid { grid-template-columns: 1fr; gap: 1.5rem; } .card { padding: 1.5rem; }
    .carousel-nav { opacity: 1; }
}
