/* --- RESET & VARIABLES --- */
:root {
    --blood-red: #8a0303;
    --blood-bright: #ff3333;
    --blood-dark: #3a0000;
    --dark-border: #440000;
    --void-black: #050505;
    --card-bg: #1a0505;
    --text-white: #e0e0e0;
    --text-muted: #a0a0a0;

    --horror-font: 'Metal Mania', cursive;
    --clean-font: 'Montserrat', sans-serif;
    --elegant-font: 'Cinzel', serif;
    --gothic-font: 'Creepster', cursive;

    /* --heading-font is overridden at runtime by JS (loadTypographySettings).
       It defaults to --horror-font so the page looks correct before JS runs. */
    --heading-font: var(--horror-font);
}

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

body {
    font-family: var(--elegant-font);
    background-color: var(--void-black);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
    /* Static texture + CSS Gradients from reference */
    background-image:
        radial-gradient(circle at 50% 30%, rgba(138, 3, 3, 0.25), transparent 60%),
        radial-gradient(circle at 20% 80%, rgba(50, 0, 0, 0.3), transparent 50%),
        url('assets/space_background.png');
    /* Keeping our generated background as base */
    background-size: cover, cover, cover;
    background-position: center, center, center;
    background-attachment: fixed;
}

/* --- ANIMATED COMETS --- */
.comet-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.comet {
    position: absolute;
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, transparent, var(--blood-bright), #fff);
    opacity: 0;
    animation: fall 3s infinite ease-in;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(45deg);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translateY(80vh) rotate(45deg);
        opacity: 0;
    }
}

/* --- HEADER --- */
header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1.5rem 3rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
    border-bottom: 1px solid rgba(138, 3, 3, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
    justify-self: start;
}

.logo-container:hover {
    transform: scale(1.02);
}

.site-logo {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(255, 51, 51, 0.4));
}

.site-name {
    font-family: var(--elegant-font);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--text-white);
    letter-spacing: 5px;
    text-shadow: 0 0 15px rgba(138, 3, 3, 0.6);
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    justify-self: center;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    margin: 0 15px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    transition: all 0.3s;
    font-family: var(--elegant-font);
}

nav a:hover {
    color: var(--blood-red);
    text-shadow: 0 0 5px var(--blood-red);
}

.nav-toggle {
    display: none;
}

/* Mobile-only site name — hidden on desktop */
.site-name-mobile {
    display: none;
}

.search-bar {
    display: flex;
    border: 1px solid var(--blood-dark);
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
    justify-self: end;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-white);
    padding: 5px;
    outline: none;
    font-family: var(--elegant-font);
    width: 150px;
}

.search-bar button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 5px;
    color: var(--text-muted);
}

/* --- HERO SECTION --- */
.hero-section {
    text-align: center;
    padding: 6rem 1rem 4rem 1rem;
    position: relative;
    z-index: 10;
}

/* Hero Fading Mask Effect */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -2px;
    /* Ensure seamless blend */
    left: 0;
    width: 100%;
    height: 300px;
    /* Increased for smoother fade */
    background: linear-gradient(to bottom, transparent 0%, var(--void-black) 100%);
    pointer-events: none;
    z-index: 1;
}

.main-title {
    font-family: var(--heading-font);
    font-size: 5rem;
    color: var(--text-white);
    text-shadow: 0 0 20px var(--blood-red);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.subtitle {
    font-family: var(--elegant-font);
    font-size: 1.2rem;
    color: var(--text-muted);
    letter-spacing: 6px;
    margin-bottom: 4rem;
    text-transform: uppercase;
}

.welcome-message {
    font-size: 1rem;
    color: var(--text-white);
    margin: 1.5rem auto 2rem;
    max-width: 800px;
    line-height: 1.6;
    text-align: center;
    opacity: 0.9;
    font-weight: 300;
    padding: 0 1rem;
}

.hero-illustration-container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    min-height: 300px;
    /* Ensure container has height for placeholder */
}

.hero-illustration-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 140%;
    background: radial-gradient(
        ellipse at center,
        rgba(138, 3, 3, 0.25) 0%,
        rgba(68, 0, 0, 0.15) 30%,
        rgba(26, 5, 5, 0.1) 50%,
        transparent 70%
    );
    z-index: -2;
    opacity: 0.8;
}

/* --- WORKS PAGE GRID --- */
#worksGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.work-item-card {
    background: rgba(15, 5, 5, 0.85);
    border: 1px solid var(--dark-border);
    border-radius: 4px;
    /* Slight rounding for cleanness */
    padding: 20px;
    text-align: left;
    /* Cleaner alignment */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.work-item-card:hover {
    transform: translateY(-5px);
    border-color: var(--blood-bright);
    box-shadow: 0 10px 30px rgba(138, 3, 3, 0.2);
}

