/* Palette of the manuscript (shared by the sheet, the cards and the site) and
   the scriptorium around it: a dark leather desk with a gilt masthead. */

:root {
    --ink: oklch(0.34 0.035 50);
    --ink-muted: oklch(0.48 0.04 58);
    --rule: oklch(0.74 0.04 72);
    --ruling: oklch(0.62 0.05 66 / 0.45);
    --paper: oklch(0.99 0.006 85);
    --field: oklch(0.915 0.03 80);
    --gilt: oklch(0.7 0.085 78);
    --red: oklch(0.52 0.12 32);
    --blue: oklch(0.47 0.07 255);

    --desk: oklch(0.24 0.022 45);
    --desk-raised: oklch(0.3 0.026 48);
    --desk-line: oklch(0.42 0.035 55);
    --desk-text: oklch(0.88 0.03 80);
    --desk-muted: oklch(0.7 0.035 72);
    --gold: oklch(0.8 0.1 82);
    --vellum: oklch(0.95 0.024 84);
    --vellum-deep: oklch(0.9 0.035 80);
    --wax: oklch(0.47 0.13 28);
    --wax-light: oklch(0.56 0.14 30);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--desk-text);
    font-family: "Cormorant Garamond", serif;
    font-weight: 500;
    font-size: 17px;
    background-color: var(--desk);
    background-image:
        radial-gradient(ellipse 70% 50% at 50% 0%, oklch(0.36 0.04 55 / 0.55), transparent 70%),
        radial-gradient(ellipse 120% 90% at 50% 120%, oklch(0.16 0.02 40 / 0.8), transparent 60%),
        repeating-linear-gradient(96deg, oklch(0.27 0.024 46 / 0.35) 0 3px, transparent 3px 11px);
    background-attachment: fixed;
}

a {
    color: var(--gold);
}

.svg-definitions {
    position: absolute;
    width: 0;
    height: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Masthead ------------------------------------------------------------------ */

.masthead {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 10px 28px 0;
    background: linear-gradient(to bottom, oklch(0.2 0.02 44), oklch(0.23 0.022 45));
    border-bottom: 1px solid var(--desk-line);
    box-shadow: 0 6px 18px oklch(0.1 0.02 40 / 0.5), inset 0 -3px 0 oklch(0.7 0.085 78 / 0.25);
}

.brand {
    display: flex;
    align-items: baseline;
    padding-bottom: 10px;
    color: var(--gold);
    text-decoration: none;
    white-space: nowrap;
    text-shadow: 0 1px 0 oklch(0.1 0.02 40);
}

.brand-initial {
    font-family: "UnifrakturMaguntia", serif;
    font-size: 40px;
    line-height: 1;
    color: oklch(0.62 0.15 32);
}

.brand-rest {
    font-family: "IM Fell English SC", serif;
    font-size: 23px;
    letter-spacing: 0.06em;
}

.navigation {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    align-self: stretch;
    min-width: 0;
}

.nav-tabs {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-link {
    display: flex;
    align-items: baseline;
    padding: 9px 18px 8px;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    color: var(--desk-text);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 160ms ease, color 160ms ease;
}

.nav-link:hover {
    background: oklch(0.32 0.03 50);
}

.nav-link[aria-current] {
    color: var(--ink);
    background: linear-gradient(to bottom, var(--vellum), var(--vellum-deep));
    border-color: var(--gilt);
    box-shadow: 0 -2px 10px oklch(0.1 0.02 40 / 0.4);
}

.nav-initial {
    font-family: "UnifrakturMaguntia", serif;
    font-size: 25px;
    line-height: 1;
    color: oklch(0.66 0.13 32);
}

.nav-link:nth-child(even) .nav-initial {
    color: oklch(0.66 0.09 250);
}

.nav-link[aria-current] .nav-initial {
    color: var(--red);
}

.nav-link[aria-current]:nth-child(even) .nav-initial {
    color: var(--blue);
}

.nav-rest {
    font-family: "IM Fell English SC", serif;
    font-size: 16px;
    letter-spacing: 0.04em;
}

.nav-print {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 9px;
    padding: 6px 14px;
    border: 1px solid var(--gilt);
    border-radius: 999px;
    font-family: "IM Fell English SC", serif;
    font-size: 15px;
    letter-spacing: 0.04em;
    color: var(--gold);
    text-decoration: none;
    white-space: nowrap;
}

.nav-print:hover,
.nav-print[aria-current] {
    background: oklch(0.7 0.085 78 / 0.16);
}

.nav-badge {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 30%, var(--wax-light), var(--wax));
    box-shadow: 0 1px 2px oklch(0.1 0.02 40 / 0.6), inset 0 0 0 2px oklch(0.4 0.12 28);
    color: var(--paper);
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
    font-size: 15px;
}

.nav-badge[hidden] {
    display: none;
}

/* Controls ------------------------------------------------------------------ */

.button {
    box-sizing: border-box;
    font: inherit;
    color: var(--ink);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 4px 15px;
    border: 1px solid var(--ink-muted);
    border-radius: 6px;
    background: linear-gradient(to bottom, var(--paper), var(--field));
    box-shadow: inset 0 0 0 2px oklch(0.99 0.006 85 / 0.7), 0 1px 2px oklch(0.2 0.02 40 / 0.25);
    font-family: "IM Fell English SC", serif;
    font-size: 15px;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.button:hover {
    background: linear-gradient(to bottom, var(--paper), oklch(0.88 0.04 78));
}

.button:active {
    transform: translateY(1px);
}

.button:disabled {
    opacity: 0.55;
    cursor: progress;
}

.button--seal {
    border-color: oklch(0.38 0.11 28);
    background: radial-gradient(ellipse at 40% 25%, var(--wax-light), var(--wax));
    box-shadow: inset 0 0 0 2px oklch(0.62 0.13 32 / 0.6), 0 2px 4px oklch(0.2 0.03 30 / 0.4);
    color: var(--paper);
}

.button--seal:hover {
    background: radial-gradient(ellipse at 40% 25%, oklch(0.6 0.14 30), oklch(0.5 0.13 28));
}

.button--small {
    min-height: 30px;
    padding: 2px 11px;
    font-size: 13.5px;
}

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

@media (max-width: 760px) {
    .masthead {
        position: relative;
        flex-wrap: wrap;
        gap: 4px 16px;
        padding: 8px 16px 0;
    }

    .brand {
        padding-bottom: 0;
    }

    .navigation {
        flex-basis: 100%;
        flex-wrap: wrap-reverse;
        justify-content: flex-start;
        gap: 4px 12px;
    }

    .nav-tabs {
        flex-wrap: wrap;
    }

    .nav-print {
        position: absolute;
        top: 12px;
        right: 16px;
        margin: 0;
    }

    .nav-link {
        padding: 8px 11px 7px;
    }
}
