/*
 * Bent Mace Apps — the gallery's own stylesheet.
 *
 * This file is served publicly. Keep it self-contained: no internal project
 * names, no repository paths, nothing that only makes sense from inside. The
 * build asserts on that, but it is easier to just not write it.
 *
 * The sub-apps have their own styles and never load this; it dresses one page.
 *
 * The premise, which the rest of Bent Mace shares: the page has no colour of
 * its own — every saturated pixel on screen belongs to an artist. That lands
 * harder here than anywhere else, because the artwork is nineteen thumbnails,
 * all of them somebody's shader or synth, sitting on paper. So the page is ink,
 * rule and weight, and the work is the only colour. Do not add an accent.
 *
 * Dark mode is a media query with no toggle, matching the website — a toggle
 * needs persisted state and a control to hang it on, and this page has neither.
 */

:root {
  color-scheme: light;

  --paper: #dfdedb;
  --ink: #1d1d1d;
  /* Rules carry the structure here, so they are full ink rather than a
     hairline grey — a printed rule, not a UI divider. */
  --edge: #1d1d1d;
  /*
   * Quiet text — the eyebrow and the colophon.
   *
   * Both are set at 13-14px, and everything else in this palette carries a
   * muted grey of #6b6a66, which measures 4.02:1 against this paper. That is
   * under the 4.5:1 floor for text this size, and this page happens to use it
   * only at those sizes. #5f5e5a is 4.82:1 and is otherwise the same colour.
   * The dark value below needs no such nudge: it is already 7.6:1.
   */
  --muted: #5f5e5a;

  --measure: 84rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    /* Not pure black: #121212 against #e8e6e1 keeps contrast high without the
       halation white-on-black causes for astigmatic readers. Same values the
       website uses. */
    --paper: #121212;
    --ink: #e8e6e1;
    /* Light mode's full-ink rule would invert to a white hairline, which
       glares. #666666 is 3.26:1 against this paper — enough that the grid
       holds, which is the whole job of a rule. */
    --edge: #666666;
    --muted: #a8a5a0;
  }
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  max-width: var(--measure);
  margin-inline: auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) clamp(1.5rem, 3vw, 2.5rem);
}

/* The venue's name sits above the page's name, small and tracked. The wordmark
   proper is a drawn logo and lives in the favicon and the share card; setting
   it in a system face at display size would only invite the comparison. */
.masthead__mark {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.masthead__title {
  margin: 0.35em 0 0;
  font-size: clamp(3rem, 12vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.9;
  text-transform: uppercase;
}

.masthead__lede {
  margin: 1.25rem 0 0;
  max-width: 44ch;
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  text-wrap: pretty;
}

/* -------------------------------------------------------------------- grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
  gap: clamp(1rem, 2.2vw, 1.75rem);
  max-width: var(--measure);
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(3rem, 8vw, 5rem);
}

.tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--edge);
  text-decoration: none;
  background: var(--paper);
  color: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .tile {
    transition: background-color 120ms ease, color 120ms ease;
  }
}

/* Inverting the whole card is the only state this page has, and it costs no
   colour: the tile becomes a stamp. The thumbnail keeps its own background —
   it is the artwork, not a UI surface. */
.tile:hover,
.tile:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.tile:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -6px;
}

/* The thumbnails are 600x400 and carry the app's title painted into the SVG,
   so the image is decorative and takes an empty alt; the link's accessible
   name comes from its aria-label instead. */
.tile__thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  border-bottom: 1px solid var(--edge);
}

.tile__blurb {
  padding: 1rem 1.125rem 1.25rem;
  font-size: 0.9375rem;
  text-wrap: pretty;
}

/* --------------------------------------------------------------- colophon */

.colophon {
  max-width: var(--measure);
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) var(--gutter)
    calc(clamp(2rem, 5vw, 3.5rem) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--edge);
  font-size: 0.875rem;
  color: var(--muted);
}

.colophon p {
  margin: 0 0 0.5rem;
  max-width: 60ch;
}

.colophon p:last-child {
  margin-bottom: 0;
}

.colophon strong {
  font-weight: 600;
  color: var(--ink);
}

.colophon a {
  color: var(--ink);
  text-underline-offset: 0.2em;
}