/* Clean Image Style */
.work-item-card .card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--blood-dark);
    transition: opacity 0.3s;
}

.work-item-card h3 {
    font-family: var(--elegant-font);
    color: var(--text-white);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    border-bottom: none;
    /* Remove underline from shared style */
}

.work-item-card p {
    font-family: var(--clean-font);
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.card-category-tag {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--blood-bright);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Footer Logo */
.footer-logo {
    height: 1.2em;
    vertical-align: middle;
    margin: 0 5px;
    filter: drop-shadow(0 0 2px rgba(255, 50, 50, 0.5));
}

.hero-img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.8));
    animation: float 6s ease-in-out infinite;
    border: 1px solid var(--dark-border);
    border-radius: 4px;
    padding: 12px;
    background: rgba(26, 5, 5, 0.6);
    box-shadow: 
        0 0 30px rgba(138, 3, 3, 0.3),
        inset 0 0 30px rgba(138, 3, 3, 0.1);
    position: relative;
    backdrop-filter: blur(2px);
}

/* Fade effect from background - matches glass-panel style */
.hero-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(115deg, transparent 45%, rgba(0, 0, 0, 0.3) 46%, rgba(0, 0, 0, 0.3) 47%, transparent 48%),
        linear-gradient(25deg, transparent 55%, rgba(0, 0, 0, 0.3) 56%, rgba(0, 0, 0, 0.3) 57%, transparent 58%),
        radial-gradient(circle at center, rgba(138, 3, 3, 0.2) 0%, transparent 70%);
    opacity: 0.4;
    pointer-events: none;
    z-index: -1;
    border-radius: 4px;
}

/* Subtle inner glow fade */
.hero-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        rgba(138, 3, 3, 0.15) 0%,
        rgba(68, 0, 0, 0.1) 40%,
        transparent 70%
    );
    border-radius: 4px;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* --- CATEGORY GRID --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 2rem auto 8rem auto;
    padding: 0 25px;
}

/* SHATTERED GLASS CARD EFFECT */
.blood-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    height: 350px;
    /* Increased height for image support */
    padding: 2rem 1rem;
    text-align: center;

    background-color: var(--card-bg);
    border: 1px solid var(--dark-border);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

/* Card Image Support */
.blood-card .card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--blood-red);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.blood-card:hover .card-image {
    opacity: 1;
}

/* The Shattered Glass Pattern */
.blood-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(115deg, transparent 45%, #000 46%, #000 47%, transparent 48%),
        linear-gradient(25deg, transparent 55%, #000 56%, #000 57%, transparent 58%),
        linear-gradient(-35deg, transparent 35%, #000 36%, #000 37%, transparent 38%);
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
}

/* The Bloody Overlay */
.blood-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(138, 3, 3, 0.1) 20%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 2;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.blood-card:hover {
    border-color: var(--blood-red);
    box-shadow: 0 0 25px rgba(138, 3, 3, 0.4);
    transform: translateY(-5px);
}

.blood-card:hover::after {
    opacity: 0.8;
}

.blood-card>* {
    position: relative;
    z-index: 10;
    /* Bring content above glass effect */
}

.card-icon {
    margin-bottom: 1.5rem;
    color: #ddd;
    filter: drop-shadow(0 2px 5px black);
    transition: color 0.3s;
}

.blood-card:hover .card-icon {
    color: var(--text-white);
}

.blood-card h3 {
    font-family: var(--elegant-font);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-white);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--blood-red);
    padding-bottom: 5px;
}

.blood-card p {
    font-family: var(--clean-font);
    /* Using clean font for readability */
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
    transition: opacity 0.3s;
}

.blood-card:hover p {
    opacity: 1;
}

/* Category Buttons Enhancement */
.category-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--dark-border);
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    font-family: var(--elegant-font);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    /* Ensuring visibility */
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.category-btn:hover,
.category-btn.active {
    background: var(--blood-red);
    color: var(--text-white);
    border-color: var(--blood-bright);
    box-shadow: 0 0 15px rgba(255, 50, 50, 0.4);
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 2rem 2rem;
    position: relative;
    z-index: 10;
    /* Lower opacity background */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.5));
    box-shadow: 0 -10px 40px rgba(138, 3, 3, 0.3);
}

.footer-nav {
    display: inline-flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.95);
    padding: 12px 35px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(138, 3, 3, 0.4), inset 0 0 20px rgba(138, 3, 3, 0.1);
    /* Stronger Red Glow */
}

.footer-nav a {
    text-decoration: none;
    color: var(--text-white);
    /* Brighter text color */
    font-family: var(--elegant-font);
    font-size: 0.9rem;
    /* Larger font */
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: all 0.3s;
    margin: 0;
    text-shadow: 0 0 8px rgba(138, 3, 3, 0.5);
}

