@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Lora:ital,wght@0,400;0,700;1,400;1,700&family=Montserrat:wght@300;400;500;700&display=swap');

/* Core Design Variables */
:root {
    --bg-primary: #050505;
    --bg-secondary: #0c0c0c;
    --bg-card: rgba(15, 15, 15, 0.75);
    --border-color: rgba(255, 62, 62, 0.15);
    --border-hover: rgba(255, 62, 62, 0.45);
    --accent-red: #ff2a2a;
    --accent-glow: rgba(255, 42, 42, 0.25);
    --accent-hover: #ff5252;
    --text-primary: #e0e0e0;
    --text-secondary: #8c8c8c;
    --text-title: #f5f5f5;
    
    --font-heading: 'Creepster', cursive;
    --font-body: 'Montserrat', sans-serif;
    --font-story: 'Lora', serif;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #020202;
}

::-webkit-scrollbar-thumb {
    background: #2a0000;
    border-radius: 4px;
    border: 1px solid var(--accent-red);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* Selection highlight */
::selection {
    background: var(--accent-red);
    color: #ffffff;
}

/* Typography & Headers */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    letter-spacing: 2px;
    color: var(--accent-red);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Navigation Bar */
header {
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position:relative;
    top: 0;
    z-index: 100;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--accent-red);
    text-shadow: 0 0 10px var(--accent-glow);
    letter-spacing: 2px;
}

.logo a:hover {
    animation: flicker 0.5s infinite alternate;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav ul li a {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding: 0.5rem 0;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
    transition: width 0.3s ease;
}

nav ul li a:hover {
    color: var(--accent-red);
    text-shadow: 0 0 8px var(--accent-glow);
}

nav ul li a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 80vh;
    background: linear-gradient(rgba(0, 0, 0, 0.4), var(--bg-primary)), 
                url('assets/hero-bg.png') no-repeat center center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.9) 95%);
    pointer-events: none;
}

.hero-content {
    z-index: 1;
    max-width: 800px;
}

.hero h1 {
    font-size: 5rem;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.6), 0 0 40px rgba(0, 0, 0, 0.8);
    animation: flicker-slow 4s infinite alternate;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    letter-spacing: 1px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border: 1px solid var(--accent-red);
    background: transparent;
    color: var(--text-primary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 0 10px var(--accent-glow);
}

.btn:hover {
    background: var(--accent-red);
    color: #000000;
    font-weight: 700;
    box-shadow: 0 0 20px var(--accent-red);
    transform: translateY(-2px);
}

/* Featured Section */
.featured {
    padding: 5rem 10%;
    background-color: var(--bg-secondary);
    position: relative;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 2px;
    background: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red);
    margin: 10px auto 0;
}

.featured-container {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
    border-radius: 4px;
    overflow: hidden;
    transition: border 0.3s ease, box-shadow 0.3s ease;
}

.featured-container:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 30px rgba(255, 42, 42, 0.1);
}

.featured-img {
    flex: 1;
    min-height: 350px;
    background: url('assets/story-walls.png') no-repeat center center/cover;
}

.featured-content {
    flex: 1.2;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--text-title);
    font-family: var(--font-body);
    font-weight: 700;
    letter-spacing: 0;
}

.featured-meta {
    font-size: 0.85rem;
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
}

.featured p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

/* Story Grid Section */
.stories {
    padding: 5rem 10%;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.story-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
}

.story-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: 0 0 30px var(--accent-glow);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.story-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-5px);
}

.story-card:hover::after {
    opacity: 1;
}

.story-card-img {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.story-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    filter: grayscale(40%) contrast(110%);
}

.story-card:hover .story-card-img img {
    transform: scale(1.08);
    filter: grayscale(0%) contrast(100%);
}

.story-card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.story-card h4 {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-title);
    margin-bottom: 0.5rem;
    letter-spacing: 0;
}

.story-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.read-link {
    color: var(--accent-red);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.read-link::after {
    content: '→';
    transition: transform 0.3s ease;
}

.read-link:hover {
    color: var(--text-primary);
}

.read-link:hover::after {
    transform: translateX(5px);
}

/* Story Page Details */
.story-header {
    min-height: 50vh;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 3rem 10%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--border-color);
}

.story-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.2), var(--bg-primary));
}

.story-header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.story-header h1 {
    font-size: 3.5rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.story-header-meta {
    font-size: 0.9rem;
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.story-container {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.story-text {
    font-family: var(--font-story);
    font-size: 1.25rem;
    line-height: 1.8;
    color: #d1d1d1;
    text-align: justify;
}

.story-text p {
    margin-bottom: 2rem;
}

.story-text p::first-letter {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    float: left;
    margin-right: 0.5rem;
    line-height: 0.8;
    color: var(--accent-red);
    text-shadow: 0 0 10px var(--accent-glow);
}

.story-text p ~ p::first-letter {
    font-family: inherit;
    font-size: inherit;
    float: none;
    margin-right: 0;
    line-height: inherit;
    color: inherit;
    text-shadow: none;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
}

.back-btn:hover {
    color: var(--accent-red);
}

/* Spooky Footer */
footer {
    background-color: #020202;
    border-top: 1px solid var(--border-color);
    padding: 3rem 10% 2rem;
    text-align: center;
}

.footer-quote {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    font-family: var(--font-story);
}

.footer-quote span {
    color: var(--accent-red);
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-socials a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.footer-socials a:hover {
    color: var(--accent-red);
    text-shadow: 0 0 5px var(--accent-glow);
}

footer p.copyright {
    font-size: 0.8rem;
    color: #444444;
}

/* Animations */
@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 0 0 4px var(--accent-glow), 0 0 10px var(--accent-glow);
        color: var(--accent-red);
    }
    20%, 24%, 55% {
        text-shadow: none;
        color: #3a0808;
    }
}

@keyframes flicker-slow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.4), 0 0 20px rgba(0,0,0,0.8);
    }
    30% {
        text-shadow: 0 0 5px rgba(255, 0, 0, 0.2), 0 0 15px rgba(0,0,0,0.8);
    }
    33% {
        text-shadow: 0 0 25px rgba(255, 0, 0, 0.7), 0 0 40px rgba(255,0,0,0.4);
    }
    60% {
        text-shadow: 0 0 12px rgba(255, 0, 0, 0.4), 0 0 20px rgba(0,0,0,0.8);
    }
    62% {
        text-shadow: none;
    }
    65% {
        text-shadow: 0 0 20px rgba(255, 0, 0, 0.5), 0 0 30px rgba(0,0,0,0.8);
    }
}

/* Responsive adjustments */
@media(max-width: 900px) {
    .featured-container {
        flex-direction: column;
    }
    .featured-img {
        min-height: 250px;
    }
    .featured-content {
        padding: 2rem;
    }
    .hero h1 {
        font-size: 3.5rem;
    }
}

@media(max-width: 600px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem 1rem;
    }
    nav ul {
        gap: 1rem;
    }
    .hero h1 {
        font-size: 2.8rem;
    }
    .featured, .stories {
        padding: 3rem 5%;
    }
    .story-header h1 {
        font-size: 2.2rem;
    }
}
