/* --paper and --ink are set by home.js from this visit's palette. */
:root {
  --paper: rgb(238, 237, 232);
  --ink: rgb(51, 51, 51);
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  transition: background-color 0.4s;   /* the palette is picked once the script loads */
  -webkit-user-select: none;           /* no text selection or callout on long-press */
  user-select: none;
  -webkit-touch-callout: none;
}

/* Any canvas outside #sketch (p5's startup canvas, offscreen buffers) stays hidden. */
canvas {
  display: none;
}

/* The canvas is rendered small and stretched to fill the window, with hard pixel edges. */
#sketch canvas {
  display: block !important;
  opacity: 0;
  transition: opacity 0.8s;
  position: fixed;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  image-rendering: pixelated;
  cursor: crosshair;
  touch-action: none;
}

/* home.js adds .ready once the first real frame is drawn. */
.ready #sketch canvas {
  opacity: 1;
}

/* ---------- Corner links ---------- */
.corner {
  position: fixed;
  z-index: 1;
  color: inherit;
  background: var(--paper);
  font: inherit;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 0;
  padding: 4px 6px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.corner:hover,
.corner:focus-visible {
  opacity: 1;
}

.corner:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}

.tl {
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
