/* Import Fonts: Creepster for headlines, Roboto Mono for retro body text */
@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Roboto+Mono:wght@400;700&display=swap');

:root {
    --st-red: #e71d23;
    --st-glow: #ff3a3a;
    --bg-dark: #090909;
    --text-light: #e0e0e0;
    --card-bg: #141414;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    background-color: var(--bg-dark);
    font-family: 'Roboto Mono', monospace;
    /* Smooth transition for the rotation flip */
    transition: transform 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* --- The Upside Down Flip State --- */
body.flipped {
    transform: rotate(180deg);
    filter: hue-rotate(15deg) contrast(1.1);
}

/* --- Typography Styling (UPDATED: Black Text with Red Glow) --- */
h1, h2, .logo {
    font-family: 'Creepster', cursive;
    text-transform: uppercase;
    letter-spacing: 2px;
    
    /* UPDATED: Solid Black Fill with Red Outline & Glow */
    color: #000; 
    -webkit-text-stroke: 1px var(--st-red);
    text-shadow: 0 0 10px var(--st-red), 0 0 20px var(--st-glow);
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.6));
}

.logo {
    font-size: 2rem;
    text-decoration: none;
}

.nav-links {
    display: flex;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--st-red);
    text-shadow: 0 0 10px var(--st-red);
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('wp12426050-stranger-things-4k-pc-wallpapers.jpg') no-repeat center center/cover;
    filter: brightness(0.8) contrast(1.2);
}

.hero-bg::after {
    content: '';
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    background: radial-gradient(circle, transparent 50%, black 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    color: var(--text-light);
    max-width: 800px;
    padding: 20px;
}

.hero h1 {
    font-size: 5rem;
    margin-bottom: 1rem;
    line-height: 1.1;
    /* Extra shadow for legibility over image */
    text-shadow: 0 0 10px var(--st-red), 2px 2px 10px #000;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.8);
}

/* --- The "Spore" Animation --- */
.spores-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.spore {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: rgba(200, 200, 200, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(231, 29, 35, 0.4);
    animation: drift linear infinite;
}

.spore:nth-child(1) { top: 10%; left: 20%; animation-duration: 15s; animation-delay: 0s; }
.spore:nth-child(2) { top: 30%; left: 80%; animation-duration: 20s; animation-delay: -5s; width: 3px; height: 3px;}
.spore:nth-child(3) { top: 70%; left: 40%; animation-duration: 18s; animation-delay: -2s; }
.spore:nth-child(4) { top: 50%; left: 10%; animation-duration: 25s; animation-delay: -10s; width: 5px; height: 5px;}
.spore:nth-child(5) { top: 90%; left: 70%; animation-duration: 22s; animation-delay: -8s; }

@keyframes drift {
    0% { transform: translateY(0) translateX(0) opacity(0); }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(50px); opacity: 0; }
}

/* --- Toggle Button --- */
.toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 200;
    padding: 15px 25px;
    background-color: transparent;
    border: 2px solid var(--st-red);
    color: var(--st-red);
    font-family: 'Creepster', cursive;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 0 15px var(--st-red);
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background-color: var(--st-red);
    color: black;
    box-shadow: 0 0 30px var(--st-red);
}

body.flipped .toggle-btn {
    transform: rotate(180deg);
}

/* --- Content Section --- */
.content-section {
    padding: 5rem 10%;
    background: var(--bg-dark);
    color: var(--text-light);
    text-align: center;
}
.content-section h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
}

/* --- Season Dropdown Styles --- */
.seasons-container {
    max-width: 1200px;
    margin: 3rem auto;
    text-align: left;
    background: transparent;
}

.season-item {
    margin-bottom: 1.5rem;
    background: #000;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
}

.season-header {
    width: 100%;
    padding: 1.5rem 2rem;
    background: linear-gradient(90deg, #111 0%, #000 100%);
    border: none;
    color: var(--text-light);
    font-family: 'Creepster', cursive;
    font-size: 1.8rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.season-header:hover, .season-header.active {
    color: var(--st-red);
    background: rgba(231, 29, 35, 0.05);
}

.season-header .icon {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.season-header.active .icon {
    transform: rotate(45deg);
}

.badge {
    font-family: 'Roboto Mono', sans-serif;
    font-size: 0.7rem;
    background: var(--st-red);
    color: #000;
    padding: 3px 6px;
    border-radius: 2px;
    vertical-align: middle;
    margin-left: 15px;
    letter-spacing: 1px;
}

.episode-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: #000;
}

/* --- Episode Grid System --- */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 2rem;
}

.chapter-card {
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.8);
    border-color: var(--st-red);
}

