/* Chi Rho Code: what every page in the family shares. This is a copy of site/brand.css in
   tossbaws/chirhocode-site; change both together (site/README.md, "Updating brand.css").
   Source: tossbaws/chirhocode-site, site/brand.css, commit 5375bea35f98395c445b2abb0db7167699879b48
   sha256 of the lines after this comment: 1ce8401a8dc8081feee0b7c4e4f7e891ec504d00973b64faa260b544d12f2581
   tests/frontend/site.test.mjs fails if they no longer match that pin.
   The colours are sampled from the company mark: black, emerald on the left running to cyan on
   the right, gold for the one action. Pages are built as the mark's window: panes fitted edge
   to edge, with 8px gaps of lead between them. Linked before gospel-getter.css. */

@font-face {
    font-family: "Source Serif 4";
    src: url("assets/fonts/source-serif-4-opsz.woff2") format("woff2-variations"),
         url("assets/fonts/source-serif-4-opsz.woff2") format("woff2");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Instrument Sans";
    src: url("assets/fonts/instrument-sans-wght.woff2") format("woff2-variations"),
         url("assets/fonts/instrument-sans-wght.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* The window */
    --lead: #26241b;
    --black: #0b0c0a;
    --night: #121410;
    --emerald-deep: #0c5734;
    --emerald: #0e704f;
    --teal: #0ca3a3;
    --cyan: #08dae4;
    --gold: #f1cb75;
    --gold-glow: #fcec9c;
    --teal-deep: #0b5c5f;

    /* Ink */
    --ink: #efeeea;
    --ink-soft: #c9c6ba;
    --ink-dark: #0b0c0a;
    --ink-dark-soft: #1d2a24;

    /* The terminal's own colours, from the captures */
    --term: #1e1e2e;
    --term-ink: #cdd6f4;
    --term-dim: #a6adc8;
    --term-green: #a6e3a1;
    --term-yellow: #f9e2af;

    /* Type: five sizes */
    --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
    --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --code: ui-monospace, "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace; /* taste-skill-ignore: only <code>, <pre> and terminal rows use it */
    --s-display: clamp(3.25rem, 1.4rem + 6.6vw, 8.5rem);
    --s-head: clamp(2rem, 1.3rem + 2.2vw, 3.5rem);
    --s-state: clamp(1.3rem, 1.05rem + 0.75vw, 1.85rem);
    --s-body: 1.0625rem;
    --s-small: 0.875rem;

    /* The board */
    --gap: 8px;
    --edge: 12px;
    --pad: clamp(1.25rem, 0.8rem + 1.6vw, 2.5rem);
    --max: 1680px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--edge);
}

body {
    margin: 0;
    background: var(--lead);
    color: var(--ink);
    font-family: var(--sans);
    font-size: var(--s-body);
    line-height: 1.55;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 600;
    text-wrap: balance;
}

h2 {
    font-size: var(--s-head);
    line-height: 1.02;
    letter-spacing: -0.02em;
}

h3 {
    font-size: var(--s-state);
    line-height: 1.12;
    letter-spacing: -0.01em;
}

p,
ul {
    margin: 0;
}

p {
    max-width: 68ch;
    text-wrap: pretty;
}

a {
    color: inherit;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
}

strong {
    font-weight: 650;
}

code {
    font-family: var(--code);
    font-size: 0.9em;
}

kbd {
    display: inline-block;
    min-width: 1.5em;
    padding: 0 0.35em;
    background: var(--gold);
    color: var(--ink-dark);
    font-family: var(--sans);
    font-weight: 650;
    font-size: 0.9em;
    line-height: 1.35;
    text-align: center;
}

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

::selection {
    background: var(--gold);
    color: var(--ink-dark);
}

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

.skip-link {
    position: absolute;
    left: var(--edge);
    top: -4rem;
    z-index: 10;
    padding: 0.75rem 1rem;
    background: var(--gold);
    color: var(--ink-dark);
    font-weight: 650;
}

.skip-link:focus {
    top: var(--edge);
}

main:focus {
    outline: none;
}

.small {
    font-size: var(--s-small);
    color: var(--ink-soft);
}

/* ---------- The bar ---------- */

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    max-width: var(--max);
    margin: var(--edge) auto 0;
    padding: 0.75rem var(--pad);
    width: calc(100% - 2 * var(--edge));
    background: var(--black);
}