.footer-nav a:hover,
.footer-nav a.active {
    color: var(--blood-bright);
    /* Brighter hover */
    text-shadow: 0 0 15px var(--blood-bright), 0 0 25px rgba(255, 51, 51, 0.6);
    transform: translateY(-2px);
}

/* --- SUBSCRIPTION BOX --- */
.subscription-box {
    text-align: center;
    padding: 3rem 1rem;
    background: rgba(10, 0, 0, 0.8);
    border-top: 1px solid var(--dark-border);
    border-bottom: 1px solid var(--dark-border);
    margin-top: 4rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.subscription-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(138, 3, 3, 0.1), transparent);
    pointer-events: none;
}

.subscription-box h2 {
    font-family: var(--heading-font);
    color: var(--blood-bright);
    font-size: 2rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.subscription-box p {
    font-family: var(--clean-font);
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.subscription-box form {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.subscription-box input {
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--blood-dark);
    color: var(--text-white);
    font-family: var(--clean-font);
    outline: none;
    width: 300px;
    max-width: 100%;
}

.subscription-box input:focus {
    border-color: var(--blood-bright);
    box-shadow: 0 0 10px rgba(255, 50, 50, 0.2);
}

.btn-subscribe {
    padding: 10px 20px;
    background: var(--blood-red);
    color: var(--text-white);
    border: none;
    font-family: var(--elegant-font);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-subscribe:hover {
    background: var(--blood-bright);
    box-shadow: 0 0 15px var(--blood-bright);
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-title {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    header {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 0;
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(0, 0, 0, 0.96);
        border-bottom: 1px solid rgba(138, 3, 3, 0.3);
    }

    .logo-container {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1.25rem;
        border-bottom: 1px solid rgba(138, 3, 3, 0.1);
    }

    /* Show site name on mobile */
    .site-name-mobile {
        display: block;
        font-family: var(--elegant-font);
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-white);
        letter-spacing: 4px;
        text-shadow: 0 0 10px rgba(138, 3, 3, 0.5);
        text-transform: uppercase;
        pointer-events: none;
        user-select: none;
    }

    /* Nav Toggle Button */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        background: rgba(138, 3, 3, 0.15);
        border: 1px solid rgba(138, 3, 3, 0.4);
        border-radius: 6px;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background-color: var(--blood-bright);
        margin: 3px 0;
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
        transform-origin: center;
    }

    /* Hamburger → X animation (properly centered) */
    .nav-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Mobile Menu */
    nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        background: rgba(5, 0, 0, 0.98);
        border-bottom: 2px solid var(--blood-dark);
        overflow: hidden;
    }

    nav.active {
        display: flex;
        animation: slideDown 0.25s ease-out forwards;
    }

    nav a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
        letter-spacing: 3px;
        border-bottom: 1px solid rgba(138, 3, 3, 0.12);
        margin: 0;
        transition: background 0.2s, color 0.2s;
    }

    nav a:hover, nav a:active {
        background: rgba(138, 3, 3, 0.15);
        color: var(--blood-bright);
    }

    /* Search bar — full-width row below nav */
    .search-bar {
        width: 100%;
        padding: 0.6rem 1.25rem;
        border-top: 1px solid rgba(138, 3, 3, 0.1);
        box-sizing: border-box;
    }

    .search-bar input {
        width: 100%;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 15px;
        margin: 1.5rem auto 4rem auto;
    }

    .blood-card {
        height: 220px;
        padding: 1.5rem 0.75rem;
    }

    .main-title {
        font-size: 2.8rem;
    }

    /* Subscription box: stack form vertically on mobile */
    .subscription-box {
        padding: 2rem 1rem;
    }

    .subscription-box form {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .subscription-box input {
        width: 100%;
        max-width: 320px;
    }

    .btn-subscribe {
        width: 100%;
        max-width: 320px;
        padding: 12px 20px;
    }

    /* Footer nav: wrap on mobile */
    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 16px;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr;
    }

    .main-title {
        font-size: 2.2rem;
    }

    .subscription-box h2 {
        font-size: 1.5rem;
    }
}

