:root {
    /* Color Palette */
    --bg-color: #000000;
    --card-bg: #1c1c1e;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --accent-color: #2997ff;
    --accent-hover: #0071e3;
    --border-color: #424245;
    --nav-bg: rgba(28, 28, 30, 0.8);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.24);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.36);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 4rem;

    /* Layout */
    --container-width: 1024px;
    --border-radius: 12px;
    --header-height: 60px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    text-decoration: none;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle:hover {
    background-color: var(--border-color);
}

#theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Hero */
.hero {
    padding-top: calc(var(--header-height) + var(--spacing-xl));
    padding-bottom: var(--spacing-lg);
    text-align: center;
}

.hero h2 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* Gallery */
.gallery {
    padding: var(--spacing-lg) 0;
}

.gallery-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.carousel-container {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--spacing-md);
    scrollbar-width: none;
    /* Firefox */
    scroll-behavior: smooth;
    width: 100%;
}

.carousel-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.carousel-slide {
    flex: 0 0 100%;
    /* Full width for single slide view */
    max-width: 100%;
    scroll-snap-align: center;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    position: relative;
    transition: transform 0.3s ease;

    /* Centering logic */
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 16/9;
    /* Enforce consistent aspect ratio */
    cursor: pointer;
    /* Indicate clickable */
}

/* Navigation Buttons */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.nav-button.prev {
    left: -20px;
}

.nav-button.next {
    right: -20px;
}

@media (max-width: 1024px) {
    .nav-button.prev {
        left: 10px;
    }

    .nav-button.next {
        right: 10px;
    }
}

/* Pagination */
.carousel-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    opacity: 0.3;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-dot.active {
    background: var(--accent-color);
    opacity: 1;
    transform: scale(1.2);
}

.carousel-slide img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

.carousel-slide .caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Desktop Layout */
@media (min-width: 1024px) {
    .carousel-container {
        justify-content: flex-start;
        /* Align items to start for standard scrolling behavior */
    }

    .carousel-slide {
        flex: 0 0 auto;
        width: 100%;
        max-width: 800px;
        /* Larger max width for desktop */
    }
}

/* Download Section */
.download {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-color);
}

.download h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    font-weight: 600;
}

.download-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* Badge Styles */
.custom-badge {
    height: 80px;
    /* Match default Flathub badge height */
    display: inline-flex;
    /* Ensure consistency */
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    background: linear-gradient(145deg, #1c1c1e, #000000);
    /* Subtle gradient */
    color: #fff;
    text-decoration: none;
    padding: 0 24px;
    border-radius: 12px;
    min-width: 200px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Subtle border */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    justify-content: center;
}

.custom-badge:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    /* Highlight border on hover */
    box-shadow: 0 8px 15px rgba(41, 151, 255, 0.2);
    /* Blue glow using accent color */
}

/* Add a subtle shine effect on hover */
.custom-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: 0.5s;
}

.custom-badge:hover::after {
    left: 100%;
}

.badge-icon {
    width: 32px;
    height: 32px;
    margin-right: 16px;
    fill: #fff;
    /* Default white */
}

/* Force specific icon colors */
.custom-badge img:not([src*="arch-official.svg"]):not([src*="github.svg"]) {
    filter: brightness(0) invert(1);
    /* Turns black icons white */
}

/* Ensure Arch Official Icon is NOT filtered/colored */
.custom-badge img[src*="arch-official.svg"],
.custom-badge img[src*="github.svg"] {
    filter: none;
}

.badge-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Ensure left alignment */
    justify-content: center;
}

.badge-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.badge-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Arch Branding Overrides */
.arch-badge .badge-text {
    justify-content: center;
}

.arch-badge .badge-title {
    font-size: 1.4rem;
    /* Match logo size roughly */
    line-height: 1;
    margin-bottom: 2px;
}

.arch-badge .badge-subtitle {
    font-size: 0.65rem;
    text-transform: lowercase;
    /* "user repository" is lowercase in logo */
    letter-spacing: 1px;
    opacity: 0.9;
    align-self: flex-end;
    /* Align to right of title if needed, or stick to default */
    font-weight: 600;
}

/* Footer */
footer {
    padding: var(--spacing-lg) 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2.5rem;
    }

    .hero .subtitle {
        font-size: 1.25rem;
    }

    .download-links {
        gap: var(--spacing-sm);
    }
}

/* Install Guide */
.install-guide {
    padding: var(--spacing-xl) 0;
    max-width: 800px;
    margin: 0 auto;
}

.step {
    margin-bottom: var(--spacing-lg);
}

.step h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.step p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

pre {
    background: var(--card-bg);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin-top: var(--spacing-xs);
}

code {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    color: #d4d4d8;
    font-size: 0.9rem;
}

/* Navigation */
.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    margin-left: var(--spacing-md);
}

.nav-link:hover {
    color: var(--text-primary);
}



/* Code Block Copy Button */
.code-block-wrapper {
    position: relative;
    margin-top: var(--spacing-xs);
}

.code-block-wrapper pre {
    margin-top: 0;
    /* Reset margin since wrapper handles spacing */
    padding-right: 48px;
    /* Space for button */
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.copy-btn.copied {
    color: #4cd964;
    /* Green for success */
    border-color: #4cd964;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    animation-name: zoom;
    animation-duration: 0.3s;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

@media only screen and (max-width: 700px) {
    .lightbox-content {
        width: 100%;
    }
}