.card-image {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    opacity: 0.8;
}

.chapter-card:hover .card-image img {
    transform: scale(1.05);
    opacity: 1;
}

.card-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--st-red);
    margin-bottom: 8px;
    font-weight: bold;
    letter-spacing: 1px;
}

.chapter-card h4 {
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.3;
}

.description {
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.air-date {
    font-size: 0.7rem;
    color: #555;
    border-top: 1px solid #333;
    padding-top: 10px;
    margin-top: auto;
}


/* --- Cast Section Grid --- */
.cast-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 1200px) {
    .cast-container {
        grid-template-columns: repeat(5, 1fr);
    }
}

.cast-card {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px); 
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 220px;
}

.cast-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--st-red);
    box-shadow: 0 0 20px rgba(231, 29, 35, 0.4);
    background: rgba(30, 30, 30, 0.9);
}

.card-inner h3 {
    font-family: 'Creepster', cursive;
    color: #000;
    -webkit-text-stroke: 1px var(--st-red);
    text-shadow: 0 0 10px var(--st-red);
    font-size: 1.8rem;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.card-inner .actor {
    display: block;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 15px;
    text-transform: uppercase;
    border-bottom: 1px dashed #444;
    padding-bottom: 5px;
}

.card-inner p {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-light);
}

.cast-card .card-inner img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--st-red);
    transition: filter 0.3s ease;
    filter: grayscale(80%) contrast(1.2);
}

.cast-card:hover .card-inner img {
    filter: grayscale(0%) contrast(1.1);
}

