@font-face {
    font-family: MarrSans-Regular-Web;
    src: url(lib/MarrSans-Regular-Web.woff2);
    font-display: swap;
}

@font-face {
    font-family: MarrSansCondensed-Semibold-Web;
    src: url(lib/MarrSansCondensed-Semibold-Web.woff2);
    font-display: swap;
}

:root {
    --ink: #101318;
    --soft: #4a4d52;
    --line: #e0e1e2;
    color: var(--ink);
    background: #fdfdfc;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.4;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #fdfdfc;
}

.app {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 64px;
}

/* Page title */

.headers {
    padding: 40px 0 32px;
}

.headers h1,
.headers p {
    margin: 0;
    font-family: MarrSansCondensed-Semibold-Web, sans-serif;
    font-weight: normal;
    line-height: 1;
}

.headers h1 {
    font-size: clamp(40px, 6vw, 64px);
}

.headers p {
    margin-top: 6px;
    font-size: clamp(22px, 3.5vw, 40px);
}

/* Sidebar on the left, content on the right */

.layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    font-size: 14px;
}

.group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.group legend,
.field span {
    padding: 0;
    margin-bottom: 4px;
    font-size: 12px;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--soft);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.field input,
.field select,
.toolbar select {
    width: 100%;
    padding: 6px 8px;
    font: inherit;
    color: inherit;
    background: #fff;
    border: 1px solid var(--ink);
    border-radius: 0;
}

.check {
    display: flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
}

.check input {
    margin: 0;
    accent-color: var(--ink);
}

.note {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin: 0;
    padding: 10px;
    font-size: 13px;
    background: #f0f4bc;
}

.key-icon {
    flex-shrink: 0;
}

.modes {
    display: flex;
    border: 1px solid var(--ink);
}

.mode {
    flex: 1;
    padding: 8px 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 0;
    cursor: pointer;
}

.mode + .mode {
    border-left: 1px solid var(--ink);
}

.mode.active {
    color: #fff;
    background: var(--ink);
}

/* Keyword cloud */

.cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cloud button {
    padding: 0;
    font: inherit;
    font-weight: 500;
    line-height: 1.2;
    text-align: left;
    overflow-wrap: anywhere;
    background: none;
    border: 0;
    cursor: pointer;
}

.cloud button:hover {
    text-decoration: underline;
}

.cloud .cloud-1 { font-size: .875rem; }
.cloud .cloud-2 { font-size: 1.275rem; }
.cloud .cloud-3 { font-size: 1.75rem; }
.cloud .cloud-4 { font-size: 2.3rem; }
.cloud .cloud-5 { font-size: 3.25rem; }

/* List mode */

.keyword-bar {
    margin-bottom: 24px;
}

.keyword-bar .expo-keywords {
    margin: 0;
}

.expo-keyword.selected {
    color: #fff;
    background: #000;
}

.expo-keyword .count {
    margin-left: 6px;
    opacity: .6;
}

.refine {
    margin-top: 16px;
}

.refine h2 {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: normal;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--soft);
}

.refine details {
    margin-top: 8px;
}

.refine summary {
    font-size: 13px;
    color: var(--soft);
    cursor: pointer;
}

.refine details .expo-keywords {
    margin-top: 8px;
}

.link {
    padding: .1em .3em;
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
    color: var(--soft);
    text-decoration: underline;
    background: none;
    border: 0;
    cursor: pointer;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--line);
}

.toolbar select {
    width: auto;
    margin-left: 4px;
    padding: 4px 6px;
}

.result-count {
    margin: 0 auto 0 0;
    font-weight: 600;
}

.empty,
.loading {
    color: var(--soft);
}

@media (max-width: 800px) {
    .app {
        padding: 0 16px 48px;
    }

    .headers {
        padding: 24px 0 20px;
    }

    .layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .sidebar {
        gap: 18px;
    }

    .group.types {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 16px;
    }

    .group.types legend {
        width: 100%;
    }

    .cloud .cloud-4 { font-size: 1.8rem; }
    .cloud .cloud-5 { font-size: 2.25rem; }
}
