:root {
    color-scheme: light;
    --background: #fff;
    --text: #000;
    --header: #0084d1;
    --header-border: oklch(0.5 0.134 242.749);
    --header-highlight: oklch(0.685 0.169 237.323);
    --hover: oklch(0.968 0.007 247.896);
    --footer-border: oklch(0.279 0.041 260.031);
    --link-hover: oklch(0.5 0.134 242.749);
    --muted: oklch(0.704 0.04 256.788);
    --mono: "Source Code Pro", ui-monospace, monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: "Work Sans", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

body.dark {
    color-scheme: dark;
    --background: oklch(0.279 0.041 260.031);
    --text: #fff;
    --header: #7008e7;
    --header-border: oklch(0.432 0.232 292.759);
    --header-highlight: oklch(0.541 0.281 293.009);
    --hover: oklch(0.491 0.27 292.581);
    --footer-border: #fff;
    --link-hover: oklch(0.491 0.27 292.581);
}

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

button {
    font: inherit;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.container {
    width: 100%;
    margin-inline: auto;
    padding-inline: 16px;
}

.header {
    position: sticky;
    top: 0;
    z-index: 10;
    color: #fff;
    background: var(--header);
    box-shadow: 0 1px 3px #0000001a;
}

.header-upper {
    border-bottom: 1px solid var(--header-border);
}

.header-top {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 24px;
    padding-block: 16px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 4px;
}

.logo i {
    font-size: calc(32px * 8 / 9);
}

.brand-text {
    margin: 0;
    text-align: center;
    font-size: clamp(13px, 3.2vw, 24px);
    font-weight: 500;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 40px;
    justify-self: end;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.theme-track {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 32px;
    border-radius: 999px;
    background: oklch(0.208 0.042 265.755 / 0.3);
}

.theme-toggle-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: oklch(0.852 0.199 91.936);
    background: #fff;
    box-shadow: 0 4px 6px #0000001a;
    transform: translateY(-8px);
    transition: transform 300ms ease-in-out;
}

.theme-toggle-circle i {
    font-size: 10px;
}

body.dark .theme-toggle-circle {
    color: oklch(0.446 0.043 257.281);
    transform: translateY(8px);
}

.breadcrumb-container {
    border-top: 1px solid var(--header-highlight);
}

.breadcrumb {
    padding-block: 8px;
    text-align: center;
    font-family: var(--mono);
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.35px;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.main-content {
    flex: 1;
}

.directory-container {
    margin-block: 16px;
}

.header-row,
.file-link {
    display: flex;
    align-items: center;
    padding: 16px;
    font-family: var(--mono);
}

.header-row {
    font-weight: 500;
}

.col-name {
    flex: 1;
    min-width: 0;
    margin-right: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-size {
    width: 16.666667%;
    margin-inline: 8px;
    text-align: right;
    flex-shrink: 0;
}

.col-sha {
    width: 25%;
    margin-left: 8px;
    text-align: right;
    flex-shrink: 0;
}

.file-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.file-link {
    border-radius: 8px;
}

.file-link:hover,
.file-link:focus-visible {
    background: var(--hover);
    box-shadow: 0 1px 2px #0000000d;
}

.file-icon {
    width: 25px;
    margin-right: 8px;
    text-align: center;
    font-size: 20px;
    flex-shrink: 0;
}

.status {
    padding: 32px 16px;
    text-align: center;
}

.error-state {
    color: #dc2626;
}

body.dark .error-state {
    color: #fca5a5;
}

[hidden] {
    display: none !important;
}

.footer {
    padding-block: 32px;
    border-top: 2px solid var(--footer-border);
    text-align: center;
}

.footer p {
    margin: 0 0 16px;
}

.footer p a {
    text-decoration: underline;
}

.footer p a:hover {
    color: var(--link-hover);
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 24px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    height: 24px;
    margin-inline: 8px;
    color: var(--muted);
    font-size: 24px;
    transition: color 150ms, transform 150ms;
}

.footer-links a:hover {
    transform: scale(1.25);
}

.social-github:hover {
    color: #181717;
}

body.dark .social-github:hover {
    color: #fff;
}

.social-bluesky:hover {
    color: #0085ff;
}

.social-discussions:hover {
    color: oklch(0.541 0.281 293.009);
}

.social-sponsor:hover {
    color: oklch(0.592 0.249 0.584);
}

@media (min-width: 640px) {
    .container { max-width: 640px; }
}

@media (min-width: 768px) {
    .container { max-width: 768px; }
}

@media (min-width: 1024px) {
    .container { max-width: 1024px; }
}

@media (min-width: 1280px) {
    .container { max-width: 1280px; }
}

@media (max-width: 639px) {
    .header-top {
        gap: 8px;
    }

    .header-row,
    .file-link {
        padding-inline: 8px;
        font-size: 12px;
    }

    .file-icon {
        width: 20px;
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .theme-toggle-circle,
    .footer-links a {
        transition: none;
    }
}

.breadcrumb,
.col-name,
.col-size,
.col-sha {
    white-space: normal;
    overflow-wrap: anywhere;
}

.col-name {
    overflow: visible;
    text-overflow: clip;
}

.col-size {
    width: min(96px, 17%);
}

.col-sha {
    width: min(480px, 50%);
}

.file-link .col-sha {
    font-size: 12px;
}

@media (max-width: 639px) {
    .col-sha {
        width: 40%;
    }

    .file-link .col-sha {
        font-size: 10px;
    }
}