/* Special Effects for Cards */
.cast-card.special-hero:hover { border-color: #fff; box-shadow: 0 0 25px rgba(255, 255, 255, 0.5); }
.cast-card.special-hero h3 { color: #000; -webkit-text-stroke: 1px #fff; text-shadow: 0 0 10px #fff; }

.cast-card.special-survivor { border-left: 4px solid var(--st-glow); }
.cast-card.special-survivor:hover { box-shadow: 0 0 20px rgba(50, 205, 50, 0.2); border-color: #556b2f; }

.cast-card.special-villain { background: linear-gradient(135deg, #000 0%, #1a0505 100%); border: 1px solid #4a0000; }
.cast-card.special-villain:hover { box-shadow: inset 0 0 30px rgba(255, 0, 0, 0.2), 0 0 30px rgba(255, 0, 0, 0.6); }
.cast-card.special-villain h3 { color: #000; -webkit-text-stroke: 1px #800000; text-shadow: 0 0 10px #ff0000; }

.cast-card.special-steve { border: 2px solid #ffd700; background: linear-gradient(to bottom right, rgba(255, 215, 0, 0.1), rgba(0,0,0,0.8)); transform: scale(1.02); }
.cast-card.special-steve:hover { box-shadow: 0 0 30px rgba(255, 215, 0, 0.6); border-color: #fff; }
.cast-card.special-steve h3 { color: #000; -webkit-text-stroke: 1px #ffd700; text-shadow: 0 0 10px #ffd700; }
.cast-card.special-steve::after { content: '👑'; position: absolute; top: 10px; right: 10px; font-size: 1.5rem; filter: drop-shadow(0 0 5px gold); animation: floatCrown 3s ease-in-out infinite; }

@keyframes floatCrown { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* --- About Section --- */
.about-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
    max-width: 1100px;
    margin: 0 auto;
    text-align: left;
    padding-top: 2rem;
}

.about-text { flex: 1; }
.about-text h3 { margin-bottom: 1.5rem; border-bottom: 1px dashed #444; padding-bottom: 10px; display: inline-block; }
.about-text p { font-size: 1rem; line-height: 1.6; margin-bottom: 1.5rem; color: #ccc; }
.about-text strong { color: var(--text-light); text-shadow: 0 0 5px white; }

.about-image { flex: 1; position: relative; }
.about-image img { width: 100%; border-radius: 4px; border: 2px solid #333; filter: sepia(0.2) contrast(1.2) brightness(0.8); transition: all 0.5s ease; box-shadow: 0 0 20px rgba(0, 0, 0, 0.8); }
.about-image:hover img { border-color: var(--st-red); box-shadow: 0 0 30px rgba(231, 29, 35, 0.4); filter: sepia(0) contrast(1.1) brightness(1); transform: scale(1.02); }


/* --- Footer --- */
.site-footer {
    position: relative;
    width: 100%;
    background: linear-gradient(to bottom, var(--bg-dark) 0%, #000000 100%);
    padding: 4rem 1rem 2rem 1rem;
    text-align: center;
    overflow: hidden;
    margin-top: -2px;
    border-top: 1px solid rgba(231, 29, 35, 0.1);
}

.site-footer::after { content: ''; position: absolute; bottom: -50px; left: 0; width: 100%; height: 100px; background: radial-gradient(ellipse at center, rgba(231, 29, 35, 0.15) 0%, transparent 70%); pointer-events: none; }

.footer-content { position: relative; z-index: 2; max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 15px; }
.footer-logo { font-family: 'Roboto Mono', monospace; font-weight: 700; letter-spacing: 3px; color: #333; font-size: 0.9rem; user-select: none; }
.flavor-text { font-family: 'Roboto Mono', monospace; font-size: 0.75rem; color: #555; text-transform: uppercase; letter-spacing: 1px; }
.divider-line { width: 50px; height: 2px; background-color: var(--st-red); box-shadow: 0 0 10px var(--st-red); margin: 10px 0; transition: width 0.5s ease; }
.site-footer:hover .divider-line { width: 150px; }
.credit { font-family: 'Roboto Mono', monospace; color: #888; font-size: 0.9rem; margin-top: 10px; }
.creator-name { font-family: 'Creepster', cursive; font-size: 1.4rem; color: var(--text-light); margin-left: 8px; position: relative; cursor: pointer; transition: all 0.3s ease; display: inline-block; }
.creator-name::before { content: ''; position: absolute; width: 100%; height: 2px; bottom: 0; left: 0; background-color: var(--st-red); transform: scaleX(0); transform-origin: right; transition: transform 0.4s ease; }
.creator-name:hover { color: var(--st-red); text-shadow: 0 0 10px var(--st-red), 0 0 20px var(--st-glow); transform: scale(1.1); }
.creator-name:hover::before { transform: scaleX(1); transform-origin: left; }

/* --- RESPONSIVENESS ADDITIONS (UPDATED) --- */

/* Hamburger Menu Base Styles (Hidden on Desktop) */
.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--text-light); transition: all 0.3s ease-in-out; }

/* Mobile & Tablet Media Queries (Range extended to 1024px to include tablets) */
@media (max-width: 1024px) {
    /* Navbar Transformations */
    .navbar {
        padding: 1rem 5%;
        background-color: #000; /* Solid black for better menu contrast */
    }

    .hamburger {
        display: block;
        z-index: 1001;
    }

    /* Hamburger Animation */
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* Nav Links DROPDOWN Style (Replaces previous full-screen style) */
    .nav-links {
        position: absolute;
        top: 100%; /* Positions it directly below the navbar */
        left: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.95); /* Nearly solid black */
        flex-direction: column;
        align-items: center;
        gap: 0;
        
        /* Dropdown Animation Properties */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;
        
        /* Border to separate from content */
        border-bottom: 2px solid transparent; 
    }

    .nav-links.active {
        max-height: 500px; /* Expands to show content */
        border-bottom-color: var(--st-red);
        box-shadow: 0 10px 20px rgba(0,0,0,0.8);
    }

    .nav-links a {
        margin: 0;
        padding: 20px 0;
        width: 100%;
        text-align: center;
        border-top: 1px solid #222;
        font-size: 1.5rem;
    }

    .nav-links a:hover {
        background-color: rgba(231, 29, 35, 0.1);
    }

    /* Hero Section Fixes */
    .hero h1 { font-size: 3.5rem; }
    .hero p { font-size: 1rem; padding: 0 20px; }

    /* General Layout Padding */
    .content-section { padding: 4rem 5%; }
    .content-section h2 { font-size: 2.2rem; word-wrap: break-word; }

    /* Season Dropdown Mobile Fixes */
    .season-header { font-size: 1.2rem; padding: 1rem; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
    .badge { font-size: 0.6rem; margin-left: 0; white-space: nowrap; justify-self: start; }

    /* Grid Adjustments */
    .chapter-grid { grid-template-columns: 1fr; padding: 1rem; }
    .cast-container { grid-template-columns: repeat(2, 1fr); }

    /* About Section */
    .about-container { flex-direction: column; gap: 30px; }
    .about-text { order: 2; }
    .about-image { order: 1; width: 100%; margin-bottom: 2rem; }
    .about-text h3 { font-size: 1.5rem; }

    /* Toggle Button Position */
    .toggle-btn { bottom: 20px; right: 20px; padding: 10px 15px; font-size: 0.9rem; }
}

/* Small Mobile Devices (Phones < 480px) */
@media (max-width: 480px) {
    .hero h1 { font-size: 2.8rem; }
    .logo { font-size: 1.5rem; }
    .cast-container { grid-template-columns: 1fr; }
}