:root {
    --bg-base: #120f0e;
    --bg-alt: #161311;
    --bg-card: #1a1513;
    --text-main: #bdae93;
    --text-heading: #e8dec3;
    --primary: #8b3a2b;
    --primary-glow: #a64533;
    --primary-hover: #5c2319;
    --border-color: #2e241e;
    --border-accent: #523b31;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Warm film grain overlay to mimic paper/grit */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- Hero Section & Background --- */
.hero-bg {
    position: absolute;
    inset: -5%;
    /* Slightly larger for zoom effect */
    background-image: url('Images/witherbandit.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    opacity: 0.15;
    filter: sepia(40%) contrast(120%) brightness(70%);
    z-index: 0;
    mask-image: radial-gradient(ellipse 80% 90% at 50% 40%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 90% at 50% 40%, black 20%, transparent 80%);
    animation: subtleZoom 20s infinite alternate ease-in-out;
}

@keyframes subtleZoom {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.05);
    }
}

/* --- Typography --- */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-heading);
    text-transform: uppercase;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: 4px;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    display: inline-block;
}

.section-text {
    max-width: 650px;
    font-size: 1.1rem;
    color: var(--text-main);
}

/* Illuminated Letters for paragraphs */
.illuminated {
    float: left;
    font-size: 3.5rem;
    line-height: 0.8;
    padding-right: 8px;
    padding-top: 4px;
    color: var(--primary-glow);
    font-family: var(--font-heading);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(18, 15, 14, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}

.navbar.nav-hidden {
    transform: translateY(-100%);
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-heading);
    letter-spacing: 5px;
    text-transform: uppercase;
    opacity: 0.9;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 3rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-glow);
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(ellipse at 50% 60%, #1a1513 0%, var(--bg-base) 80%);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40vh;
    background: linear-gradient(to top, var(--bg-base), transparent);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(4rem, 10vw, 7rem);
    letter-spacing: 12px;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 60px rgba(139, 58, 43, 0.1), 0 10px 40px rgba(0, 0, 0, 0.9);
    color: var(--text-heading);
}

.tagline {
    font-size: 1.1rem;
    color: var(--primary-glow);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 3rem;
    opacity: 0.9;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(139, 58, 43, 0.5);
    animation: emberFlicker 4s infinite alternate ease-in-out;
}

@keyframes emberFlicker {
    0% {
        text-shadow: 0 0 8px rgba(139, 58, 43, 0.4), 0 0 2px rgba(139, 58, 43, 0.2);
        color: var(--primary-glow);
        transform: scale(1);
    }

    50% {
        text-shadow: 0 0 18px rgba(166, 69, 51, 0.8), 0 0 8px rgba(166, 69, 51, 0.5);
        color: #d15d45;
        transform: scale(1.01);
    }

    100% {
        text-shadow: 0 0 12px rgba(139, 58, 43, 0.6), 0 0 4px rgba(139, 58, 43, 0.3);
        color: var(--primary-glow);
        transform: scale(1);
    }
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 1rem 3rem;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    color: var(--text-heading);
    border: 1px solid var(--border-accent);
    background: rgba(139, 58, 43, 0.05);
}

.btn-primary:hover {
    background: rgba(139, 58, 43, 0.15);
    border-color: var(--primary-glow);
    box-shadow: 0 0 30px rgba(139, 58, 43, 0.2), inset 0 0 15px rgba(139, 58, 43, 0.1);
    transform: translateY(-2px);
}

.pulse-btn {
    animation: pulseGlow 3s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 58, 43, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(139, 58, 43, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(139, 58, 43, 0);
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 0.6;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--text-main);
    border-radius: 15px;
    position: relative;
}

.mouse::before {
    content: '';
    width: 4px;
    height: 6px;
    background: var(--primary-glow);
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 15px);
        opacity: 0;
    }
}

/* --- Layout --- */
.section-padding {
    padding: 10rem 5%;
}

