:root {
  --bg: #f6f6f5;
  --line: #a9a9a9;
  --ink: #a2a2a2;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  /* --page: set while the sky covers everything, so whatever lies beyond the page's
     edges (overscroll, browser bars that fall back to this colour) matches it */
  background: var(--page, var(--bg));
  -webkit-font-smoothing: antialiased;
}

.sky {
  position: fixed;
  inset: 0;
  visibility: hidden;
  background: linear-gradient(#1d3f6e, #9bb2cc);
  pointer-events: none;
}

.sky canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* iOS Safari colours its status bar and its toolbar after the frontmost fixed element
   lying along the viewport's top and bottom edge: it reads that element's
   background-color from its style (WebKit: LocalFrameView::fixedContainerEdges). A
   viewport-sized layer such as .sky does not count, and leaves the bars stuck on
   whatever they were before. So these two strips lie in front of everything along
   those edges, and main.js gives them the colour of the picture's top and bottom rows
   once the sky gets there; before that they have the page's own.
   They are for Safari to read, not for the eye: the colour is clipped to a content box
   of no height, so nothing is painted. Wider than 90% of the viewport and more than
   10px high, or Safari passes them over. */
.edge {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 2;
  box-sizing: content-box;
  height: 0;
  padding-top: 16px;
  background-color: var(--bg);
  background-clip: content-box;
  pointer-events: none;
}

.edge--top {
  top: 0;
}

.edge--bottom {
  bottom: 0;
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.mark {
  width: min(56vw, 500px, 60vh);
  height: auto;
  overflow: visible;
  transform: translateY(-4vh);
}

.stage--sky {
  position: absolute;
}

.lines {
  pointer-events: fill;
  cursor: default;
}

.ln {
  fill: none;
  stroke: var(--line);
  /* --stroke: main.js thickens the pen on small screens, where 1.1 units would come
     out well under a pixel */
  stroke-width: var(--stroke, 1.1);
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  transition: stroke 0.6s ease;
}

.ln + .ln { animation-delay: 0.3s; }

.hit * {
  fill: none;
  stroke: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.lines:hover .ln {
  stroke: #7a7a7a;
}

.mark--sky .ln {
  stroke: rgba(255, 255, 255, 0.95);
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(44px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  gap: 30px;
  font: 400 13px/1 "Instrument Sans", "Helvetica Neue", sans-serif;
  letter-spacing: 0.035em;
  color: var(--ink);
  transition: color 0.7s ease, text-shadow 0.7s ease;
  opacity: 0;
  animation: fade 1.2s ease 1.4s forwards;
}

.nav a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}

.nav a:hover {
  color: #4a4a4a;
}

.nav em {
  font-style: italic;
  opacity: 0.75;
}

body.is-sky .nav {
  /* the links sit across rock and snow alike: white, carried by a soft dark halo */
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 0 2px rgba(8, 20, 45, 0.7), 0 0 7px rgba(8, 20, 45, 0.5), 0 1px 14px rgba(8, 20, 45, 0.6);
}

body.is-sky .nav a:hover {
  color: #fff;
}

@keyframes fade {
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ln {
    animation: none;
    stroke-dashoffset: 0;
  }
  .nav {
    animation: none;
    opacity: 1;
  }
}
