/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Properties for Horror Theme */
:root {
    --color-bg-primary: #0d0d0d;
    --color-bg-secondary: #1a1a1a;
    --color-bg-tertiary: #2d2d2d;
    --color-text-primary: #e0e0e0;
    --color-text-secondary: #b0b0b0;
    --color-accent-red: #8b0000;
    --color-accent-red-bright: #dc143c;
    --color-accent-purple: #4a0e4e;
    --color-accent-orange: #d2691e;
    --color-border: #333;
    --color-shadow: rgba(0, 0, 0, 0.8);
    --color-glow-red: rgba(220, 20, 60, 0.3);
    --color-glow-purple: rgba(138, 43, 226, 0.2);
    
    --font-family-primary: 'Georgia', 'Times New Roman', serif;
    --font-family-accent: 'Courier New', monospace;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    --border-radius: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-reveal: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Base Styles */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, var(--color-glow-red) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--color-glow-purple) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(139, 0, 0, 0.1) 0%, transparent 50%);
    animation: horrorPulse 8s ease-in-out infinite;
    z-index: -1;
}

@keyframes horrorPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Header Styles */
.site-header {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
    border-bottom: 2px solid var(--color-accent-red);
    padding: var(--spacing-lg) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 20, 60, 0.1), transparent);
    animation: headerScan 4s linear infinite;
}

@keyframes headerScan {
    0% { left: -100%; }
    100% { left: 100%; }
}

.logo-section {
    position: relative;
    z-index: 2;
}

.site-logo {
    max-width: 300px;
    height: auto;
    margin-bottom: var(--spacing-sm);
    filter: drop-shadow(0 0 10px var(--color-glow-red));
    transition: var(--transition-smooth);
}

.site-logo:hover {
    filter: drop-shadow(0 0 20px var(--color-accent-red-bright));
    transform: scale(1.05);
}

.site-title {
    font-size: 3rem;
    font-family: var(--font-family-accent);
    color: var(--color-accent-red-bright);
    text-shadow: 
        0 0 10px var(--color-glow-red),
        2px 2px 4px var(--color-shadow);
    margin-bottom: var(--spacing-xs);
    animation: titleGlow 2s ease-in-out infinite alternate;
    letter-spacing: 2px;
}

@keyframes titleGlow {
    from { text-shadow: 0 0 10px var(--color-glow-red), 2px 2px 4px var(--color-shadow); }
    to { text-shadow: 0 0 20px var(--color-accent-red-bright), 2px 2px 8px var(--color-shadow); }
}

.site-tagline {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    font-style: italic;
    opacity: 0.8;
}

/* Main Content */
.main-content {
    padding: var(--spacing-xl) 0;
}

.content-article {
    background: var(--color-bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    box-shadow: 
        0 10px 30px var(--color-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
}

.content-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent-red), var(--color-accent-purple), var(--color-accent-red));
    animation: borderPulse 3s linear infinite;
}

@keyframes borderPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Section Styles */
section {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--color-border);
    opacity: 0;
    transform: translateY(20px);
    animation: revealSection 0.8s ease-out forwards;
}

section:last-child {
    border-bottom: none;
}

@keyframes revealSection {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }
section:nth-child(4) { animation-delay: 0.4s; }
section:nth-child(5) { animation-delay: 0.5s; }
section:nth-child(6) { animation-delay: 0.6s; }

/* Typography */
h2 {
    font-size: 2.2rem;
    color: var(--color-accent-red-bright);
    margin-bottom: var(--spacing-lg);
    text-shadow: 0 0 5px var(--color-glow-red);
    position: relative;
    padding-bottom: var(--spacing-sm);
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent-red), transparent);
}

h3 {
    font-size: 1.6rem;
    color: var(--color-accent-orange);
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 0 3px rgba(210, 105, 30, 0.5);
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-primary);
    line-height: 1.8;
}

.intro-text {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    font-style: italic;
    border-left: 3px solid var(--color-accent-red);
    padding-left: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    background: rgba(139, 0, 0, 0.1);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: var(--spacing-md);
}

/* Game Entry Styles */
.game-entry {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.game-entry::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 20, 60, 0.1), transparent);
    transition: left 0.6s ease;
}

.game-entry:hover {
    border-color: var(--color-accent-red);
    box-shadow: 
        0 5px 20px var(--color-shadow),
        0 0 20px var(--color-glow-red);
    transform: translateY(-2px);
}

.game-entry:hover::before {
    left: 100%;
}

.game-entry h3 {
    position: relative;
    z-index: 2;
}

.game-entry p {
    position: relative;
    z-index: 2;
    margin-bottom: 0;
}

/* CTA Section */
.cta-section {
    text-align: center;
    background: linear-gradient(135deg, var(--color-accent-purple) 0%, var(--color-accent-red) 100%);
    color: white;
    border-radius: var(--border-radius);
    margin: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    );
    animation: patternMove 20s linear infinite;
}

@keyframes patternMove {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(20px) translateY(20px); }
}

.cta-section h2,
.cta-section p {
    position: relative;
    z-index: 2;
    color: white;
}

.discord-cta {
    position: relative;
    z-index: 2;
}

.discord-button {
    display: inline-block;
    background: #5865f2;
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: var(--transition-smooth);
    border: 2px solid transparent;
    text-shadow: none;
}

.discord-button:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 101, 242, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.discord-text {
    margin-top: var(--spacing-md);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-family-accent);
    word-break: break-all;
}

/* References Section */
.references-section {
    background: var(--color-bg-tertiary);
    border-radius: var(--border-radius);
    margin: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.references-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.reference-entry {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.reference-entry::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 20, 60, 0.1), transparent);
    transition: left 0.6s ease;
}

.reference-entry:hover {
    border-color: var(--color-accent-red);
    box-shadow: 0 5px 15px var(--color-shadow);
    transform: translateY(-2px);
}

.reference-entry:hover::before {
    left: 100%;
}

.reference-entry a {
    color: var(--color-accent-orange);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1.4;
    position: relative;
    z-index: 2;
    display: block;
    transition: var(--transition-smooth);
}

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

/* Footer */
.site-footer {
    background: var(--color-bg-primary);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-lg) 0;
    text-align: center;
    color: var(--color-text-secondary);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .site-header::before,
    .content-article::before,
    .game-entry::before,
    .cta-section::before {
        animation: none;
    }
    
    .site-title {
        animation: none;
    }
    
    body::before {
        animation: none;
    }
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--color-accent-red-bright);
    outline-offset: 2px;
}

a:focus {
    outline-color: var(--color-accent-orange);
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-lg: 1.5rem;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .site-title {
        font-size: 2.2rem;
    }
    
    .site-logo {
        max-width: 250px;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.4rem;
    }
    
    section {
        padding: var(--spacing-lg);
    }
    
    .game-entry {
        padding: var(--spacing-md);
    }
    
    .intro-text {
        padding: var(--spacing-sm);
        padding-left: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }
    
    .site-logo {
        max-width: 200px;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    section {
        padding: var(--spacing-md);
    }
    
    .discord-button {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 1rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --color-bg-primary: #000000;
        --color-bg-secondary: #1a1a1a;
        --color-text-primary: #ffffff;
        --color-accent-red-bright: #ff0000;
        --color-border: #ffffff;
    }
}

/* Print Styles */
@media print {
    body::before,
    .site-header::before,
    .content-article::before,
    .game-entry::before,
    .cta-section::before {
        display: none;
    }
    
    .cta-section {
        background: transparent;
        color: black;
        border: 1px solid black;
    }
    
    .discord-button {
        background: transparent;
        color: black;
        border: 1px solid black;
    }
}