.maker {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--serif);
    font-weight: 600;
    font-size: var(--s-body);
    white-space: nowrap;
    text-decoration: none;
}

.maker img {
    width: 40px;
    height: 40px;
    transition: transform 400ms var(--ease-out);
}

.maker:hover img {
    transform: rotate(-8deg) scale(1.06);
}

.bar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.75rem;
    padding: 0;
    list-style: none;
}

.bar nav a {
    position: relative;
    display: inline-block;
    padding: 0.5rem 0;
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 200ms;
}

.bar nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.2rem;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 300ms var(--ease-out);
}

.bar nav a:hover {
    color: var(--ink);
}

.bar nav a:hover::after {
    transform: scaleX(1);
}

/* ---------- The board and its panes ---------- */

.board {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--gap);
    max-width: var(--max);
    width: calc(100% - 2 * var(--edge));
    margin: var(--gap) auto 0;
}

.pane {
    position: relative;
    margin: 0;
    padding: var(--pad);
    background: var(--night);
    color: var(--ink);
    overflow: hidden;
}

.pane > * + * {
    margin-top: 1rem;
}

.pane h2 + p,
.pane h3 + p,
.pane h3 + ul {
    margin-top: 1rem;
}

.pane-black {
    background: var(--black);
}

.pane-night {
    background: var(--night);
}

.pane-emerald-deep {
    background: var(--emerald-deep);
}

.pane-emerald {
    background: var(--emerald);
}

.pane-teal {
    background: var(--teal);
    color: var(--ink-dark);
}

.pane-cyan {
    background: var(--cyan);
    color: var(--ink-dark);
}

.pane-gold {
    background: var(--gold);
    color: var(--ink-dark);
}

.pane-teal-deep {
    background: var(--teal-deep);
}

.pane-term {
    background: var(--term);
    color: var(--term-ink);
}

.pane ul {
    padding-left: 1.1em;
}

.pane li + li {
    margin-top: 0.5rem;
}

.pane li::marker {
    color: var(--gold);
}

.pane-teal li::marker,
.pane-cyan li::marker,
.pane-gold li::marker {
    color: currentColor;
}

.pane-emerald li::marker,
.pane-emerald-deep li::marker {
    color: var(--gold-glow);
}

/* ---------- Buttons and links ---------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.25rem;
    padding: 0.75rem 1.5rem;
    border: 0;
    background: var(--gold);
    color: var(--ink-dark);
    font-family: var(--sans);
    font-weight: 650;
    font-size: var(--s-body);
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms var(--ease-out), background-color 180ms;
}

.button:hover {
    background: var(--gold-glow);
    transform: translateY(-2px);
}

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

.button-ink {
    background: var(--ink-dark);
    color: var(--gold);
}

.button-ink:hover {
    background: var(--emerald-deep);
    color: var(--gold-glow);
}

/* A buy or download button before 1.0: no href, not focusable, shown as words. */
.button[aria-disabled="true"] {
    min-height: 0;
    padding: 0;
    background: none;
    color: inherit;
    font-weight: 500;
    opacity: 0.8;
    cursor: default;
    transform: none;
}

.link {
    font-weight: 600;
    text-decoration-color: var(--gold);
    text-decoration-thickness: 2px;
    transition: text-underline-offset 200ms var(--ease-out), color 200ms;
}

.link:hover {
    color: var(--gold-glow);
    text-underline-offset: 0.35em;
}

.foot {
    max-width: var(--max);
    width: calc(100% - 2 * var(--edge));
    margin: var(--gap) auto var(--edge);
    background: #000;
    overflow: hidden;
}

.foot-links {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding: var(--pad);
}

.foot-name {
    font-family: var(--serif);
    font-size: var(--s-state);
    font-weight: 600;
}

.foot-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    padding: 0;
    list-style: none;
}

.foot-links a {
    color: var(--ink-soft);
    text-decoration-color: var(--gold);
}

.foot-links a:hover {
    color: var(--ink);
}

.foot-window {
    height: clamp(14rem, 34vw, 36rem);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.foot-window img {
    width: min(92%, 72rem);
    height: auto;
    aspect-ratio: 1;
    flex: none;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    html {
        scroll-behavior: auto;
    }
}

@media (max-width: 46rem) {
    :root {
        --edge: 8px;
        --gap: 6px;
    }

    .bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.25rem;
    }

    .bar ul {
        gap: 0 1.25rem;
    }

    .board > * {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }

}
