:root {
    --imm-bg: #0A0A0A;
    --imm-surface: #1A1A1A;
    --imm-text: #FFFFFF;
    --imm-text-muted: #A0A0A0;
    --imm-accent: #C4A484;
    /* Gold/Bronze accent */
    --imm-font-serif: 'Playfair Display', serif;
    --imm-font-sans: 'Inter', sans-serif;
}

body.immersive-mode {
    background-color: var(--imm-bg);
    color: var(--imm-text);
    font-family: var(--imm-font-sans);
}

/* Typography */
.imm-title {
    font-family: var(--imm-font-serif);
    font-weight: 700;
    line-height: 1.1;
}

.imm-text-muted {
    color: var(--imm-text-muted);
}

/* Hero Section */
.imm-hero {
    height: 90vh;
    /* Fallback */
    height: 90dvh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.imm-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.imm-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    filter: blur(2px) brightness(0.7);
    transition: transform 10s ease;
}

.imm-hero:hover .imm-hero-bg img {
    transform: scale(1.05);
}

.imm-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding-left: 5vw;
}

.imm-hero-tag {
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--imm-accent);
    margin-bottom: 1.5rem;
    display: inline-block;
    border-bottom: 1px solid var(--imm-accent);
    padding-bottom: 4px;
}

.imm-hero-headline {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 2rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Horizontal Scroll Section */
.imm-section-header {
    padding: 4rem 5vw 2rem;
    display: flex;
    justify-content: space-between;
    align-items: end;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.imm-scroll-container {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 0 5vw 4rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.imm-scroll-container::-webkit-scrollbar {
    display: none;
}

.imm-card {
    min-width: 300px;
    max-width: 300px;
    scroll-snap-align: start;
    transition: transform 0.3s ease;
    background: transparent;
    border: none;
}

.imm-card:hover {
    transform: translateY(-10px);
}

.imm-card-img {
    aspect-ratio: 3/4;
    object-fit: cover;
    width: 100%;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.imm-card-title {
    font-family: var(--imm-font-serif);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--imm-text);
}

.imm-btn-read {
    background: var(--imm-text);
    color: var(--imm-bg);
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.imm-btn-read:hover {
    background: var(--imm-accent);
    color: #000;
    transform: scale(1.05);
}

/* Grid Section */
.imm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 3rem;
    padding: 0 5vw 6rem;
}

/* Footer override */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Modern Split Hero Design --- */
:root {
    --imm-bg-navy: #0B1120;
    --imm-accent-red: #E11D48;
    --imm-btn-blue: #0EA5E9;
}

.imm-hero-modern {
    background-color: var(--imm-bg-navy);
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: 240px;
    /* Adjusted padding for hero content */
}

.imm-hero-modern .imm-hero-bg {
    opacity: 0.2;
    /* Subtler background */
}

.imm-hero-body {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 2rem 5vw;
    gap: 5%;
    position: relative;
    /* Ensure relative positioning for toggle */
    z-index: 2;
}

.imm-cover-wrapper {
    flex: 0 0 35%;
    position: relative;
    display: flex;
    justify-content: center;
}

.imm-cover-frame {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 15px 15px 40px 15px;
    /* Hardcover book feel */
    border-radius: 4px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        2px 2px 0px #ccc;
    /* Page thickness */
    position: relative;
}

.imm-cover-img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}

.imm-badge-corner {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--imm-accent-red);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.4);
}

.imm-info-wrapper {
    flex: 1;
    color: white;
}

.imm-meta-tag {
    color: var(--imm-btn-blue);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: block;
    text-transform: uppercase;
}

