/* Trellisbyte. One dark screen: the mark in the middle, a little small print at the bottom.
   The field behind it, and the way things arrive, come from trellis.js. */

/* Mona Sans, pinned to its regular weight and subset to Latin */
@font-face { font-family: "Mona Sans"; src: url("/fonts/mona-sans.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --night: #0a0b0b;
  --bone: #ecebe6;
  --mute: #7d7f7b;
  --faint: #4c4f4d;
  --teal: #0fa195;
  --sans: "Mona Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 760px) { :root { --gutter: 36px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body { margin: 0; background: var(--night); color: var(--bone); font: 400 13px/1.55 var(--sans); letter-spacing: 0.005em; -webkit-font-smoothing: antialiased; }
h1, p { margin: 0; }
::selection { background: var(--teal); color: var(--night); }
:focus-visible { outline: 1px solid var(--teal); outline-offset: 4px; }

/* a finger can drag across the field (trellis.js) and still pinch to zoom */
.page { position: relative; isolation: isolate; overflow: hidden; min-height: 100svh; touch-action: pinch-zoom; }
.field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }

/* the mark sits a touch above centre, where the eye puts the middle */
.mark {
  position: absolute; left: 50%; top: 45%; translate: -50% -50%;
  width: clamp(112px, 13vw, 184px); line-height: 0;
}
.mark img { display: block; width: 100%; height: auto; }

/* What the field brings to life waits for it; if the script never gets there, it shows anyway
   after three seconds. Text arrives as bits: words hold together and each character keeps the
   width it has in the real text, so nothing shifts when the bits settle. */
.js [data-trellis] { opacity: 0; animation: show 0s 3s forwards; }
.trellis [data-trellis]:not(.is-live) { animation: none; }
.js [data-trellis].is-live, .is-built [data-trellis] { opacity: 1; animation: none; }
@keyframes show { to { opacity: 1; } }
/* an image whose parts re-form when clicked */
[data-trellis-parts] { -webkit-user-drag: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.tw { white-space: nowrap; }
.tc { display: inline-block; }
.tc.off { visibility: hidden; }
.tc.bit { color: var(--teal); text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.foot {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--gutter) + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; align-items: flex-end; gap: 14px 32px; flex-wrap: wrap;
  color: var(--mute);
}
.name { color: var(--bone); }
.links { display: flex; gap: 20px; }
.links a {
  color: var(--mute); text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: color 0.25s, background-size 0.35s var(--ease);
}
.links a:hover, .links a:focus-visible { color: var(--bone); background-size: 100% 1px; }

/* ---------------------------------------------------------------- 404 */
.nf { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 22px; padding: 24px var(--gutter); text-align: center; color: var(--mute); }
.nf img { width: 72px; height: auto; display: block; }
.nf a { color: var(--bone); text-underline-offset: 4px; text-decoration-color: var(--faint); }
.nf a:hover { text-decoration-color: var(--teal); }

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