/* Color Palette & Global Variables */
:root {
    --bg-dark: #000000;
    --bg-card: #111111;
    --brand-red: #ff1e1e;
    --accent-cyan: #00ffff;
    --text-main: #e0e0e0;
    --text-muted: #888888;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* THE IMMERSIVE CIRCUITRY TEXTURE OVERLAY (Pure Code Edition) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='%23ff1e1e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 100h150l30 30v120l-30 30H50 M250 0v80l20 20h100l20-20V0 M600 200h-80l-20 20v150l20 20h80 M100 600v-80l20-20h150l20 20v80'/%3E%3Cpath d='M200 250h80l20 20v60l-20 20h-80l-20-20v-60z M350 350h100l30 30v80l-30 30H350l-30-30v-80z'/%3E%3Cpath d='M150 130v40 M180 250v-60 M370 100v80 M450 350v-90 M480 490v50 M290 350v60 M120 450h80'/%3E%3C/g%3E%3Cg fill='%23ff1e1e'%3E%3Ccircle cx='150' cy='130' r='4'/%3E%3Ccircle cx='150' cy='170' r='6'/%3E%3Ccircle cx='180' cy='190' r='5'/%3E%3Ccircle cx='370' cy='180' r='4'/%3E%3Ccircle cx='450' cy='260' r='6'/%3E%3Ccircle cx='480' cy='540' r='5'/%3E%3Ccircle cx='290' cy='410' r='4'/%3E%3Ccircle cx='200' cy='450' r='5'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 500px 500px;
    opacity: 0.22;
    z-index: -1;
    pointer-events: none;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: rgba(0, 0, 0, 0.95);
    border-bottom: 2px solid var(--brand-red);
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Casts a subtle downward red ambient glow directly from the navbar line */
    box-shadow: 0 10px 25px -5px rgba(255, 30, 30, 0.35);
}

.nav-brand {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.nav-brand span {
    color: var(--accent-cyan);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-cyan);
}

/* Vibrant Hero Section: RESTORED TOP ATMOSPHERIC GLOW */
.hero {
    height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    /* Restored intense top radial gradient bleeding outward into the circuitry void */
    background: radial-gradient(circle at 50% 0%, rgba(255, 30, 30, 0.45) 0%, rgba(180, 10, 10, 0.15) 45%, transparent 80%);
    border-bottom: 1px solid #222;
    /* Restored top ceiling light bleed */
    box-shadow: inset 0 20px 40px -15px rgba(255, 30, 30, 0.5);
    position: relative;
}

.hero h1 {
    font-size: 5rem;
    font-weight: 700;
    letter-spacing: 5px;
    text-shadow: 0 0 50px rgba(255, 30, 30, 0.7);
}

.hero h1 span {
    color: var(--brand-red);
}

.hero p {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-top: 10px;
    letter-spacing: 1px;
}

/* Content Sections */
.content-section {
    padding: 5rem 10%;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    border-left: 5px solid var(--brand-red);
    padding-left: 15px;
}

.cyan-text {
    color: var(--accent-cyan);
    font-size: 1.8rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* Grids & Cards */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 4px;
    border: 1px solid #222;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
}

/* Buttons */
.btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 10px 25px;
    background-color: var(--brand-red);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    background-color: #ff3b3b;
    box-shadow: 0 0 15px rgba(255, 30, 30, 0.8);
}

