/* The landing page.
   The scene is the page; the text sits on top of it and must stay legible
   whatever the canvas is doing behind. */

:root {
  color-scheme: dark;
  --ink:    #e8e8e4;
  --muted:  #8a8a83;
  --accent: #9ab6dd;
  --line:   rgba(232, 232, 228, 0.10);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  /* Not flat black: a slight lift stops the canvas edges reading as banding on
     an OLED display, and gives the points something to sit against. */
  background: radial-gradient(120% 90% at 50% 40%, #14161a 0%, #0c0d10 70%);
  color: var(--ink);
  font: 15px/1.6 ui-sans-serif, system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

/* The canvas is scenery. It must never intercept a click meant for a link, so
   pointer events are handed to it explicitly by the script, not by z-order. */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  pointer-events: none; /* only the links below take the pointer back */
}

header h1 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

header p {
  margin: .5rem 0 0;
  max-width: 30rem;
  color: var(--muted);
  font-size: clamp(13.5px, 1.6vw, 15px);
}

/* Bottom row: destinations on the left, score on the right. */
footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  pointer-events: auto;
}
.links a {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.links a:hover,
.links a:focus-visible { border-bottom-color: var(--accent); }

.contact {
  margin: .9rem 0 0;
  color: var(--muted);
  font-size: 12.5px;
  pointer-events: auto;
}
.contact a { color: var(--muted); }

/* Score sits opposite the links, quiet until it means something. */
.tally {
  text-align: right;
  font-family: var(--mono);
  line-height: 1.2;
}
#score {
  display: block;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-variant-numeric: tabular-nums; /* the number must not jitter as it counts */
}
.tally small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

#hint {
  color: var(--muted);
  font-size: 12.5px;
  transition: opacity .8s ease;
}
#hint.faded { opacity: 0; }

/* Without WebGL the canvas is removed and the page is simply the text. It has
   to stand on its own, so the layout does not depend on the scene existing. */
body.no-webgl { overflow: auto; }
body.no-webgl .tally { display: none; }

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

@media (max-width: 32rem) {
  footer { flex-direction: column; align-items: flex-start; }
  .tally { text-align: left; }
}