.bg-alt {
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.grid {
    display: grid;
    gap: 3rem;
}

.features-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* --- Cards --- */
.card {
    background: transparent;
    padding: 2rem 1.5rem;
    border: 1px solid transparent;
    transition: var(--transition);
    position: relative;
}

/* Add etched corners */
.card::before,
.card::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.card::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.card::after {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

.card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.card:hover::before,
.card:hover::after {
    border-color: var(--primary-glow);
    width: 20px;
    height: 20px;
}

.card-number {
    display: block;
    font-family: var(--font-heading);
    color: var(--border-color);
    font-size: 2rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.card:hover .card-number {
    color: var(--primary-glow);
}

.card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}


.dev-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    justify-content: center;
    gap: 5rem;
}

.dev-card {
    text-align: center;
    cursor: pointer;
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.dev-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    filter: sepia(60%) contrast(120%) brightness(70%);
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.avatar-border {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 100%;
    height: 100%;
    border: 1px solid var(--border-color);
    z-index: 1;
    transition: var(--transition);
}

.dev-card:hover .dev-avatar-img {
    filter: sepia(0%) contrast(100%) brightness(100%);
    transform: translate(-4px, -4px);
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5);
}

.dev-card:hover .avatar-border {
    border-color: var(--primary-glow);
    transform: translate(4px, 4px);
}

@keyframes floatAvatar {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0);
    }
}

.dev-card {
    animation: floatAvatar 6s infinite ease-in-out;
}

.dev-card:nth-child(2) {
    animation-delay: 3s;
}

.role {
    color: var(--primary-glow);
    font-size: 0.75rem;
    letter-spacing: 2px;
    margin-top: 0.5rem;
    opacity: 0.85;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 7, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.standard-modal {
    background: var(--bg-card);
    width: 90%;
    max-width: 500px;
    padding: 4rem 3rem;
    border: 1px solid var(--border-accent);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    position: relative;
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .standard-modal {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 2rem;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--primary-glow);
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
}

/* --- THE LORE BOOK --- */
.book-container {
    width: 90vw;
    max-width: 700px;
    height: 75vh;
    background-color: #1a1513;
    padding: 10px 15px 15px 45px;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 1), 0 0 60px rgba(139, 58, 43, 0.05), inset 0 0 20px #000;
    border-radius: 4px 8px 8px 4px;
    border: 1px solid var(--border-accent);
    transform: scale(0.95);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .book-container {
    transform: scale(1);
}

.book-spine {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 35px;
    background: linear-gradient(to right, #0a0807, #1c1614, #0a0807);
    border-right: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
}

.book-page {
    background-color: #1c1714;
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 2px 6px 6px 2px;
    overflow: hidden;
    box-shadow:
        inset 0 0 60px rgba(0, 0, 0, 0.9),
        inset 15px 0 25px rgba(0, 0, 0, 0.6);
}

.page-content {
    position: relative;
    z-index: 2;
    padding: 3rem;
    height: 100%;
    overflow-y: auto;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-weight: 500;
}

.page-content h2 {
    color: var(--text-heading);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    font-size: 2rem;
    letter-spacing: 4px;
}

.page-content p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.9;
}

.book-close {
    z-index: 10;
    color: var(--text-main);
    top: 10px;
    right: 25px;
}

.book-close:hover {
    color: var(--text-heading);
}

.lore-footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
}

.btn-ink {
    color: var(--primary-glow);
    border-bottom: 1px solid var(--border-accent);
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 2px;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-weight: 700;
}

.btn-ink:hover {
    color: var(--text-heading);
    border-color: var(--text-heading);
}

.page-content::-webkit-scrollbar {
    width: 3px;
}

.page-content::-webkit-scrollbar-track {
    background: transparent;
}

.page-content::-webkit-scrollbar-thumb {
    background: var(--border-accent);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 4rem;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #4a3b32;
}

/* --- Utils --- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.text-center {
    text-align: center;
}

/* --- Showcase Section --- */
.showcase-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 4rem;
}

.showcase-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    transition: var(--transition);
}

.showcase-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-glow);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(139, 58, 43, 0.1);
}