/* Outline Buttons */
.btn-outline {
    background-color: transparent;
    border: 2px solid var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-outline:hover {
    background-color: var(--accent-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

/* Final Footer: Dual-Sided Light Saber Beam */
footer {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--bg-dark);
    border-top: 2px solid var(--brand-red);
    position: relative;
    z-index: 10;
    box-shadow: 
        0 -12px 25px rgba(255, 30, 30, 0.55),
        0 -25px 50px rgba(255, 30, 30, 0.25);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.social-btn {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 10px 20px;
    border: 1px solid #333;
    transition: all 0.3s ease;
}

.social-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   ANIMATION SERIES HUB (`animation.html` Exclusive Styles)
   ========================================================================== */

/* Sub-page Header Styling */
.page-header {
    padding: 4rem 10% 2rem;
    text-align: center;
    border-bottom: 1px solid #222;
    background: radial-gradient(circle at 50% 0%, rgba(255, 30, 30, 0.25) 0%, transparent 70%);
}

.page-header h1 {
    font-size: 3.5rem;
    letter-spacing: 4px;
    text-shadow: 0 0 30px rgba(255, 30, 30, 0.5);
}

.page-header h1 span {
    color: var(--brand-red);
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-top: 5px;
}

/* Clickable Wrapper Strips default web link formatting */
.series-banner-link {
    text-decoration: none;
    display: block;
    margin-bottom: 3rem;
}

/* The Banner Card Container (Split Grid) */
.series-banner {
    display: grid;
    grid-template-columns: 300px 1fr; /* Exactly 300px for the 1:1 image, rest goes to text */
    border: 2px solid #333;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

/* Hover Effect: The whole card lifts and glows Cyan */
.series-banner-link:hover .series-banner {
    transform: translateY(-6px);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 35px rgba(0, 255, 255, 0.35);
}

/* Left Side: 1x1 Square Image Container */
.banner-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #000;
}

.banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Right Side: Text Rectangle with Third Image Gradient */
.banner-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Exactly replicates the vertical black-to-deep-red gradient from image_2bc913 */
    background: linear-gradient(to bottom, #000000 0%, #3a0000 60%, #8a0303 100%);
    color: #ffffff; /* Explicitly forced pure white text */
}

.banner-content h2 {
    font-size: 3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    color: #ffffff;
    transition: color 0.3s ease;
}

/* When hovering the banner, the Title turns Cyan */
.series-banner-link:hover .banner-content h2 {
    color: var(--accent-cyan);
}

.banner-content p {
    font-size: 1.35rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85); /* Slightly softened white logline */
}

/* Mobile Responsive Override: Stacks the image on top of text on smaller phone screens */
@media (max-width: 768px) {
    .series-banner {
        grid-template-columns: 1fr;
    }
    .banner-image {
        max-height: 300px;
    }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE OVERRIDES (Universal Phone Fixes)
   ========================================================================== */

@media (max-width: 768px) {

    /* 1. Navbar Fix: Stack the brand on top and turn links into a scrollable horizontal ribbon */
    .navbar {
        flex-direction: column;
        padding: 1rem 5%;
        gap: 1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto; /* Lets users swipe horizontally through nav links on phone */
        padding-bottom: 5px;
        gap: 1.25rem;
        -webkit-overflow-scrolling: touch; /* Smooth iOS swipe scrolling */
    }

    .nav-links::-webkit-scrollbar {
        display: none; /* Hides ugly scrollbar on mobile nav */
    }

    .nav-links a {
        font-size: 0.95rem;
        white-space: nowrap; /* Prevents text from breaking onto two lines */
    }

    /* 2. Typography Fixes: Scale down massive desktop fonts for small phone screens */
    .hero h1 {
        font-size: 3.2rem;
        letter-spacing: 2px;
    }

    .page-header h1 {
        font-size: 2.8rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    /* 3. Grid & Card Fixes: Force all cards and content sections to take up full screen width */
    .content-section {
        padding: 3rem 5%;
    }

    .grid-container {
        grid-template-columns: 1fr; /* Forces 1 single column on phone */
        width: 100%;
    }

    .card {
        width: 100%;
        padding: 1.5rem;
    }

    /* 4. Animation Hub Banner Fix: Full-width stacked Mecha cards */
    .series-banner {
        grid-template-columns: 1fr; /* Stacks image on top of text */
        width: 100%;
    }

    .banner-image {
        width: 100%;
        max-height: 250px;
    }

    .banner-content {
        padding: 1.5rem;
    }

    .banner-content h2 {
        font-size: 2rem;
    }

    .banner-content p {
        font-size: 1.1rem;
    }

    /* 5. Terminal Tabs: Stack vertically on phone so they don't squish */
    .terminal-tabs {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .terminal-tab {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================================
   THE CORRUPTED LEGACY NODE (`animation.html` Hazard Styles)
   ========================================================================== */

.glitch-node-wrapper {
    position: relative;
    cursor: pointer;
    user-select: none;
}

/* Natural idle twitching for Box 3 */
@keyframes boxIdleGlitch {
    0% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(-2px, 1px) rotate(-0.3deg); }
    40% { transform: translate(2px, -1px) rotate(0.3deg); }
    60% { transform: translate(-1px, -2px) rotate(0deg); }
    80% { transform: translate(3px, 1px) rotate(-0.3deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.corrupted-banner {
    border-color: var(--brand-red) !important;
    box-shadow: 0 0 25px rgba(255, 30, 30, 0.45) !important;
    animation: boxIdleGlitch 0.16s infinite;
}

.glitch-node-wrapper:hover .corrupted-banner {
    border-color: #ffffff !important;
    box-shadow: 0 0 45px rgba(255, 30, 30, 0.9) !important;
}

/* Corrupted Particle Field Container */
.particle-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 25;
}

.corrupt-speck {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: var(--brand-red);
    box-shadow: 0 0 8px var(--brand-red);
    pointer-events: none;
    transition: top 0.09s linear, left 0.09s linear;
}

/* Prevents scrollbars during screen vibration */
html, body {
    overflow-x: hidden;
}

/* ==========================================================================
   CLAUSTROPHOBIC VIGNETTE OVERLAY (Camera-Tracked Absolute Positioning)
   ========================================================================== */

.screen-vignette {
    position: absolute; /* Changed from 'fixed' so it can track down the document page */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Automatically stretches to cover the entire page height */
    background: radial-gradient(circle at 50% 50%, transparent 5%, rgba(0, 0, 0, 0.95) 28%, #000000 45%);
    opacity: 0; 
    z-index: 900; 
    pointer-events: none; 
    transition: opacity 0.15s ease-in;
}

/* ==========================================================================
   ARTIFISIUM SHOWCASE PAGE (`artifisium.html` Exclusive Styles)
   ========================================================================== */

.showcase-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
}

/* Feature Poster Container */
.poster-frame {
    max-width: 750px;
    width: 100%;
    border: 2px solid #333;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(255, 30, 30, 0.25);
    margin-bottom: 3rem;
}

.poster-frame img {
    width: 100%;
    height: auto;
    display: block;
}

/* Constrained Synopsis Paragraph */
.series-synopsis {
    max-width: 900px;
    font-size: 1.35rem;
    line-height: 1.7;
    color: #e0e0e0;
    text-align: justify; /* Crisp newspaper-style block alignment */
    margin-bottom: 4rem;
    padding: 0 1.5rem;
}

/* Subtle Glowing Divider */
.section-divider {
    width: 100%;
    max-width: 1000px;
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #444, var(--brand-red), #444, transparent);
    margin-bottom: 4rem;
}

.directory-feed {
    width: 100%;
    max-width: 1200px;
}