/* Ornyx. Graphite and warm grays, one serif, a lot of room. */

:root {
  --graphite: #272624;   /* page */
  --shadow:   #1f1e1c;   /* the figure's shadow on the ground */
  --rule:     #4a4844;   /* the ground line, link underlines */
  --stone:    #9c978f;   /* secondary text, 5.1:1 on graphite */
  --ash:      #d6d2ca;   /* primary text and the figure, 10.6:1 */

  --gutter-x: clamp(16px, 6vw, 96px);
  --gutter-y: clamp(24px, 5vh, 56px);

  color-scheme: dark;
}

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

html {
  background: var(--graphite);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--gutter-y) var(--gutter-x);
  background: var(--graphite);
  color: var(--ash);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 1.125rem;
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--rule); color: var(--ash); }

p, h1 { margin: 0; }

a {
  color: var(--ash);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.22em;
  transition: text-decoration-color 160ms ease;
}
a:hover { text-decoration-color: var(--ash); }

:focus-visible {
  outline: 2px solid var(--ash);
  outline-offset: 4px;
  border-radius: 3px;
}

/* Header */

.wordmark {
  font-size: 1.1875rem;
  font-weight: 450;
  letter-spacing: 0.005em;
}

/* The stage: a figure on a line */

main {
  align-self: center;
  width: 100%;
  padding-block: 2.5rem;
}

.stage {
  position: relative;
  height: 11.5rem;
}
.stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
/* The hit area sits over the figure only; the canvas draws the rest. */
.poke {
  position: absolute;
  left: 0;
  bottom: 22px;              /* just under the ground line, which sits 30px up */
  width: 7.25rem;
  height: 5.75rem;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.poke:disabled { cursor: default; }

.hint {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--stone);
  min-height: 1.5em;
  transition: opacity 900ms ease;
}
.played .hint { opacity: 0; }
.hint-touch { display: none; }
@media (pointer: coarse) {
  .hint-keys { display: none; }
  .hint-touch { display: inline; }
}
.motionless .hint { visibility: hidden; }

h1 {
  margin-top: 2.75rem;
  max-width: 19ch;
  font-size: clamp(1.75rem, 1.15rem + 1.7vw, 2.5rem);
  font-weight: 330;
  line-height: 1.18;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.note {
  margin-top: 1.25rem;
  max-width: 36ch;
  color: var(--stone);
  text-wrap: pretty;
}

/* Footer */

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  font-size: 0.9375rem;
  color: var(--stone);
}
footer a { color: var(--stone); }
footer a:hover { color: var(--ash); }

@media (max-width: 480px) {
  main { padding-block: 1.5rem; }
  .stage { height: 10.5rem; }
  h1 { margin-top: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  a { transition: none; }
}
