/* yusuframadhan.dev: a planet of light.
   Without the "gl" class on <html> this is a plain dark page with the list of demos.
   With it, the canvas fills the window and everything else floats over it.

   "Wide" means the words sit beside the planet; otherwise they sit under it. The same test
   is in world.js (wideQuery), and the two must stay the same. */

@font-face {
  font-family: 'Plus Jakarta Sans Variable';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/assets/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  color-scheme: dark;
  --space: #04040b;
  --ink: #f2f3fb;
  --soft: #a3a4c2;
  --line: rgb(255 255 255 / 0.14);
  --ice: #9be8ff;
  --font: 'Plus Jakarta Sans Variable', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --edge: max(clamp(1.1rem, 4.2vw, 3.5rem), env(safe-area-inset-left), env(safe-area-inset-right));
  --out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--space);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
ol,
dl,
dd {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

/* A white ring with a dark edge, so it shows over both the sky and the bright rim. */
:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 8px;
  box-shadow: 0 0 0 7px rgb(4 4 11 / 0.85);
}

[hidden] {
  display: none !important;
}

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

/* ---- The canvas ---- */

.world {
  display: none;
}

.gl .world {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.gl .world.is-over {
  cursor: pointer;
}

.gl .world.is-dragging {
  cursor: grabbing;
}

.gl,
.gl body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

/* ---- The name beside each beacon. The script moves each one every frame. They are for
   the eye and the pointer only; the picker and the arrow keys do the same job for keys. ---- */

.pins {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.pin {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(6 6 16 / 0.88);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  opacity: 0;
  will-change: transform;
  transition:
    opacity 0.25s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.pin::before {
  content: '';
  position: absolute;
  left: calc(50% + var(--tick, 0px));
  bottom: 100%;
  width: 1px;
  height: 9px;
  background: rgb(255 255 255 / 0.4);
}

.pin.is-front {
  opacity: 1;
}

.pin.is-hover {
  color: var(--ink);
  border-color: rgb(255 255 255 / 0.45);
}

/* ---- The closer look: a card at the chosen beacon, shown when the camera is close. The
   script places it and puts "is-peek" on <html> while it should be seen. ---- */

.peek {
  display: none;
}

.gl .peek {
  display: block;
  position: fixed;
  z-index: 2;
  left: 0;
  top: 0;
  width: clamp(14.5rem, 20vw, 18.5rem);
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(6 6 16 / 0.8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px -30px rgb(155 232 255 / 0.55);
  color: var(--ink);
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  will-change: transform;
  transition:
    opacity 0.25s ease,
    visibility 0s 0.25s,
    border-color 0.2s ease;
}

.is-peek .peek {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.5s ease 0.1s,
    border-color 0.2s ease;
}

.peek:hover {
  border-color: rgb(155 232 255 / 0.6);
}

/* A short line joins the card to the beacon above it. */
.peek.is-under::before {
  content: '';
  position: absolute;
  left: calc(50% + var(--tick, 0px));
  bottom: 100%;
  width: 1px;
  height: 16px;
  background: rgb(155 232 255 / 0.55);
}

.peek-art {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 12px;
  background: radial-gradient(130% 130% at 28% 18%, rgb(52 44 132 / 0.5), rgb(7 7 26 / 0.85));
}

.peek-art svg {
  display: none;
  width: 100%;
  height: 100%;
}

.peek-art svg.is-on {
  display: block;
}

/* The sketches: l is the line of light, h a plain white line, d a dim one, w and v the two
   other colours; f and g are filled, s is a faint wash. */
.peek-art .l,
.peek-art .h,
.peek-art .d,
.peek-art .w,
.peek-art .v {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.peek-art .l {
  stroke: var(--ice);
}

.peek-art .h {
  stroke: rgb(242 243 251 / 0.9);
}

.peek-art .d {
  stroke: rgb(255 255 255 / 0.26);
  stroke-width: 1.4;
}

.peek-art .w {
  stroke: #ffc99a;
}

.peek-art .v {
  stroke: #b3a4ff;
}

.peek-art .thin {
  stroke: rgb(242 243 251 / 0.5);
}

.peek-art .dash {
  stroke-dasharray: 3 5;
}

.peek-art .f {
  fill: var(--ice);
}

.peek-art .g {
  fill: rgb(255 255 255 / 0.3);
}

.peek-art .s {
  fill: rgb(155 232 255 / 0.1);
}

/* The lines of light draw themselves as the card arrives. */
.is-peek .peek-art svg.is-on .l,
.is-peek .peek-art svg.is-on .w,
.is-peek .peek-art svg.is-on .v {
  animation: sketch 0.9s ease-out 0.25s backwards;
}

.is-peek .peek-art svg.is-on .dash {
  animation: none;
}

@keyframes sketch {
  from {
    stroke-dasharray: 0 400;
  }

  to {
    stroke-dasharray: 400 0;
  }
}

.peek-facts {
  display: grid;
  gap: 0.3rem;
  margin: 0.7rem 0.3rem 0;
  color: var(--soft);
  font-size: 0.84rem;
  line-height: 1.35;
}

.peek-facts span {
  position: relative;
  display: block;
  padding-left: 0.95rem;
}

.peek-facts span::before {
  content: '';
  position: absolute;
  left: 0.1rem;
  top: 0.5em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ice);
}

.peek-go {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.7rem 0.3rem 0.15rem;
  color: var(--ice);
  font-size: 0.78rem;
  font-weight: 600;
}

.peek-go::after {
  content: '';
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.2em;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.go-touch {
  display: none;
}

/* The low strip: the sketch on the left, the facts beside it. */
.gl .peek.is-compact {
  display: grid;
  grid-template-columns: 6.6rem minmax(0, 1fr);
  align-items: center;
  gap: 0 0.75rem;
  width: min(26rem, 100vw - 2 * var(--edge));
  padding: 0.5rem;
  border-radius: 14px;
}

.is-compact .peek-art {
  grid-row: 1 / span 2;
  border-radius: 9px;
}

.is-compact .peek-facts {
  gap: 0.12rem;
  margin: 0;
  font-size: 0.76rem;
}

.is-compact .peek-go {
  margin: 0.3rem 0 0;
}

@media (hover: none) {
  .go-mouse {
    display: none;
  }

  .go-touch {
    display: inline;
  }
}

/* ---- The dive: on the way into a demo everything else steps aside, and the light of the
   beacon grows from where the beacon is until it fills the window. The script sets where
   (--x, --y), how large (--r), how strong (--o) and how white (--w). ---- */

.dive {
  display: none;
}

.gl .dive {
  display: block;
  position: fixed;
  z-index: 6;
  inset: 0;
  pointer-events: none;
  visibility: hidden;
  opacity: var(--o, 0);
  background: radial-gradient(
    circle at var(--x, 50%) var(--y, 50%),
    rgb(255 255 255) 0,
    rgb(222 247 255 / 0.96) calc(var(--r, 0px) * 0.3),
    rgb(155 232 255 / 0.5) calc(var(--r, 0px) * 0.62),
    rgb(155 232 255 / 0) var(--r, 0px)
  );
}

.gl .dive::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #f1fbff;
  opacity: var(--w, 0);
}

.is-diving .dive {
  visibility: visible;
}

.is-diving .info,
.is-diving .top,
.is-diving .pins {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gl .info {
  transition: opacity 0.4s ease;
}

/* ---- Top line ---- */

.top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: max(clamp(0.9rem, 2.4vh, 1.6rem), env(safe-area-inset-top)) var(--edge) 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.gl .top {
  position: fixed;
  inset: 0 0 auto 0;
}

.gl .top::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 -3.5rem 0;
  background: linear-gradient(rgb(4 4 11 / 0.72), rgb(4 4 11 / 0));
  pointer-events: none;
}

.gl .top::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 -3.5rem 0;
  background: linear-gradient(rgb(4 4 11 / 0.9), rgb(4 4 11 / 0.75) 50%, rgb(4 4 11 / 0));
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.is-close .top::after {
  opacity: 1;
}

.is-arriving .top {
  opacity: 0;
  visibility: hidden;
  transition: none;
}

/* Before the script has decided what kind of page this is, neither the plain list nor the
   top line is shown (see boot.js). */
.is-booting .all,
.is-booting .top {
  visibility: hidden;
}

.mark {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.mark-sub {
  display: block;
  font-weight: 400;
  color: var(--soft);
  letter-spacing: 0;
}

.top-nav {
  display: none;
  gap: 0.1rem;
  margin: -0.45rem -0.7rem 0 0;
  pointer-events: auto;
}

.gl .top-nav {
  display: flex;
}

.top-btn {
  padding: 0.45rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--soft);
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease;
}

.top-btn:hover {
  color: var(--ink);
}

.top-btn .short {
  display: none;
}

/* Sound and Motion show whether they are on with a small light. */
.has-state::before {
  content: '';
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-right: 0.5em;
  border: 1px solid currentColor;
  border-radius: 50%;
  vertical-align: 0.12em;
  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.has-state[aria-pressed='true']::before {
  border-color: var(--ice);
  background: var(--ice);
  box-shadow: 0 0 8px var(--ice);
}

/* ---- The chosen demo. The block is fixed by its bottom edge, so the buttons and the
   picker stay put however many lines the title takes. ---- */

.info {
  position: fixed;
  z-index: 2;
  left: var(--edge);
  right: var(--edge);
  bottom: max(1.2rem, env(safe-area-inset-bottom));
  max-width: 34rem;
  pointer-events: none;
}

/* Only the controls take the pointer, so the planet can still be dragged and scrolled
   through the words. */
.info a,
.info button {
  pointer-events: auto;
}

.info.is-waiting {
  visibility: hidden;
}

/* Behind the words the picture is darkened, so they stay readable over the planet. */
.gl .info::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: calc(var(--edge) * -1);
  width: 100vw;
  top: -7rem;
  bottom: calc(max(1.2rem, env(safe-area-inset-bottom)) * -1);
  background: linear-gradient(rgb(4 4 11 / 0), rgb(4 4 11 / 0.8) 30%, rgb(4 4 11 / 0.95));
}

.info-kind {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ice);
}

.info-kind::before {
  content: '';
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.info-title {
  margin-top: 0.4rem;
  font-size: clamp(2rem, 8.4vw, 3.4rem);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.028em;
  word-spacing: 0.08em;
  text-wrap: balance;
}

.info-text {
  margin-top: 1.1rem;
  max-width: 30rem;
  color: var(--soft);
  word-spacing: 0.03em;
  text-wrap: pretty;
  text-shadow: 0 1px 12px var(--space);
}

/* When another demo is chosen the words rise into place; they never drop to nothing. */
.info.is-swapping .info-kind,
.info.is-swapping .info-title,
.info.is-swapping .info-text {
  animation: swap 0.4s var(--out) both;
}

.info.is-swapping .info-title {
  animation-delay: 0.02s;
}

.info.is-swapping .info-text {
  animation-delay: 0.04s;
}

@keyframes swap {
  from {
    opacity: 0.3;
    transform: translateY(8px);
  }
}

/* The first time, each part of the block arrives a little after the one above it. */
.info.is-entering > * {
  animation: enter 0.7s var(--out) both;
}

.info.is-entering::before {
  animation: fade-in 0.7s ease both;
}

.info.is-entering > :nth-child(2) {
  animation-delay: 0.08s;
}

.info.is-entering > :nth-child(3) {
  animation-delay: 0.16s;
}

.info.is-entering > :nth-child(4) {
  animation-delay: 0.26s;
}

.info.is-entering > :nth-child(5) {
  animation-delay: 0.34s;
}

.info.is-entering > :nth-child(6) {
  animation-delay: 0.9s;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(0.9rem);
  }
}

.info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.6rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s var(--out),
    background-color 0.2s ease,
    border-color 0.15s ease,
    box-shadow 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-main {
  background: var(--ink);
  color: #06060f;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.2),
    0 8px 24px -16px rgb(255 255 255 / 0.5);
}

.btn-main::after {
  content: '';
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.6em;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s var(--out);
}

.btn-main:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.4),
    0 12px 28px -14px rgb(255 255 255 / 0.6);
}

.btn-main:hover::after {
  transform: translateX(0.2em) rotate(45deg);
}

.btn-quiet {
  border-color: rgb(255 255 255 / 0.26);
  background: rgb(6 6 16 / 0.5);
}

.btn-quiet:hover {
  border-color: rgb(255 255 255 / 0.5);
}

/* The picker: two arrows and a line in six parts, one for each demo. */
.picker {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 1.3rem 0 0 -0.6rem;
}

.arrow {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--soft);
  cursor: pointer;
  transition: color 0.15s ease;
}

