:root {
    /* Colors extracted based on the "Desert/Earth" theme in your screenshot 
    */

    /* Background: Deep Brown/Black (like the dark rocks in the wallpaper) */
    --md-sys-color-background: #1a110f;

    /* Surface: Slightly lighter brown (like the coffee color icons) */
    --md-sys-color-surface: #261916;

    /* Surface Variant: For image placeholders (Muted brown) */
    --md-sys-color-surface-variant: #53433f;

    /* Primary: The bright Peach/Orange accent (like the widget highlights) */
    --md-sys-color-primary: #ffb59b;

    /* On Primary: Dark text to sit on top of the Orange (Deep Rust) */
    --md-sys-color-on-primary: #5e1600;

    /* On Surface: The text color (Warm Beige/Cream instead of stark white) */
    --md-sys-color-on-surface: #ede0db;

    /* On Surface Variant: Secondary text color */
    --md-sys-color-on-surface-variant: #d7c1be;

    /* Sizing */
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
}

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-surface);
    height: 100vh;
    overflow: hidden;
    /* Prevent body scroll, we scroll specific areas */
}

/* --- Layout --- */
.app-container {
    display: flex;
    height: 100%;
}

/* --- Sidebar (Table of Contents) --- */
.sidebar {
    width: 280px;
    background-color: var(--md-sys-color-surface);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 2rem;
    padding-left: 1rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-left: 1rem;
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
}

.sidebar-header p {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
}

.sidebar ul {
    list-style: none;
}

.nav-link {
    display: block;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: var(--md-sys-color-on-surface-variant);
    border-radius: 50px;
    /* Pill shape for MD3 */
    font-weight: 500;
    transition: background 0.3s, color 0.3s;
}

.nav-link:hover {
    background-color: rgba(208, 188, 255, 0.08);
    /* Slight primary tint */
    color: var(--md-sys-color-on-surface);
}

/* Active State (Pill shape filled) */
.nav-link.active {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

/* --- Main Content Area --- */
.content {
    flex-grow: 1;
    overflow-y: auto;
    /* Scrollable */
    padding: 3rem 4rem;
    scroll-behavior: smooth;
}

/* --- Feature Blocks --- */
.feature-block {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    margin-bottom: 3rem;
    /* Optional: Slight elevation shadow */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.text-content {
    margin-bottom: 2rem;
}

.text-content h1 {
    font-size: 3rem;
    color: var(--md-sys-color-primary);
    margin-bottom: 1rem;
}

.text-content h2 {
    font-size: 2rem;
    color: var(--md-sys-color-primary);
    margin-bottom: 1rem;
}

.text-content h3 {
    font-size: 1.5rem;
    color: var(--md-sys-color-primary);
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.text-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--md-sys-color-on-surface);
}

.text-content ul {
    list-style: disc inside;
    margin-top: .5rem;
    color: var(--md-sys-color-primary);
}

.text-content ul li {
    margin-bottom: 0.5rem;
    color: var(--md-sys-color-on-surface);
}

.text-content a {
    color: var(--md-sys-color-primary);
    text-decoration: underline;
}

/* --- Image Gallery --- */
.image-gallery {
    position: relative;
    width: 100%;
    height: 80vh;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background-color: var(--md-sys-color-surface-variant);
}

.gallery-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

.img-wrapper {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
    /* Let clicks pass through if needed, or prevent interaction on hidden ones */
}

.img-wrapper.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Gallery Buttons */
.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.gallery-btn:hover {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.gallery-btn.prev {
    left: 20px;
}

.gallery-btn.next {
    right: 20px;
}

/* --- Comparison Slider --- */
.compare-container {
    position: relative;
    width: 100%;
    height: 80vh;
    /* Adjust height as needed */
    border-radius: var(--border-radius-md);
    overflow: hidden;
    cursor: col-resize;
    /* Shows resize cursor on hover */
    /* Prevents selecting text while dragging */
    user-select: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.compare-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures images align perfectly */
    display: block;
    pointer-events: none;
    /* Ignore mouse clicks on images */
}

/* Base Image (Full width background) */
.img-base {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Overlay Image (Clipped based on --position variable) */
.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* This creates the magic: clips the image from the right side */
    clip-path: inset(0 calc(100% - var(--position)) 0 0);
}

/* --- Labels (Before/After text) --- */
.label-badge {
    position: absolute;
    top: 20px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.75rem;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
}

.before-label {
    left: 20px;
}

.after-label {
    right: 20px;
}

/* --- The Slider Handle --- */
.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    /* Move handle to the position defined by JS */
    left: var(--position);
    width: 2px;
    background: var(--md-sys-color-primary);
    /* Material Primary Color */
    transform: translateX(-50%);
    /* Center the line on the cursor */
    z-index: 20;
    pointer-events: none;
    /* Let clicks pass through to container */
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

/* The Circle in the middle */
.handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.handle-circle svg {
    width: 20px;
    height: 20px;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 1rem;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid #333;
    }

    .sidebar ul {
        display: flex;
        gap: 10px;
    }

    .nav-link {
        padding: 0.5rem 1rem;
        white-space: nowrap;
    }

    .content {
        padding: 1.5rem;
    }

    .image-gallery {
        grid-template-columns: 1fr;
        /* Stack images on mobile */
    }
}