@font-face {
    font-family: 'Google Sans';
    src: url('/fonts/GoogleSans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Google Sans';
    src: url('/fonts/GoogleSans-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Google Sans';
    src: url('/fonts/GoogleSans-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    --md-sys-color-primary: #0061a4;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d1e4ff;
    --md-sys-color-on-primary-container: #001d36;

    --md-sys-color-secondary-container: #d7e3f7;
    --md-sys-color-on-secondary-container: #101c2b;

    --md-sys-color-tertiary-container: #d1eadd;
    --md-sys-color-on-tertiary-container: #002114;

    --md-sys-color-error-container: #ffdad6;
    --md-sys-color-on-error-container: #410002;

    --md-sys-color-background: #fdfcff;
    --md-sys-color-on-background: #1a1c1e;

    --md-sys-color-surface: #fdfcff;
    --md-sys-color-on-surface: #1a1c1e;
    --md-sys-color-on-surface-variant: #43474e;
    
    --md-sys-color-surface-container-low: #f3f4f9;
    --md-sys-color-surface-container: #edeef4;
    --md-sys-color-surface-container-high: #e7e8ee;

    --md-sys-color-outline: #73777f;
    --md-sys-color-outline-variant: #c3c7cf;

    --md-sys-shape-corner-none: 0px;
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 16px;
    --md-sys-shape-corner-large: 24px;
    --md-sys-shape-corner-full: 100px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --md-sys-color-primary: #9ecafe;
        --md-sys-color-on-primary: #003258;
        --md-sys-color-primary-container: #00497d;
        --md-sys-color-on-primary-container: #d1e4ff;

        --md-sys-color-secondary-container: #3b4858;
        --md-sys-color-on-secondary-container: #d7e3f7;

        --md-sys-color-tertiary-container: #1b4b38;
        --md-sys-color-on-tertiary-container: #d1eadd;

        --md-sys-color-error-container: #93000a;
        --md-sys-color-on-error-container: #ffdad6;

        --md-sys-color-background: #1a1c1e;
        --md-sys-color-on-background: #e2e2e6;

        --md-sys-color-surface: #1a1c1e;
        --md-sys-color-on-surface: #e2e2e6;
        --md-sys-color-on-surface-variant: #c3c7cf;

        --md-sys-color-surface-container-low: #1e2022;
        --md-sys-color-surface-container: #222528;
        --md-sys-color-surface-container-high: #2d3135;

        --md-sys-color-outline: #8d9199;
        --md-sys-color-outline-variant: #43474e;
    }
}

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

body {
    font-family: 'Google Sans', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

header {
    background-color: var(--md-sys-color-surface);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--md-sys-color-surface-container-high);
}

.logo {
    font-size: 22px;
    font-weight: 500;
    color: var(--md-sys-color-primary);
}

nav {
    display: flex;
    gap: 8px;
}

nav a {
    padding: 8px 16px;
    border-radius: var(--md-sys-shape-corner-full);
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
}

nav a:hover {
    background-color: var(--md-sys-color-surface-container-high);
}

nav a.active {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--md-sys-shape-corner-full);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn-primary:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    filter: brightness(1.1);
}

.btn-tonal {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.btn-tonal:hover {
    background-color: var(--md-sys-color-surface-container-high);
}

.builds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.card {
    background-color: var(--md-sys-color-surface-container-low);
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    background-color: var(--md-sys-color-surface-container);
    transform: translateY(-2px);
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--md-sys-color-surface-container-high);
}

.card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--md-sys-color-on-surface);
}

.card .btn-tonal {
    margin-top: auto;
    align-self: flex-start;
}

.slider-container {
    position: relative;
    width: 100%;
    border-radius: var(--md-sys-shape-corner-large);
    overflow: hidden;
    background-color: var(--md-sys-color-surface-container);
    margin: 32px 0;
    aspect-ratio: 16 / 9;
}

.slider-wrapper {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out; 
}

.slide {
    min-width: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 32px 24px 16px;
    font-weight: 500;
    font-size: 18px;
}

.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    transform: translateY(-50%);
    pointer-events: none;
}

.slider-btn {
    pointer-events: auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn:hover {
    opacity: 1;
    background-color: var(--md-sys-color-secondary-container);
}

.build-header {
    margin-bottom: 24px;
}

.build-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--md-sys-shape-corner-large);
    margin-bottom: 32px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 22px;
    font-weight: 500;
    margin: 32px 0 16px 0;
    color: var(--md-sys-color-on-surface);
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.chip-group span {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 14px;
    font-weight: 500;
}

.removed-chip {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.changed-chip {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.added-chip {
    background-color: var(--md-sys-color-tertiary-container);
    color: var(--md-sys-color-on-tertiary-container);
}

.install-warning {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
    padding: 24px;
    border-radius: var(--md-sys-shape-corner-medium);
    margin: 32px 0;
}

.install-warning h2 {
    font-size: 20px;
    margin-bottom: 12px;
}

.install-warning ul {
    margin-top: 12px;
    padding-left: 24px;
}

.install-warning li {
    margin-bottom: 8px;
}

.download-section {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.copyright {
    text-align: center;
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 14px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-on-surface);
    padding: 24px;
    border-radius: var(--md-sys-shape-corner-large);
    max-width: 560px;
    width: 90%;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.agreement-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 24px;
    padding: 16px;
    background-color: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-small);
    font-weight: 500;
    transition: background-color 0.2s;
}

.agreement-label:hover {
    background-color: var(--md-sys-color-surface-container-high);
}

.agreement-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--md-sys-color-primary);
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.modal-download-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.link-disabled {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(100%);
}

@media (max-width: 600px) {
    .modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .modal-download-links {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    main {
        padding: 24px 16px;
    }

    .slider-container {
        aspect-ratio: 16 / 10;
        border-radius: var(--md-sys-shape-corner-medium);
    }

    .build-header h1 {
        font-size: 28px !important;
    }

    .download-section {
        flex-direction: column;
    }

    .download-section .btn {
        width: 100%;
    }
}

@media (min-width: 2560px) {
    main {
        max-width: 1600px;
    }

    body {
        font-size: 18px;
    }

    .card img {
        height: 240px;
    }

    .builds-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}