/* The commandb.org grid system.
   6 columns x 6 rows of square fields with one-baseline gutters; the raster is implied, not drawn.
   One weight. Type sizes are 0.9 of their leading, and leading is whole baselines:
   header A on 6, B on 5, C on 2, D on 1; captions sit on three quarters of a baseline.
   Colour sheets carry black type; white appears as solid paper fields, never as thin text. */

:root {
    --yellow: #f2a90b;
    --stone: #e4ddd2;
    --white: #fbfaf6;
    --ink: #151413;
    --ink-soft: #4b4740;
    --line: rgb(21 20 19 / 0.26);
    --focus: #151413;

    --font: "Neue Haas Grotesk Display", "Helvetica Neue", Helvetica, Arial, sans-serif;

    --b: 18px;
    --gap: var(--b);
    --margin: calc(var(--b) * 1.5);
    --max: 1600px;
    /* Square fields: a row is exactly one column wide, so covers fill whole fields. */
    --row: calc((min(100vw - 2 * var(--margin), var(--max)) - 5 * var(--gap)) / 6);
}

@media (min-width: 900px) {
    :root { --b: 22px; --margin: calc(var(--b) * 2); }
}

body { background: var(--stone); color: var(--ink); font-family: var(--font); font-weight: 400; font-size: calc(var(--b) * 0.9); line-height: var(--b); }
a { color: inherit; }
h1, h2, h3, h4 { font-weight: 400; }
/* The one exception to the single weight: artist names stay bold, as on the live site. */
strong, b { font-weight: 700; }

/* Header styles A to D, plus caption. */
.t-a { font-size: calc(var(--b) * 5.4); line-height: calc(var(--b) * 6); letter-spacing: -0.01em; }
.t-b { font-size: calc(var(--b) * 4.5); line-height: calc(var(--b) * 5); letter-spacing: -0.01em; }
.t-c { font-size: calc(var(--b) * 1.8); line-height: calc(var(--b) * 2); }
/* The sheets set D and captions in Neue Haas Text; with only the Display cut here, open it up a touch at small sizes. */
.t-d { font-size: calc(var(--b) * 0.9); line-height: var(--b); letter-spacing: 0.012em; }
.t-cap { font-size: calc(var(--b) * 0.675); line-height: calc(var(--b) * 0.75); letter-spacing: 0.02em; }

/* A sheet is one page of the system: a colour, a margin, and the 6-column field grid. */
.sheet {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: var(--row);
    gap: var(--gap);
    padding: var(--margin) max(var(--margin), (100% - var(--max)) / 2);
    isolation: isolate;
}
.sheet > * { position: relative; z-index: 2; min-width: 0; }
.sheet-yellow { background: var(--yellow); }
.sheet-stone { background: var(--stone); }
.sheet-white { background: var(--white); }

.sheet-free { grid-auto-rows: auto; }

/* A white field: solid paper filling whole fields, gutters included where it spans. */
.field-white { background: var(--white); z-index: 0; }
.field-yellow { background: var(--yellow); z-index: 0; }

/* Text sits a hair inside the field's top-left corner, like the sheets. */
.inset { padding: calc(var(--b) * 0.2) calc(var(--b) * 0.25) 0; }

/* Spec block: right-aligned labels in one column, values in the next. */
.spec { display: grid; grid-template-columns: subgrid; align-content: start; }
.spec > div { display: contents; }
.spec dt { grid-column: 1; text-align: right; padding-right: calc(var(--b) * 0.5); }
.spec dd { grid-column: 2; margin: 0; }
.spec-wide { grid-template-columns: max-content 1fr; }

/* Vertical type, reading upward like the stone sheet. */
.vertical { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; justify-self: start; }
/* Vertical header lines set at header B so they stay inside their columns. */
.vertical.t-a { font-size: calc(var(--b) * 4.5); line-height: calc(var(--b) * 5); }
.edge-mark { position: absolute; right: calc(var(--margin) / 3); top: calc(var(--margin) + var(--row) * 2); writing-mode: vertical-rl; z-index: 3; text-decoration: none; }

/* Links and actions, in the one weight. */
.link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; display: inline-block; min-height: 24px; }
.link:hover { text-decoration-thickness: 2px; }
.plain { text-decoration: none; display: inline-block; min-height: 24px; }
.plain:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.action {
    display: inline-flex; align-items: center; min-height: 48px; padding: 0 calc(var(--b) * 0.75);
    background: var(--ink); color: var(--white); text-decoration: none; border: 1px solid var(--ink);
    transition: background-color 120ms ease, color 120ms ease;
}
.action:hover { background: var(--white); color: var(--ink); }
.action:active { transform: translateY(1px); }
.list-plain li { min-height: var(--b); }

.player { display: grid; gap: calc(var(--b) * 0.5); justify-items: start; }

/* Phones: pair the six columns into two and let rows grow with content. */
@media (max-width: 899px) {
    .sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; row-gap: calc(var(--b) * 1.5); }
    .sheet > * { grid-column: 1 / -1 !important; grid-row: auto !important; }
    .t-a, .vertical.t-a { font-size: calc(var(--b) * 3.6); line-height: calc(var(--b) * 4); }
    .t-b { font-size: calc(var(--b) * 2.7); line-height: calc(var(--b) * 3); }
    .edge-mark { display: none; }
}

/* Footer: Georgia, with Atlanta starred, opposite the command b mark.
   The ⌘ fills 77% of mark.png's height with 11% padding below and 14% at each side, so Georgia takes
   the symbol's height and baseline, and the mark shifts out so its visible edge meets the margin. */
.colophon-mark { height: calc(var(--b) * 2.6); width: auto; margin-right: calc(var(--b) * -0.34); }
.colophon-georgia { height: calc(var(--b) * 2.6 * 0.772); width: auto; margin-bottom: calc(var(--b) * 2.6 * 0.107); grid-column: 1; grid-row: 1; justify-self: start; align-self: end; }
.colophon-georgia path { fill: var(--ink); }
.colophon-georgia .georgia-star { fill: var(--white); transform-box: fill-box; transform-origin: center; transform: scale(1.8); }
@media (max-width: 899px) {
    .colophon { display: flex; justify-content: space-between; align-items: flex-end; }
}