.arrow:hover {
  color: var(--ink);
}

.dots {
  display: flex;
  align-items: center;
}

.dots button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 2.5rem;
  padding: 0 3px;
  border: 0;
  background: none;
  cursor: pointer;
}

.dots button::before {
  content: '';
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0.22;
  transition:
    opacity 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.dots button:hover::before {
  opacity: 0.6;
}

.dots button[aria-current='true']::before {
  opacity: 1;
  background: var(--ice);
  box-shadow: 0 0 10px var(--ice);
}

.hint {
  margin-top: 0.7rem;
  font-size: 0.86rem;
  color: var(--soft);
  text-wrap: balance;
  transition: opacity 0.6s ease;
}

.hint.is-done {
  opacity: 0;
}

.hint-touch {
  display: none;
}

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

  .hint-touch {
    display: inline;
  }
}

/* ---- The plain list (in the page without WebGL, in a sheet with it) ---- */

.all {
  width: min(100% - 2.5rem, 44rem);
  margin: 0 auto;
  padding: 3.5rem 0 4rem;
}

.sheet .all {
  width: auto;
  padding: 0;
}

.all h2,
.sheet h2 {
  font-size: clamp(1.9rem, 4.4vw, 2.5rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.028em;
}

.all-lede {
  margin-top: 0.6rem;
  color: var(--soft);
}

.demos {
  margin-top: 1.4rem;
  counter-reset: demo;
}

.demos li {
  border-top: 1px solid var(--line);
  counter-increment: demo;
}

.demos a {
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: start;
  padding: 1.05rem 0;
  text-decoration: none;
}

.demos a::before {
  content: counter(demo, decimal-leading-zero);
  padding-top: 0.22rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--soft);
}

