/* The page around the band. sky.js owns every color in the art itself and
   hands back the season's accent as --sky-accent, which is the one thread
   between the two: the prose, the rules and the current control all pick up
   whatever hue the season is in, without this file knowing which season that
   is or how `?sky=` resolved it. Before the script runs there is no such
   property, so every use below carries a fallback that stands on its own. */

:root {
  color-scheme: light dark;
  --ink: light-dark(#1b1b1b, #e6e6e6);
  --paper: light-dark(#fbfaf8, #14161a);
  --quiet: light-dark(#6a6a6a, #9a9a9a);
  --rule: light-dark(#e2e0dc, #2a2d33);
  --accent: var(--sky-accent, light-dark(#5c0207, #fac6c1));
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

/* The pixel-art ridgeline. sky.js creates the element as well as drawing it,
   so nothing here renders without JS — a decorative band isn't worth a blank
   gap in the layout when the script doesn't run.

   The bitmap is a few hundred pixels wide and the browser scales it up, so
   `pixelated` is load-bearing: default smooth sampling averages the dither
   back into flat grey and the whole technique disappears.

   Nothing sets a background: unpainted pixels are transparent and the page
   shows through, so the band can never disagree with what's behind it. */
canvas.sky {
  display: block;
  width: 100%;
  image-rendering: pixelated;

}

/* The whole viewport, which is what turns the band into a valley: sky.js
   measures the height the page gives it and fits as many receding ridgelines
   as it can into the room. `svh` rather than `vh` so a phone's collapsing
   address bar doesn't crop the near hill off the bottom.

   Only on the valley's own page. /about gives its canvas no height at all,
   and so gets the 78-row band instead — the same file, the shape it was born
   as, serving as that page's masthead and as the thing that tells it which
   season's accent to wear. */
body.scene canvas.sky {
  height: 100svh;
}

/* The valley's own page carries nothing else, so the canvas is the whole of
   it and the body must not add a scrollbar under it. */
body.scene {
  overflow: hidden;
}

/* The only thing in the markup on that page: the route to /about for anyone
   not using a pointer. Off-screen until it takes focus, then it lands in the
   corner as an ordinary link. Not `display: none`, which would take it out of
   the focus order and defeat the entire purpose. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip:focus {
  left: 0;
  z-index: 1;
  margin: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--accent);
  border-radius: 3px;
}

.back {
  margin: 0 0 2rem;
  font-size: 0.9375rem;
}

.back a {
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
}

main {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 0.25rem;
  color: var(--accent);
}

.standfirst {
  margin: 0 0 2.25rem;
  color: var(--quiet);
}

h2 {
  font-size: 1rem;
  font-weight: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--quiet);
  margin: 2.75rem 0 0.75rem;
}

a {
  color: var(--accent);
}

/* ------------------------------------------------------------------ *
 * The controls
 * ------------------------------------------------------------------ */

/* Plain links, one per state, each one a `?sky=` the band already understood
   before this page existed. Nothing here holds state or talks to the canvas:
   following a link reloads, which is also how you get the reveal to play
   again. Every scene on this page is therefore an address you can send
   someone. */
.controls {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.5rem 1rem;
  align-items: baseline;
  margin: 0;
  font-size: 0.9375rem;
}

.controls dt {
  color: var(--quiet);
  font-variant-caps: small-caps;
  letter-spacing: 0.03em;
}

.controls dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.controls a {
  color: inherit;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
}

.controls a[aria-current] {
  color: var(--accent);
  font-weight: 600;
  text-decoration-color: currentColor;
}

footer {
  margin-top: 3.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--quiet);
  font-size: 0.9375rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