/* Form message feedback */
.form-message {
    font-family: var(--clean-font, sans-serif);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    display: inline-block;
}
.form-message.success { color: #d4af37; background: rgba(212,175,55,0.08); border: 1px solid rgba(212,175,55,0.4); }
.form-message.error   { color: #ff6b6b; background: rgba(138,3,3,0.15);   border: 1px solid rgba(138,3,3,0.5); }
.form-message.info    { color: #c9a0a0; background: rgba(138,3,3,0.08);   border: 1px solid rgba(138,3,3,0.3); }

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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


/* --- UTILITY & REFACTORED INLINE STYLES --- */
.logo-icon {
    color: var(--blood-bright);
    transform: rotate(-20deg);
}

.copyright-text {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--text-white);
    letter-spacing: 1px;
    text-align: center;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(138, 3, 3, 0.6), 0 2px 4px rgba(0, 0, 0, 0.5);
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
}

.designer-credit {
    font-size: 0.6rem;
    color: #444;
    letter-spacing: 2px;
}

/* Comet Variations */
.comet-1 {
    left: 20%;
    animation-delay: 0s;
}

.comet-2 {
    left: 50%;
    animation-delay: 1.5s;
}

.comet-3 {
    left: 80%;
    animation-delay: 0.8s;
}

.comet-4 {
    left: 10%;
    animation-delay: 2s;
    height: 120px;
}

.comet-5 {
    left: 70%;
    animation-delay: 2.5s;
    height: 80px;
}

.comet-6 {
    left: 35%;
    animation-delay: 1.2s;
    height: 140px;
}

.comet-7 {
    left: 90%;
    animation-delay: 3s;
}

/* --- ANIMATED FLYING BATS --- */
.bat-container {
    display: none; /* Bats disabled by user request */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bat {
    position: absolute;
    width: 120px;
    height: 80px;
    opacity: 0.75;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.5)) drop-shadow(0 0 12px rgba(0, 0, 0, 0.9));
    will-change: transform;
    color: #000000;
}

.bat svg {
    width: 100%;
    height: 100%;
}

@keyframes flyBat {
    0% {
        transform: translateX(-150px) translateY(0) rotate(0deg);
        opacity: 0;
    }
    3% {
        opacity: 0.75;
    }
    50% {
        transform: translateX(calc(50vw - 60px)) translateY(-50px) rotate(12deg);
    }
    97% {
        opacity: 0.75;
    }
    100% {
        transform: translateX(calc(100vw + 150px)) translateY(50px) rotate(0deg);
        opacity: 0;
    }
}

@keyframes flyBatReverse {
    0% {
        transform: translateX(calc(100vw + 150px)) translateY(0) rotate(0deg);
        opacity: 0;
    }
    3% {
        opacity: 0.75;
    }
    50% {
        transform: translateX(calc(50vw - 60px)) translateY(-50px) rotate(-12deg);
    }
    97% {
        opacity: 0.75;
    }
    100% {
        transform: translateX(-150px) translateY(50px) rotate(0deg);
        opacity: 0;
    }
}

@keyframes flyBatCenter {
    0% {
        transform: translateX(calc(25vw - 60px)) translateY(0) rotate(0deg);
        opacity: 0;
    }
    3% {
        opacity: 0.75;
    }
    50% {
        transform: translateX(calc(75vw - 60px)) translateY(-50px) rotate(12deg);
    }
    97% {
        opacity: 0.75;
    }
    100% {
        transform: translateX(calc(125vw - 60px)) translateY(50px) rotate(0deg);
        opacity: 0;
    }
}

@keyframes flapWings {
    0%, 100% {
        transform: scaleY(1) rotate(0deg);
    }
    25% {
        transform: scaleY(0.5) rotate(-3deg);
    }
    50% {
        transform: scaleY(0.9) rotate(0deg);
    }
    75% {
        transform: scaleY(0.5) rotate(3deg);
    }
}

.bat {
    animation: flyBat 15s infinite linear, flapWings 0.35s infinite ease-in-out;
    --scroll-y: 0px;
    --scroll-x: 0px;
    /* Position adjustments for scroll parallax (works alongside transform animations) */
    margin-top: var(--scroll-y);
    margin-left: var(--scroll-x);
}

/* Bat Variations - Distributed across entire window */
.bat-1 {
    top: 8%;
    left: 0%;
    animation-delay: 0s;
    animation-duration: 18s, 0.3s;
    animation-name: flyBat, flapWings;
}

.bat-2 {
    top: 15%;
    left: 0%;
    animation-delay: 2s;
    animation-duration: 20s, 0.32s;
    animation-name: flyBatReverse, flapWings;
}

.bat-3 {
    top: 25%;
    left: 0%;
    animation-delay: 4s;
    animation-duration: 16s, 0.35s;
    animation-name: flyBat, flapWings;
}

.bat-4 {
    top: 35%;
    left: 0%;
    animation-delay: 1s;
    animation-duration: 22s, 0.28s;
    animation-name: flyBatReverse, flapWings;
}

.bat-5 {
    top: 45%;
    left: 0%;
    animation-delay: 3s;
    animation-duration: 19s, 0.33s;
    animation-name: flyBat, flapWings;
}

.bat-6 {
    top: 55%;
    left: 0%;
    animation-delay: 5s;
    animation-duration: 17s, 0.3s;
    animation-name: flyBatReverse, flapWings;
}

.bat-7 {
    top: 12%;
    left: 0%;
    animation-delay: 6s;
    animation-duration: 21s, 0.31s;
    animation-name: flyBatCenter, flapWings;
}

.bat-8 {
    top: 30%;
    left: 0%;
    animation-delay: 7s;
    animation-duration: 18.5s, 0.29s;
    animation-name: flyBatCenter, flapWings;
}

.bat-9 {
    top: 50%;
    left: 0%;
    animation-delay: 8s;
    animation-duration: 20.5s, 0.34s;
    animation-name: flyBatReverse, flapWings;
}

.bat-10 {
    top: 65%;
    left: 0%;
    animation-delay: 9s;
    animation-duration: 16.5s, 0.32s;
    animation-name: flyBat, flapWings;
}

/* === COMPONENT STYLES EXTRACTED === */

/* --- ABOUT PAGE --- */
.glass-panel {
    background: rgba(26, 5, 5, 0.6);
    border: 1px solid var(--dark-border);
    padding: 3rem;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(115deg, transparent 45%, #000 46%, #000 47%, transparent 48%),
        linear-gradient(25deg, transparent 55%, #000 56%, #000 57%, transparent 58%);
    opacity: 0.2;
    pointer-events: none;
    z-index: -1;
}

.about-text h2 {
    font-family: var(--heading-font);
    color: var(--blood-red);
    font-size: 3rem;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 0 10px var(--blood-dark);
}

.readable-content p {
    font-family: var(--elegant-font);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #d0d0d0;
}

.author-photo-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 3rem auto;
    padding: 10px;
    border: 1px solid var(--blood-red);
    box-shadow: 0 0 30px rgba(138, 3, 3, 0.3);
    transform: rotate(2deg);
}

.author-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.3) contrast(1.1);
}