.demos a::after {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  margin: 0.5rem 0.2rem 0 0;
  border-top: 1.5px solid var(--soft);
  border-right: 1.5px solid var(--soft);
  transform: rotate(45deg);
  transition:
    transform 0.2s var(--out),
    border-color 0.2s ease;
}

.demos a:hover::after,
.demos a:focus-visible::after {
  transform: translateX(0.25rem) rotate(45deg);
  border-color: var(--ice);
}

.demos a:hover::before {
  color: var(--ice);
}

.demo-words strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.012em;
}

.demo-words span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.96rem;
  color: var(--soft);
}

.all-foot {
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--soft);
}

.all-foot a {
  color: var(--ink);
  font-weight: 600;
  text-underline-offset: 0.25em;
}

/* ---- Sheets ---- */

.sheet {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100%, 32rem);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 4.2rem clamp(1.25rem, 4vw, 2.25rem) 2.5rem;
  border: 0;
  border-left: 1px solid var(--line);
  background: #080814;
  color: var(--ink);
  overflow-y: auto;
  scrollbar-width: none;
}

.sheet::-webkit-scrollbar {
  width: 0;
}

.sheet::backdrop {
  background: rgb(3 3 9 / 0.72);
}

.sheet[open] {
  animation: sheet-in 0.36s var(--out);
}

