@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;600;700;800&family=Playfair+Display:ital,wght@0,600;1,600&display=swap");

:root {
    --pearl: #f2f0ec;
    --paper: #fffdf9;
    --ink: #181b26;
    --ink-soft: #5f6270;
    --ink-faint: #858894;
    --line: #c9c5bd;
    --lilac: #c9bdff;
    --pink: #ffb1c8;
    --blue: #9cdbed;
    --green: #bee3c0;
    --shadow: 0 2px 0 #ccc7c0;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--pearl);
}

body {
    min-width: 320px;
    margin: 0;
    color: var(--ink);
    background: var(--pearl);
    font:
        15px/1.45 Figtree,
        sans-serif;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

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

[hidden] {
    display: none !important;
}

.display-toggle {
    display: inline-flex;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.display-toggle button {
    padding: 6px 10px;
    color: var(--ink-soft);
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 12px;
    font-weight: 800;
}

.display-toggle button[aria-pressed="true"] {
    color: var(--paper);
    background: var(--ink);
}

.catalogue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.catalogue-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    padding: 20px;
    background: var(--paper);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

/* shown only while "N hidden" is pressed, so it has to look set aside */
.catalogue-card.is-hidden-model {
    opacity: 0.5;
}

.catalogue-dismiss {
    position: absolute;
    top: 16px;
    right: 16px;
}

.hide-button {
    display: inline-grid;
    width: 26px;
    height: 26px;
    padding: 0;
    place-items: center;
    color: var(--ink-soft);
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.hide-button:hover,
.hide-button:focus-visible {
    color: var(--ink);
    border-color: var(--ink);
}

.catalogue-card:nth-child(4n + 2) {
    background: var(--lilac);
}
.catalogue-card:nth-child(4n + 3) {
    background: var(--blue);
}
.catalogue-card:nth-child(4n) {
    background: var(--green);
}

.catalogue-orb {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 2px solid var(--ink);
    border-radius: 50%;
    font:
        italic 19px "Playfair Display",
        serif;
}

.catalogue-card h2 {
    margin: 21px 0 8px;
    overflow-wrap: anywhere;
    font:
        600 31px/0.92 "Playfair Display",
        serif;
    letter-spacing: -0.055em;
}

.catalogue-card h2 a {
    text-decoration: none;
}

.catalogue-description {
    min-height: 54px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.catalogue-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 14px 0;
}

/* The chip strip is a radiogroup: the filled chip is the quant the card is
   proposing, and the leading mark says what the bench made of that same quant.
   Two encodings, because they are two different facts. */
.catalogue-tags button,
.catalogue-tags .quant-note {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    color: var(--ink);
    background: #ffffff80;
    border: 1px solid #777;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}

.catalogue-tags button {
    cursor: pointer;
}

/* fits, but leaves little room for a context window */
.catalogue-tags button.is-tight {
    border-style: dashed;
}

.catalogue-tags button[aria-checked="true"] {
    color: var(--paper);
    background: var(--ink);
    border-color: var(--ink);
    font-weight: 700;
}

.catalogue-tags button:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.catalogue-tags .quant-note {
    color: var(--ink-soft);
    background: transparent;
    border-style: dashed;
}

.quant-mark {
    font-weight: 800;
}

.mark-kept {
    color: #0b7659;
}

.mark-rejected {
    color: #ab3755;
}

.mark-aborted,
.mark-unusable {
    color: #a15110;
}

/* the same marks on the filled chip, where the dark ground eats them */
.catalogue-tags button[aria-checked="true"] .mark-kept {
    color: var(--green);
}

.catalogue-tags button[aria-checked="true"] .mark-rejected {
    color: var(--pink);
}

.catalogue-tags button[aria-checked="true"] .mark-aborted,
.catalogue-tags button[aria-checked="true"] .mark-unusable {
    color: #ffce9c;
}

.catalogue-base {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
}

.catalogue-metrics,
.catalogue-notes {
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
}

.catalogue-notes {
    font-style: italic;
    font-weight: 400;
}

.catalogue-footer {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding-top: 11px;
    border-top: 1px solid #777;
}

.catalogue-command {
    min-width: 0;
    overflow-wrap: anywhere;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 66px;
    padding: 13px clamp(20px, 5vw, 72px);
    color: var(--pearl);
    background: var(--ink);
    transition:
        min-height 180ms ease,
        padding 180ms ease,
        box-shadow 180ms ease;
}

.site-brand {
    flex: 0 0 auto;
    color: inherit;
    font:
        600 24px/0.9 "Playfair Display",
        serif;
    letter-spacing: -0.06em;
    text-decoration: none;
}

.site-brand em {
    color: var(--pink);
}

.site-section-title {
    display: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-section-title .page-title {
    max-width: none;
    overflow: hidden;
    color: var(--pearl);
    font-size: 25px;
    line-height: 0.8;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 14px;
}

.site-nav a {
    padding: 5px 2px;
    color: var(--pearl);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--blue);
}

.site-header.is-compact {
    min-height: 48px;
    padding-block: 9px;
    box-shadow: 0 2px 14px #181b2629;
}

.site-header.is-compact .site-brand {
    display: none;
}

.site-header.is-compact .site-section-title {
    display: block;
}

.app-main {
    min-height: calc(100vh - 132px);
}

.page-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(38px, 6vw, 84px) clamp(20px, 6vw, 86px);
    color: var(--pearl);
    background: var(--ink);
}

.page-hero::after {
    position: absolute;
    right: -22px;
    bottom: -116px;
    color: var(--lilac);
    content: "◌";
    font-size: 390px;
    line-height: 1;
}

.page-hero > * {
    position: relative;
    z-index: 1;
}

.page-eyebrow {
    margin: 0 0 14px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.page-title {
    max-width: 12ch;
    margin: 0;
    font:
        600 clamp(48px, 8vw, 108px)/0.82 "Playfair Display",
        serif;
    letter-spacing: -0.07em;
}

.page-title em {
    color: var(--pink);
}

.page-intro {
    max-width: 54ch;
    margin: 20px 0 0;
    font-size: 17px;
}

.site-footer {
    padding: 18px clamp(20px, 5vw, 72px);
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 560px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
    .site-nav {
        justify-content: flex-start;
    }
    .site-header.is-compact {
        align-items: center;
        flex-direction: row;
        gap: 12px;
    }
    .site-header.is-compact .site-section-title {
        flex: 1 1 auto;
        min-width: 0;
    }
    .site-header.is-compact .site-nav {
        flex: 0 1 auto;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
    }
    .site-header.is-compact .site-nav a {
        padding-block: 2px;
        font-size: 10px;
    }
    .page-hero::after {
        right: -62px;
        font-size: 310px;
    }
}

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