/* ============================================================
   1. VARIABLES & RESET
   ============================================================ */
:root {
    --bg: #030303;
    --fg: #e0e0e0;
    --accent: #b02748;
    --secondary: #39399E;
    --easing: cubic-bezier(0.165, 0.84, 0.44, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: "Montserrat", sans-serif;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("https://theonewheresomebodydies.neocities.org/graphics/giphy.gif");
    background-size: cover; background-position: center;
    opacity: 0.15; z-index: -10; pointer-events: none;
}

.noise {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9998; opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ============================================================
   2. NAVIGATION
   ============================================================ */
.brutal-nav {
    position: fixed; top: 0; left: 0; width: 100%; padding: 3rem 4rem;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 100; transition: all 0.7s var(--easing);
}

.brutal-nav.scrolled {
    top: 1.5rem; padding: 0.8rem 2rem; width: 80%; max-width: 1200px;
    left: 50%; transform: translateX(-50%);
    background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(9px);
    border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 12px;
}

.nav-logo { font-weight: 800; font-size: 2rem; color: #fff; text-decoration: none; }
.nav-menu { display: flex; gap: 3rem; list-style: none; }
.nav-link { font-weight: 700; font-size: 0.95rem; color: #fff; text-decoration: none; }

.cta-btn {
    padding: 0.8rem 2rem; background: #fff; color: #000; font-weight: 700;
    text-transform: uppercase; cursor: pointer; position: relative; overflow: hidden;
}

/* ============================================================
   3. HERO & TAPE (MAIN PAGE)
   ============================================================ */
.hero {
    height: 100vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    position: relative; text-align: center; overflow: hidden;
}

.hero h1 {
    font-size: 9.5vw; 
    display: flex; flex-direction: column; align-items: center;
    line-height: 0.8; letter-spacing: -0.02em; font-weight: 900;
    color: var(--bg) !important; 
    -webkit-text-stroke: 6px var(--fg);
    paint-order: stroke fill;
    transition: all 0.3s ease;
}

.hero h1:hover, .hero h1:hover * {
    color: var(--accent) !important;
    -webkit-text-stroke: 0px transparent !important;
}

.tape-wrapper {
    position: absolute; bottom: 10vh; left: -10%; width: 120%;
    background: #FFD044; color: #000; transform: rotate(-2deg);
    padding: 10px 0; border-top: 3px solid #000; z-index: 10;
}

.tape-text {
    font-size: 2rem; font-weight: 800; white-space: nowrap;
    animation: tapeScroll 15s linear infinite;
}

@keyframes tapeScroll { to { transform: translateX(-50%); } }

/* ============================================================
   4. CONTENT BLOCKS (MAIN PAGE DEFAULT)
   ============================================================ */
.section-dark { 
    min-height: 80vh; 
    display: flex; 
    align-items: center; 
    padding: 5vw 10vw; 
}

.big-text { 
    font-size: 5vw; 
    line-height: 1.1; 
    font-weight: 300; 
    color: #444; 
    text-align: left;
}

.big-text span { color: var(--accent); font-weight: 700; }

.content-container { display: flex; align-items: center; gap: 4rem; width: 100%; }
.image-wrapper img { 
    max-width: 65%; border: 2px solid var(--fg); 
    filter: grayscale(100%) contrast(120%); transition: 0.3s;
}
.image-wrapper img:hover { filter: grayscale(0%); }

/* ============================================================
   5. SUB-PAGE SPECIFIC OVERRIDES
   ============================================================ */
.sub-page .section-dark:not(.mobile-nav-stack):not(.section-with-image) {
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important; 
    padding-top: 4rem;
    padding-bottom: 2rem;
}

/* Specific Sub-Page Image Sections (Side-by-Side) */
.sub-page .section-with-image {
    min-height: auto !important;
    display: flex !important;
    flex-direction: row !important; /* Forces side-by-side on desktop */
    align-items: center !important;
    justify-content: center !important;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

/* Ensure the container inside the sub-page image section behaves */
.sub-page .section-with-image .content-container {
    display: flex !important;
    flex-direction: row !important;
    text-align: left !important;
}

.sub-page .section-with-image .big-text {
    text-align: left !important; /* Stops the header text from centering in image sections */
    font-size: 4vw; /* Slightly smaller to fit next to images */
}

/* Sub-Page Header */
.sub-page .section-dark:first-of-type {
    padding-top: 10rem !important;
}

/* Hollow-to-Red Hover for Sub-Page Headers */
@media (min-width: 901px) {
    .sub-page .mobile-stack { transition: all 0.3s ease; }
    
    .sub-page .mobile-stack:hover, 
    .sub-page .mobile-stack:hover span {
        color: var(--accent) !important;
        -webkit-text-stroke: 0px transparent !important;
        cursor: pointer;
    }
}

.sub-page .story-content {
    max-width: 800px; width: 100%; margin: 1rem auto;
    font-family: "PT Serif", serif; font-size: 1.25rem;
    line-height: 1.6; color: var(--fg); text-align: left;
}

.sub-page .story-content p { margin-bottom: 1.5rem; }
.sub-page .story-content span {
    color: var(--accent); font-weight: bold;
    font-family: "Montserrat", sans-serif;
}

/* ============================================================
   6. MOBILE SYSTEM (MAX-WIDTH: 900px)
   ============================================================ */
@media (max-width: 900px) {
    .desktop-only, .brutal-nav { display: none !important; }

    .mobile-only {
        display: flex !important;
        flex-direction: column; justify-content: center; align-items: center;
        min-height: 85vh; padding: 0 5vw;
    }

    .mobile-stack {
        display: flex; flex-direction: column; align-items: center;
        font-family: "Montserrat", sans-serif; font-weight: 900;
        font-size: 15vw !important; color: var(--accent) !important;
        line-height: 0.8; text-transform: uppercase; text-align: center; margin: 0;
    }

    .mobile-stack span {
        display: block; color: var(--accent) !important;
        -webkit-text-stroke: 0px transparent !important; 
    }

    .big-text { font-size: 10vw !important; text-align: center !important; }

    .content-container { flex-direction: column !important; gap: 2rem; }
    .image-wrapper { width: 100% !important; order: 1; }
    .image-wrapper img { max-width: 90%; filter: grayscale(0%) contrast(110%); }

    .mobile-nav-stack {
        display: flex !important;
        flex-direction: column; padding: 5rem 10vw;
        background-color: var(--fg); color: var(--bg);
        border-top: 10px solid var(--accent);
    }

    .mobile-nav-stack a {
        font-family: "Montserrat", sans-serif; font-weight: 900;
        font-size: 14vw; line-height: 1; color: var(--bg);
        text-transform: uppercase; margin-bottom: 1.5rem; text-decoration: none;
    }

    .section-dark { padding: 10vh 8vw !important; min-height: auto; }
    .tape-wrapper { bottom: 5vh; }
}

/* ============================================================
   7. THE GHOST KILLER (DESKTOP CLEANUP)
   ============================================================ */
@media (min-width: 901px) {
    .mobile-nav-stack, .mobile-only {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }
}

/* ============================================================
   8. BRUTALIST TABLE STYLE
   ============================================================ */
.table-container {
    width: 100%;
    overflow-x: auto; /* Makes it responsive on mobile */
    margin: 2rem 0;
    border: 3px solid var(--fg);
}

.brutal-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Montserrat", sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    text-align: left;
}

.brutal-table thead {
    background-color: var(--fg);
    color: var(--bg);
}

.brutal-table th {
    padding: 1rem;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 0.1em;
    border: 2px solid var(--fg);
}

.brutal-table td {
    padding: 1rem;
    border: 1px solid rgba(224, 224, 224, 0.2);
    font-size: 0.9rem;
}

/* Alternating Row Colors */
.brutal-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Hover Effect */
.brutal-table tbody tr:hover {
    background-color: var(--accent);
    color: #fff;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .brutal-table th, .brutal-table td {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
}

/* ============================================================
   9. ARCHIVE PAGE STYLE
   ============================================================ */
.archive-filters {
    display: flex;
    gap: 1rem;
    margin: 3rem 0;
    flex-wrap: wrap;
    z-index: 10;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--fg);
    color: var(--fg);
    padding: 0.6rem 1.8rem;
    font-family: "Montserrat", sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s var(--easing);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--fg);
    color: var(--bg);
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 3rem;
    width: 100%;
    margin-bottom: 5rem;
}

.episode-card {
    background: var(--bg);
    border: 4px solid var(--fg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden; /* Rest state: clips the title */
    transition: transform 0.1s ease, background 0.2s ease;
    z-index: 1;
}

.ep-num {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 2px;
    z-index: 5;
    background: var(--bg);
    padding-right: 8px;
    transition: background 0.2s ease;
}

.ep-title {
    position: absolute;
    top: 3rem;
    left: 1rem;
    width: 130%; /* Title is wider than box to ensure spillover */
    font-size: 4rem;
    font-weight: 900;
    line-height: 0.8;
    text-transform: uppercase;
    color: var(--fg);
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s ease, transform 0.2s ease;
}

.ep-date {
    font-family: "PT Serif", serif;
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    opacity: 0.8;
    z-index: 4;
}

.ep-link {
    position: relative;
    z-index: 6;
    text-decoration: none;
    color: var(--bg);
    background: var(--fg);
    text-align: center;
    padding: 0.8rem;
    font-weight: 900;
    font-size: 0.85rem;
    transition: background 0.2s ease, color 0.2s ease;
}

/* --- THE JARRING HOVER --- */

.episode-card:hover {
    overflow: visible; /* Burst effect */
    background: var(--accent);
    border-color: #fff;
    transform: scale(1.03);
    z-index: 100; /* Overlaps neighbors */
    box-shadow: 20px 20px 0px #fff;
    cursor: crosshair;
}

.episode-card:hover .ep-title {
    color: #fff;
    transform: skewX(-6deg);
}

.episode-card:hover .ep-num {
    background: var(--accent);
    color: #fff;
}

.episode-card:hover .ep-link {
    background: #fff;
    color: var(--accent);
}

@media (max-width: 900px) {
    .ep-title { font-size: 3rem; }
    .archive-grid { gap: 1.5rem; }
}