.imm-title-modern {
    font-family: var(--imm-font-sans);
    /* Use sans for modern look per reference */
    font-weight: 800;
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.imm-title-highlight {
    color: var(--imm-accent-red);
}

.imm-description-modern {
    color: #94A3B8;
    /* Slate 400 */
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 600px;
}

.imm-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.btn-imm-primary {
    background: var(--imm-btn-blue);
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}

.btn-imm-primary:hover {
    transform: translateY(-2px);
    color: white;
    background: #0284c7;
}

.btn-imm-outline {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-imm-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: white;
}

.imm-stats-row {
    display: flex;
    gap: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.imm-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.imm-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748B;
    /* Slate 500 */
    letter-spacing: 1px;
}

/* Filter Bar */
.imm-filter-bar {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem 5vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.imm-filter-label {
    font-weight: 700;
    font-size: 1.1rem;
}

.imm-filter-menu {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 5px;
    /* For scrollbar */
}

.imm-filter-pill {
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.imm-filter-pill:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.imm-filter-pill.active {
    background: var(--imm-accent-red);
    border-color: var(--imm-accent-red);
    color: white;
}

/* Responsive */
@media (max-width: 992px) {
    .imm-hero-body {
        flex-direction: column;
        padding-top: 1rem;
        /* Reduced padding */
        gap: 1.5rem;
        /* Reduced gap */
    }

    .imm-cover-wrapper {
        width: 100%;
        max-width: 240px;
        /* Smaller cover for better fit */
        margin: 0 auto;
    }

    .imm-hero-modern {
        padding-top: 20px !important;
        /* Minimal top padding as portal header is now relative and has 150px padding */
        min-height: auto;
    }

    /* Mobile Header Adjustments */
    .imm-portal-header {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        padding: 150px 1rem 1rem !important;
        /* Balanced padding for sticky menu */
        background: transparent;
        margin-bottom: 0;
    }

    .imm-portal-title {
        font-size: 1.5rem !important;
        line-height: 1.2;
        margin-bottom: 0.25rem;
    }

    .imm-portal-subtitle {
        font-size: 0.7rem !important;
        opacity: 0.8;
    }

    .imm-stats-row {
        gap: 1rem;
        /* Tighter gap */
        justify-content: center;
        flex-wrap: wrap;
        padding-top: 1rem;
        /* Reduced padding */
        margin-top: 0;
        border-top: none;
        /* remove border to save space visually if needed, or keep it */
    }

    .imm-filter-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem;
        /* Reduced padding */
    }

    .imm-title-modern {
        font-size: 1.8rem;
        /* Slightly smaller */
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .imm-description-modern {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .imm-info-wrapper {
        text-align: center;
    }

    .imm-actions {
        justify-content: center;
        flex-direction: column;
        width: 100%;
        max-width: 400px;
        margin: 0 auto 1.5rem;
        /* Reduced margin */
        gap: 0.75rem;
    }

    .btn-imm-primary,
    .btn-imm-outline {
        justify-content: center;
        width: 100%;
        padding: 10px 20px;
        /* Slightly smaller buttons */
    }
}

/* --- Light Mode Support --- */
body.light-theme {
    --imm-bg: #F8FAFC;
    /* Slate 50 */
    --imm-bg-navy: #FFFFFF;
    --imm-surface: #F1F5F9;
    /* Slate 100 */
    --imm-text: #0F172A;
    /* Slate 900 */
    --imm-text-muted: #64748B;
    /* Slate 500 */
    --imm-accent: #B45309;
    /* Darker Gold for visibility */
}

/* Light Theme Specific Overrides */
body.light-theme .imm-hero-modern .imm-hero-bg {
    opacity: 1;
    filter: none;
    /* Show clear image */
}

body.light-theme .imm-hero-bg img {
    opacity: 0.1;
    /* Faint background */
    filter: grayscale(100%);
}

body.light-theme .imm-cover-frame {
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.15),
        2px 2px 0px #e2e8f0;
}

body.light-theme .imm-title-modern {
    color: var(--imm-text);
}

body.light-theme .imm-description-modern {
    color: #475569;
    /* Slate 600 */
}

body.light-theme .btn-imm-outline {
    border-color: #CBD5E1;
    /* Slate 300 */
    color: var(--imm-text);
}

body.light-theme .btn-imm-outline:hover {
    background: #F1F5F9;
    border-color: #94A3B8;
}

body.light-theme .imm-filter-bar {
    background: white;
    border-top: 1px solid #E2E8F0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

body.light-theme .imm-filter-pill {
    border-color: #E2E8F0;
    color: #64748B;
}

body.light-theme .imm-filter-pill:hover {
    border-color: #94A3B8;
    color: var(--imm-text);
}

body.light-theme .imm-filter-label {
    color: var(--imm-text) !important;
}

/* Theme Toggle Button */
.imm-theme-toggle {
    position: absolute;
    top: 6rem;
    /* Lowered further per request */
    right: 5vw;
    z-index: 99;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    /* Default Dark Mode: White Icon */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.imm-theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    width: auto;
    /* Allow expansion for text */
    padding: 0 15px;
    /* Add padding for text */
    border-radius: 30px;
    /* Pill shape on hover */
}

/* Hover Label - Default (Dark Mode -> Switch to Light) */
.imm-theme-toggle::after {
    content: "Hidupkan Lampu";
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
    display: none;
    white-space: nowrap;
}

.imm-theme-toggle:hover::after {
    display: block;
}

/* Light Mode Styles */
body.light-theme .imm-theme-toggle {
    background: white;
    border-color: #E2E8F0;
    color: #0F172A;
    /* Light Mode: Dark Icon (Contrast) */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.light-theme .imm-theme-toggle:hover {
    background: #F1F5F9;
}

/* Hover Label - Light Mode (Light Mode -> Switch to Dark) */
body.light-theme .imm-theme-toggle::after {
    content: "Matikan Lampu";
}

body.light-theme .imm-info-wrapper {
    color: var(--imm-text);
}

/* --- Portal Header --- */
.imm-portal-header {
    position: absolute;
    top: 170px;
    /* Moved down further to avoid navbar */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    text-align: center;
    z-index: 20;
    /* High z-index */
    pointer-events: none;
}

.imm-portal-title {
    font-family: 'Inter', sans-serif;
    /* Explicitly Inter */
    font-size: 3rem;
    /* Larger, dramatic size */
    font-weight: 800;
    /* Extra Bold */
    letter-spacing: 2px;
    color: var(--imm-text);
    margin-bottom: 5px;
    text-transform: uppercase;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    /* Stronger shadow */
    line-height: 1.1;
}

.imm-portal-subtitle {
    font-family: var(--imm-font-sans);
    font-size: 0.85rem;
    color: var(--imm-text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 5px;
    display: block;
    font-weight: 500;
}

/* Light Mode Adjustment */
body.light-theme .imm-portal-title {
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
    color: var(--imm-text) !important;
    /* Ensure Dark Text */
}

body.light-theme .imm-portal-subtitle {
    color: var(--imm-text) !important;
    font-weight: 700;
}