.gif-container {
    width: 100%;
    height: 220px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    background: #0c0a09;
}

.showcase-gif {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: sepia(40%) contrast(120%) brightness(60%);
    transition: var(--transition);
}

.showcase-card:hover .showcase-gif {
    filter: sepia(10%) contrast(110%) brightness(90%);
    transform: scale(1.02);
}

.gif-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-card) 0%, transparent 50%);
    pointer-events: none;
}

.showcase-info {
    padding: 2rem;
}

.showcase-info h3 {
    color: var(--text-heading);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.showcase-info p {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.6;
}

/* ================================================
   CAROUSEL SYSTEM (Combat Archives)
   ================================================ */
.carousel-block {
    margin-bottom: 5rem;
}

.carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
    margin-bottom: 2rem;
}

.carousel-category {
    font-size: 1.1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.carousel-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.carousel-counter {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-main);
    opacity: 0.6;
    min-width: 40px;
    text-align: center;
}

.carousel-btn {
    background: transparent;
    border: 1px solid var(--border-accent);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    border-radius: 2px;
}

.carousel-btn:hover {
    border-color: var(--primary-glow);
    color: var(--text-heading);
    background: rgba(139, 58, 43, 0.1);
    box-shadow: 0 0 12px rgba(139, 58, 43, 0.15);
}

.carousel-track-wrapper {
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    width: 100%;
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-slide {
    flex: 0 0 100%;
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-accent);
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
}

.dot.active {
    background: var(--primary-glow);
    width: 22px;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(139, 58, 43, 0.5);
}

/* DEV LOG SECTION */
.devlog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.devlog-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.devlog-label {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--primary-glow);
    opacity: 0.8;
}

.devlog-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
}

.devlog-date {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-main);
    opacity: 0.5;
    text-transform: uppercase;
}

.devlog-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: #5caf6c;
    text-transform: uppercase;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5caf6c;
    box-shadow: 0 0 8px rgba(92, 175, 108, 0.7);
    animation: statusPulse 2.5s infinite ease-in-out;
    display: inline-block;
}

@keyframes statusPulse {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(92, 175, 108, 0.5);
    }

    50% {
        box-shadow: 0 0 14px rgba(92, 175, 108, 1);
    }
}

.devlog-body {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 5rem;
    align-items: start;
}

.devlog-text {
    color: var(--text-main);
}

.devlog-text p {
    font-size: 1rem;
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

/* Map Carousel */
.map-carousel-wrapper {
    position: relative;
    min-width: 0;
}

.map-carousel-track-wrapper {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
}

.map-carousel-track {
    display: flex;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.map-slide {
    flex: 0 0 100%;
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    position: relative;
}

.map-img {
    width: 100%;
    display: block;
    height: 480px;
    object-fit: cover;
    filter: sepia(30%) contrast(110%) brightness(65%);
    transition: filter 0.5s ease;
}

.map-slide:hover .map-img {
    filter: sepia(10%) contrast(105%) brightness(85%);
}

.map-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(to top, rgba(18, 15, 14, 0.95) 0%, transparent 100%);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-main);
    opacity: 0.7;
}

.map-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-60%);
    background: rgba(18, 15, 14, 0.85);
    border: 1px solid var(--border-accent);
    color: var(--text-main);
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    border-radius: 2px;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.map-arrow:hover {
    border-color: var(--primary-glow);
    color: var(--text-heading);
    background: rgba(139, 58, 43, 0.15);
    box-shadow: 0 0 15px rgba(139, 58, 43, 0.2);
}

.map-arrow-left {
    left: -23px;
}

.map-arrow-right {
    right: -23px;
}

.map-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.2rem;
}

.map-counter {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--text-main);
    opacity: 0.4;
    margin-top: 0.5rem;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 900px) {
    .devlog-body {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .map-arrow-left {
        left: 8px;
    }

    .map-arrow-right {
        right: 8px;
    }

    .devlog-header {
        flex-direction: column;
    }

    .devlog-meta {
        align-items: flex-start;
    }
}