.sheet[open]::backdrop {
  animation: fade-in 0.36s ease;
}

.sheet.is-closing {
  animation: sheet-out 0.2s ease both;
}

.sheet.is-closing::backdrop {
  animation: fade-out 0.2s ease both;
}

@keyframes sheet-in {
  from {
    transform: translateX(2.5rem);
    opacity: 0;
  }
}

@keyframes sheet-out {
  to {
    transform: translateX(2rem);
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

.sheet-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.sheet-close:hover {
  border-color: rgb(255 255 255 / 0.5);
}

.sheet > p {
  margin-top: 1rem;
  color: var(--soft);
}

.stats {
  margin-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.stats div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.stats dt {
  color: var(--soft);
}

.stats dd {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.sheet > .credit {
  margin-top: 1.6rem;
  color: var(--ink);
  font-weight: 600;
}

/* ---- The 404 page: the edge of the planet, drawn with a gradient ---- */

.lost {
  display: grid;
  align-content: center;
  min-height: 100svh;
  padding: 0 var(--edge) 8vh;
  background:
    radial-gradient(circle at 78% 132%, rgb(4 4 11 / 0) 0 54vmax, rgb(214 226 255 / 0.7) 54.15vmax, rgb(91 56 242 / 0.26) 55vmax, rgb(91 56 242 / 0) 64vmax),
    radial-gradient(1px 1px at 12% 22%, rgb(255 255 255 / 0.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 31% 64%, rgb(255 255 255 / 0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 16%, rgb(255 255 255 / 0.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 74% 41%, rgb(255 255 255 / 0.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 12%, rgb(255 255 255 / 0.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 46% 38%, rgb(255 255 255 / 0.35) 50%, transparent 51%);
}

.lost-top {
  position: absolute;
  inset: 0 0 auto 0;
}

.lost h1 {
  font-size: clamp(2.6rem, 8vw, 5.4rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.028em;
  word-spacing: 0.08em;
}

.lost p {
  margin: 1.2rem 0 1.8rem;
  max-width: 30rem;
  color: var(--soft);
}

.lost .btn {
  justify-self: start;
}

/* ---- Wide: the words sit to the left of the planet ---- */

@media (min-width: 62rem) and (min-aspect-ratio: 5 / 4), (max-height: 30rem) and (min-aspect-ratio: 5 / 4) {
  .gl .info {
    right: auto;
    bottom: max(clamp(1.2rem, 15vh, 10rem), 34vh - 10.5rem);
    width: min(48rem, 39vw);
    max-width: none;
  }

  /* The picture itself darkens the left side here (see FINAL in shaders.js). */
  .gl .info::before {
    content: none;
  }

  .info-title {
    min-height: 2.08em;
    font-size: clamp(2.2rem, 3.9vw, 4.2rem);
  }

  .info-text {
    max-width: min(34rem, 33vw);
    font-size: clamp(1.0625rem, 0.55vw + 0.6rem, 1.25rem);
  }
}

/* A phone on its side: little height, so the words are cut down. */
@media (max-height: 30rem) and (min-aspect-ratio: 5 / 4) {
  .gl .info {
    bottom: max(0.8rem, env(safe-area-inset-bottom));
    width: 46vw;
  }

  .info-title {
    font-size: clamp(1.4rem, 7.5vh, 2.2rem);
  }

  .info-text,
  .hint,
  .mark-sub {
    display: none;
  }

  .info-actions {
    margin-top: 0.8rem;
  }

  .picker {
    margin-top: 0.4rem;
  }

  .btn {
    min-height: 2.5rem;
    padding: 0.4rem 1rem;
    font-size: 0.92rem;
  }
}

@media (max-width: 36rem) {
  .top {
    gap: 0.4rem;
  }

  .mark {
    font-size: 0.86rem;
  }

  .mark-sub {
    display: none;
  }

  .top-nav {
    gap: 0;
    margin-right: -0.4rem;
  }

  .top-btn {
    padding: 0.45rem 0.36rem;
    font-size: 0.78rem;
  }

  .has-state::before {
    margin-right: 0.35em;
  }

  .top-btn .long {
    display: none;
  }

  .top-btn .short {
    display: inline;
  }

  .info-text {
    font-size: 0.98rem;
  }
}

/* With motion off nothing animates. The script puts "is-calm" on <html> when the system
   asks for reduced motion, and the Motion button switches it either way. */
.is-calm .info.is-swapping .info-kind,
.is-calm .info.is-swapping .info-title,
.is-calm .info.is-swapping .info-text,
.is-calm .info.is-entering > *,
.is-calm .info.is-entering::before,
.is-calm .sheet[open],
.is-calm .sheet[open]::backdrop,
.is-calm .sheet.is-closing,
.is-calm .sheet.is-closing::backdrop {
  animation: none;
}

.is-calm .peek,
.is-calm .info,
.is-calm .top,
.is-calm .top::after,
.is-calm .hint,
.is-calm .pin,
.is-calm .btn,
.is-calm .btn-main::after,
.is-calm .dots button::before,
.is-calm .demos a::after {
  transition: none;
}

/* When the system replaces colours, shapes drawn only with a background would vanish. */
@media (forced-colors: active) {
  .dots button::before,
  .info-kind::before,
  .has-state::before {
    border: 1px solid CanvasText;
  }

  .dots button[aria-current='true']::before {
    height: 6px;
    background: Highlight;
  }
}

/* The narrowest phones. */
@media (max-width: 23.5rem) {
  .top-btn {
    padding: 0.45rem 0.27rem;
    font-size: 0.74rem;
  }
}

.is-calm .peek-art svg.is-on * {
  animation: none;
}
