/* =========================================================================
   FRANCHISE UNDERWORLD - Visual Canon (Lumenridge Landing)
   ========================================================================= */

:root {
    /* Color Canon */
    --clr-sodium: #c48b59;
    /* 70% sodium warmth */
    --clr-sodium-dim: rgba(196, 139, 89, 0.4);
    --clr-charcoal: #121316;
    /* 20% charcoal/asphalt */
    --clr-asphalt-deep: #08090a;

    /* Neon reflections (muted) */
    --clr-neon-cyan: rgba(0, 150, 200, 0.15);
    --clr-neon-magenta: rgba(180, 0, 100, 0.15);

    /* Text */
    --clr-text-title: rgba(230, 220, 210, 0.95);
    /* ~95% opacity */
    --clr-text-menu: rgba(200, 190, 180, 0.8);
    --clr-text-menu-hover: rgba(150, 140, 135, 0.9);

    /* Fonts */
    --font-title: 'Playfair Display', serif;
    --font-ui: 'Inter', sans-serif;
}

/* =========================================================================
   RESET & GLOBAL
   ========================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    width: 100%;
    height: 100%;
    background-color: var(--clr-asphalt-deep);
    color: var(--clr-text-title);
    font-family: var(--font-ui);
    overflow-x: hidden;
    user-select: none;
}

/* =========================================================================
   BACKGROUND & ENVIRONMENT LAYERS
   ========================================================================= */
.background-anchor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.background-anchor img {
    width: 100%;
    height: 100%;
}

/* Rain Overlay */
.rain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0.15;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* Fog Overlay: low-density ground mist drifting slowly */
.fog-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 50%;
    background: linear-gradient(to top, var(--clr-sodium-dim) 0%, transparent 100%);
    filter: blur(20px);
    opacity: 0.05;
    /* 4-6% opacity requirement */
    z-index: 3;
    pointer-events: none;
    animation: driftMist 60s infinite linear;
}

@keyframes driftMist {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Film Grain Overlay: 3-5% opacity */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.04;
    mix-blend-mode: overlay;
}

/* =========================================================================
   UI & TYPOGRAPHY
   ========================================================================= */
.content-container {
    position: relative;
    z-index: 20;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Occasional very subtle flicker */
    animation: subtleFlicker 60s infinite;
}

@keyframes subtleFlicker {

    0%,
    98%,
    100% {
        opacity: 1;
    }

    98.5% {
        opacity: 0.98;
    }

    99% {
        opacity: 1;
    }

    99.5% {
        opacity: 0.99;
    }
}

.title-container {
    margin-bottom: 4rem;
    text-align: center;
}

.main-title {
    font-family: var(--font-title);
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: 0.2em;
    font-weight: 400;
    text-transform: uppercase;
    color: var(--clr-text-title);
    text-shadow: 1px 1px 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
}

.dev-badge {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    letter-spacing: 0.4em;
    color: var(--clr-text-menu);
    opacity: 0.7;
    text-transform: uppercase;
    margin-top: 1.5rem;
    display: inline-block;
    border: 1px solid rgba(230, 210, 180, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2px;
    background-color: rgba(10, 12, 15, 0.5);
    /* Slight dark background for contrast */
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

/* Navigation - "Access Points" */
.main-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--clr-text-menu);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    font-weight: 600;
    /* Increased weight for legibility */
    text-transform: uppercase;
    position: relative;
    padding-bottom: 2px;
    transition: color 0.3s ease;
    text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0, 0, 0, 0.6);
    /* Dark shadow for contrast */
}

/* Minimal hover: slight darken + thin underline fade */
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--clr-text-menu-hover);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.main-nav a:hover {
    color: var(--clr-text-menu-hover);
}

.main-nav a:hover::after {
    opacity: 0.6;
}

.live-indicator {
    font-style: italic;
    opacity: 0.5;
    text-transform: lowercase;
    letter-spacing: normal;
    font-family: var(--font-title);
}

/* Social Media Links */
.social-links {
    margin-top: 3rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.social-links a {
    color: var(--clr-text-menu);
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    opacity: 1;
    color: var(--clr-text-menu-hover);
    transform: translateY(-2px);
}

.social-links svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    filter: drop-shadow(1px 1px 4px rgba(0, 0, 0, 0.8));
}

/* =========================================================================
   AUDIO CONTROLS
   ========================================================================= */
.audio-control {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 30;
    opacity: 0.4;
    cursor: pointer;
    transition: opacity 0.3s ease;
    padding: 10px;
}

.audio-control:hover {
    opacity: 0.6;
}

.audio-control.playing svg line {
    display: none;
    /* Hide the mute lines when playing */
}

/* =========================================================================
   SUB-PAGES (Records Pending & Gallery)
   ========================================================================= */
.subpage-anchor {
    position: fixed;
    top: -2%;
    left: -2%;
    width: 104%;
    height: 104%;
    background-image: url('../assets/images/records_pending.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 1;
    filter: brightness(0.6) contrast(1.1);
    /* Dim desk surface */
}

/* Subpage content container */
.subpage-container {
    position: relative;
    z-index: 20;
    width: 100%;
    min-height: 100vh;
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

/* Return Link */
.return-link {
    align-self: flex-start;
    color: var(--clr-text-menu);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    margin-bottom: 3rem;
    position: relative;
}

.return-link::before {
    content: '← ';
}

.return-link:hover {
    opacity: 1;
}

/* Records Pending Centered Stamp */
.placeholder-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stamp {
    font-family: var(--font-title);
    font-size: 3rem;
    color: rgba(180, 50, 50, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transform: rotate(-5deg);
    border: 3px solid rgba(180, 50, 50, 0.8);
    padding: 1rem 2rem;
    border-radius: 4px;
    mix-blend-mode: multiply;
}

/* Gallery Grid */
.gallery-layout {
    background-color: var(--clr-asphalt-deep);
    /* overriding subpage background to solid dark */
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    width: 100%;
}

.gallery-item {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-item:hover {
    transform: translateY(-8px);
    border-color: rgba(196, 139, 89, 0.4);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(196, 139, 89, 0.1);
}

.gallery-item img {
    width: 100%;
    height: auto;
    max-height: 400px;
    /* Limits size directly within the grid cell */
    object-fit: contain;
    display: block;
    filter: brightness(0.8) grayscale(20%);
    transition: filter 0.4s ease;
    border-radius: 2px;
}

.gallery-item:hover img {
    filter: brightness(1) grayscale(0%);
}

.evidence-label {
    margin-top: 1.5rem;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: var(--clr-text-menu);
    opacity: 0.7;
    text-align: center;
}

.gallery-title {
    font-size: 2rem;
    text-align: center;
    color: var(--clr-text-title);
    margin-bottom: 3rem;
    letter-spacing: 0.2em;
}

/* =========================================================================
   ACCESSIBILITY - REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
    .background-anchor {
        animation: none;
    }

    .fog-overlay {
        animation: none;
    }

    .content-container {
        animation: none;
    }
}