:root {
  --night: #0b1124;
  /* the avatar's mint, lifted brighter and more saturated: the old #9fe8cc
     read greyish on a large button next to the blob's near-white highlight */
  --mint: #a6fad6;
  --ink: #e9fff6;
  --muted: #9aa8cc;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* wide-gamut screens (every recent iPhone) can show a greener mint than any
   hex reaches; the hex above stays the fallback everywhere else */
@media (color-gamut: p3) {
  :root { --mint: color(display-p3 0.62 1 0.82); }
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
/* the sky's base tone sits on the root, under everything; the glyph canvas
   and the copy stack above it with positive z-indexes only. A negative-z
   canvas over a propagated body background with background-attachment: fixed
   is the likely reason the sky was invisible in iPhone Safari. Matches the avatar's gradient:
   deep navy overhead, lifting towards the horizon */
html {
  background:
    radial-gradient(100% 70% at 50% 100%, #2a4377 0%, transparent 70%),
    linear-gradient(180deg, #070b19 0%, var(--night) 55%, #16234a 100%);
  background-color: var(--night);
}
body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 15vh;
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
canvas.sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  text-align: center;
}
/* a soft dark pool behind the copy so the glyphs never fight the text */
main::before {
  content: "";
  position: absolute;
  inset: -4rem -3rem;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(7 11 25 / 0.7), transparent);
  pointer-events: none;
}
.avatar {
  display: block;
  width: 9rem;
  height: 9rem;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--mint) 35%, transparent),
    0 0 0 8px color-mix(in oklab, var(--mint) 6%, transparent),
    0 0 4rem color-mix(in oklab, var(--mint) 18%, transparent);
}
h1 {
  margin-top: 1.5rem;
  font: 650 2.25rem/1.1 var(--sans);
  letter-spacing: -0.035em;
}
h1 .tld { color: var(--mint); }
/* the 404 heading: one colour, heavier and larger so the error reads at a glance */
h1.error { font-size: 3.5rem; font-weight: 800; letter-spacing: -0.04em; }
.now {
  margin-top: 1rem;
  color: var(--muted);
  font: 400 1rem/1.6 var(--sans);
  text-wrap: balance;
}
.now strong { color: var(--mint); font-weight: 600; }
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}
nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0 1.3rem;
  border: 1px solid color-mix(in oklab, var(--mint) 30%, transparent);
  border-radius: 999px;
  background: rgb(11 17 36 / 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink);
  font: 500 0.95rem/1 var(--sans);
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
nav a:hover {
  background: color-mix(in oklab, var(--mint) 12%, transparent);
  border-color: var(--mint);
  transform: translateY(-1px);
}
nav a:active { transform: scale(0.97); }
nav a:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
/* the page's one ask, so it carries the weight */
nav a.primary {
  background: var(--mint);
  border-color: var(--mint);
  color: var(--night);
  font-weight: 600;
  box-shadow: 0 0 1.75rem color-mix(in oklab, var(--mint) 22%, transparent);
}
nav a.primary:hover {
  background: var(--ink);
  border-color: var(--ink);
}
nav a.primary:focus-visible { outline-color: var(--ink); }
nav svg { width: 0.95rem; height: 0.95rem; fill: currentColor; }
/* mock only: the real-sky readout */
.debug {
  position: fixed; left: 0.75rem; bottom: 0.75rem; z-index: 2;
  padding: 0.5rem 0.75rem; border-radius: 0.5rem;
  background: rgb(7 11 25 / 0.8); color: var(--muted);
  font: 11px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
}
/* the sky's caption, like the label on a star chart */
.sky-caption {
  font: 500 0.75rem/1.4 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.sky-caption.in-main { margin-top: 1.75rem; opacity: 0.85; }
.sky-caption.on-hill {
  position: fixed; left: 50%; bottom: 1.25rem; z-index: 1;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0.35rem 0.8rem; border-radius: 999px;
  background: rgb(7 11 25 / 0.72);
  color: var(--ink);
}
/* the Earth is grabbable below the horizon */
.earth-grab {
  position: fixed; left: 0; right: 0; bottom: 0; height: 21%;
  z-index: 1; cursor: grab; touch-action: none;
}
.earth-grab.grabbing { cursor: grabbing; }
.sky-caption.on-hill { z-index: 2; display: flex; align-items: center; gap: 0.5rem; }
.sky-caption .home {
  font: inherit; color: var(--mint); background: none; border: 0;
  padding: 0 0.15rem; cursor: pointer;
}
.sky-caption .home[hidden] { display: none; }
