@font-face {
    font-family: "Herbik";
    src: url("/fonts/HerbikUnlicencedTrial-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Commit Mono";
    src: url("/fonts/CommitMono-500-Regular.otf") format("opentype");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Commit Mono";
    src: url("/fonts/CommitMono-500-Italic.otf") format("opentype");
    font-style: italic;
    font-weight: 500;
    font-display: swap;
}

:root {
    --page-width: 960px;
    --page-padding: 20px;
    --grid-columns: 3; /* Change this to set the number of cards per row. */
    --grid-gap: 16px;
    /* --font-family: Helvetica, Arial, sans-serif; */
    /* --font-family: "Herbik", sans-serif; */
    --font-family: "Commit Mono", monospace;
    --color-background: light-dark(#ffffff, #000000);
    --color-text: light-dark(#000000, #ffffff);
    --color-border: light-dark(#000000, #ffffff);
    --color-accent: light-dark(#005cb4, #66b3ff);
    --color-grey: light-dark(#666666, #999999);
    color-scheme: light dark;
}

:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.025em;
}

body {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: var(--page-padding);
    background: var(--color-background);
    color: var(--color-text);
}

body,
button,
input,
textarea,
select {
    font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-block: 0;
    font: inherit;
}

a {
    color: inherit;
}

a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 48px;
}

.site-nav ul {
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a[aria-current="page"] {
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.theme-button {
    position: relative;
    display: grid;
    width: 32px;
    height: 32px;
    padding: 5px;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-background);
    color: var(--color-text);
    cursor: pointer;
}

.theme-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.theme-icon {
    position: absolute;
    width: 18px;
    height: 18px;
    opacity: 0;
    transition: opacity 160ms ease, transform 160ms ease;
}

.theme-icon-sun {
    transform: rotate(-45deg) scale(0.6);
}

.theme-icon-moon {
    transform: rotate(45deg) scale(0.6);
}

:root[data-theme="light"] .theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
    .theme-icon {
        transition: none;
    }
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
    gap: var(--grid-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.card-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 16px;
}

.card-filter {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-grey);
    cursor: pointer;
}

button[aria-pressed="true"] {
    color: var(--color-accent);
}

.card-filter[aria-pressed="true"] {
    color: var(--color-text);
    font-style: italic;
    /* font-weight: bold; */
}

.card-filter-count {
    margin-left: 2px;
    font-size: 0.7em;
    line-height: 0;
    vertical-align: super;
}

.card-filter:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.card[hidden] {
    display: none;
}

.card {
    display: flex;
    aspect-ratio: 1;
    min-width: 0;
    border: 1px solid var(--color-border);
}

.card > a,
.card > div {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: 16px;
}

.card > a {
    text-decoration: none;
}

.card > a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

@media (max-width: 520px) {
    :root {
        --grid-columns: 2;
    }
}