.author-photo-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

.author-placeholder {
    width: 100%;
    height: 100%;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: var(--elegant-font);
}

.home-photo-placeholder {
    width: 100%;
    min-height: 300px;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: var(--elegant-font);
    border: 1px solid var(--blood-red);
    box-shadow: 0 0 30px rgba(138, 3, 3, 0.3);
}

/* --- CONTACT PAGE --- */
.contact-panel {
    background: rgba(26, 5, 5, 0.6);
    border: 1px solid var(--dark-border);
    padding: 3rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.contact-panel h2 {
    font-family: var(--heading-font);
    color: var(--blood-red);
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 0 0 15px var(--blood-dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-family: var(--elegant-font);
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    color: var(--text-white);
    padding: 12px;
    font-family: var(--clean-font);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blood-red);
    box-shadow: 0 0 10px rgba(138, 3, 3, 0.3);
    background: rgba(10, 0, 0, 0.8);
}

.btn-submit {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px solid var(--blood-red);
    color: var(--blood-bright);
    padding: 1rem;
    font-family: var(--elegant-font);
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s;
}

.btn-submit:hover {
    background: var(--blood-red);
    color: white;
    box-shadow: 0 0 20px rgba(138, 3, 3, 0.6);
    transform: translateY(-2px);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Form Messages */
.form-message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-family: var(--clean-font);
    font-size: 0.95rem;
    text-align: center;
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-message.success {
    display: block;
    background: rgba(212,175,55,0.08);
    border: 1px solid rgba(212,175,55,0.4);
    color: #d4af37;
}

.form-message.error {
    display: block;
    background: rgba(138,3,3,0.15);
    border: 1px solid rgba(138,3,3,0.5);
    color: #ff6b6b;
}

.form-message.info {
    display: block;
    background: rgba(138,3,3,0.08);
    border: 1px solid rgba(138,3,3,0.3);
    color: #c9a0a0;
}

/* --- WORKS PAGE --- */
.works-hero-title {
    font-family: var(--heading-font);
    font-size: 4rem;
    color: var(--text-white);
    text-align: center;
    margin: 2rem 0;
    text-shadow: 0 0 20px var(--blood-red);
}

.works-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 3rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid #444;
    color: var(--text-muted);
    padding: 8px 20px;
    font-family: var(--elegant-font);
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--blood-red);
    color: var(--blood-bright);
    box-shadow: 0 0 10px rgba(138, 3, 3, 0.4);
}

/* --- WORKS PAGE GRID --- */
#worksGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.work-item-card {
    background: rgba(15, 5, 5, 0.85);
    border: 1px solid var(--dark-border);
    border-radius: 4px;
    /* Slight rounding for cleanness */
    padding: 20px;
    text-align: left;
    /* Cleaner alignment */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.work-item-card:hover {
    transform: translateY(-5px);
    border-color: var(--blood-bright);
    box-shadow: 0 10px 30px rgba(138, 3, 3, 0.2);
}

