.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
}

.bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: var(--measure);
  margin: 0 auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.menu {
  display: flex;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
  margin-left: -0.7rem;
  padding: 0.35rem 0;
  overflow-x: auto;
  scrollbar-width: none;
  font: 0.9rem/1 var(--pixel);
  white-space: nowrap;
}

.menu::-webkit-scrollbar {
  display: none;
}

.menu a {
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0.7rem calc(100% - 0.55rem) / 0 3px no-repeat;
  padding: 0.7rem 0.7rem;
  transition: background-size 0.3s steps(6);
}

.menu a:hover {
  background-size: calc(100% - 1.4rem) 3px;
}

.letter {
  color: var(--accent);
}

main,
.foot,
.sky-band {
  position: relative;
  z-index: 1;
}

main,
.foot {
  max-width: var(--measure);
  margin: 0 auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.hero {
  padding: 4rem 0 1rem;
}

.hero h1 {
  font: 600 clamp(2.6rem, 9vw, 5rem) / 1.05 var(--pixel);
  margin-bottom: 1.5rem;
  background: linear-gradient(100deg, var(--ink) 45%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* A blinking pixel cursor, like a seed waiting to be planted. */
.hero h1 .cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.12em;
  margin-left: 0.15em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.lead {
  font-size: 1.2rem;
  max-width: 42rem;
  margin-bottom: 1rem;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  margin-top: 1.75rem;
  font: 0.95rem/1.2 var(--pixel);
  color: var(--muted);
}

.facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.facts li::before {
  content: "";
  width: 15px;
  height: 15px;
  background: var(--blossom) center / 15px 15px no-repeat;
  image-rendering: pixelated;
}

.foot {
  position: relative;
  padding-top: 3.5rem;
  padding-bottom: 5rem;
  margin-top: 4rem;
}

.foot::before {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 0;
  height: 15px;
  background: var(--grass) repeat-x 0 100% / 72px 15px;
  image-rendering: pixelated;
  opacity: 0.9;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  font: 1rem/1.4 var(--pixel);
  margin-bottom: 1.5rem;
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
  max-width: 36rem;
}

/* Footer in two columns on wider screens: links and the closing note on the left, the energy note on the right. */
@media (min-width: 48rem) {
  .foot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 3rem;
    align-items: start;
  }

  .foot > .links,
  .foot > .note {
    grid-column: 1;
  }

  .foot > .shortcuts-hint {
    grid-column: 2;
    justify-self: end;
    text-align: right;
  }

  .foot > .note.energy {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    max-width: 26rem;
    margin-top: 0.2rem;
    text-align: right;
  }
}

/* A line from someone else, under a section's intro. */
.epigraph {
  margin: 1.25rem 0 2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  max-width: 36rem;
}

.epigraph blockquote {
  margin: 0;
}

.epigraph p {
  font: 1.15rem/1.4 var(--pixel);
  color: var(--ink);
}

.epigraph figcaption {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.epigraph figcaption::before {
  content: "— ";
}

/* The keyboard tip: small and quiet, and hidden on touch screens where there is no keyboard. */
.note.shortcuts-hint {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-style: normal;
}

@media (hover: none) {
  .note.shortcuts-hint {
    display: none;
  }
}

/* What delivering this page cost in energy: measured per visit, estimated after the Sustainable Web Design Model. */
.note.energy {
  margin-top: 1rem;
  font-size: 0.85rem;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.energy-leaf {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 0.5rem;
  vertical-align: -2px;
  background: var(--blossom) center / 15px 15px no-repeat;
  image-rendering: pixelated;
}

/* Phones: tighter rhythm, and a fade that shows the menu scrolls. */
@media (max-width: 36rem) {
  :root {
    --gutter: 16px;
  }

  .menu {
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent);
    padding-right: 1.5rem;
  }

  .hero {
    padding-top: 2.25rem;
  }

  .hero h1 {
    margin-bottom: 1.1rem;
  }

  .lead {
    font-size: 1.1rem;
  }

  .foot {
    padding-bottom: calc(3.5rem + env(safe-area-inset-bottom));
  }
}