/* Clean Image Style */
.work-item-card .card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--blood-dark);
    transition: opacity 0.3s;
}

.work-item-card h3 {
    font-family: var(--elegant-font);
    color: var(--text-white);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    border-bottom: none;
    /* Remove underline from shared style */
    z-index: 2;
}

.work-item-card p {
    font-family: var(--clean-font);
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
    z-index: 2;
}

.card-category-tag {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--blood-bright);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.read-more-btn {
    margin-top: auto;
    align-self: flex-start;
    color: var(--blood-bright);
    text-decoration: none;
    font-family: var(--elegant-font);
    font-weight: bold;
    font-size: 0.8rem;
    z-index: 2;
}

/* Footer Logo */
.footer-logo {
    height: 1.2em;
    vertical-align: middle;
    margin: 0 5px;
    filter: drop-shadow(0 0 2px rgba(255, 50, 50, 0.5));
}

.empty-works-message {
    display: none;
    text-align: center;
    color: #888;
}

.padded-main {
    padding: 4rem 1rem;
}

/* ===========================================
   WORKS PAGE STYLES
   =========================================== */

/* Works Hero & Filter Section */
.works-hero-section {
    text-align: center;
    padding: 3rem 1rem;
}

.works-hero-title {
    font-family: var(--heading-font);
    font-size: 4rem;
    color: var(--blood-bright);
    text-shadow: 0 0 20px rgba(255, 51, 51, 0.6);
    margin-bottom: 2rem;
    letter-spacing: 0.2em;
}

/* Category Filter Buttons */
.works-filter {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.filter-btn {
    padding: 0.8rem 2rem;
    background: rgba(138, 3, 3, 0.3);
    border: 2px solid var(--blood-red);
    color: var(--text-white);
    font-family: var(--elegant-font);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 51, 51, 0.3), transparent);
    transition: left 0.5s ease;
}

.filter-btn:hover {
    background: rgba(138, 3, 3, 0.6);
    border-color: var(--blood-bright);
    color: var(--blood-bright);
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.4);
    transform: translateY(-2px);
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--blood-red) 0%, var(--blood-bright) 100%);
    border-color: var(--blood-bright);
    color: white;
    box-shadow: 0 0 25px rgba(255, 51, 51, 0.6), 0 4px 15px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

/* Works Grid Container */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Individual Work Card */
.work-card {
    background: rgba(26, 5, 5, 0.9);
    border: 1px solid var(--dark-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.work-card:hover {
    transform: translateY(-5px);
    border-color: var(--blood-bright);
    box-shadow: 0 8px 25px rgba(138, 3, 3, 0.4);
}

/* Work Card Image/Placeholder */
.work-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--blood-dark) 0%, var(--void-black) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.work-placeholder span {
    color: var(--text-muted);
    font-family: var(--elegant-font);
    font-size: 1rem;
    letter-spacing: 2px;
}

/* Work Card Header */
.work-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--dark-border);
}

.work-card-header h3 {
    font-family: var(--elegant-font);
    color: var(--text-white);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    border: none;
}

.work-category {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--blood-bright);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 0.5rem;
}

/* Work Card Body */
.work-card-body {
    padding: 1rem 1.5rem;
    flex-grow: 1;
}

.work-card-body p {
    font-family: var(--clean-font);
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Work Card Footer */
.work-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--dark-border);
}

.btn-read-more {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--blood-red) 0%, var(--blood-bright) 100%);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-family: var(--elegant-font);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-read-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 51, 51, 0.4);
}

/* Single Work View */
.write-section {
    max-width: 800px;
    margin: 0 auto;
}

.single-work-nav {
    margin-bottom: 2rem;
}

.back-btn {
    background: rgba(26, 5, 5, 0.8);
    border: 1px solid var(--dark-border);
    color: var(--text-white);
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    font-family: var(--clean-font);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--blood-red);
    border-color: var(--blood-bright);
}

.write-content {
    background: rgba(26, 5, 5, 0.6);
    border: 1px solid var(--dark-border);
    border-radius: 8px;
    padding: 2rem;
}

.write-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--dark-border);
}

.write-header h1 {
    font-family: var(--elegant-font);
    color: var(--text-white);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    border: none;
}

.write-meta {
    display: flex;
    gap: 1.5rem;
    font-family: var(--clean-font);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.write-category {
    color: var(--blood-bright);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.write-image {
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.write-image img {
    width: 100%;
    height: auto;
    display: block;
}

.write-body {
    font-family: var(--clean-font);
    line-height: 1.8;
    color: var(--text-white);
    overflow-wrap: break-word;
    word-break: break-word;
    overflow-x: hidden;
}

.write-text {
    font-size: 1.1rem;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow-x: hidden;
    max-width: 100%;
}

.write-text p {
    margin-bottom: 1.5rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ===========================================
   READ ALOUD FEATURE
   =========================================== */

/* Read Aloud Container - INLINE */
.read-aloud-container {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, rgba(26, 5, 5, 0.98) 0%, rgba(58, 0, 0, 0.98) 100%);
    border: 2px solid var(--blood-red);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(138, 3, 3, 0.6);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    display: none;
}

.read-aloud-container.visible {
    display: block;
}

/* Header */
.read-aloud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--dark-border);
    background: rgba(0, 0, 0, 0.3);
}

.read-aloud-header h3 {
    font-family: var(--elegant-font);
    font-size: 1.1rem;
    color: var(--blood-bright);
    margin: 0;
    border: none;
}

.read-aloud-close {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.read-aloud-close:hover {
    background: var(--blood-red);
    color: white;
}

/* Controls Container */
.read-aloud-controls {
    padding: 2rem 1.5rem;
}

/* Playback Controls */
.playback-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.control-btn {
    background: linear-gradient(135deg, var(--blood-red) 0%, var(--blood-dark) 100%);
    border: 1px solid var(--blood-red);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.control-btn:hover {
    background: linear-gradient(135deg, var(--blood-bright) 0%, var(--blood-red) 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 15px rgba(255, 51, 51, 0.4);
}

.control-btn:active {
    transform: translateY(0) scale(0.95);
}

.control-btn svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.hidden {
    display: none !important;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    margin-bottom: 2rem;
    cursor: pointer;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--blood-red) 0%, var(--blood-bright) 100%);
    border-radius: 4px;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--blood-bright);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(255, 51, 51, 0.6);
    transition: left 0.1s linear;
    pointer-events: none;
}

/* Settings Rows */
.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group.full-width {
    grid-column: 1 / -1;
}

.setting-group label {
    font-family: var(--clean-font);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.setting-note {
    font-family: var(--clean-font);
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: -0.3rem;
}

/* Select Dropdowns */
.read-aloud-select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--dark-border);
    color: var(--text-white);
    padding: 0.75rem;
    border-radius: 4px;
    font-family: var(--clean-font);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
}

.read-aloud-select:hover {
    border-color: var(--blood-red);
    background: rgba(0, 0, 0, 0.7);
}

.read-aloud-select:focus {
    outline: none;
    border-color: var(--blood-bright);
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

/* Speed Slider */
.speed-slider {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--blood-bright);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 51, 51, 0.6);
    transition: all 0.3s ease;
}

.speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255, 51, 51, 0.8);
}

.speed-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--blood-bright);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 51, 51, 0.6);
    transition: all 0.3s ease;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #1a0505 25%, #2a0a0a 50%, #1a0505 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.work-item-card.skeleton-card {
    pointer-events: none;
    min-height: 350px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    margin-bottom: 1rem;
}

.speed-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255, 51, 51, 0.8);
}

.speed-marks {
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
}

.speed-marks span {
    font-family: var(--clean-font);
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Word Highlighting */
.read-word {
    transition: all 0.3s ease;
    padding: 2px 0;
    border-radius: 2px;
}

.reading-highlight {
    background: linear-gradient(135deg, var(--blood-red) 0%, var(--blood-bright) 100%);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(255, 51, 51, 0.6);
    font-weight: 600;
}

/* Read Aloud Button in Single Work View */
.read-aloud-trigger {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--blood-red) 0%, var(--blood-bright) 100%);
    border: 2px solid var(--blood-bright);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-family: var(--elegant-font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 6px 20px rgba(255, 51, 51, 0.5);
    transition: all 0.3s ease;
    z-index: 999;
}

.read-aloud-trigger:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 51, 51, 0.7);
}

.read-aloud-trigger:active {
    transform: translateY(-1px) scale(0.98);
}

/* Responsive */
@media (max-width: 768px) {
    .read-aloud-container {
        width: 100%;
        max-width: none;
        border-radius: 12px 12px 0 0;
    }

    .settings-row {
        grid-template-columns: 1fr;
    }

    .setting-group.full-width {
        grid-column: 1;
    }

    .read-aloud-trigger {
        bottom: 1rem;
        right: 1rem;
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ===========================================
   COMPREHENSIVE MOBILE RESPONSIVE FIXES
   =========================================== */

/* Mobile: Small Screens (max-width: 480px) */
@media (max-width: 480px) {
    /* Body and Container Fixes */
    body {
        padding: 0;
        overflow-x: hidden;
    }

    /* Header Mobile Optimization */
    header {
        padding: 0.75rem 1rem;
    }

    .logo-container h1 {
        font-size: 1.2rem;
    }

    .logo-container .bat-icon {
        width: 24px;
        height: 24px;
    }

    /* Main Title */
    .main-title {
        font-size: 2rem !important;
        padding: 0 1rem;
        text-align: center;
    }

    .subtitle {
        font-size: 0.9rem !important;
        padding: 0 1rem;
    }

    /* Category Grid */
    .category-grid {
        padding: 1rem;
        gap: 1rem;
    }

    .category-card {
        padding: 1.5rem 1rem;
    }

    .category-card h2 {
        font-size: 1.3rem;
    }

    .category-card p {
        font-size: 0.85rem;
    }

    /* Glass Panel (About, Content pages) */
    .glass-panel {
        padding: 1.5rem 1rem;
        margin: 1rem;
    }

    .glass-panel h1 {
        font-size: 1.8rem;
    }

    .glass-panel h2 {
        font-size: 1.4rem;
    }

    .glass-panel p {
        font-size: 0.95rem;
    }

    /* Footer */
    footer {
        padding: 1.5rem 1rem;
    }

    .copyright-text {
        font-size: 0.85rem !important;
        padding: 0.5rem !important;
    }

    .designer-credit {
        font-size: 0.75rem !important;
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-social-media {
        gap: 1rem;
        padding: 0.5rem;
    }

    /* Search Bar */
    .search-bar {
        width: 100% !important;
        max-width: 100%;
    }

    .search-bar input {
        font-size: 0.9rem;
        padding: 0.6rem 2.5rem 0.6rem 1rem;
    }

    /* Story Display Page */
    .story-container {
        padding: 1rem;
        margin: 1rem;
    }

    .story-header h1 {
        font-size: 1.8rem;
    }

    .story-meta {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }

    .story-content {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Contact Form */
    .contact-form-container {
        padding: 1.5rem 1rem;
        margin: 1rem;
    }

    /* Works Grid */
    .works-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        padding: 1rem;
    }

    .work-card {
        padding: 1rem;
    }

    /* Account Settings */
    .account-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        padding: 1rem;
    }

    /* Buttons */
    .btn,
    .submit-btn,
    button {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

    /* Modal/Popup Dialogs */
    .modal-content,
    .popup-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 1rem auto;
        padding: 1rem;
    }

    /* Tables */
    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.5rem 0.3rem;
    }

    /* Navigation Links */
    nav a {
        font-size: 1rem;
        padding: 0.6rem 0;
    }
}

/* Mobile: Medium Screens (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    /* Header Adjustments */
    .logo-container h1 {
        font-size: 1.4rem;
    }

    /* Main Title */
    .main-title {
        font-size: 2.5rem !important;
    }

    .subtitle {
        font-size: 1rem !important;
    }

    /* Glass Panel */
    .glass-panel {
        padding: 2rem 1.5rem;
        margin: 1.5rem;
    }

    /* Category Grid */
    .category-grid {
        padding: 1.5rem;
        gap: 1.5rem;
    }

    /* Works Grid */
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Footer */
    .copyright-text {
        font-size: 0.9rem !important;
    }

    .designer-credit {
        font-size: 0.8rem !important;
    }
}

/* Tablet: Medium to Large (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Main Container */
    .container,
    .glass-panel {
        max-width: 90%;
        padding: 2.5rem 2rem;
    }

    /* Category Grid */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    /* Works Grid */
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Header */
    header {
        padding: 1.25rem 2rem;
    }

    .main-title {
        font-size: 3rem;
    }
}

/* ================================================
   CROSS-BROWSER COMPATIBILITY FIXES
   Targets: Safari, Firefox, Chrome, Edge
   ================================================ */

/* Safari mobile font inflation fix */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Remove default Safari/iOS form styling */
input,
textarea,
button,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Safe area insets for iPhone notch / home bar (iOS Safari) */
body {
    padding-left:   env(safe-area-inset-left);
    padding-right:  env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

/* iOS Safari: Remove tap highlight on interactive elements */
a,
button,
.blood-card,
.nav-toggle,
.btn-subscribe {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Firefox: remove dotted focus outline on buttons */
button::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/* Flexbox gap fallback for Safari < 14.1 */
@supports not (gap: 1rem) {
    .footer-nav > * + * {
        margin-left: 20px;
    }
    .subscription-box form > * + * {
        margin-left: 10px;
    }
}

/* Scrollbar styling - Chrome/Edge/Safari (Firefox uses scrollbar-width) */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0a0000;
}
::-webkit-scrollbar-thumb {
    background: #8a0303;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #ff3232;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #8a0303 #0a0000;
}

/* iOS Safari: background-attachment: fixed causes jank — use scroll on touch devices */
@media (hover: none) and (pointer: coarse) {
    body {
        background-attachment: scroll;
    }
}

/* CSS animation: prefers-reduced-motion for accessibility (all browsers) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .comet-container,
    .bat-container {
        display: none !important;
    }
}
